diff --git a/.gitignore b/.gitignore index 65a97ce7d..87bc6ab3f 100644 --- a/.gitignore +++ b/.gitignore @@ -143,7 +143,7 @@ spine-cocos2dx/example-v4/cocos2dx.zip spine-ts/spine-core/dist spine-ts/spine-canvas/dist spine-ts/spine-construct3/dist -spine-ts/spine-construct3-lib/dist +spine-ts/spine-construct3/spine-construct3-lib/dist spine-ts/spine-webgl/dist spine-ts/spine-player/dist spine-ts/spine-webcomponents/dist diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/AssetLoader.d.ts b/spine-ts/spine-construct3/spine-construct3-lib/dist/AssetLoader.d.ts deleted file mode 100644 index 96d19b2cc..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/AssetLoader.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated April 5, 2025. Replaces all prior versions. - * - * Copyright (c) 2013-2025, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import { TextureAtlas } from "@esotericsoftware/spine-core"; -export declare class AssetLoader { - loadSkeletonEditor(sid: number, textureAtlas: TextureAtlas, scale: number | undefined, instance: SDK.IWorldInstance): Promise; - loadAtlasEditor(sid: number, instance: SDK.IWorldInstance, renderer: SDK.Gfx.IWebGLRenderer): Promise; - loadSpineTextureEditor(pageName: string, pma: boolean | undefined, instance: SDK.IWorldInstance): Promise; - loadSkeletonRuntime(path: string, textureAtlas: TextureAtlas, scale: number | undefined, instance: IRuntime): Promise; - loadAtlasRuntime(path: string, instance: IRuntime, renderer: IRenderer): Promise; - loadSpineTextureRuntime(pageName: string, pma: boolean | undefined, instance: IRuntime): Promise; - static createImageBitmapFromBlob(blob: Blob, pma: boolean): Promise; -} diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/AssetLoader.js b/spine-ts/spine-construct3/spine-construct3-lib/dist/AssetLoader.js deleted file mode 100644 index 4ac8c2383..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/AssetLoader.js +++ /dev/null @@ -1,137 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated April 5, 2025. Replaces all prior versions. - * - * Copyright (c) 2013-2025, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import { AtlasAttachmentLoader, SkeletonBinary, SkeletonJson, TextureAtlas } from "@esotericsoftware/spine-core"; -import { C3Texture, C3TextureEditor } from "./C3Texture"; -export class AssetLoader { - async loadSkeletonEditor(sid, textureAtlas, scale = 1, instance) { - const projectFile = instance.GetProject().GetProjectFileBySID(sid); - if (!projectFile) - return null; - const blob = projectFile.GetBlob(); - const atlasLoader = new AtlasAttachmentLoader(textureAtlas); - const isBinary = projectFile.GetName().endsWith(".skel"); - if (isBinary) { - const skeletonFile = await blob.arrayBuffer(); - const skeletonLoader = new SkeletonBinary(atlasLoader); - skeletonLoader.scale = scale; - return skeletonLoader.readSkeletonData(skeletonFile); - } - const skeletonFile = await blob.text(); - const skeletonLoader = new SkeletonJson(atlasLoader); - skeletonLoader.scale = scale; - return skeletonLoader.readSkeletonData(skeletonFile); - } - async loadAtlasEditor(sid, instance, renderer) { - const projectFile = instance.GetProject().GetProjectFileBySID(sid); - if (!projectFile) - return null; - const blob = projectFile.GetBlob(); - const content = await blob.text(); - const path = projectFile.GetPath(); - const basePath = path.substring(0, path.lastIndexOf("/") + 1); - const textureAtlas = new TextureAtlas(content); - await Promise.all(textureAtlas.pages.map(async (page) => { - const texture = await this.loadSpineTextureEditor(basePath + page.name, page.pma, instance); - if (texture) { - const spineTexture = new C3TextureEditor(texture, renderer, page); - page.setTexture(spineTexture); - } - return texture; - })); - return textureAtlas; - } - async loadSpineTextureEditor(pageName, pma = false, instance) { - const projectFile = instance.GetProject().GetProjectFileByExportPath(pageName); - if (!projectFile) { - throw new Error(`An error occured while loading the texture: ${pageName}`); - } - const content = projectFile.GetBlob(); - return AssetLoader.createImageBitmapFromBlob(content, pma); - } - async loadSkeletonRuntime(path, textureAtlas, scale = 1, instance) { - const fullPath = await instance.assets.getProjectFileUrl(path); - if (!fullPath) - return null; - const atlasLoader = new AtlasAttachmentLoader(textureAtlas); - const isBinary = path.endsWith(".skel"); - if (isBinary) { - const content = await instance.assets.fetchArrayBuffer(fullPath); - if (!content) - return null; - const skeletonLoader = new SkeletonBinary(atlasLoader); - skeletonLoader.scale = scale; - return skeletonLoader.readSkeletonData(content); - } - const content = await instance.assets.fetchJson(fullPath); - if (!content) - return null; - const skeletonLoader = new SkeletonJson(atlasLoader); - skeletonLoader.scale = scale; - return skeletonLoader.readSkeletonData(content); - } - async loadAtlasRuntime(path, instance, renderer) { - const fullPath = await instance.assets.getProjectFileUrl(path); - if (!fullPath) - return null; - const content = await instance.assets.fetchText(fullPath); - if (!content) - return null; - const basePath = path.substring(0, path.lastIndexOf("/") + 1); - const textureAtlas = new TextureAtlas(content); - await Promise.all(textureAtlas.pages.map(async (page) => { - const texture = await this.loadSpineTextureRuntime(basePath + page.name, page.pma, instance); - if (texture) { - const spineTexture = new C3Texture(texture, renderer, page); - page.setTexture(spineTexture); - } - return texture; - })); - return textureAtlas; - } - async loadSpineTextureRuntime(pageName, pma = false, instance) { - const fullPath = await instance.assets.getProjectFileUrl(pageName); - if (!fullPath) - return null; - const content = await instance.assets.fetchBlob(fullPath); - if (!content) - return null; - return AssetLoader.createImageBitmapFromBlob(content, pma); - } - static async createImageBitmapFromBlob(blob, pma) { - try { - // pma parameters seems to do not matter here. It matters in C3 Texture creation - return createImageBitmap(blob, { premultiplyAlpha: pma ? "none" : "premultiply" }); - } - catch (e) { - console.error("Failed to create ImageBitmap from blob:", e); - return null; - } - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXNzZXRMb2FkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvQXNzZXRMb2FkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsrRUEyQitFO0FBRS9FLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxjQUFjLEVBQUUsWUFBWSxFQUFFLFlBQVksRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQ2pILE9BQU8sRUFBRSxTQUFTLEVBQUUsZUFBZSxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBR3pELE1BQU0sT0FBTyxXQUFXO0lBRWhCLEtBQUssQ0FBQyxrQkFBa0IsQ0FBRSxHQUFXLEVBQUUsWUFBMEIsRUFBRSxLQUFLLEdBQUcsQ0FBQyxFQUFFLFFBQTRCO1FBQ2hILE1BQU0sV0FBVyxHQUFHLFFBQVEsQ0FBQyxVQUFVLEVBQUUsQ0FBQyxtQkFBbUIsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUNuRSxJQUFJLENBQUMsV0FBVztZQUFFLE9BQU8sSUFBSSxDQUFDO1FBRTlCLE1BQU0sSUFBSSxHQUFHLFdBQVcsQ0FBQyxPQUFPLEVBQUUsQ0FBQztRQUNuQyxNQUFNLFdBQVcsR0FBRyxJQUFJLHFCQUFxQixDQUFDLFlBQVksQ0FBQyxDQ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IG1hdHRlciBoZXJlLiBJdCBtYXR0ZXJzIGluIEMzIFRleHR1cmUgY3JlYXRpb25cblx0XHRcdHJldHVybiBjcmVhdGVJbWFnZUJpdG1hcChibG9iLCB7IHByZW11bHRpcGx5QWxwaGE6IHBtYSA/IFwibm9uZVwiIDogXCJwcmVtdWx0aXBseVwiIH0pO1xuXHRcdH0gY2F0Y2ggKGUpIHtcblx0XHRcdGNvbnNvbGUuZXJyb3IoXCJGYWlsZWQgdG8gY3JlYXRlIEltYWdlQml0bWFwIGZyb20gYmxvYjpcIiwgZSk7XG5cdFx0XHRyZXR1cm4gbnVsbDtcblx0XHR9XG5cdH1cblxufVxuXG5cbiJdfQ== \ No newline at end of file diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/C3Texture.d.ts b/spine-ts/spine-construct3/spine-construct3-lib/dist/C3Texture.d.ts deleted file mode 100644 index dbaf2ffa1..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/C3Texture.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated April 5, 2025. Replaces all prior versions. - * - * Copyright (c) 2013-2025, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import { BlendMode, Texture, type TextureAtlasPage } from "@esotericsoftware/spine-core"; -export declare class C3TextureEditor extends Texture { - texture: SDK.Gfx.IWebGLTexture; - renderer: SDK.Gfx.IWebGLRenderer; - constructor(image: HTMLImageElement | ImageBitmap, renderer: SDK.Gfx.IWebGLRenderer, page: TextureAtlasPage); - setFilters(): void; - setWraps(): void; - dispose(): void; -} -export declare class C3Texture extends Texture { - texture: ITexture; - renderer: IRenderer; - constructor(image: HTMLImageElement | ImageBitmap, renderer: IRenderer, page: TextureAtlasPage); - setFilters(): void; - setWraps(): void; - dispose(): void; -} -export declare const BlendingModeSpineToC3: Record; diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/C3Texture.js b/spine-ts/spine-construct3/spine-construct3-lib/dist/C3Texture.js deleted file mode 100644 index 251336916..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/C3Texture.js +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated April 5, 2025. Replaces all prior versions. - * - * Copyright (c) 2013-2025, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import { BlendMode, Texture, TextureFilter, TextureWrap } from "@esotericsoftware/spine-core"; -export class C3TextureEditor extends Texture { - texture; - renderer; - constructor(image, renderer, page) { - super(image); - this.renderer = renderer; - const options = { - wrapX: toC3TextureWrap(page.uWrap), - wrapY: toC3TextureWrap(page.vWrap), - sampling: toC3Filter(page.minFilter), - mipMap: toC3MipMap(page.minFilter), - }; - this.texture = renderer.CreateDynamicTexture(image.width, image.height, options); - this.renderer.UpdateTexture(image, this.texture, { premultiplyAlpha: !page.pma }); - } - setFilters() { - // cannot change filter after texture creation - } - setWraps() { - // cannot change wraps after texture creation - } - dispose() { - this.renderer.DeleteTexture(this.texture); - } -} -export class C3Texture extends Texture { - texture; - renderer; - constructor(image, renderer, page) { - super(image); - this.renderer = renderer; - const options = { - wrapX: toC3TextureWrap(page.uWrap), - wrapY: toC3TextureWrap(page.vWrap), - sampling: toC3Filter(page.minFilter), - mipMap: toC3MipMap(page.minFilter), - }; - this.texture = renderer.createDynamicTexture(image.width, image.height, options); - this.renderer.updateTexture(image, this.texture, { premultiplyAlpha: !page.pma }); - } - setFilters() { - // cannot change filter after texture creation - } - setWraps() { - // cannot change wraps after texture creation - } - dispose() { - this.renderer.deleteTexture(this.texture); - } -} -function toC3TextureWrap(wrap) { - if (wrap === TextureWrap.ClampToEdge) - return "clamp-to-edge"; - else if (wrap === TextureWrap.MirroredRepeat) - return "mirror-repeat"; - else if (wrap === TextureWrap.Repeat) - return "repeat"; - else - throw new Error(`Unknown texture wrap: ${wrap}`); -} -function toC3MipMap(filter) { - switch (filter) { - case TextureFilter.MipMap: - case TextureFilter.MipMapLinearNearest: - case TextureFilter.MipMapNearestLinear: - case TextureFilter.MipMapNearestNearest: - return true; - case TextureFilter.Linear: - case TextureFilter.Nearest: - return false; - default: - throw new Error(`Unknown texture filter: ${filter}`); - } -} -function toC3Filter(filter) { - switch (filter) { - case TextureFilter.Nearest: - case TextureFilter.MipMapNearestNearest: - return "nearest"; - case TextureFilter.Linear: - case TextureFilter.MipMapLinearNearest: - case TextureFilter.MipMapNearestLinear: - return "bilinear"; - case TextureFilter.MipMap: - case TextureFilter.MipMapLinearLinear: - return "trilinear"; - default: - throw new Error(`Unknown texture filter: ${filter}`); - } -} -export const BlendingModeSpineToC3 = { - [BlendMode.Normal]: "normal", - [BlendMode.Additive]: "additive", - [BlendMode.Multiply]: "multiply", - [BlendMode.Screen]: "screen", -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQzNUZXh0dXJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0MzVGV4dHVyZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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tYWxdOiBcIm5vcm1hbFwiLFxuXHRbQmxlbmRNb2RlLkFkZGl0aXZlXTogXCJhZGRpdGl2ZVwiLFxuXHRbQmxlbmRNb2RlLk11bHRpcGx5XTogXCJtdWx0aXBseVwiLFxuXHRbQmxlbmRNb2RlLlNjcmVlbl06IFwic2NyZWVuXCIsXG59XG5cbiJdfQ== \ No newline at end of file diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/SpineBoundsProvider.d.ts b/spine-ts/spine-construct3/spine-construct3-lib/dist/SpineBoundsProvider.d.ts deleted file mode 100644 index 760799887..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/SpineBoundsProvider.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { AnimationState, Skeleton } from "@esotericsoftware/spine-core"; -interface Rectangle { - x: number; - y: number; - width: number; - height: number; -} -interface GameObject { - skeleton?: Skeleton; - state?: AnimationState; -} -export interface SpineBoundsProvider { - /** Returns the bounding box for the skeleton, in skeleton space. */ - calculateBounds(gameObject: GameObject): Rectangle; -} -export declare class AABBRectangleBoundsProvider implements SpineBoundsProvider { - private x; - private y; - private width; - private height; - constructor(x: number, y: number, width: number, height: number); - calculateBounds(): { - x: number; - y: number; - width: number; - height: number; - }; -} -export declare class SetupPoseBoundsProvider implements SpineBoundsProvider { - private clipping; - /** - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(clipping?: boolean); - calculateBounds(gameObject: GameObject): { - x: number; - y: number; - width: number; - height: number; - }; -} -export declare class SkinsAndAnimationBoundsProvider implements SpineBoundsProvider { - private animation?; - private skins; - private timeStep; - private clipping; - /** - * @param animation The animation to use for calculating the bounds. If null, the setup pose is used. - * @param skins The skins to use for calculating the bounds. If empty, the default skin is used. - * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation. - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(animation?: string | undefined, skins?: string[], timeStep?: number, clipping?: boolean); - calculateBounds(gameObject: GameObject): { - x: number; - y: number; - width: number; - height: number; - }; -} -export {}; diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/SpineBoundsProvider.js b/spine-ts/spine-construct3/spine-construct3-lib/dist/SpineBoundsProvider.js deleted file mode 100644 index 7285edb18..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/SpineBoundsProvider.js +++ /dev/null @@ -1,115 +0,0 @@ -import { AnimationState, Physics, Skeleton, SkeletonClipping, Skin } from "@esotericsoftware/spine-core"; -export class AABBRectangleBoundsProvider { - x; - y; - width; - height; - constructor(x, y, width, height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - calculateBounds() { - return { x: this.x, y: this.y, width: this.width, height: this.height }; - } -} -export class SetupPoseBoundsProvider { - clipping; - /** - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(clipping = false) { - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton) - return { x: 0, y: 0, width: 0, height: 0 }; - // Make a copy of animation state and skeleton as this might be called while - // the skeleton in the GameObject has already been heavily modified. We can not - // reconstruct that state. - const skeleton = new Skeleton(gameObject.skeleton.data); - skeleton.setupPose(); - skeleton.updateWorldTransform(Physics.update); - const bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : undefined); - return bounds.width === Number.NEGATIVE_INFINITY - ? { x: 0, y: 0, width: 0, height: 0 } - : bounds; - } -} -export class SkinsAndAnimationBoundsProvider { - animation; - skins; - timeStep; - clipping; - /** - * @param animation The animation to use for calculating the bounds. If null, the setup pose is used. - * @param skins The skins to use for calculating the bounds. If empty, the default skin is used. - * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation. - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(animation, skins = [], timeStep = 0.05, clipping = false) { - this.animation = animation; - this.skins = skins; - this.timeStep = timeStep; - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton || !gameObject.state) - return { x: 0, y: 0, width: 0, height: 0 }; - // Make a copy of animation state and skeleton as this might be called while - // the skeleton in the GameObject has already been heavily modified. We can not - // reconstruct that state. - const animationState = new AnimationState(gameObject.state.data); - const skeleton = new Skeleton(gameObject.skeleton.data); - const clipper = this.clipping ? new SkeletonClipping() : undefined; - const data = skeleton.data; - if (this.skins.length > 0) { - const customSkin = new Skin("custom-skin"); - for (const skinName of this.skins) { - const skin = data.findSkin(skinName); - if (skin == null) - continue; - customSkin.addSkin(skin); - } - skeleton.setSkin(customSkin); - } - skeleton.setupPose(); - const animation = this.animation != null ? data.findAnimation(this.animation) : null; - if (animation == null) { - skeleton.updateWorldTransform(Physics.update); - const bounds = skeleton.getBoundsRect(clipper); - return bounds.width === Number.NEGATIVE_INFINITY - ? { x: 0, y: 0, width: 0, height: 0 } - : bounds; - } - else { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - animationState.clearTracks(); - animationState.setAnimation(0, animation, false); - const steps = Math.max(animation.duration / this.timeStep, 1.0); - for (let i = 0; i < steps; i++) { - const delta = i > 0 ? this.timeStep : 0; - animationState.update(delta); - animationState.apply(skeleton); - skeleton.update(delta); - skeleton.updateWorldTransform(Physics.update); - const bounds = skeleton.getBoundsRect(clipper); - minX = Math.min(minX, bounds.x); - minY = Math.min(minY, bounds.y); - maxX = Math.max(maxX, bounds.x + bounds.width); - maxY = Math.max(maxY, bounds.y + bounds.height); - } - const bounds = { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY, - }; - return bounds.width === Number.NEGATIVE_INFINITY - ? { x: 0, y: 0, width: 0, height: 0 } - : bounds; - } - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3BpbmVCb3VuZHNQcm92aWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9TcGluZUJvdW5kc1Byb3ZpZGVyLnR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HRcdFx0bWluWSA9IE1hdGgubWluKG1pblksIGJvdW5kcy55KTtcblx0XHRcdFx0bWF4WCA9IE1hdGgubWF4KG1heFgsIGJvdW5kcy54ICsgYm91bmRzLndpZHRoKTtcblx0XHRcdFx0bWF4WSA9IE1hdGgubWF4KG1heFksIGJvdW5kcy55ICsgYm91bmRzLmhlaWdodCk7XG5cdFx0XHR9XG5cdFx0XHRjb25zdCBib3VuZHMgPSB7XG5cdFx0XHRcdHg6IG1pblgsXG5cdFx0XHRcdHk6IG1pblksXG5cdFx0XHRcdHdpZHRoOiBtYXhYIC0gbWluWCxcblx0XHRcdFx0aGVpZ2h0OiBtYXhZIC0gbWluWSxcblx0XHRcdH07XG5cdFx0XHRyZXR1cm4gYm91bmRzLndpZHRoID09PSBOdW1iZXIuTkVHQVRJVkVfSU5GSU5JVFlcblx0XHRcdFx0PyB7IHg6IDAsIHk6IDAsIHdpZHRoOiAwLCBoZWlnaHQ6IDAgfVxuXHRcdFx0XHQ6IGJvdW5kcztcblx0XHR9XG5cdH1cbn0iXX0= \ No newline at end of file diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/iife/spine-construct3-lib.js b/spine-ts/spine-construct3/spine-construct3-lib/dist/iife/spine-construct3-lib.js deleted file mode 100644 index 2469fa1a7..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/iife/spine-construct3-lib.js +++ /dev/null @@ -1,12721 +0,0 @@ -"use strict"; -var spine = (() => { - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; - }; - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - - // spine-construct3/spine-construct3-lib/src/index.ts - var index_exports = {}; - __export(index_exports, { - AABBRectangleBoundsProvider: () => AABBRectangleBoundsProvider, - AlphaTimeline: () => AlphaTimeline, - Animation: () => Animation, - AnimationState: () => AnimationState, - AnimationStateAdapter: () => AnimationStateAdapter, - AnimationStateData: () => AnimationStateData, - AssetCache: () => AssetCache, - AssetLoader: () => AssetLoader, - AssetManagerBase: () => AssetManagerBase, - AtlasAttachmentLoader: () => AtlasAttachmentLoader, - Attachment: () => Attachment, - AttachmentTimeline: () => AttachmentTimeline, - BinaryInput: () => BinaryInput, - BlendMode: () => BlendMode, - BlendingModeSpineToC3: () => BlendingModeSpineToC3, - Bone: () => Bone, - BoneData: () => BoneData, - BoneLocal: () => BoneLocal, - BonePose: () => BonePose, - BoneTimeline1: () => BoneTimeline1, - BoneTimeline2: () => BoneTimeline2, - BoundingBoxAttachment: () => BoundingBoxAttachment, - C3Texture: () => C3Texture, - C3TextureEditor: () => C3TextureEditor, - CURRENT: () => CURRENT, - ClippingAttachment: () => ClippingAttachment, - Color: () => Color, - Constraint: () => Constraint, - ConstraintData: () => ConstraintData, - ConstraintTimeline1: () => ConstraintTimeline1, - CurveTimeline: () => CurveTimeline, - CurveTimeline1: () => CurveTimeline1, - DebugUtils: () => DebugUtils, - DeformTimeline: () => DeformTimeline, - Downloader: () => Downloader, - DrawOrderTimeline: () => DrawOrderTimeline, - Event: () => Event, - EventData: () => EventData, - EventQueue: () => EventQueue, - EventTimeline: () => EventTimeline, - EventType: () => EventType, - FIRST: () => FIRST, - FakeTexture: () => FakeTexture, - FromProperty: () => FromProperty, - FromRotate: () => FromRotate, - FromScaleX: () => FromScaleX, - FromScaleY: () => FromScaleY, - FromShearY: () => FromShearY, - FromX: () => FromX, - FromY: () => FromY, - HOLD_FIRST: () => HOLD_FIRST, - HOLD_MIX: () => HOLD_MIX, - HOLD_SUBSEQUENT: () => HOLD_SUBSEQUENT, - IkConstraint: () => IkConstraint, - IkConstraintData: () => IkConstraintData, - IkConstraintPose: () => IkConstraintPose, - IkConstraintTimeline: () => IkConstraintTimeline, - Inherit: () => Inherit, - InheritTimeline: () => InheritTimeline, - IntSet: () => IntSet, - Interpolation: () => Interpolation, - MathUtils: () => MathUtils, - MeshAttachment: () => MeshAttachment, - MixBlend: () => MixBlend, - MixDirection: () => MixDirection, - PathAttachment: () => PathAttachment, - PathConstraint: () => PathConstraint, - PathConstraintData: () => PathConstraintData, - PathConstraintMixTimeline: () => PathConstraintMixTimeline, - PathConstraintPose: () => PathConstraintPose, - PathConstraintPositionTimeline: () => PathConstraintPositionTimeline, - PathConstraintSpacingTimeline: () => PathConstraintSpacingTimeline, - Physics: () => Physics, - PhysicsConstraint: () => PhysicsConstraint, - PhysicsConstraintDampingTimeline: () => PhysicsConstraintDampingTimeline, - PhysicsConstraintData: () => PhysicsConstraintData, - PhysicsConstraintGravityTimeline: () => PhysicsConstraintGravityTimeline, - PhysicsConstraintInertiaTimeline: () => PhysicsConstraintInertiaTimeline, - PhysicsConstraintMassTimeline: () => PhysicsConstraintMassTimeline, - PhysicsConstraintMixTimeline: () => PhysicsConstraintMixTimeline, - PhysicsConstraintPose: () => PhysicsConstraintPose, - PhysicsConstraintResetTimeline: () => PhysicsConstraintResetTimeline, - PhysicsConstraintStrengthTimeline: () => PhysicsConstraintStrengthTimeline, - PhysicsConstraintTimeline: () => PhysicsConstraintTimeline, - PhysicsConstraintWindTimeline: () => PhysicsConstraintWindTimeline, - PointAttachment: () => PointAttachment, - Pool: () => Pool, - Posed: () => Posed, - PosedActive: () => PosedActive, - PosedData: () => PosedData, - PositionMode: () => PositionMode, - Pow: () => Pow, - PowOut: () => PowOut, - Property: () => Property, - RGB2Timeline: () => RGB2Timeline, - RGBA2Timeline: () => RGBA2Timeline, - RGBATimeline: () => RGBATimeline, - RGBTimeline: () => RGBTimeline, - RegionAttachment: () => RegionAttachment, - RotateMode: () => RotateMode, - RotateTimeline: () => RotateTimeline, - SETUP: () => SETUP, - SUBSEQUENT: () => SUBSEQUENT, - ScaleTimeline: () => ScaleTimeline, - ScaleXTimeline: () => ScaleXTimeline, - ScaleYTimeline: () => ScaleYTimeline, - Sequence: () => Sequence, - SequenceMode: () => SequenceMode, - SequenceModeValues: () => SequenceModeValues, - SequenceTimeline: () => SequenceTimeline, - SetupPoseBoundsProvider: () => SetupPoseBoundsProvider, - ShearTimeline: () => ShearTimeline, - ShearXTimeline: () => ShearXTimeline, - ShearYTimeline: () => ShearYTimeline, - Skeleton: () => Skeleton, - SkeletonBinary: () => SkeletonBinary, - SkeletonBounds: () => SkeletonBounds, - SkeletonClipping: () => SkeletonClipping, - SkeletonData: () => SkeletonData, - SkeletonJson: () => SkeletonJson, - SkeletonRendererCore: () => SkeletonRendererCore, - Skin: () => Skin, - SkinEntry: () => SkinEntry, - SkinsAndAnimationBoundsProvider: () => SkinsAndAnimationBoundsProvider, - Slider: () => Slider, - SliderData: () => SliderData, - SliderMixTimeline: () => SliderMixTimeline, - SliderPose: () => SliderPose, - SliderTimeline: () => SliderTimeline, - Slot: () => Slot, - SlotCurveTimeline: () => SlotCurveTimeline, - SlotData: () => SlotData, - SlotPose: () => SlotPose, - SpacingMode: () => SpacingMode, - StringSet: () => StringSet, - Texture: () => Texture, - TextureAtlas: () => TextureAtlas, - TextureAtlasPage: () => TextureAtlasPage, - TextureAtlasRegion: () => TextureAtlasRegion, - TextureFilter: () => TextureFilter, - TextureRegion: () => TextureRegion, - TextureWrap: () => TextureWrap, - TimeKeeper: () => TimeKeeper, - Timeline: () => Timeline, - ToProperty: () => ToProperty, - ToRotate: () => ToRotate, - ToScaleX: () => ToScaleX, - ToScaleY: () => ToScaleY, - ToShearY: () => ToShearY, - ToX: () => ToX, - ToY: () => ToY, - TrackEntry: () => TrackEntry, - TransformConstraint: () => TransformConstraint, - TransformConstraintData: () => TransformConstraintData, - TransformConstraintPose: () => TransformConstraintPose, - TransformConstraintTimeline: () => TransformConstraintTimeline, - TranslateTimeline: () => TranslateTimeline, - TranslateXTimeline: () => TranslateXTimeline, - TranslateYTimeline: () => TranslateYTimeline, - Triangulator: () => Triangulator, - Utils: () => Utils, - Vector2: () => Vector2, - VertexAttachment: () => VertexAttachment, - WindowedMean: () => WindowedMean, - isBoneTimeline: () => isBoneTimeline, - isConstraintTimeline: () => isConstraintTimeline, - isSlotTimeline: () => isSlotTimeline - }); - - // spine-core/src/Utils.ts - var IntSet = class { - array = []; - add(value) { - const contains = this.contains(value); - this.array[value | 0] = value | 0; - return !contains; - } - contains(value) { - return this.array[value | 0] !== void 0; - } - remove(value) { - this.array[value | 0] = void 0; - } - clear() { - this.array.length = 0; - } - }; - var StringSet = class { - entries = {}; - size = 0; - add(value) { - const contains = this.entries[value]; - this.entries[value] = true; - if (!contains) { - this.size++; - return true; - } - return false; - } - addAll(values) { - const oldSize = this.size; - for (let i = 0, n = values.length; i < n; i++) - this.add(values[i]); - return oldSize !== this.size; - } - contains(value) { - return this.entries[value]; - } - clear() { - this.entries = {}; - this.size = 0; - } - }; - var Color = class _Color { - constructor(r = 0, g = 0, b = 0, a = 0) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - static WHITE = new _Color(1, 1, 1, 1); - static RED = new _Color(1, 0, 0, 1); - static GREEN = new _Color(0, 1, 0, 1); - static BLUE = new _Color(0, 0, 1, 1); - static MAGENTA = new _Color(1, 0, 1, 1); - set(r, g, b, a) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - return this.clamp(); - } - setFromColor(c) { - this.r = c.r; - this.g = c.g; - this.b = c.b; - this.a = c.a; - return this; - } - setFromString(hex) { - hex = hex.charAt(0) === "#" ? hex.substr(1) : hex; - this.r = parseInt(hex.substr(0, 2), 16) / 255; - this.g = parseInt(hex.substr(2, 2), 16) / 255; - this.b = parseInt(hex.substr(4, 2), 16) / 255; - this.a = hex.length !== 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255; - return this; - } - add(r, g, b, a) { - this.r += r; - this.g += g; - this.b += b; - this.a += a; - return this.clamp(); - } - clamp() { - 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; - } - static rgba8888ToColor(color, value) { - color.r = ((value & 4278190080) >>> 24) / 255; - color.g = ((value & 16711680) >>> 16) / 255; - color.b = ((value & 65280) >>> 8) / 255; - color.a = (value & 255) / 255; - } - static rgb888ToColor(color, value) { - color.r = ((value & 16711680) >>> 16) / 255; - color.g = ((value & 65280) >>> 8) / 255; - color.b = (value & 255) / 255; - } - toRgb888() { - const hex = (x) => `0${(x * 255).toString(16)}`.slice(-2); - return Number(`0x${hex(this.r)}${hex(this.g)}${hex(this.b)}`); - } - static fromString(hex, color = new _Color()) { - return color.setFromString(hex); - } - }; - var MathUtils = class _MathUtils { - // biome-ignore lint/suspicious/noApproximativeNumericConstant: reference runtime - static PI = 3.1415927; - static PI2 = _MathUtils.PI * 2; - static invPI2 = 1 / _MathUtils.PI2; - static radiansToDegrees = 180 / _MathUtils.PI; - static radDeg = _MathUtils.radiansToDegrees; - static degreesToRadians = _MathUtils.PI / 180; - static degRad = _MathUtils.degreesToRadians; - static clamp(value, min, max) { - if (value < min) return min; - if (value > max) return max; - return value; - } - static cosDeg(degrees) { - return Math.cos(degrees * _MathUtils.degRad); - } - static sinDeg(degrees) { - return Math.sin(degrees * _MathUtils.degRad); - } - static atan2Deg(y, x) { - return Math.atan2(y, x) * _MathUtils.radDeg; - } - static signum(value) { - return value > 0 ? 1 : value < 0 ? -1 : 0; - } - static toInt(x) { - return x > 0 ? Math.floor(x) : Math.ceil(x); - } - static cbrt(x) { - const y = Math.pow(Math.abs(x), 1 / 3); - return x < 0 ? -y : y; - } - static randomTriangular(min, max) { - return _MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); - } - static randomTriangularWith(min, max, mode) { - const u = Math.random(); - const 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)); - } - static isPowerOfTwo(value) { - return value && (value & value - 1) === 0; - } - }; - var Interpolation = class { - apply(start, end, a) { - return start + (end - start) * this.applyInternal(a); - } - }; - var Pow = class extends Interpolation { - power = 2; - constructor(power) { - super(); - this.power = power; - } - applyInternal(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; - } - }; - var PowOut = class extends Pow { - constructor(power) { - super(power); - } - applyInternal(a) { - return Math.pow(a - 1, this.power) * (this.power % 2 === 0 ? -1 : 1) + 1; - } - }; - var Utils = class _Utils { - static SUPPORTS_TYPED_ARRAYS = typeof Float32Array !== "undefined"; - static arrayCopy(source, sourceStart, dest, destStart, numElements) { - for (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { - dest[j] = source[i]; - } - } - static arrayFill(array, fromIndex, toIndex, value) { - for (let i = fromIndex; i < toIndex; i++) - array[i] = value; - } - // biome-ignore lint/suspicious/noExplicitAny: ok any in this case - static setArraySize(array, size, value = 0) { - const oldSize = array.length; - if (oldSize === size) return array; - array.length = size; - if (oldSize < size) { - for (let i = oldSize; i < size; i++) array[i] = value; - } - return array; - } - // biome-ignore lint/suspicious/noExplicitAny: ok any in this case - static ensureArrayCapacity(array, size, value = 0) { - if (array.length >= size) return array; - return _Utils.setArraySize(array, size, value); - } - static newArray(size, defaultValue) { - const array = []; - for (let i = 0; i < size; i++) array[i] = defaultValue; - return array; - } - static newFloatArray(size) { - if (_Utils.SUPPORTS_TYPED_ARRAYS) - return new Float32Array(size); - else { - const array = []; - for (let i = 0; i < array.length; i++) array[i] = 0; - return array; - } - } - static newShortArray(size) { - if (_Utils.SUPPORTS_TYPED_ARRAYS) - return new Int16Array(size); - else { - const array = []; - for (let i = 0; i < array.length; i++) array[i] = 0; - return array; - } - } - static toFloatArray(array) { - return _Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; - } - static toSinglePrecision(value) { - return _Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; - } - // This function is used to fix WebKit 602 specific issue described at https://esotericsoftware.com/forum/d/10109-ios-10-disappearing-graphics - static webkit602BugfixHelper(alpha, blend) { - } - static contains(array, element, identity = true) { - for (let i = 0; i < array.length; i++) - if (array[i] === element) return true; - return false; - } - // biome-ignore lint/suspicious/noExplicitAny: ok any in this case - static enumValue(type, name) { - return type[name[0].toUpperCase() + name.slice(1)]; - } - }; - var DebugUtils = class { - static logBones(skeleton) { - for (let i = 0; i < skeleton.bones.length; i++) { - const bone = skeleton.bones[i].applied; - console.log(`${bone.bone.data.name}, ${bone.a}, ${bone.b}, ${bone.c}, ${bone.d}, ${bone.worldX}, ${bone.worldY}`); - } - } - }; - var Pool = class { - items = []; - instantiator; - constructor(instantiator) { - this.instantiator = instantiator; - } - obtain() { - return this.items.length > 0 ? this.items.pop() : this.instantiator(); - } - free(item) { - item.reset?.(); - this.items.push(item); - } - freeAll(items) { - for (let i = 0; i < items.length; i++) - this.free(items[i]); - } - clear() { - this.items.length = 0; - } - }; - var Vector2 = class { - constructor(x = 0, y = 0) { - this.x = x; - this.y = y; - } - set(x, y) { - this.x = x; - this.y = y; - return this; - } - length() { - const x = this.x; - const y = this.y; - return Math.sqrt(x * x + y * y); - } - normalize() { - const len = this.length(); - if (len !== 0) { - this.x /= len; - this.y /= len; - } - return this; - } - }; - var TimeKeeper = class { - maxDelta = 0.064; - framesPerSecond = 0; - delta = 0; - totalTime = 0; - lastTime = Date.now() / 1e3; - frameCount = 0; - frameTime = 0; - update() { - const now = Date.now() / 1e3; - 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; - } - } - }; - var WindowedMean = class { - values; - addedValues = 0; - lastValue = 0; - mean = 0; - dirty = true; - constructor(windowSize = 32) { - this.values = new Array(windowSize); - } - hasEnoughData() { - return this.addedValues >= this.values.length; - } - addValue(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; - } - getMean() { - if (this.hasEnoughData()) { - if (this.dirty) { - let mean = 0; - for (let i = 0; i < this.values.length; i++) - mean += this.values[i]; - this.mean = mean / this.values.length; - this.dirty = false; - } - return this.mean; - } - return 0; - } - }; - - // spine-core/src/attachments/Attachment.ts - var Attachment = class { - name; - constructor(name) { - if (!name) throw new Error("name cannot be null."); - this.name = name; - } - }; - var VertexAttachment = class _VertexAttachment extends Attachment { - static nextID = 0; - /** The unique ID for this attachment. */ - id = _VertexAttachment.nextID++; - /** The bones which affect the {@link vertices}. The array entries are, for each vertex, the number of bones affecting - * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton.bones}. Will be null - * if this attachment has no weights. */ - bones = null; - /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y` - * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting - * each vertex. */ - vertices = []; - /** The maximum number of world vertex values that can be output by - * {@link computeWorldVertices} using the `count` parameter. */ - worldVerticesLength = 0; - /** Timelines for the timeline attachment are also applied to this attachment. - * May be null if no attachment-specific timelines should be applied. */ - timelineAttachment = this; - constructor(name) { - super(name); - } - /** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link SlotPose.deform} is - * not empty, it is used to deform the vertices. - * - * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine - * Runtimes Guide. - * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y. - * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`. - * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` * - * `stride` / 2. - * @param offset The `worldVertices` index to begin writing values. - * @param stride The number of `worldVertices` entries between the value pairs written. */ - computeWorldVertices(skeleton, slot, start, count, worldVertices, offset, stride) { - count = offset + (count >> 1) * stride; - const deformArray = slot.applied.deform; - let vertices = this.vertices; - const bones = this.bones; - if (!bones) { - if (deformArray.length > 0) vertices = deformArray; - const bone = slot.bone.applied; - const x = bone.worldX; - const y = bone.worldY; - const a = bone.a, b = bone.b, c = bone.c, d = bone.d; - for (let v2 = start, w = offset; w < count; v2 += 2, w += stride) { - const vx = vertices[v2], vy = vertices[v2 + 1]; - worldVertices[w] = vx * a + vy * b + x; - worldVertices[w + 1] = vx * c + vy * d + y; - } - return; - } - let v = 0, skip = 0; - for (let i = 0; i < start; i += 2) { - const n = bones[v]; - v += n + 1; - skip += n; - } - const skeletonBones = skeleton.bones; - if (deformArray.length === 0) { - for (let w = offset, b = skip * 3; w < count; w += stride) { - let wx = 0, wy = 0; - let n = bones[v++]; - n += v; - for (; v < n; v++, b += 3) { - const bone = skeletonBones[bones[v]].applied; - const 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 { - const deform = deformArray; - for (let w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { - let wx = 0, wy = 0; - let n = bones[v++]; - n += v; - for (; v < n; v++, b += 3, f += 2) { - const bone = skeletonBones[bones[v]].applied; - const 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; - } - } - } - /** Does not copy id (generated) or name (set on construction). **/ - copyTo(attachment) { - if (this.bones) { - attachment.bones = []; - Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length); - } else - attachment.bones = null; - if (this.vertices) { - attachment.vertices = Utils.newFloatArray(this.vertices.length); - Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length); - } - attachment.worldVerticesLength = this.worldVerticesLength; - attachment.timelineAttachment = this.timelineAttachment; - } - }; - - // spine-core/src/attachments/Sequence.ts - var Sequence = class _Sequence { - static _nextID = 0; - id = _Sequence.nextID(); - regions; - start = 0; - digits = 0; - /** The index of the region to show for the setup pose. */ - setupIndex = 0; - constructor(count) { - this.regions = new Array(count); - } - copy() { - const copy = new _Sequence(this.regions.length); - Utils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length); - copy.start = this.start; - copy.digits = this.digits; - copy.setupIndex = this.setupIndex; - return copy; - } - apply(slot, attachment) { - let index = slot.sequenceIndex; - if (index === -1) index = this.setupIndex; - if (index >= this.regions.length) index = this.regions.length - 1; - const region = this.regions[index]; - if (attachment.region !== region) { - attachment.region = region; - attachment.updateRegion(); - } - } - getPath(basePath, index) { - let result = basePath; - const frame = (this.start + index).toString(); - for (let i = this.digits - frame.length; i > 0; i--) - result += "0"; - result += frame; - return result; - } - static nextID() { - return _Sequence._nextID++; - } - }; - var SequenceMode = /* @__PURE__ */ ((SequenceMode2) => { - SequenceMode2[SequenceMode2["hold"] = 0] = "hold"; - SequenceMode2[SequenceMode2["once"] = 1] = "once"; - SequenceMode2[SequenceMode2["loop"] = 2] = "loop"; - SequenceMode2[SequenceMode2["pingpong"] = 3] = "pingpong"; - SequenceMode2[SequenceMode2["onceReverse"] = 4] = "onceReverse"; - SequenceMode2[SequenceMode2["loopReverse"] = 5] = "loopReverse"; - SequenceMode2[SequenceMode2["pingpongReverse"] = 6] = "pingpongReverse"; - return SequenceMode2; - })(SequenceMode || {}); - var SequenceModeValues = [ - 0 /* hold */, - 1 /* once */, - 2 /* loop */, - 3 /* pingpong */, - 4 /* onceReverse */, - 5 /* loopReverse */, - 6 /* pingpongReverse */ - ]; - - // spine-core/src/Animation.ts - var Animation = class { - /** The animation's name, which is unique across all animations in the skeleton. */ - name; - /** If the returned array or the timelines it contains are modified, {@link setTimelines()} must be called. */ - timelines = []; - timelineIds; - bones; - /** The duration of the animation in seconds, which is usually the highest time of all frames in the timeline. The duration is - * used to know when it has completed and when it should loop back to the start. */ - duration; - constructor(name, timelines, duration) { - if (!name) throw new Error("name cannot be null."); - this.name = name; - this.duration = duration; - this.timelineIds = new StringSet(); - this.bones = []; - this.setTimelines(timelines); - } - setTimelines(timelines) { - if (!timelines) throw new Error("timelines cannot be null."); - this.timelines = timelines; - const n = timelines.length; - this.timelineIds.clear(); - this.bones.length = 0; - const boneSet = /* @__PURE__ */ new Set(); - const items = timelines; - for (let i = 0; i < n; i++) { - const timeline = items[i]; - this.timelineIds.addAll(timeline.getPropertyIds()); - if (isBoneTimeline(timeline) && boneSet.add(timeline.boneIndex)) - this.bones.push(timeline.boneIndex); - } - } - hasTimeline(ids) { - for (let i = 0; i < ids.length; i++) - if (this.timelineIds.contains(ids[i])) return true; - return false; - } - /** Applies the animation's timelines to the specified skeleton. - * - * See Timeline {@link Timeline.apply}. - * @param skeleton The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton - * components the timelines may change. - * @param lastTime The last time in seconds this animation was applied. Some timelines trigger only at specific times rather - * than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered. - * @param time The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after - * this time and interpolate between the frame values. If beyond the {@link duration} and loop is - * true then the animation will repeat, else the last frame will be applied. - * @param loop If true, the animation repeats after the {@link duration}. - * @param events If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines - * fire events. - * @param alpha 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between - * 0 and 1 applies values between the current or setup values and the timeline values. By adjusting - * alpha over time, an animation can be mixed in or out. alpha can also be useful to apply - * animations on top of each other (layering). - * @param blend Controls how mixing is applied when alpha < 1. - * @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, - * such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}. - * @param appliedPose True to to modify the applied pose. */ - apply(skeleton, lastTime, time, loop, events, alpha, blend, direction, appliedPose) { - if (!skeleton) throw new Error("skeleton cannot be null."); - if (loop && this.duration !== 0) { - time %= this.duration; - if (lastTime > 0) lastTime %= this.duration; - } - const timelines = this.timelines; - for (let i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose); - } - }; - var MixBlend = /* @__PURE__ */ ((MixBlend2) => { - MixBlend2[MixBlend2["setup"] = 0] = "setup"; - MixBlend2[MixBlend2["first"] = 1] = "first"; - MixBlend2[MixBlend2["replace"] = 2] = "replace"; - MixBlend2[MixBlend2["add"] = 3] = "add"; - return MixBlend2; - })(MixBlend || {}); - var MixDirection = /* @__PURE__ */ ((MixDirection2) => { - MixDirection2[MixDirection2["in"] = 0] = "in"; - MixDirection2[MixDirection2["out"] = 1] = "out"; - return MixDirection2; - })(MixDirection || {}); - var Property = /* @__PURE__ */ ((Property2) => { - Property2[Property2["rotate"] = 0] = "rotate"; - Property2[Property2["x"] = 1] = "x"; - Property2[Property2["y"] = 2] = "y"; - Property2[Property2["scaleX"] = 3] = "scaleX"; - Property2[Property2["scaleY"] = 4] = "scaleY"; - Property2[Property2["shearX"] = 5] = "shearX"; - Property2[Property2["shearY"] = 6] = "shearY"; - Property2[Property2["inherit"] = 7] = "inherit"; - Property2[Property2["rgb"] = 8] = "rgb"; - Property2[Property2["alpha"] = 9] = "alpha"; - Property2[Property2["rgb2"] = 10] = "rgb2"; - Property2[Property2["attachment"] = 11] = "attachment"; - Property2[Property2["deform"] = 12] = "deform"; - Property2[Property2["event"] = 13] = "event"; - Property2[Property2["drawOrder"] = 14] = "drawOrder"; - Property2[Property2["ikConstraint"] = 15] = "ikConstraint"; - Property2[Property2["transformConstraint"] = 16] = "transformConstraint"; - Property2[Property2["pathConstraintPosition"] = 17] = "pathConstraintPosition"; - Property2[Property2["pathConstraintSpacing"] = 18] = "pathConstraintSpacing"; - Property2[Property2["pathConstraintMix"] = 19] = "pathConstraintMix"; - Property2[Property2["physicsConstraintInertia"] = 20] = "physicsConstraintInertia"; - Property2[Property2["physicsConstraintStrength"] = 21] = "physicsConstraintStrength"; - Property2[Property2["physicsConstraintDamping"] = 22] = "physicsConstraintDamping"; - Property2[Property2["physicsConstraintMass"] = 23] = "physicsConstraintMass"; - Property2[Property2["physicsConstraintWind"] = 24] = "physicsConstraintWind"; - Property2[Property2["physicsConstraintGravity"] = 25] = "physicsConstraintGravity"; - Property2[Property2["physicsConstraintMix"] = 26] = "physicsConstraintMix"; - Property2[Property2["physicsConstraintReset"] = 27] = "physicsConstraintReset"; - Property2[Property2["sequence"] = 28] = "sequence"; - Property2[Property2["sliderTime"] = 29] = "sliderTime"; - Property2[Property2["sliderMix"] = 30] = "sliderMix"; - return Property2; - })(Property || {}); - var Timeline = class { - propertyIds; - frames; - constructor(frameCount, ...propertyIds) { - this.propertyIds = propertyIds; - this.frames = Utils.newFloatArray(frameCount * this.getFrameEntries()); - } - getPropertyIds() { - return this.propertyIds; - } - getFrameEntries() { - return 1; - } - getFrameCount() { - return this.frames.length / this.getFrameEntries(); - } - getDuration() { - return this.frames[this.frames.length - this.getFrameEntries()]; - } - /** Linear search using the specified stride (default 1). - * @param time Must be >= the first value in frames. - * @return The index of the first value <= time. */ - static search(frames, time, step = 1) { - const n = frames.length; - for (let i = step; i < n; i += step) - if (frames[i] > time) return i - step; - return n - step; - } - }; - function isSlotTimeline(obj) { - return typeof obj === "object" && obj !== null && typeof obj.slotIndex === "number"; - } - var CurveTimeline = class extends Timeline { - curves; - // type, x, y, ... - constructor(frameCount, bezierCount, ...propertyIds) { - super(frameCount, ...propertyIds); - this.curves = Utils.newFloatArray( - frameCount + bezierCount * 18 - /*BEZIER_SIZE*/ - ); - this.curves[frameCount - 1] = 1; - } - /** Sets the specified key frame to linear interpolation. */ - setLinear(frame) { - this.curves[frame] = 0; - } - /** Sets the specified key frame to stepped interpolation. */ - setStepped(frame) { - this.curves[frame] = 1; - } - /** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger - * than the actual number of Bezier curves. */ - shrink(bezierCount) { - const size = this.getFrameCount() + bezierCount * 18; - if (this.curves.length > size) { - const newCurves = Utils.newFloatArray(size); - Utils.arrayCopy(this.curves, 0, newCurves, 0, size); - this.curves = newCurves; - } - } - /** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than - * one curve per frame. - * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified - * in the constructor), inclusive. - * @param frame Between 0 and frameCount - 1, inclusive. - * @param value The index of the value for this frame that this curve is used for. - * @param time1 The time for the first key. - * @param value1 The value for the first key. - * @param cx1 The time for the first Bezier handle. - * @param cy1 The value for the first Bezier handle. - * @param cx2 The time of the second Bezier handle. - * @param cy2 The value for the second Bezier handle. - * @param time2 The time for the second key. - * @param value2 The value for the second key. */ - setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) { - const curves = this.curves; - let i = this.getFrameCount() + bezier * 18; - if (value === 0) curves[frame] = 2 + i; - const tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03; - const dddx = ((cx1 - cx2) * 3 - time1 + time2) * 6e-3, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 6e-3; - let ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy; - let dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667; - let x = time1 + dx, y = value1 + dy; - for (let n = i + 18; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dx += ddx; - dy += ddy; - ddx += dddx; - ddy += dddy; - x += dx; - y += dy; - } - } - /** Returns the Bezier interpolated value for the specified time. - * @param frameIndex The index into {@link #getFrames()} for the values of the frame before time. - * @param valueOffset The offset from frameIndex to the value this curve is used for. - * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */ - getBezierValue(time, frameIndex, valueOffset, i) { - const curves = this.curves; - if (curves[i] > time) { - const x2 = this.frames[frameIndex], y2 = this.frames[frameIndex + valueOffset]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - const n = i + 18; - for (i += 2; i < n; i += 2) { - if (curves[i] >= time) { - const x2 = curves[i - 2], y2 = curves[i - 1]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - } - frameIndex += this.getFrameEntries(); - const x = curves[n - 2], y = curves[n - 1]; - return y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y); - } - }; - var CurveTimeline1 = class extends CurveTimeline { - constructor(frameCount, bezierCount, propertyId) { - super(frameCount, bezierCount, propertyId); - } - getFrameEntries() { - return 2; - } - /** Sets the time and value for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, value) { - frame <<= 1; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*VALUE*/ - ] = value; - } - /** Returns the interpolated value for the specified time. */ - getCurveValue(time) { - const frames = this.frames; - let i = frames.length - 2; - for (let ii = 2; ii <= i; ii += 2) { - if (frames[ii] > time) { - i = ii - 2; - break; - } - } - const curveType = this.curves[i >> 1]; - switch (curveType) { - case 0: { - const before = frames[i], value = frames[ - i + 1 - /*VALUE*/ - ]; - return value + (time - before) / (frames[ - i + 2 - /*ENTRIES*/ - ] - before) * (frames[ - i + 2 + 1 - /*VALUE*/ - ] - value); - } - case 1: - return frames[ - i + 1 - /*VALUE*/ - ]; - } - return this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - } - getRelativeValue(time, alpha, blend, current, setup) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - const value = this.getCurveValue(time); - switch (blend) { - case 0 /* setup */: - return setup + value * alpha; - case 1 /* first */: - case 2 /* replace */: - return current + (value + setup - current) * alpha; - case 3 /* add */: - return current + value * alpha; - } - } - getAbsoluteValue(time, alpha, blend, current, setup, value) { - if (value === void 0) - return this.getAbsoluteValue1(time, alpha, blend, current, setup); - else - return this.getAbsoluteValue2(time, alpha, blend, current, setup, value); - } - getAbsoluteValue1(time, alpha, blend, current, setup) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - default: - return current; - } - } - const value = this.getCurveValue(time); - switch (blend) { - case 0 /* setup */: - return setup + (value - setup) * alpha; - case 1 /* first */: - case 2 /* replace */: - return current + (value - current) * alpha; - case 3 /* add */: - return current + value * alpha; - } - } - getAbsoluteValue2(time, alpha, blend, current, setup, value) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - default: - return current; - } - } - switch (blend) { - case 0 /* setup */: - return setup + (value - setup) * alpha; - case 1 /* first */: - case 2 /* replace */: - return current + (value - current) * alpha; - case 3 /* add */: - return current + value * alpha; - } - } - getScaleValue(time, alpha, blend, direction, current, setup) { - const frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - default: - return current; - } - } - const value = this.getCurveValue(time) * setup; - if (alpha === 1) return blend === 3 /* add */ ? current + value - setup : value; - if (direction === 1 /* out */) { - switch (blend) { - case 0 /* setup */: - return setup + (Math.abs(value) * MathUtils.signum(setup) - setup) * alpha; - case 1 /* first */: - case 2 /* replace */: - return current + (Math.abs(value) * MathUtils.signum(current) - current) * alpha; - } - } else { - let s = 0; - switch (blend) { - case 0 /* setup */: - s = Math.abs(setup) * MathUtils.signum(value); - return s + (value - s) * alpha; - case 1 /* first */: - case 2 /* replace */: - s = Math.abs(current) * MathUtils.signum(value); - return s + (value - s) * alpha; - } - } - return current + (value - setup) * alpha; - } - }; - var BoneTimeline2 = class extends CurveTimeline { - boneIndex; - /** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}. - * @param propertyIds Unique identifiers for the properties the timeline modifies. */ - constructor(frameCount, bezierCount, boneIndex, property1, property2) { - super(frameCount, bezierCount, `${property1}|${boneIndex}`, `${property2}|${boneIndex}`); - this.boneIndex = boneIndex; - } - getFrameEntries() { - return 3; - } - /** Sets the time and values for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, value1, value2) { - frame *= 3; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*VALUE1*/ - ] = value1; - this.frames[ - frame + 2 - /*VALUE2*/ - ] = value2; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose) { - const bone = skeleton.bones[this.boneIndex]; - if (bone.active) this.apply1(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, blend, direction); - } - }; - function isBoneTimeline(obj) { - return typeof obj === "object" && obj !== null && typeof obj.boneIndex === "number"; - } - var BoneTimeline1 = class extends CurveTimeline1 { - boneIndex; - constructor(frameCount, bezierCount, boneIndex, property) { - super(frameCount, bezierCount, `${property}|${boneIndex}`); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose) { - const bone = skeleton.bones[this.boneIndex]; - if (bone.active) this.apply1(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, blend, direction); - } - }; - var RotateTimeline = class extends BoneTimeline1 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 0 /* rotate */); - } - apply1(pose, setup, time, alpha, blend, direction) { - pose.rotation = this.getRelativeValue(time, alpha, blend, pose.rotation, setup.rotation); - } - }; - var TranslateTimeline = class extends BoneTimeline2 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 1 /* x */, 2 /* y */); - } - apply1(pose, setup, time, alpha, blend, direction) { - const frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - pose.x = setup.x; - pose.y = setup.y; - return; - case 1 /* first */: - pose.x += (setup.x - pose.x) * alpha; - pose.y += (setup.y - pose.y) * alpha; - } - return; - } - let x = 0, y = 0; - const i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - const curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: { - const before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - const t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - } - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: - pose.x = setup.x + x * alpha; - pose.y = setup.y + y * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - pose.x += (setup.x + x - pose.x) * alpha; - pose.y += (setup.y + y - pose.y) * alpha; - break; - case 3 /* add */: - pose.x += x * alpha; - pose.y += y * alpha; - } - } - }; - var TranslateXTimeline = class extends BoneTimeline1 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 1 /* x */); - } - apply1(pose, setup, time, alpha, blend, direction) { - pose.x = this.getRelativeValue(time, alpha, blend, pose.x, setup.x); - } - }; - var TranslateYTimeline = class extends BoneTimeline1 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 2 /* y */); - } - apply1(pose, setup, time, alpha, blend, direction) { - pose.y = this.getRelativeValue(time, alpha, blend, pose.y, setup.y); - } - }; - var ScaleTimeline = class extends BoneTimeline2 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 3 /* scaleX */, 4 /* scaleY */); - } - apply1(pose, setup, time, alpha, blend, direction) { - const frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - pose.scaleX = setup.scaleX; - pose.scaleY = setup.scaleY; - return; - case 1 /* first */: - pose.scaleX += (setup.scaleX - pose.scaleX) * alpha; - pose.scaleY += (setup.scaleY - pose.scaleY) * alpha; - } - return; - } - let x, y; - const i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - const curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: { - const before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - const t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - } - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - x *= setup.scaleX; - y *= setup.scaleY; - if (alpha === 1) { - if (blend === 3 /* add */) { - pose.scaleX += x - setup.scaleX; - pose.scaleY += y - setup.scaleY; - } else { - pose.scaleX = x; - pose.scaleY = y; - } - } else { - let bx = 0, by = 0; - if (direction === 1 /* out */) { - switch (blend) { - case 0 /* setup */: - bx = setup.scaleX; - by = setup.scaleY; - pose.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha; - pose.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bx = pose.scaleX; - by = pose.scaleY; - pose.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha; - pose.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; - break; - case 3 /* add */: - pose.scaleX += (x - setup.scaleX) * alpha; - pose.scaleY += (y - setup.scaleY) * alpha; - } - } else { - switch (blend) { - case 0 /* setup */: - bx = Math.abs(setup.scaleX) * MathUtils.signum(x); - by = Math.abs(setup.scaleY) * MathUtils.signum(y); - pose.scaleX = bx + (x - bx) * alpha; - pose.scaleY = by + (y - by) * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bx = Math.abs(pose.scaleX) * MathUtils.signum(x); - by = Math.abs(pose.scaleY) * MathUtils.signum(y); - pose.scaleX = bx + (x - bx) * alpha; - pose.scaleY = by + (y - by) * alpha; - break; - case 3 /* add */: - pose.scaleX += (x - setup.scaleX) * alpha; - pose.scaleY += (y - setup.scaleY) * alpha; - } - } - } - } - }; - var ScaleXTimeline = class extends BoneTimeline1 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 3 /* scaleX */); - } - apply1(pose, setup, time, alpha, blend, direction) { - pose.scaleX = this.getScaleValue(time, alpha, blend, direction, pose.scaleX, setup.scaleX); - } - }; - var ScaleYTimeline = class extends BoneTimeline1 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 4 /* scaleY */); - } - apply1(pose, setup, time, alpha, blend, direction) { - pose.scaleY = this.getScaleValue(time, alpha, blend, direction, pose.scaleY, setup.scaleY); - } - }; - var ShearTimeline = class extends BoneTimeline2 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 5 /* shearX */, 6 /* shearY */); - } - apply1(pose, setup, time, alpha, blend, direction) { - const frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - pose.shearX = setup.shearX; - pose.shearY = setup.shearY; - return; - case 1 /* first */: - pose.shearX += (setup.shearX - pose.shearX) * alpha; - pose.shearY += (setup.shearY - pose.shearY) * alpha; - } - return; - } - let x = 0, y = 0; - const i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - const curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: { - const before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - const t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - } - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: - pose.shearX = setup.shearX + x * alpha; - pose.shearY = setup.shearY + y * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - pose.shearX += (setup.shearX + x - pose.shearX) * alpha; - pose.shearY += (setup.shearY + y - pose.shearY) * alpha; - break; - case 3 /* add */: - pose.shearX += x * alpha; - pose.shearY += y * alpha; - } - } - }; - var ShearXTimeline = class extends BoneTimeline1 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 5 /* shearX */); - } - apply1(pose, setup, time, alpha, blend, direction) { - pose.shearX = this.getRelativeValue(time, alpha, blend, pose.shearX, setup.shearX); - } - }; - var ShearYTimeline = class extends BoneTimeline1 { - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, boneIndex, 6 /* shearY */); - } - apply1(pose, setup, time, alpha, blend, direction) { - pose.shearY = this.getRelativeValue(time, alpha, blend, pose.shearY, setup.shearY); - } - }; - var InheritTimeline = class extends Timeline { - boneIndex; - constructor(frameCount, boneIndex) { - super(frameCount, `${7 /* inherit */}|${boneIndex}`); - this.boneIndex = boneIndex; - } - getFrameEntries() { - return 2; - } - /** Sets the inherit transform mode for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, inherit) { - frame *= 2; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*INHERIT*/ - ] = inherit; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose) { - const bone = skeleton.bones[this.boneIndex]; - if (!bone.active) return; - const pose = appliedPose ? bone.applied : bone.pose; - if (direction === 1 /* out */) { - if (blend === 0 /* setup */) pose.inherit = bone.data.setup.inherit; - return; - } - const frames = this.frames; - if (time < frames[0]) { - if (blend === 0 /* setup */ || blend === 1 /* first */) pose.inherit = bone.data.setup.inherit; - } else - pose.inherit = this.frames[ - Timeline.search( - frames, - time, - 2 - /*ENTRIES*/ - ) + 1 - /*INHERIT*/ - ]; - } - }; - var SlotCurveTimeline = class extends CurveTimeline { - slotIndex; - constructor(frameCount, bezierCount, slotIndex, ...propertyIds) { - super(frameCount, bezierCount, ...propertyIds); - this.slotIndex = slotIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose) { - const slot = skeleton.slots[this.slotIndex]; - if (slot.bone.active) this.apply1(slot, appliedPose ? slot.applied : slot.pose, time, alpha, blend); - } - }; - var RGBATimeline = class extends SlotCurveTimeline { - constructor(frameCount, bezierCount, slotIndex) { - super( - frameCount, - bezierCount, - slotIndex, - // - `${8 /* rgb */}|${slotIndex}`, - // - `${9 /* alpha */}|${slotIndex}` - ); - } - getFrameEntries() { - return 5; - } - /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */ - setFrame(frame, time, r, g, b, a) { - frame *= 5; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*A*/ - ] = a; - } - apply1(slot, pose, time, alpha, blend) { - const frames = this.frames; - const color = pose.color; - if (time < frames[0]) { - const setup = slot.data.setup.color; - switch (blend) { - case 0 /* setup */: - color.setFromColor(setup); - break; - case 1 /* first */: - color.add( - (setup.r - color.r) * alpha, - (setup.g - color.g) * alpha, - (setup.b - color.b) * alpha, - (setup.a - color.a) * alpha - ); - break; - } - return; - } - let r = 0, g = 0, b = 0, a = 0; - const i = Timeline.search( - frames, - time, - 5 - /*ENTRIES*/ - ); - const curveType = this.curves[ - i / 5 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: { - const before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - const t = (time - before) / (frames[ - i + 5 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 5 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 5 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 5 + 3 - /*B*/ - ] - b) * t; - a += (frames[ - i + 5 + 4 - /*A*/ - ] - a) * t; - break; - } - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - a = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - } - if (alpha === 1) - color.set(r, g, b, a); - else { - if (blend === 0 /* setup */) color.setFromColor(slot.data.setup.color); - color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); - } - } - }; - var RGBTimeline = class extends SlotCurveTimeline { - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, slotIndex, `${8 /* rgb */}|${slotIndex}`); - } - getFrameEntries() { - return 4; - } - /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */ - setFrame(frame, time, r, g, b) { - frame <<= 2; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - } - apply1(slot, pose, time, alpha, blend) { - const frames = this.frames; - const color = pose.color; - if (time < frames[0]) { - const setup = slot.data.setup.color; - switch (blend) { - case 0 /* setup */: - color.r = setup.r; - color.g = setup.g; - color.b = setup.b; - return; - case 1 /* first */: - color.r += (setup.r - color.r) * alpha; - color.g += (setup.g - color.g) * alpha; - color.b += (setup.b - color.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0; - const i = Timeline.search( - frames, - time, - 4 - /*ENTRIES*/ - ); - const curveType = this.curves[i >> 2]; - switch (curveType) { - case 0: { - const before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - const t = (time - before) / (frames[ - i + 4 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 4 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 4 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 4 + 3 - /*B*/ - ] - b) * t; - break; - } - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - } - if (alpha === 1) { - color.r = r; - color.g = g; - color.b = b; - } else { - if (blend === 0 /* setup */) { - const setup = slot.data.setup.color; - color.r = setup.r; - color.g = setup.g; - color.b = setup.b; - } - color.r += (r - color.r) * alpha; - color.g += (g - color.g) * alpha; - color.b += (b - color.b) * alpha; - } - } - }; - var AlphaTimeline = class extends CurveTimeline1 { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, `${9 /* alpha */}|${slotIndex}`); - this.slotIndex = slotIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose) { - const slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) return; - const color = (appliedPose ? slot.applied : slot.pose).color; - const frames = this.frames; - if (time < frames[0]) { - const setup = slot.data.setup.color; - switch (blend) { - case 0 /* setup */: - color.a = setup.a; - break; - case 1 /* first */: - color.a += (setup.a - color.a) * alpha; - break; - } - return; - } - const a = this.getCurveValue(time); - if (alpha === 1) - color.a = a; - else { - if (blend === 0 /* setup */) color.a = slot.data.setup.color.a; - color.a += (a - color.a) * alpha; - } - } - }; - var RGBA2Timeline = class extends SlotCurveTimeline { - constructor(frameCount, bezierCount, slotIndex) { - super( - frameCount, - bezierCount, - slotIndex, - // - `${8 /* rgb */}|${slotIndex}`, - // - `${9 /* alpha */}|${slotIndex}`, - // - `${10 /* rgb2 */}|${slotIndex}` - ); - } - getFrameEntries() { - return 8; - } - /** Sets the time in seconds, light, and dark colors for the specified key frame. */ - setFrame(frame, time, r, g, b, a, r2, g2, b2) { - frame <<= 3; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*A*/ - ] = a; - this.frames[ - frame + 5 - /*R2*/ - ] = r2; - this.frames[ - frame + 6 - /*G2*/ - ] = g2; - this.frames[ - frame + 7 - /*B2*/ - ] = b2; - } - apply1(slot, pose, time, alpha, blend) { - const frames = this.frames; - const light = pose.color, dark = pose.darkColor; - if (time < frames[0]) { - const setup = slot.data.setup; - const setupLight = setup.color, setupDark = setup.darkColor; - switch (blend) { - case 0 /* setup */: - light.setFromColor(setupLight); - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - return; - case 1 /* first */: - light.add( - (setupLight.r - light.r) * alpha, - (setupLight.g - light.g) * alpha, - (setupLight.b - light.b) * alpha, - (setupLight.a - light.a) * alpha - ); - dark.r += (setupDark.r - dark.r) * alpha; - dark.g += (setupDark.g - dark.g) * alpha; - dark.b += (setupDark.b - dark.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; - const i = Timeline.search( - frames, - time, - 8 - /*ENTRIES*/ - ); - const curveType = this.curves[i >> 3]; - switch (curveType) { - case 0: { - const before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - r2 = frames[ - i + 5 - /*R2*/ - ]; - g2 = frames[ - i + 6 - /*G2*/ - ]; - b2 = frames[ - i + 7 - /*B2*/ - ]; - const t = (time - before) / (frames[ - i + 8 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 8 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 8 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 8 + 3 - /*B*/ - ] - b) * t; - a += (frames[ - i + 8 + 4 - /*A*/ - ] - a) * t; - r2 += (frames[ - i + 8 + 5 - /*R2*/ - ] - r2) * t; - g2 += (frames[ - i + 8 + 6 - /*G2*/ - ] - g2) * t; - b2 += (frames[ - i + 8 + 7 - /*B2*/ - ] - b2) * t; - break; - } - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - r2 = frames[ - i + 5 - /*R2*/ - ]; - g2 = frames[ - i + 6 - /*G2*/ - ]; - b2 = frames[ - i + 7 - /*B2*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - a = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - r2 = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - g2 = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - b2 = this.getBezierValue( - time, - i, - 7, - curveType + 18 * 6 - 2 - /*BEZIER*/ - ); - } - if (alpha === 1) { - light.set(r, g, b, a); - dark.r = r2; - dark.g = g2; - dark.b = b2; - } else { - if (blend === 0 /* setup */) { - const setup = slot.data.setup; - light.setFromColor(setup.color); - const setupDark = setup.darkColor; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - } - light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); - dark.r += (r2 - dark.r) * alpha; - dark.g += (g2 - dark.g) * alpha; - dark.b += (b2 - dark.b) * alpha; - } - } - }; - var RGB2Timeline = class extends SlotCurveTimeline { - constructor(frameCount, bezierCount, slotIndex) { - super( - frameCount, - bezierCount, - slotIndex, - // - `${8 /* rgb */}|${slotIndex}`, - // - `${10 /* rgb2 */}|${slotIndex}` - ); - } - getFrameEntries() { - return 7; - } - /** Sets the time in seconds, light, and dark colors for the specified key frame. */ - setFrame(frame, time, r, g, b, r2, g2, b2) { - frame *= 7; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*R2*/ - ] = r2; - this.frames[ - frame + 5 - /*G2*/ - ] = g2; - this.frames[ - frame + 6 - /*B2*/ - ] = b2; - } - apply1(slot, pose, time, alpha, blend) { - const frames = this.frames; - const light = pose.color, dark = pose.darkColor; - if (time < frames[0]) { - const setup = slot.data.setup; - const setupLight = setup.color, setupDark = setup.darkColor; - switch (blend) { - case 0 /* setup */: - light.r = setupLight.r; - light.g = setupLight.g; - light.b = setupLight.b; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - return; - case 1 /* first */: - light.r += (setupLight.r - light.r) * alpha; - light.g += (setupLight.g - light.g) * alpha; - light.b += (setupLight.b - light.b) * alpha; - dark.r += (setupDark.r - dark.r) * alpha; - dark.g += (setupDark.g - dark.g) * alpha; - dark.b += (setupDark.b - dark.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0, r2 = 0, g2 = 0, b2 = 0; - const i = Timeline.search( - frames, - time, - 7 - /*ENTRIES*/ - ); - const curveType = this.curves[ - i / 7 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: { - const before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - r2 = frames[ - i + 4 - /*R2*/ - ]; - g2 = frames[ - i + 5 - /*G2*/ - ]; - b2 = frames[ - i + 6 - /*B2*/ - ]; - const t = (time - before) / (frames[ - i + 7 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 7 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 7 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 7 + 3 - /*B*/ - ] - b) * t; - r2 += (frames[ - i + 7 + 4 - /*R2*/ - ] - r2) * t; - g2 += (frames[ - i + 7 + 5 - /*G2*/ - ] - g2) * t; - b2 += (frames[ - i + 7 + 6 - /*B2*/ - ] - b2) * t; - break; - } - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - r2 = frames[ - i + 4 - /*R2*/ - ]; - g2 = frames[ - i + 5 - /*G2*/ - ]; - b2 = frames[ - i + 6 - /*B2*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - r2 = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - g2 = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - b2 = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - } - if (alpha === 1) { - light.r = r; - light.g = g; - light.b = b; - dark.r = r2; - dark.g = g2; - dark.b = b2; - } else { - if (blend === 0 /* setup */) { - const setup = slot.data.setup; - const setupLight = setup.color, setupDark = setup.darkColor; - light.r = setupLight.r; - light.g = setupLight.g; - light.b = setupLight.b; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - } - light.r += (r - light.r) * alpha; - light.g += (g - light.g) * alpha; - light.b += (b - light.b) * alpha; - dark.r += (r2 - dark.r) * alpha; - dark.g += (g2 - dark.g) * alpha; - dark.b += (b2 - dark.b) * alpha; - } - } - }; - var AttachmentTimeline = class extends Timeline { - slotIndex = 0; - /** The attachment name for each key frame. May contain null values to clear the attachment. */ - attachmentNames; - constructor(frameCount, slotIndex) { - super(frameCount, `${11 /* attachment */}|${slotIndex}`); - this.slotIndex = slotIndex; - this.attachmentNames = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the attachment name for the specified key frame. */ - setFrame(frame, time, attachmentName) { - this.frames[frame] = time; - this.attachmentNames[frame] = attachmentName; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose) { - const slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) return; - const pose = appliedPose ? slot.applied : slot.pose; - if (direction === 1 /* out */) { - if (blend === 0 /* setup */) this.setAttachment(skeleton, pose, slot.data.attachmentName); - } else if (time < this.frames[0]) { - if (blend === 0 /* setup */ || blend === 1 /* first */) this.setAttachment(skeleton, pose, slot.data.attachmentName); - } else - this.setAttachment(skeleton, pose, this.attachmentNames[Timeline.search(this.frames, time)]); - } - setAttachment(skeleton, pose, attachmentName) { - pose.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); - } - }; - var DeformTimeline = class extends SlotCurveTimeline { - /** The attachment that will be deformed. - * - * See {@link VertexAttachment.getTimelineAttachment()}. */ - attachment; - /** The vertices for each key frame. */ - vertices; - constructor(frameCount, bezierCount, slotIndex, attachment) { - super(frameCount, bezierCount, slotIndex, `${12 /* deform */}|${slotIndex}|${attachment.id}`); - this.attachment = attachment; - this.vertices = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time and vertices for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. - * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */ - setFrame(frame, time, vertices) { - this.frames[frame] = time; - this.vertices[frame] = vertices; - } - /** @param value1 Ignored (0 is used for a deform timeline). - * @param value2 Ignored (1 is used for a deform timeline). */ - setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) { - const curves = this.curves; - let i = this.getFrameCount() + bezier * 18; - if (value === 0) curves[frame] = 2 + i; - const tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06; - const dddx = ((cx1 - cx2) * 3 - time1 + time2) * 6e-3, dddy = (cy1 - cy2 + 0.33333333) * 0.018; - let ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy; - let dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667; - let x = time1 + dx, y = dy; - for (let n = i + 18; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dx += ddx; - dy += ddy; - ddx += dddx; - ddy += dddy; - x += dx; - y += dy; - } - } - getCurvePercent(time, frame) { - const curves = this.curves; - let i = curves[frame]; - switch (i) { - case 0: { - const x2 = this.frames[frame]; - return (time - x2) / (this.frames[frame + this.getFrameEntries()] - x2); - } - case 1: - return 0; - } - i -= 2; - if (curves[i] > time) { - const x2 = this.frames[frame]; - return curves[i + 1] * (time - x2) / (curves[i] - x2); - } - const n = i + 18; - for (i += 2; i < n; i += 2) { - if (curves[i] >= time) { - const x2 = curves[i - 2], y2 = curves[i - 1]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - } - const x = curves[n - 2], y = curves[n - 1]; - return y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x); - } - apply1(slot, pose, time, alpha, blend) { - if (!(pose.attachment instanceof VertexAttachment)) return; - const vertexAttachment = pose.attachment; - if (vertexAttachment.timelineAttachment !== this.attachment) return; - const deform = pose.deform; - if (deform.length === 0) blend = 0 /* setup */; - const vertices = this.vertices; - const vertexCount = vertices[0].length; - const frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - deform.length = 0; - return; - case 1 /* first */: - if (alpha === 1) { - deform.length = 0; - return; - } - deform.length = vertexCount; - if (!vertexAttachment.bones) { - const setupVertices = vertexAttachment.vertices; - for (let i = 0; i < vertexCount; i++) - deform[i] += (setupVertices[i] - deform[i]) * alpha; - } else { - alpha = 1 - alpha; - for (let i = 0; i < vertexCount; i++) - deform[i] *= alpha; - } - } - return; - } - deform.length = vertexCount; - if (time >= frames[frames.length - 1]) { - const lastVertices = vertices[frames.length - 1]; - if (alpha === 1) { - if (blend === 3 /* add */) { - if (!vertexAttachment.bones) { - const setupVertices = vertexAttachment.vertices; - for (let i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i] - setupVertices[i]; - } else { - for (let i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i]; - } - } else - Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount); - } else { - switch (blend) { - case 0 /* setup */: { - if (!vertexAttachment.bones) { - const setupVertices = vertexAttachment.vertices; - for (let i = 0; i < vertexCount; i++) { - const setup = setupVertices[i]; - deform[i] = setup + (lastVertices[i] - setup) * alpha; - } - } else { - for (let i = 0; i < vertexCount; i++) - deform[i] = lastVertices[i] * alpha; - } - break; - } - case 1 /* first */: - case 2 /* replace */: - for (let i = 0; i < vertexCount; i++) - deform[i] += (lastVertices[i] - deform[i]) * alpha; - break; - case 3 /* add */: - if (!vertexAttachment.bones) { - const setupVertices = vertexAttachment.vertices; - for (let i = 0; i < vertexCount; i++) - deform[i] += (lastVertices[i] - setupVertices[i]) * alpha; - } else { - for (let i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i] * alpha; - } - } - } - return; - } - const frame = Timeline.search(frames, time); - const percent = this.getCurvePercent(time, frame); - const prevVertices = vertices[frame]; - const nextVertices = vertices[frame + 1]; - if (alpha === 1) { - if (blend === 3 /* add */) { - if (!vertexAttachment.bones) { - const setupVertices = vertexAttachment.vertices; - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i]; - deform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i]; - } - } else { - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i]; - deform[i] += prev + (nextVertices[i] - prev) * percent; - } - } - } else if (percent === 0) - Utils.arrayCopy(prevVertices, 0, deform, 0, vertexCount); - else { - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i]; - deform[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } else { - switch (blend) { - case 0 /* setup */: { - if (!vertexAttachment.bones) { - const setupVertices = vertexAttachment.vertices; - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i], setup = setupVertices[i]; - deform[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha; - } - } else { - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i]; - deform[i] = (prev + (nextVertices[i] - prev) * percent) * alpha; - } - } - break; - } - case 1 /* first */: - case 2 /* replace */: - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i]; - deform[i] += (prev + (nextVertices[i] - prev) * percent - deform[i]) * alpha; - } - break; - case 3 /* add */: - if (!vertexAttachment.bones) { - const setupVertices = vertexAttachment.vertices; - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i]; - deform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha; - } - } else { - for (let i = 0; i < vertexCount; i++) { - const prev = prevVertices[i]; - deform[i] += (prev + (nextVertices[i] - prev) * percent) * alpha; - } - } - } - } - } - }; - var SequenceTimeline = class _SequenceTimeline extends Timeline { - static ENTRIES = 3; - static MODE = 1; - static DELAY = 2; - slotIndex; - attachment; - constructor(frameCount, slotIndex, attachment) { - super(frameCount, `${28 /* sequence */}|${slotIndex}|${attachment.sequence.id}`); - this.slotIndex = slotIndex; - this.attachment = attachment; - } - getFrameEntries() { - return _SequenceTimeline.ENTRIES; - } - getSlotIndex() { - return this.slotIndex; - } - getAttachment() { - return this.attachment; - } - /** Sets the time, mode, index, and frame time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time Seconds between frames. */ - setFrame(frame, time, mode, index, delay) { - const frames = this.frames; - frame *= _SequenceTimeline.ENTRIES; - frames[frame] = time; - frames[frame + _SequenceTimeline.MODE] = mode | index << 4; - frames[frame + _SequenceTimeline.DELAY] = delay; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose) { - const slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) return; - const pose = appliedPose ? slot.applied : slot.pose; - const slotAttachment = pose.attachment; - const attachment = this.attachment; - if (slotAttachment !== attachment) { - if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment !== attachment) return; - } - const sequence = slotAttachment.sequence; - if (!sequence) return; - if (direction === 1 /* out */) { - if (blend === 0 /* setup */) pose.sequenceIndex = -1; - return; - } - const frames = this.frames; - if (time < frames[0]) { - if (blend === 0 /* setup */ || blend === 1 /* first */) pose.sequenceIndex = -1; - return; - } - const i = Timeline.search(frames, time, _SequenceTimeline.ENTRIES); - const before = frames[i]; - const modeAndIndex = frames[i + _SequenceTimeline.MODE]; - const delay = frames[i + _SequenceTimeline.DELAY]; - let index = modeAndIndex >> 4, count = sequence.regions.length; - const mode = SequenceModeValues[modeAndIndex & 15]; - if (mode !== 0 /* hold */) { - index += (time - before) / delay + 1e-5 | 0; - switch (mode) { - case 1 /* once */: - index = Math.min(count - 1, index); - break; - case 2 /* loop */: - index %= count; - break; - case 3 /* pingpong */: { - const n = (count << 1) - 2; - index = n === 0 ? 0 : index % n; - if (index >= count) index = n - index; - break; - } - case 4 /* onceReverse */: - index = Math.max(count - 1 - index, 0); - break; - case 5 /* loopReverse */: - index = count - 1 - index % count; - break; - case 6 /* pingpongReverse */: { - const n = (count << 1) - 2; - index = n === 0 ? 0 : (index + count - 1) % n; - if (index >= count) index = n - index; - } - } - } - pose.sequenceIndex = index; - } - }; - var EventTimeline = class _EventTimeline extends Timeline { - static propertyIds = [`${13 /* event */}`]; - /** The event for each key frame. */ - events; - constructor(frameCount) { - super(frameCount, ..._EventTimeline.propertyIds); - this.events = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the event for the specified key frame. */ - setFrame(frame, event) { - this.frames[frame] = event.time; - this.events[frame] = event; - } - /** Fires events for frames > `lastTime` and <= `time`. */ - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - if (!firedEvents) return; - const frames = this.frames; - const frameCount = this.frames.length; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction, appliedPose); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) - return; - if (time < frames[0]) return; - let i = 0; - if (lastTime < frames[0]) - i = 0; - else { - i = Timeline.search(frames, lastTime) + 1; - const frameTime = frames[i]; - while (i > 0) { - if (frames[i - 1] !== frameTime) break; - i--; - } - } - for (; i < frameCount && time >= frames[i]; i++) - firedEvents.push(this.events[i]); - } - }; - var DrawOrderTimeline = class _DrawOrderTimeline extends Timeline { - static propertyIds = [`${14 /* drawOrder */}`]; - /** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */ - drawOrders; - constructor(frameCount) { - super(frameCount, ..._DrawOrderTimeline.propertyIds); - this.drawOrders = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the draw order for the specified key frame. - * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose - * draw order. */ - setFrame(frame, time, drawOrder) { - this.frames[frame] = time; - this.drawOrders[frame] = drawOrder; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - if (direction === 1 /* out */) { - if (blend === 0 /* setup */) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - if (time < this.frames[0]) { - if (blend === 0 /* setup */ || blend === 1 /* first */) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - const idx = Timeline.search(this.frames, time); - const drawOrderToSetupIndex = this.drawOrders[idx]; - if (!drawOrderToSetupIndex) - Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - else { - const drawOrder = skeleton.drawOrder; - const slots = skeleton.slots; - for (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = slots[drawOrderToSetupIndex[i]]; - } - } - }; - function isConstraintTimeline(obj) { - return typeof obj === "object" && obj !== null && typeof obj.constraintIndex === "number"; - } - var IkConstraintTimeline = class extends CurveTimeline { - constraintIndex = 0; - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, `${15 /* ikConstraint */}|${constraintIndex}`); - this.constraintIndex = constraintIndex; - } - getFrameEntries() { - return 6; - } - /** Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. - * @param bendDirection 1 or -1. */ - setFrame(frame, time, mix, softness, bendDirection, compress, stretch) { - frame *= 6; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*MIX*/ - ] = mix; - this.frames[ - frame + 2 - /*SOFTNESS*/ - ] = softness; - this.frames[ - frame + 3 - /*BEND_DIRECTION*/ - ] = bendDirection; - this.frames[ - frame + 4 - /*COMPRESS*/ - ] = compress ? 1 : 0; - this.frames[ - frame + 5 - /*STRETCH*/ - ] = stretch ? 1 : 0; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - const constraint = skeleton.constraints[this.constraintIndex]; - if (!constraint.active) return; - const pose = appliedPose ? constraint.applied : constraint.pose; - const frames = this.frames; - if (time < frames[0]) { - const setup = constraint.data.setup; - switch (blend) { - case 0 /* setup */: - pose.mix = setup.mix; - pose.softness = setup.softness; - pose.bendDirection = setup.bendDirection; - pose.compress = setup.compress; - pose.stretch = setup.stretch; - return; - case 1 /* first */: - pose.mix += (setup.mix - pose.mix) * alpha; - pose.softness += (setup.softness - pose.softness) * alpha; - pose.bendDirection = setup.bendDirection; - pose.compress = setup.compress; - pose.stretch = setup.stretch; - } - return; - } - let mix = 0, softness = 0; - const i = Timeline.search( - frames, - time, - 6 - /*ENTRIES*/ - ); - const curveType = this.curves[ - i / 6 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: { - const before = frames[i]; - mix = frames[ - i + 1 - /*MIX*/ - ]; - softness = frames[ - i + 2 - /*SOFTNESS*/ - ]; - const t = (time - before) / (frames[ - i + 6 - /*ENTRIES*/ - ] - before); - mix += (frames[ - i + 6 + 1 - /*MIX*/ - ] - mix) * t; - softness += (frames[ - i + 6 + 2 - /*SOFTNESS*/ - ] - softness) * t; - break; - } - case 1: - mix = frames[ - i + 1 - /*MIX*/ - ]; - softness = frames[ - i + 2 - /*SOFTNESS*/ - ]; - break; - default: - mix = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - softness = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: { - const setup = constraint.data.setup; - pose.mix = setup.mix + (mix - setup.mix) * alpha; - pose.softness = setup.softness + (softness - setup.softness) * alpha; - if (direction === 1 /* out */) { - pose.bendDirection = setup.bendDirection; - pose.compress = setup.compress; - pose.stretch = setup.stretch; - return; - } - break; - } - case 1 /* first */: - case 2 /* replace */: - pose.mix += (mix - pose.mix) * alpha; - pose.softness += (softness - pose.softness) * alpha; - if (direction === 1 /* out */) return; - break; - case 3 /* add */: - pose.mix += mix * alpha; - pose.softness += softness * alpha; - if (direction === 1 /* out */) return; - break; - } - pose.bendDirection = frames[ - i + 3 - /*BEND_DIRECTION*/ - ]; - pose.compress = frames[ - i + 4 - /*COMPRESS*/ - ] !== 0; - pose.stretch = frames[ - i + 5 - /*STRETCH*/ - ] !== 0; - } - }; - var TransformConstraintTimeline = class extends CurveTimeline { - /** The index of the transform constraint slot in {@link Skeleton.transformConstraints} that will be changed. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, `${16 /* transformConstraint */}|${constraintIndex}`); - this.constraintIndex = constraintIndex; - } - getFrameEntries() { - return 7; - } - /** Sets the time, rotate mix, translate mix, scale mix, and shear mix for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY) { - const frames = this.frames; - frame *= 7; - frames[frame] = time; - frames[ - frame + 1 - /*ROTATE*/ - ] = mixRotate; - frames[ - frame + 2 - /*X*/ - ] = mixX; - frames[ - frame + 3 - /*Y*/ - ] = mixY; - frames[ - frame + 4 - /*SCALEX*/ - ] = mixScaleX; - frames[ - frame + 5 - /*SCALEY*/ - ] = mixScaleY; - frames[ - frame + 6 - /*SHEARY*/ - ] = mixShearY; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - const constraint = skeleton.constraints[this.constraintIndex]; - if (!constraint.active) return; - const pose = appliedPose ? constraint.applied : constraint.pose; - const frames = this.frames; - if (time < frames[0]) { - const setup = constraint.data.setup; - switch (blend) { - case 0 /* setup */: - pose.mixRotate = setup.mixRotate; - pose.mixX = setup.mixX; - pose.mixY = setup.mixY; - pose.mixScaleX = setup.mixScaleX; - pose.mixScaleY = setup.mixScaleY; - pose.mixShearY = setup.mixShearY; - return; - case 1 /* first */: - pose.mixRotate += (setup.mixRotate - pose.mixRotate) * alpha; - pose.mixX += (setup.mixX - pose.mixX) * alpha; - pose.mixY += (setup.mixY - pose.mixY) * alpha; - pose.mixScaleX += (setup.mixScaleX - pose.mixScaleX) * alpha; - pose.mixScaleY += (setup.mixScaleY - pose.mixScaleY) * alpha; - pose.mixShearY += (setup.mixShearY - pose.mixShearY) * alpha; - } - return; - } - let rotate, x, y, scaleX, scaleY, shearY; - const i = Timeline.search( - frames, - time, - 7 - /*ENTRIES*/ - ); - const curveType = this.curves[ - i / 7 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: { - const before = frames[i]; - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - scaleX = frames[ - i + 4 - /*SCALEX*/ - ]; - scaleY = frames[ - i + 5 - /*SCALEY*/ - ]; - shearY = frames[ - i + 6 - /*SHEARY*/ - ]; - const t = (time - before) / (frames[ - i + 7 - /*ENTRIES*/ - ] - before); - rotate += (frames[ - i + 7 + 1 - /*ROTATE*/ - ] - rotate) * t; - x += (frames[ - i + 7 + 2 - /*X*/ - ] - x) * t; - y += (frames[ - i + 7 + 3 - /*Y*/ - ] - y) * t; - scaleX += (frames[ - i + 7 + 4 - /*SCALEX*/ - ] - scaleX) * t; - scaleY += (frames[ - i + 7 + 5 - /*SCALEY*/ - ] - scaleY) * t; - shearY += (frames[ - i + 7 + 6 - /*SHEARY*/ - ] - shearY) * t; - break; - } - case 1: - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - scaleX = frames[ - i + 4 - /*SCALEX*/ - ]; - scaleY = frames[ - i + 5 - /*SCALEY*/ - ]; - shearY = frames[ - i + 6 - /*SHEARY*/ - ]; - break; - default: - rotate = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - x = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - scaleX = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - scaleY = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - shearY = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: { - const setup = constraint.data.setup; - pose.mixRotate = setup.mixRotate + (rotate - setup.mixRotate) * alpha; - pose.mixX = setup.mixX + (x - setup.mixX) * alpha; - pose.mixY = setup.mixY + (y - setup.mixY) * alpha; - pose.mixScaleX = setup.mixScaleX + (scaleX - setup.mixScaleX) * alpha; - pose.mixScaleY = setup.mixScaleY + (scaleY - setup.mixScaleY) * alpha; - pose.mixShearY = setup.mixShearY + (shearY - setup.mixShearY) * alpha; - break; - } - case 1 /* first */: - case 2 /* replace */: - pose.mixRotate += (rotate - pose.mixRotate) * alpha; - pose.mixX += (x - pose.mixX) * alpha; - pose.mixY += (y - pose.mixY) * alpha; - pose.mixScaleX += (scaleX - pose.mixScaleX) * alpha; - pose.mixScaleY += (scaleY - pose.mixScaleY) * alpha; - pose.mixShearY += (shearY - pose.mixShearY) * alpha; - break; - case 3 /* add */: - pose.mixRotate += rotate * alpha; - pose.mixX += x * alpha; - pose.mixY += y * alpha; - pose.mixScaleX += scaleX * alpha; - pose.mixScaleY += scaleY * alpha; - pose.mixShearY += shearY * alpha; - break; - } - } - }; - var ConstraintTimeline1 = class extends CurveTimeline1 { - constraintIndex; - constructor(frameCount, bezierCount, constraintIndex, property) { - super(frameCount, bezierCount, `${property}|${constraintIndex}`); - this.constraintIndex = constraintIndex; - } - }; - var PathConstraintPositionTimeline = class extends ConstraintTimeline1 { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 17 /* pathConstraintPosition */); - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - const constraint = skeleton.constraints[this.constraintIndex]; - if (constraint.active) { - const pose = appliedPose ? constraint.applied : constraint.pose; - pose.position = this.getAbsoluteValue(time, alpha, blend, pose.position, constraint.data.setup.position); - } - } - }; - var PathConstraintSpacingTimeline = class extends ConstraintTimeline1 { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 18 /* pathConstraintSpacing */); - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - const constraint = skeleton.constraints[this.constraintIndex]; - if (constraint.active) { - const pose = appliedPose ? constraint.applied : constraint.pose; - pose.spacing = this.getAbsoluteValue(time, alpha, blend, pose.spacing, constraint.data.setup.spacing); - } - } - }; - var PathConstraintMixTimeline = class extends CurveTimeline { - constraintIndex; - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, `${19 /* pathConstraintMix */}|${constraintIndex}`); - this.constraintIndex = constraintIndex; - } - getFrameEntries() { - return 4; - } - /** Sets the time and color for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, mixRotate, mixX, mixY) { - const frames = this.frames; - frame <<= 2; - frames[frame] = time; - frames[ - frame + 1 - /*ROTATE*/ - ] = mixRotate; - frames[ - frame + 2 - /*X*/ - ] = mixX; - frames[ - frame + 3 - /*Y*/ - ] = mixY; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - const constraint = skeleton.constraints[this.constraintIndex]; - if (!constraint.active) return; - const pose = appliedPose ? constraint.applied : constraint.pose; - const frames = this.frames; - if (time < frames[0]) { - const setup = constraint.data.setup; - switch (blend) { - case 0 /* setup */: - pose.mixRotate = setup.mixRotate; - pose.mixX = setup.mixX; - pose.mixY = setup.mixY; - return; - case 1 /* first */: - pose.mixRotate += (setup.mixRotate - pose.mixRotate) * alpha; - pose.mixX += (setup.mixX - pose.mixX) * alpha; - pose.mixY += (setup.mixY - pose.mixY) * alpha; - } - return; - } - let rotate, x, y; - const i = Timeline.search( - frames, - time, - 4 - /*ENTRIES*/ - ); - const curveType = this.curves[i >> 2]; - switch (curveType) { - case 0: { - const before = frames[i]; - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - const t = (time - before) / (frames[ - i + 4 - /*ENTRIES*/ - ] - before); - rotate += (frames[ - i + 4 + 1 - /*ROTATE*/ - ] - rotate) * t; - x += (frames[ - i + 4 + 2 - /*X*/ - ] - x) * t; - y += (frames[ - i + 4 + 3 - /*Y*/ - ] - y) * t; - break; - } - case 1: - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - break; - default: - rotate = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - x = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: { - const setup = constraint.data.setup; - pose.mixRotate = setup.mixRotate + (rotate - setup.mixRotate) * alpha; - pose.mixX = setup.mixX + (x - setup.mixX) * alpha; - pose.mixY = setup.mixY + (y - setup.mixY) * alpha; - break; - } - case 1 /* first */: - case 2 /* replace */: - pose.mixRotate += (rotate - pose.mixRotate) * alpha; - pose.mixX += (x - pose.mixX) * alpha; - pose.mixY += (y - pose.mixY) * alpha; - break; - case 3 /* add */: - pose.mixRotate += rotate * alpha; - pose.mixX += x * alpha; - pose.mixY += y * alpha; - break; - } - } - }; - var PhysicsConstraintTimeline = class extends ConstraintTimeline1 { - /** @param constraintIndex -1 for all physics constraints in the skeleton. */ - constructor(frameCount, bezierCount, constraintIndex, property) { - super(frameCount, bezierCount, constraintIndex, property); - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - if (this.constraintIndex === -1) { - const value = time >= this.frames[0] ? this.getCurveValue(time) : 0; - const constraints = skeleton.physics; - for (const constraint of constraints) { - if (constraint.active && this.global(constraint.data)) { - const pose = appliedPose ? constraint.applied : constraint.pose; - this.set(pose, this.getAbsoluteValue(time, alpha, blend, this.get(pose), this.get(constraint.data.setup), value)); - } - } - } else { - const constraint = skeleton.constraints[this.constraintIndex]; - if (constraint.active) { - const pose = appliedPose ? constraint.applied : constraint.pose; - this.set(pose, this.getAbsoluteValue(time, alpha, blend, this.get(pose), this.get(constraint.data.setup))); - } - } - } - }; - var PhysicsConstraintInertiaTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 20 /* physicsConstraintInertia */); - } - get(pose) { - return pose.inertia; - } - set(pose, value) { - pose.inertia = value; - } - global(constraint) { - return constraint.inertiaGlobal; - } - }; - var PhysicsConstraintStrengthTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 21 /* physicsConstraintStrength */); - } - get(pose) { - return pose.strength; - } - set(pose, value) { - pose.strength = value; - } - global(constraint) { - return constraint.strengthGlobal; - } - }; - var PhysicsConstraintDampingTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 22 /* physicsConstraintDamping */); - } - get(pose) { - return pose.damping; - } - set(pose, value) { - pose.damping = value; - } - global(constraint) { - return constraint.dampingGlobal; - } - }; - var PhysicsConstraintMassTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 23 /* physicsConstraintMass */); - } - get(pose) { - return 1 / pose.massInverse; - } - set(pose, value) { - pose.massInverse = 1 / value; - } - global(constraint) { - return constraint.massGlobal; - } - }; - var PhysicsConstraintWindTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 24 /* physicsConstraintWind */); - } - get(pose) { - return pose.wind; - } - set(pose, value) { - pose.wind = value; - } - global(constraint) { - return constraint.windGlobal; - } - }; - var PhysicsConstraintGravityTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 25 /* physicsConstraintGravity */); - } - get(pose) { - return pose.gravity; - } - set(pose, value) { - pose.gravity = value; - } - global(constraint) { - return constraint.gravityGlobal; - } - }; - var PhysicsConstraintMixTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 26 /* physicsConstraintMix */); - } - get(pose) { - return pose.mix; - } - set(pose, value) { - pose.mix = value; - } - global(constraint) { - return constraint.mixGlobal; - } - }; - var PhysicsConstraintResetTimeline = class _PhysicsConstraintResetTimeline extends Timeline { - static propertyIds = [27 /* physicsConstraintReset */.toString()]; - /** The index of the physics constraint in {@link Skeleton.contraints} that will be reset when this timeline is - * applied, or -1 if all physics constraints in the skeleton will be reset. */ - constraintIndex; - /** @param constraintIndex -1 for all physics constraints in the skeleton. */ - constructor(frameCount, constraintIndex) { - super(frameCount, ..._PhysicsConstraintResetTimeline.propertyIds); - this.constraintIndex = constraintIndex; - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. */ - setFrame(frame, time) { - this.frames[frame] = time; - } - /** Resets the physics constraint when frames > lastTime and <= time. */ - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - let constraint; - if (this.constraintIndex !== -1) { - constraint = skeleton.constraints[this.constraintIndex]; - if (!constraint.active) return; - } - const frames = this.frames; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, [], alpha, blend, direction, appliedPose); - lastTime = -1; - } else if (lastTime >= frames[frames.length - 1]) - return; - if (time < frames[0]) return; - if (lastTime < frames[0] || time >= frames[Timeline.search(frames, lastTime) + 1]) { - if (constraint != null) - constraint.reset(skeleton); - else { - for (const constraint2 of skeleton.physics) { - if (constraint2.active) constraint2.reset(skeleton); - } - } - } - } - }; - var SliderTimeline = class extends ConstraintTimeline1 { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 29 /* sliderTime */); - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - const constraint = skeleton.constraints[this.constraintIndex]; - if (constraint.active) { - const pose = appliedPose ? constraint.applied : constraint.pose; - pose.time = this.getAbsoluteValue(time, alpha, blend, pose.time, constraint.data.setup.time); - } - } - }; - var SliderMixTimeline = class extends ConstraintTimeline1 { - constructor(frameCount, bezierCount, constraintIndex) { - super(frameCount, bezierCount, constraintIndex, 30 /* sliderMix */); - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction, appliedPose) { - const constraint = skeleton.constraints[this.constraintIndex]; - if (constraint.active) { - const pose = appliedPose ? constraint.applied : constraint.pose; - pose.mix = this.getAbsoluteValue(time, alpha, blend, pose.mix, constraint.data.setup.mix); - } - } - }; - - // spine-core/src/AnimationState.ts - var AnimationState = class _AnimationState { - static emptyAnimation = new Animation("", [], 0); - /** The AnimationStateData to look up mix durations. */ - data; - /** The list of tracks that currently have animations, which may contain null entries. */ - tracks = []; - /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower - * or faster. Defaults to 1. - * - * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */ - timeScale = 1; - unkeyedState = 0; - events = []; - listeners = []; - queue = new EventQueue(this); - propertyIDs = new StringSet(); - animationsChanged = false; - trackEntryPool = new Pool(() => new TrackEntry()); - constructor(data) { - this.data = data; - } - /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */ - update(delta) { - delta *= this.timeScale; - const tracks = this.tracks; - for (let i = 0, n = tracks.length; i < n; i++) { - const current = tracks[i]; - if (!current) continue; - current.animationLast = current.nextAnimationLast; - current.trackLast = current.nextTrackLast; - let currentDelta = delta * current.timeScale; - if (current.delay > 0) { - current.delay -= currentDelta; - if (current.delay > 0) continue; - currentDelta = -current.delay; - current.delay = 0; - } - let next = current.next; - if (next) { - const 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) { - next.mixTime += delta; - next = next.mixingFrom; - } - continue; - } - } else if (current.trackLast >= current.trackEnd && !current.mixingFrom) { - tracks[i] = null; - this.queue.end(current); - this.clearNext(current); - continue; - } - if (current.mixingFrom && this.updateMixingFrom(current, delta)) { - let from = current.mixingFrom; - current.mixingFrom = null; - if (from) from.mixingTo = null; - while (from) { - this.queue.end(from); - from = from.mixingFrom; - } - } - current.trackTime += currentDelta; - } - this.queue.drain(); - } - /** Returns true when all mixing from entries are complete. */ - updateMixingFrom(to, delta) { - const from = to.mixingFrom; - if (!from) return true; - const finished = this.updateMixingFrom(from, delta); - from.animationLast = from.nextAnimationLast; - from.trackLast = from.nextTrackLast; - if (to.nextTrackLast !== -1 && 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; - } - /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the - * animation state can be applied to multiple skeletons to pose them identically. - * @returns True if any animations were applied. */ - apply(skeleton) { - if (!skeleton) throw new Error("skeleton cannot be null."); - if (this.animationsChanged) this._animationsChanged(); - const events = this.events; - const tracks = this.tracks; - let applied = false; - for (let i = 0, n = tracks.length; i < n; i++) { - const current = tracks[i]; - if (!current || current.delay > 0) continue; - applied = true; - const blend = i === 0 ? 1 /* first */ : current.mixBlend; - let alpha = current.alpha; - if (current.mixingFrom) - alpha *= this.applyMixingFrom(current, skeleton, blend); - else if (current.trackTime >= current.trackEnd && !current.next) - alpha = 0; - let attachments = alpha >= current.alphaAttachmentThreshold; - let animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime; - let applyEvents = events; - if (current.reverse) { - applyTime = current.animation.duration - applyTime; - applyEvents = null; - } - const timelines = current.animation.timelines; - const timelineCount = timelines.length; - if (i === 0 && alpha === 1 || blend === 3 /* add */) { - if (i === 0) attachments = true; - for (let ii = 0; ii < timelineCount; ii++) { - Utils.webkit602BugfixHelper(alpha, blend); - const timeline = timelines[ii]; - if (timeline instanceof AttachmentTimeline) - this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments); - else - timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, 0 /* in */, false); - } - } else { - const timelineMode = current.timelineMode; - const shortestRotation = current.shortestRotation; - const firstFrame = !shortestRotation && current.timelinesRotation.length !== timelineCount << 1; - if (firstFrame) current.timelinesRotation.length = timelineCount << 1; - for (let ii = 0; ii < timelineCount; ii++) { - const timeline = timelines[ii]; - const timelineBlend = timelineMode[ii] === SUBSEQUENT ? blend : 0 /* setup */; - if (!shortestRotation && timeline instanceof RotateTimeline) { - this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, current.timelinesRotation, ii << 1, firstFrame); - } else if (timeline instanceof AttachmentTimeline) { - this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments); - } else { - Utils.webkit602BugfixHelper(alpha, blend); - timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, 0 /* in */, false); - } - } - } - this.queueEvents(current, animationTime); - events.length = 0; - current.nextAnimationLast = animationTime; - current.nextTrackLast = current.trackTime; - } - const setupState = this.unkeyedState + SETUP; - const slots = skeleton.slots; - for (let i = 0, n = skeleton.slots.length; i < n; i++) { - const slot = slots[i]; - if (slot.attachmentState === setupState) { - const attachmentName = slot.data.attachmentName; - slot.pose.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName)); - } - } - this.unkeyedState += 2; - this.queue.drain(); - return applied; - } - applyMixingFrom(to, skeleton, blend) { - const from = to.mixingFrom; - if (from.mixingFrom) this.applyMixingFrom(from, skeleton, blend); - let mix = 0; - if (to.mixDuration === 0) { - mix = 1; - if (blend === 1 /* first */) blend = 0 /* setup */; - } else { - mix = to.mixTime / to.mixDuration; - if (mix > 1) mix = 1; - if (blend !== 1 /* first */) blend = from.mixBlend; - } - const attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold; - const timelines = from.animation.timelines; - const timelineCount = timelines.length; - const alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); - let animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime; - let events = null; - if (from.reverse) - applyTime = from.animation.duration - applyTime; - else if (mix < from.eventThreshold) - events = this.events; - if (blend === 3 /* add */) { - for (let i = 0; i < timelineCount; i++) - timelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, 1 /* out */, false); - } else { - const timelineMode = from.timelineMode; - const timelineHoldMix = from.timelineHoldMix; - const shortestRotation = from.shortestRotation; - const firstFrame = !shortestRotation && from.timelinesRotation.length !== timelineCount << 1; - if (firstFrame) from.timelinesRotation.length = timelineCount << 1; - from.totalAlpha = 0; - for (let i = 0; i < timelineCount; i++) { - const timeline = timelines[i]; - let direction = 1 /* out */; - let timelineBlend; - let alpha = 0; - switch (timelineMode[i]) { - case SUBSEQUENT: - if (!drawOrder && timeline instanceof DrawOrderTimeline) continue; - timelineBlend = blend; - alpha = alphaMix; - break; - case FIRST: - timelineBlend = 0 /* setup */; - alpha = alphaMix; - break; - case HOLD_SUBSEQUENT: - timelineBlend = blend; - alpha = alphaHold; - break; - case HOLD_FIRST: - timelineBlend = 0 /* setup */; - alpha = alphaHold; - break; - default: { - timelineBlend = 0 /* setup */; - const holdMix = timelineHoldMix[i]; - alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); - break; - } - } - from.totalAlpha += alpha; - if (!shortestRotation && timeline instanceof RotateTimeline) - this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame); - else if (timeline instanceof AttachmentTimeline) - this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments && alpha >= from.alphaAttachmentThreshold); - else { - Utils.webkit602BugfixHelper(alpha, blend); - if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend === 0 /* setup */) - direction = 0 /* in */; - timeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction, false); - } - } - } - if (to.mixDuration > 0) this.queueEvents(from, animationTime); - this.events.length = 0; - from.nextAnimationLast = animationTime; - from.nextTrackLast = from.trackTime; - return mix; - } - applyAttachmentTimeline(timeline, skeleton, time, blend, attachments) { - const slot = skeleton.slots[timeline.slotIndex]; - if (!slot.bone.active) return; - if (time < timeline.frames[0]) { - if (blend === 0 /* setup */ || blend === 1 /* first */) - this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments); - } else - this.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search(timeline.frames, time)], attachments); - if (slot.attachmentState <= this.unkeyedState) slot.attachmentState = this.unkeyedState + SETUP; - } - setAttachment(skeleton, slot, attachmentName, attachments) { - slot.pose.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName)); - if (attachments) slot.attachmentState = this.unkeyedState + CURRENT; - } - applyRotateTimeline(timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { - if (firstFrame) timelinesRotation[i] = 0; - if (alpha === 1) { - timeline.apply(skeleton, 0, time, null, 1, blend, 0 /* in */, false); - return; - } - const bone = skeleton.bones[timeline.boneIndex]; - if (!bone.active) return; - const pose = bone.pose, setup = bone.data.setup; - const frames = timeline.frames; - let r1 = 0, r2 = 0; - if (time < frames[0]) { - switch (blend) { - // biome-ignore lint/suspicious/noFallthroughSwitchClause: reference runtime does fall through - case 0 /* setup */: - pose.rotation = setup.rotation; - // biome-ignore lint/suspicious/useDefaultSwitchClauseLast: needed for fall through - default: - return; - case 1 /* first */: - r1 = pose.rotation; - r2 = setup.rotation; - } - } else { - r1 = blend === 0 /* setup */ ? setup.rotation : pose.rotation; - r2 = setup.rotation + timeline.getCurveValue(time); - } - let total = 0, diff = r2 - r1; - diff -= Math.ceil(diff / 360 - 0.5) * 360; - if (diff === 0) { - total = timelinesRotation[i]; - } else { - let lastTotal = 0, lastDiff = 0; - if (firstFrame) { - lastTotal = 0; - lastDiff = diff; - } else { - lastTotal = timelinesRotation[i]; - lastDiff = timelinesRotation[i + 1]; - } - const loops = lastTotal - lastTotal % 360; - total = diff + loops; - let current = diff >= 0, dir = lastTotal >= 0; - if (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) !== MathUtils.signum(diff)) { - if (Math.abs(lastTotal - loops) > 180) { - total += 360 * MathUtils.signum(lastTotal); - dir = current; - } else if (loops !== 0) - total -= 360 * MathUtils.signum(lastTotal); - else - dir = current; - } - if (dir !== current) total += 360 * MathUtils.signum(lastTotal); - timelinesRotation[i] = total; - } - timelinesRotation[i + 1] = diff; - pose.rotation = r1 + total * alpha; - } - queueEvents(entry, animationTime) { - const animationStart = entry.animationStart, animationEnd = entry.animationEnd; - const duration = animationEnd - animationStart; - const trackLastWrapped = entry.trackLast % duration; - const events = this.events; - let i = 0, n = events.length; - for (; i < n; i++) { - const event = events[i]; - if (event.time < trackLastWrapped) break; - if (event.time > animationEnd) continue; - this.queue.event(entry, event); - } - let complete = false; - if (entry.loop) { - if (duration === 0) - complete = true; - else { - const cycles = Math.floor(entry.trackTime / duration); - complete = cycles > 0 && cycles > Math.floor(entry.trackLast / duration); - } - } else - complete = animationTime >= animationEnd && entry.animationLast < animationEnd; - if (complete) this.queue.complete(entry); - for (; i < n; i++) { - const event = events[i]; - if (event.time < animationStart) continue; - this.queue.event(entry, event); - } - } - /** Removes all animations from all tracks, leaving skeletons in their current pose. - * - * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose, - * rather than leaving them in their current pose. */ - clearTracks() { - const oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (let i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - } - /** Removes all animations from the track, leaving skeletons in their current pose. - * - * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose, - * rather than leaving them in their current pose. */ - clearTrack(trackIndex) { - if (trackIndex >= this.tracks.length) return; - const current = this.tracks[trackIndex]; - if (!current) return; - this.queue.end(current); - this.clearNext(current); - let entry = current; - while (true) { - const from = entry.mixingFrom; - if (!from) break; - this.queue.end(from); - entry.mixingFrom = null; - entry.mixingTo = null; - entry = from; - } - this.tracks[current.trackIndex] = null; - this.queue.drain(); - } - setCurrent(index, current, interrupt) { - const from = this.expandToIndex(index); - this.tracks[index] = current; - current.previous = null; - if (from) { - if (interrupt) this.queue.interrupt(from); - current.mixingFrom = from; - from.mixingTo = current; - current.mixTime = 0; - if (from.mixingFrom && from.mixDuration > 0) - current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); - from.timelinesRotation.length = 0; - } - this.queue.start(current); - } - setAnimation(trackIndex, animationNameOrAnimation, loop = false) { - if (typeof animationNameOrAnimation === "string") - return this.setAnimation1(trackIndex, animationNameOrAnimation, loop); - return this.setAnimation2(trackIndex, animationNameOrAnimation, loop); - } - setAnimation1(trackIndex, animationName, loop = false) { - const animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw new Error(`Animation not found: ${animationName}`); - return this.setAnimation2(trackIndex, animation, loop); - } - /** Sets the current animation for a track, discarding any queued animations. - *

- * If the formerly current track entry is for the same animation and was never applied to a skeleton, it is replaced (not mixed - * from). - * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its - * duration. In either case {@link TrackEntry#getTrackEnd()} determines when the track is cleared. - * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */ - setAnimation2(trackIndex, animation, loop = false) { - if (trackIndex < 0) throw new Error("trackIndex must be >= 0."); - if (!animation) throw new Error("animation cannot be null."); - let interrupt = true; - let current = this.expandToIndex(trackIndex); - if (current) { - if (current.nextTrackLast === -1 && current.animation === animation) { - this.tracks[trackIndex] = current.mixingFrom; - this.queue.interrupt(current); - this.queue.end(current); - this.clearNext(current); - current = current.mixingFrom; - interrupt = false; - } else - this.clearNext(current); - } - const entry = this.trackEntry(trackIndex, animation, loop, current); - this.setCurrent(trackIndex, entry, interrupt); - this.queue.drain(); - return entry; - } - addAnimation(trackIndex, animationNameOrAnimation, loop = false, delay = 0) { - if (typeof animationNameOrAnimation === "string") - return this.addAnimation1(trackIndex, animationNameOrAnimation, loop, delay); - return this.addAnimation2(trackIndex, animationNameOrAnimation, loop, delay); - } - addAnimation1(trackIndex, animationName, loop = false, delay = 0) { - const animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) throw new Error(`Animation not found: ${animationName}`); - return this.addAnimation2(trackIndex, animation, loop, delay); - } - addAnimation2(trackIndex, animation, loop = false, delay = 0) { - if (!animation) throw new Error("animation cannot be null."); - let last = this.expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - } - const entry = this.trackEntry(trackIndex, animation, loop, last); - if (!last) { - this.setCurrent(trackIndex, entry, true); - this.queue.drain(); - if (delay < 0) delay = 0; - } else { - last.next = entry; - entry.previous = last; - if (delay <= 0) delay = Math.max(delay + last.getTrackComplete() - entry.mixDuration, 0); - } - entry.delay = delay; - return entry; - } - /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's - * {@link TrackEntry#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 {@link #setEmptyAnimation()}, - * {@link #setEmptyAnimations()}, or {@link #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 - * {@link #addAnimation()} and on the returned track entry, set the - * {@link TrackEntry#setMixDuration()}. 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. - * - * See Empty animations in the Spine - * Runtimes Guide. */ - setEmptyAnimation(trackIndex, mixDuration = 0) { - const entry = this.setAnimation(trackIndex, _AnimationState.emptyAnimation, false); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - } - /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's - * {@link TrackEntry#getMixDuration()}. If the track has no entries, it is equivalent to calling - * {@link #setEmptyAnimation(int, float)}. - * - * See {@link #setEmptyAnimation(int, float)} and - * Empty animations in the Spine - * Runtimes Guide. - * @param delay If > 0, sets {@link TrackEntry#getDelay()}. If <= 0, the delay set is the duration of the previous track entry - * minus any mix duration 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. - * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */ - addEmptyAnimation(trackIndex, mixDuration = 0, delay = 0) { - const entry = this.addAnimation(trackIndex, _AnimationState.emptyAnimation, false, delay); - if (delay <= 0) entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - } - /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration. - * - * See Empty animations in the Spine - * Runtimes Guide. */ - setEmptyAnimations(mixDuration = 0) { - const oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (let i = 0, n = this.tracks.length; i < n; i++) { - const current = this.tracks[i]; - if (current) this.setEmptyAnimation(current.trackIndex, mixDuration); - } - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - } - expandToIndex(index) { - if (index < this.tracks.length) return this.tracks[index]; - Utils.ensureArrayCapacity(this.tracks, index + 1, null); - this.tracks.length = index + 1; - return null; - } - /** @param last May be null. */ - trackEntry(trackIndex, animation, loop, last) { - const entry = this.trackEntryPool.obtain(); - entry.reset(); - entry.trackIndex = trackIndex; - entry.animation = animation; - entry.loop = loop; - entry.holdPrevious = false; - entry.reverse = false; - entry.shortestRotation = false; - entry.eventThreshold = 0; - entry.alphaAttachmentThreshold = 0; - entry.mixAttachmentThreshold = 0; - entry.mixDrawOrderThreshold = 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.mixTime = 0; - entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation); - entry.interruptAlpha = 1; - entry.totalAlpha = 0; - entry.mixBlend = 2 /* replace */; - return entry; - } - /** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */ - clearNext(entry) { - let next = entry.next; - while (next) { - this.queue.dispose(next); - next = next.next; - } - entry.next = null; - } - _animationsChanged() { - this.animationsChanged = false; - this.propertyIDs.clear(); - const tracks = this.tracks; - for (let i = 0, n = tracks.length; i < n; i++) { - let entry = tracks[i]; - if (!entry) continue; - while (entry.mixingFrom) - entry = entry.mixingFrom; - do { - if (!entry.mixingTo || entry.mixBlend !== 3 /* add */) this.computeHold(entry); - entry = entry.mixingTo; - } while (entry); - } - } - computeHold(entry) { - const to = entry.mixingTo; - const timelines = entry.animation.timelines; - const timelinesCount = entry.animation.timelines.length; - const timelineMode = entry.timelineMode; - timelineMode.length = timelinesCount; - const timelineHoldMix = entry.timelineHoldMix; - timelineHoldMix.length = 0; - const propertyIDs = this.propertyIDs; - if (to?.holdPrevious) { - for (let i = 0; i < timelinesCount; i++) - timelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT; - return; - } - outer: - for (let i = 0; i < timelinesCount; i++) { - const timeline = timelines[i]; - const ids = timeline.getPropertyIds(); - if (!propertyIDs.addAll(ids)) - timelineMode[i] = SUBSEQUENT; - else if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline || timeline instanceof EventTimeline || !to.animation.hasTimeline(ids)) { - timelineMode[i] = FIRST; - } else { - for (let next = to.mixingTo; next; next = next.mixingTo) { - if (next.animation.hasTimeline(ids)) continue; - if (entry.mixDuration > 0) { - timelineMode[i] = HOLD_MIX; - timelineHoldMix[i] = next; - continue outer; - } - break; - } - timelineMode[i] = HOLD_FIRST; - } - } - } - /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */ - getCurrent(trackIndex) { - if (trackIndex >= this.tracks.length) return null; - return this.tracks[trackIndex]; - } - /** Adds a listener to receive events for all track entries. */ - addListener(listener) { - if (!listener) throw new Error("listener cannot be null."); - this.listeners.push(listener); - } - /** Removes the listener added with {@link #addListener()}. */ - removeListener(listener) { - const index = this.listeners.indexOf(listener); - if (index >= 0) this.listeners.splice(index, 1); - } - /** Removes all listeners added with {@link #addListener()}. */ - clearListeners() { - this.listeners.length = 0; - } - /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an - * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery - * are not wanted because new animations are being set. */ - clearListenerNotifications() { - this.queue.clear(); - } - }; - var TrackEntry = class { - /** The animation to apply for this track entry. */ - animation = null; - previous = null; - /** The animation queued to start after this animation, or null. `next` makes up a linked list. */ - next = null; - /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no - * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */ - mixingFrom = null; - /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is - * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */ - mixingTo = null; - /** The listener for events generated by this track entry, or null. - * - * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation - * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */ - listener = null; - /** The index of the track where this track entry is either current or queued. - * - * See {@link AnimationState#getCurrent()}. */ - trackIndex = 0; - /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its - * duration. */ - loop = false; - /** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead - * of being mixed out. - * - * When mixing between animations that key the same property, if a lower track also keys that property then the value will - * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0% - * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation - * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which - * keys the property, only when a higher track also keys the property. - * - * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the - * previous animation. */ - holdPrevious = false; - reverse = false; - shortestRotation = false; - /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the - * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event - * timelines are not applied while this animation is being mixed out. */ - eventThreshold = 0; - /** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the - * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to - * 0, so attachment timelines are not applied while this animation is being mixed out. */ - mixAttachmentThreshold = 0; - /** When {@link #getAlpha()} is greater than alphaAttachmentThreshold, attachment timelines are applied. - * Defaults to 0, so attachment timelines are always applied. */ - alphaAttachmentThreshold = 0; - /** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the - * mixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to - * 0, so draw order timelines are not applied while this animation is being mixed out. */ - mixDrawOrderThreshold = 0; - /** Seconds when this animation starts, both initially and after looping. Defaults to 0. - * - * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same - * value to prevent timeline keys before the start time from triggering. */ - animationStart = 0; - /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will - * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */ - animationEnd = 0; - /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this - * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and - * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation - * is applied. */ - animationLast = 0; - nextAnimationLast = 0; - /** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay` - * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from - * the start of the previous animation to when this track entry will become the current track entry (ie when the previous - * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`). - * - * {@link #timeScale} affects the delay. */ - delay = 0; - /** Current time in seconds this track entry has been the current track entry. The track time determines - * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting - * looping. */ - trackTime = 0; - trackLast = 0; - nextTrackLast = 0; - /** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float - * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time - * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the - * properties keyed by the animation are set to the setup pose and the track is cleared. - * - * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation - * abruptly cease being applied. */ - trackEnd = 0; - /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or - * faster. Defaults to 1. - * - * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to - * match the animation speed. - * - * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the - * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If - * the time scale is not 1, the delay may need to be adjusted. - * - * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */ - timeScale = 0; - /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults - * to 1, which overwrites the skeleton's current pose with this animation. - * - * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to - * use alpha on track 0 if the skeleton pose is from the last frame render. */ - alpha = 0; - /** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be - * slightly more than `mixDuration` when the mix is complete. */ - mixTime = 0; - /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData - * {@link AnimationStateData#getMix()} based on the animation before this animation (if any). - * - * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the - * properties it was animating. - * - * The `mixDuration` can be set manually rather than use the value from - * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new - * track entry only before {@link AnimationState#update(float)} is next called. - * - * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the - * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set - * afterward. */ - mixDuration = 0; - interruptAlpha = 0; - totalAlpha = 0; - /** Sets both {@link #getMixDuration()} and {@link #getDelay()}. - * @param delay If > 0, sets {@link TrackEntry#getDelay()}. If <= 0, the delay set is the duration of the previous track - * entry minus the specified mix duration 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. */ - setMixDuration(mixDuration, delay) { - this.mixDuration = mixDuration; - if (delay !== void 0) { - if (delay <= 0) { - if (this.previous != null) - delay = Math.max(delay + this.previous.getTrackComplete() - mixDuration, 0); - else - delay = 0; - } - this.delay = delay; - } - } - /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which - * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to - * the values from the lower tracks. - * - * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is next - * called. */ - mixBlend = 2 /* replace */; - timelineMode = []; - timelineHoldMix = []; - timelinesRotation = []; - reset() { - this.next = null; - this.previous = null; - this.mixingFrom = null; - this.mixingTo = null; - this.animation = null; - this.listener = null; - this.timelineMode.length = 0; - this.timelineHoldMix.length = 0; - this.timelinesRotation.length = 0; - } - /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart} - * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the - * `animationStart` time. */ - getAnimationTime() { - if (this.loop) { - const 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); - } - setAnimationLast(animationLast) { - this.animationLast = animationLast; - this.nextAnimationLast = animationLast; - } - /** Returns true if at least one loop has been completed. - * - * See {@link AnimationStateListener#complete()}. */ - isComplete() { - return this.trackTime >= this.animationEnd - this.animationStart; - } - /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the - * long way around when using {@link #alpha} and starting animations on other tracks. - * - * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions: - * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long - * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the - * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */ - resetRotationDirections() { - this.timelinesRotation.length = 0; - } - getTrackComplete() { - const duration = this.animationEnd - this.animationStart; - if (duration !== 0) { - if (this.loop) return duration * (1 + (this.trackTime / duration | 0)); - if (this.trackTime < duration) return duration; - } - return this.trackTime; - } - /** Returns true if this track entry has been applied at least once. - *

- * See {@link AnimationState#apply(Skeleton)}. */ - wasApplied() { - return this.nextTrackLast !== -1; - } - /** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next - * {@link AnimationState#update(float)}. */ - isNextReady() { - return this.next != null && this.nextTrackLast - this.next.delay >= 0; - } - }; - var EventQueue = class { - objects = []; - drainDisabled = false; - animState; - constructor(animState) { - this.animState = animState; - } - start(entry) { - this.objects.push(0 /* start */); - this.objects.push(entry); - this.animState.animationsChanged = true; - } - interrupt(entry) { - this.objects.push(1 /* interrupt */); - this.objects.push(entry); - } - end(entry) { - this.objects.push(2 /* end */); - this.objects.push(entry); - this.animState.animationsChanged = true; - } - dispose(entry) { - this.objects.push(3 /* dispose */); - this.objects.push(entry); - } - complete(entry) { - this.objects.push(4 /* complete */); - this.objects.push(entry); - } - event(entry, event) { - this.objects.push(5 /* event */); - this.objects.push(entry); - this.objects.push(event); - } - drain() { - if (this.drainDisabled) return; - this.drainDisabled = true; - const listeners = this.animState.listeners; - const objects = this.objects; - for (let i = 0; i < objects.length; i += 2) { - const type = objects[i]; - const entry = objects[i + 1]; - switch (type) { - case 0 /* start */: - if (entry.listener?.start) entry.listener.start(entry); - for (let ii = 0; ii < listeners.length; ii++) { - const listener = listeners[ii]; - if (listener.start) listener.start(entry); - } - break; - case 1 /* interrupt */: - if (entry.listener?.interrupt) entry.listener.interrupt(entry); - for (let ii = 0; ii < listeners.length; ii++) { - const listener = listeners[ii]; - if (listener.interrupt) listener.interrupt(entry); - } - break; - // biome-ignore lint/suspicious/noFallthroughSwitchClause: reference runtime does fall through - case 2 /* end */: - if (entry.listener?.end) entry.listener.end(entry); - for (let ii = 0; ii < listeners.length; ii++) { - const listener = listeners[ii]; - if (listener.end) listener.end(entry); - } - // Fall through. - case 3 /* dispose */: - if (entry.listener?.dispose) entry.listener.dispose(entry); - for (let ii = 0; ii < listeners.length; ii++) { - const listener = listeners[ii]; - if (listener.dispose) listener.dispose(entry); - } - this.animState.trackEntryPool.free(entry); - break; - case 4 /* complete */: - if (entry.listener?.complete) entry.listener.complete(entry); - for (let ii = 0; ii < listeners.length; ii++) { - const listener = listeners[ii]; - if (listener.complete) listener.complete(entry); - } - break; - case 5 /* event */: { - const event = objects[i++ + 2]; - if (entry.listener?.event) entry.listener.event(entry, event); - for (let ii = 0; ii < listeners.length; ii++) { - const listener = listeners[ii]; - if (listener.event) listener.event(entry, event); - } - break; - } - } - } - this.clear(); - this.drainDisabled = false; - } - clear() { - this.objects.length = 0; - } - }; - var EventType = /* @__PURE__ */ ((EventType2) => { - EventType2[EventType2["start"] = 0] = "start"; - EventType2[EventType2["interrupt"] = 1] = "interrupt"; - EventType2[EventType2["end"] = 2] = "end"; - EventType2[EventType2["dispose"] = 3] = "dispose"; - EventType2[EventType2["complete"] = 4] = "complete"; - EventType2[EventType2["event"] = 5] = "event"; - return EventType2; - })(EventType || {}); - var AnimationStateAdapter = class { - start(entry) { - } - interrupt(entry) { - } - end(entry) { - } - dispose(entry) { - } - complete(entry) { - } - event(entry, event) { - } - }; - var SUBSEQUENT = 0; - var FIRST = 1; - var HOLD_SUBSEQUENT = 2; - var HOLD_FIRST = 3; - var HOLD_MIX = 4; - var SETUP = 1; - var CURRENT = 2; - - // spine-core/src/AnimationStateData.ts - var AnimationStateData = class { - /** The SkeletonData to look up animations when they are specified by name. */ - skeletonData; - animationToMixTime = {}; - /** The mix duration to use when no mix duration has been defined between two animations. */ - defaultMix = 0; - constructor(skeletonData) { - if (!skeletonData) throw new Error("skeletonData cannot be null."); - this.skeletonData = skeletonData; - } - setMix(from, to, duration) { - if (typeof from === "string") - return this.setMix1(from, to, duration); - return this.setMix2(from, to, duration); - } - setMix1(fromName, toName, duration) { - const from = this.skeletonData.findAnimation(fromName); - if (!from) throw new Error(`Animation not found: ${fromName}`); - const to = this.skeletonData.findAnimation(toName); - if (!to) throw new Error(`Animation not found: ${toName}`); - this.setMix2(from, to, duration); - } - setMix2(from, to, duration) { - if (!from) throw new Error("from cannot be null."); - if (!to) throw new Error("to cannot be null."); - const key = `${from.name}.${to.name}`; - this.animationToMixTime[key] = duration; - } - /** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if - * no mix duration has been set. */ - getMix(from, to) { - const key = `${from.name}.${to.name}`; - const value = this.animationToMixTime[key]; - return value === void 0 ? this.defaultMix : value; - } - }; - - // spine-core/src/Texture.ts - var Texture = class { - _image; - constructor(image) { - this._image = image; - } - getImage() { - return this._image; - } - }; - var TextureFilter = /* @__PURE__ */ ((TextureFilter2) => { - TextureFilter2[TextureFilter2["Nearest"] = 9728] = "Nearest"; - TextureFilter2[TextureFilter2["Linear"] = 9729] = "Linear"; - TextureFilter2[TextureFilter2["MipMap"] = 9987] = "MipMap"; - TextureFilter2[TextureFilter2["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; - TextureFilter2[TextureFilter2["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; - TextureFilter2[TextureFilter2["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; - TextureFilter2[TextureFilter2["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; - return TextureFilter2; - })(TextureFilter || {}); - var TextureWrap = /* @__PURE__ */ ((TextureWrap2) => { - TextureWrap2[TextureWrap2["MirroredRepeat"] = 33648] = "MirroredRepeat"; - TextureWrap2[TextureWrap2["ClampToEdge"] = 33071] = "ClampToEdge"; - TextureWrap2[TextureWrap2["Repeat"] = 10497] = "Repeat"; - return TextureWrap2; - })(TextureWrap || {}); - var TextureRegion = class { - texture; - u = 0; - v = 0; - u2 = 0; - v2 = 0; - width = 0; - height = 0; - degrees = 0; - offsetX = 0; - offsetY = 0; - originalWidth = 0; - originalHeight = 0; - }; - var FakeTexture = class extends Texture { - setFilters(minFilter, magFilter) { - } - setWraps(uWrap, vWrap) { - } - dispose() { - } - }; - - // spine-core/src/TextureAtlas.ts - var TextureAtlas = class { - pages = []; - regions = []; - constructor(atlasText) { - const reader = new TextureAtlasReader(atlasText); - const entry = new Array(4); - const pageFields = {}; - pageFields.size = (page2) => { - page2.width = parseInt(entry[1]); - page2.height = parseInt(entry[2]); - }; - pageFields.format = () => { - }; - pageFields.filter = (page2) => { - page2.minFilter = Utils.enumValue(TextureFilter, entry[1]); - page2.magFilter = Utils.enumValue(TextureFilter, entry[2]); - }; - pageFields.repeat = (page2) => { - if (entry[1].indexOf("x") !== -1) page2.uWrap = 10497 /* Repeat */; - if (entry[1].indexOf("y") !== -1) page2.vWrap = 10497 /* Repeat */; - }; - pageFields.pma = (page2) => { - page2.pma = entry[1] === "true"; - }; - var regionFields = {}; - regionFields.xy = (region) => { - region.x = parseInt(entry[1]); - region.y = parseInt(entry[2]); - }; - regionFields.size = (region) => { - region.width = parseInt(entry[1]); - region.height = parseInt(entry[2]); - }; - regionFields.bounds = (region) => { - region.x = parseInt(entry[1]); - region.y = parseInt(entry[2]); - region.width = parseInt(entry[3]); - region.height = parseInt(entry[4]); - }; - regionFields.offset = (region) => { - region.offsetX = parseInt(entry[1]); - region.offsetY = parseInt(entry[2]); - }; - regionFields.orig = (region) => { - region.originalWidth = parseInt(entry[1]); - region.originalHeight = parseInt(entry[2]); - }; - regionFields.offsets = (region) => { - region.offsetX = parseInt(entry[1]); - region.offsetY = parseInt(entry[2]); - region.originalWidth = parseInt(entry[3]); - region.originalHeight = parseInt(entry[4]); - }; - regionFields.rotate = (region) => { - const value = entry[1]; - if (value === "true") - region.degrees = 90; - else if (value !== "false") - region.degrees = parseInt(value); - }; - regionFields.index = (region) => { - region.index = parseInt(entry[1]); - }; - let line = reader.readLine(); - while (line && line.trim().length === 0) - line = reader.readLine(); - while (true) { - if (!line || line.trim().length === 0) break; - if (reader.readEntry(entry, line) === 0) break; - line = reader.readLine(); - } - let page = null; - let names = null; - let values = null; - while (true) { - if (line === null) break; - if (line.trim().length === 0) { - page = null; - line = reader.readLine(); - } else if (!page) { - page = new TextureAtlasPage(line.trim()); - while (true) { - if (reader.readEntry(entry, line = reader.readLine()) === 0) break; - const field = pageFields[entry[0]]; - if (field) field(page); - } - this.pages.push(page); - } else { - const region = new TextureAtlasRegion(page, line); - while (true) { - const count = reader.readEntry(entry, line = reader.readLine()); - if (count === 0) break; - const field = regionFields[entry[0]]; - if (field) - field(region); - else { - if (!names) names = []; - if (!values) values = []; - names.push(entry[0]); - const entryValues = []; - for (let i = 0; i < count; i++) - entryValues.push(parseInt(entry[i + 1])); - values.push(entryValues); - } - } - if (region.originalWidth === 0 && region.originalHeight === 0) { - region.originalWidth = region.width; - region.originalHeight = region.height; - } - if (names && names.length > 0 && values && values.length > 0) { - region.names = names; - region.values = values; - names = null; - values = null; - } - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.degrees === 90) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - this.regions.push(region); - } - } - } - findRegion(name) { - for (let i = 0; i < this.regions.length; i++) { - if (this.regions[i].name === name) { - return this.regions[i]; - } - } - return null; - } - setTextures(assetManager, pathPrefix = "") { - for (const page of this.pages) - page.setTexture(assetManager.get(pathPrefix + page.name)); - } - dispose() { - for (let i = 0; i < this.pages.length; i++) { - this.pages[i].texture?.dispose(); - } - } - }; - var TextureAtlasReader = class { - lines; - index = 0; - constructor(text) { - this.lines = text.split(/\r\n|\r|\n/); - } - readLine() { - if (this.index >= this.lines.length) - return null; - return this.lines[this.index++]; - } - readEntry(entry, line) { - if (!line) return 0; - line = line.trim(); - if (line.length === 0) return 0; - const colon = line.indexOf(":"); - if (colon === -1) return 0; - entry[0] = line.substr(0, colon).trim(); - for (let i = 1, lastMatch = colon + 1; ; i++) { - const comma = line.indexOf(",", lastMatch); - if (comma === -1) { - entry[i] = line.substr(lastMatch).trim(); - return i; - } - entry[i] = line.substr(lastMatch, comma - lastMatch).trim(); - lastMatch = comma + 1; - if (i === 4) return 4; - } - } - }; - var TextureAtlasPage = class { - name; - minFilter = 9728 /* Nearest */; - magFilter = 9728 /* Nearest */; - uWrap = 33071 /* ClampToEdge */; - vWrap = 33071 /* ClampToEdge */; - texture = null; - width = 0; - height = 0; - pma = false; - regions = []; - constructor(name) { - this.name = name; - } - setTexture(texture) { - this.texture = texture; - texture.setFilters(this.minFilter, this.magFilter); - texture.setWraps(this.uWrap, this.vWrap); - for (const region of this.regions) - region.texture = texture; - } - }; - var TextureAtlasRegion = class extends TextureRegion { - page; - name; - x = 0; - y = 0; - offsetX = 0; - offsetY = 0; - originalWidth = 0; - originalHeight = 0; - index = 0; - degrees = 0; - names = null; - values = null; - constructor(page, name) { - super(); - this.page = page; - this.name = name; - page.regions.push(this); - } - }; - - // spine-core/src/AssetManagerBase.ts - var AssetManagerBase = class { - pathPrefix = ""; - textureLoader; - downloader; - cache; - errors = {}; - toLoad = 0; - loaded = 0; - constructor(textureLoader, pathPrefix = "", downloader = new Downloader(), cache = new AssetCache()) { - this.textureLoader = textureLoader; - this.pathPrefix = pathPrefix; - this.downloader = downloader; - this.cache = cache; - } - start(path) { - this.toLoad++; - return this.pathPrefix + path; - } - success(callback, path, asset) { - this.toLoad--; - this.loaded++; - this.cache.assets[path] = asset; - this.cache.assetsRefCount[path] = (this.cache.assetsRefCount[path] || 0) + 1; - if (callback) callback(path, asset); - } - error(callback, path, message) { - this.toLoad--; - this.loaded++; - this.errors[path] = message; - if (callback) callback(path, message); - } - loadAll() { - const promise = new Promise((resolve, reject) => { - const check = () => { - if (this.isLoadingComplete()) { - if (this.hasErrors()) reject(this.errors); - else resolve(this); - return; - } - requestAnimationFrame(check); - }; - requestAnimationFrame(check); - }); - return promise; - } - setRawDataURI(path, data) { - this.downloader.rawDataUris[this.pathPrefix + path] = data; - } - loadBinary(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - if (this.reuseAssets(path, success, error)) return; - this.cache.assetsLoaded[path] = new Promise((resolve, reject) => { - this.downloader.downloadBinary(path, (data) => { - this.success(success, path, data); - resolve(data); - }, (status, responseText) => { - const errorMsg = `Couldn't load binary ${path}: status ${status}, ${responseText}`; - this.error(error, path, errorMsg); - reject(errorMsg); - }); - }); - } - loadText(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - this.downloader.downloadText(path, (data) => { - this.success(success, path, data); - }, (status, responseText) => { - this.error(error, path, `Couldn't load text ${path}: status ${status}, ${responseText}`); - }); - } - loadJson(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - if (this.reuseAssets(path, success, error)) return; - this.cache.assetsLoaded[path] = new Promise((resolve, reject) => { - this.downloader.downloadJson(path, (data) => { - this.success(success, path, data); - resolve(data); - }, (status, responseText) => { - const errorMsg = `Couldn't load JSON ${path}: status ${status}, ${responseText}`; - this.error(error, path, errorMsg); - reject(errorMsg); - }); - }); - } - reuseAssets(path, success = () => { - }, error = () => { - }) { - const loadedStatus = this.cache.getAsset(path); - const alreadyExistsOrLoading = loadedStatus !== void 0; - if (alreadyExistsOrLoading) { - this.cache.assetsLoaded[path] = loadedStatus.then((data) => { - data = data instanceof Image || data instanceof ImageBitmap ? this.textureLoader(data) : data; - this.success(success, path, data); - return data; - }).catch((errorMsg) => { - this.error(error, path, errorMsg); - return void 0; - }); - } - return alreadyExistsOrLoading; - } - loadTexture(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - if (this.reuseAssets(path, success, error)) return; - this.cache.assetsLoaded[path] = new Promise((resolve, reject) => { - const isBrowser = !!(typeof window !== "undefined" && typeof navigator !== "undefined" && window.document); - const isWebWorker = !isBrowser; - if (isWebWorker) { - fetch(path, { mode: "cors" }).then((response) => { - if (response.ok) return response.blob(); - const errorMsg = `Couldn't load image: ${path}`; - this.error(error, path, `Couldn't load image: ${path}`); - reject(errorMsg); - }).then((blob) => { - return blob ? createImageBitmap(blob, { premultiplyAlpha: "none", colorSpaceConversion: "none" }) : null; - }).then((bitmap) => { - if (bitmap) { - const texture = this.createTexture(path, bitmap); - this.success(success, path, texture); - resolve(texture); - } - ; - }); - } else { - const image = new Image(); - image.crossOrigin = "anonymous"; - image.onload = () => { - const texture = this.createTexture(path, image); - this.success(success, path, texture); - resolve(texture); - }; - image.onerror = () => { - const errorMsg = `Couldn't load image: ${path}`; - this.error(error, path, errorMsg); - reject(errorMsg); - }; - if (this.downloader.rawDataUris[path]) path = this.downloader.rawDataUris[path]; - image.src = path; - } - }); - } - loadTextureAtlas(path, success = () => { - }, error = () => { - }, fileAlias) { - const index = path.lastIndexOf("/"); - const parent = index >= 0 ? path.substring(0, index + 1) : ""; - path = this.start(path); - if (this.reuseAssets(path, success, error)) return; - this.cache.assetsLoaded[path] = new Promise((resolve, reject) => { - this.downloader.downloadText(path, (atlasText) => { - try { - const atlas = this.createTextureAtlas(path, atlasText); - let toLoad = atlas.pages.length, abort = false; - for (const page of atlas.pages) { - this.loadTexture( - !fileAlias ? parent + page.name : fileAlias[page.name], - (imagePath, texture) => { - if (!abort) { - page.setTexture(texture); - if (--toLoad === 0) { - this.success(success, path, atlas); - resolve(atlas); - } - } - }, - (imagePath, message) => { - if (!abort) { - const errorMsg = `Couldn't load texture ${path} page image: ${imagePath}`; - this.error(error, path, errorMsg); - reject(errorMsg); - } - abort = true; - } - ); - } - } catch (e) { - const errorMsg = `Couldn't parse texture atlas ${path}: ${e.message}`; - this.error(error, path, errorMsg); - reject(errorMsg); - } - }, (status, responseText) => { - const errorMsg = `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`; - this.error(error, path, errorMsg); - reject(errorMsg); - }); - }); - } - loadTextureAtlasButNoTextures(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - if (this.reuseAssets(path, success, error)) return; - this.cache.assetsLoaded[path] = new Promise((resolve, reject) => { - this.downloader.downloadText(path, (atlasText) => { - try { - const atlas = this.createTextureAtlas(path, atlasText); - this.success(success, path, atlas); - resolve(atlas); - } catch (e) { - const errorMsg = `Couldn't parse texture atlas ${path}: ${e.message}`; - this.error(error, path, errorMsg); - reject(errorMsg); - } - }, (status, responseText) => { - const errorMsg = `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`; - this.error(error, path, errorMsg); - reject(errorMsg); - }); - }); - } - // Promisified versions of load function - async loadBinaryAsync(path) { - return new Promise((resolve, reject) => { - this.loadBinary( - path, - (_, binary) => resolve(binary), - (_, message) => reject(message) - ); - }); - } - async loadJsonAsync(path) { - return new Promise((resolve, reject) => { - this.loadJson( - path, - (_, object) => resolve(object), - (_, message) => reject(message) - ); - }); - } - async loadTextureAsync(path) { - return new Promise((resolve, reject) => { - this.loadTexture( - path, - (_, texture) => resolve(texture), - (_, message) => reject(message) - ); - }); - } - async loadTextureAtlasAsync(path) { - return new Promise((resolve, reject) => { - this.loadTextureAtlas( - path, - (_, atlas) => resolve(atlas), - (_, message) => reject(message) - ); - }); - } - async loadTextureAtlasButNoTexturesAsync(path) { - return new Promise((resolve, reject) => { - this.loadTextureAtlasButNoTextures( - path, - (_, atlas) => resolve(atlas), - (_, message) => reject(message) - ); - }); - } - setCache(cache) { - this.cache = cache; - } - get(path) { - return this.cache.assets[this.pathPrefix + path]; - } - require(path) { - path = this.pathPrefix + path; - const asset = this.cache.assets[path]; - if (asset) return asset; - const error = this.errors[path]; - throw Error(`Asset not found: ${path}${error ? ` -${error}` : ""}`); - } - remove(path) { - path = this.pathPrefix + path; - const asset = this.cache.assets[path]; - if (asset.dispose) asset.dispose(); - delete this.cache.assets[path]; - delete this.cache.assetsRefCount[path]; - delete this.cache.assetsLoaded[path]; - return asset; - } - removeAll() { - for (const path in this.cache.assets) { - const asset = this.cache.assets[path]; - if (asset.dispose) asset.dispose(); - } - this.cache.assets = {}; - this.cache.assetsLoaded = {}; - this.cache.assetsRefCount = {}; - } - isLoadingComplete() { - return this.toLoad === 0; - } - getToLoad() { - return this.toLoad; - } - getLoaded() { - return this.loaded; - } - dispose() { - this.removeAll(); - } - // dispose asset only if it's not used by others - disposeAsset(path) { - const asset = this.cache.assets[path]; - if (asset instanceof TextureAtlas) { - asset.dispose(); - return; - } - this.disposeAssetInternal(path); - } - hasErrors() { - return Object.keys(this.errors).length > 0; - } - getErrors() { - return this.errors; - } - disposeAssetInternal(path) { - if (this.cache.assetsRefCount[path] > 0 && --this.cache.assetsRefCount[path] === 0) { - return this.remove(path); - } - } - createTextureAtlas(path, atlasText) { - const atlas = new TextureAtlas(atlasText); - atlas.dispose = () => { - if (this.cache.assetsRefCount[path] <= 0) return; - this.disposeAssetInternal(path); - for (const page of atlas.pages) { - page.texture?.dispose(); - } - }; - return atlas; - } - createTexture(path, image) { - const texture = this.textureLoader(image); - const textureDispose = texture.dispose.bind(texture); - texture.dispose = () => { - if (this.disposeAssetInternal(path)) textureDispose(); - }; - return texture; - } - }; - var AssetCache = class _AssetCache { - assets = {}; - assetsRefCount = {}; - assetsLoaded = {}; - static AVAILABLE_CACHES = /* @__PURE__ */ new Map(); - static getCache(id) { - const cache = _AssetCache.AVAILABLE_CACHES.get(id); - if (cache) return cache; - const newCache = new _AssetCache(); - _AssetCache.AVAILABLE_CACHES.set(id, newCache); - return newCache; - } - async addAsset(path, asset) { - this.assetsLoaded[path] = Promise.resolve(asset); - this.assets[path] = asset; - return asset; - } - getAsset(path) { - return this.assetsLoaded[path]; - } - }; - var Downloader = class { - callbacks = {}; - rawDataUris = {}; - dataUriToString(dataUri) { - if (!dataUri.startsWith("data:")) { - throw new Error("Not a data URI."); - } - let base64Idx = dataUri.indexOf("base64,"); - if (base64Idx !== -1) { - base64Idx += "base64,".length; - return atob(dataUri.substr(base64Idx)); - } else { - return dataUri.substr(dataUri.indexOf(",") + 1); - } - } - base64ToUint8Array(base64) { - var binary_string = window.atob(base64); - var len = binary_string.length; - var bytes = new Uint8Array(len); - for (let i = 0; i < len; i++) { - bytes[i] = binary_string.charCodeAt(i); - } - return bytes; - } - dataUriToUint8Array(dataUri) { - if (!dataUri.startsWith("data:")) { - throw new Error("Not a data URI."); - } - let base64Idx = dataUri.indexOf("base64,"); - if (base64Idx === -1) throw new Error("Not a binary data URI."); - base64Idx += "base64,".length; - return this.base64ToUint8Array(dataUri.substr(base64Idx)); - } - downloadText(url, success, error) { - if (this.start(url, success, error)) return; - const rawDataUri = this.rawDataUris[url]; - if (rawDataUri && !rawDataUri.includes(".")) { - try { - this.finish(url, 200, this.dataUriToString(rawDataUri)); - } catch (e) { - this.finish(url, 400, JSON.stringify(e)); - } - return; - } - const request = new XMLHttpRequest(); - request.overrideMimeType("text/html"); - request.open("GET", rawDataUri ? rawDataUri : url, true); - const done = () => { - this.finish(url, request.status, request.responseText); - }; - request.onload = done; - request.onerror = done; - request.send(); - } - downloadJson(url, success, error) { - this.downloadText(url, (data) => { - success(JSON.parse(data)); - }, error); - } - downloadBinary(url, success, error) { - if (this.start(url, success, error)) return; - const rawDataUri = this.rawDataUris[url]; - if (rawDataUri && !rawDataUri.includes(".")) { - try { - this.finish(url, 200, this.dataUriToUint8Array(rawDataUri)); - } catch (e) { - this.finish(url, 400, JSON.stringify(e)); - } - return; - } - const request = new XMLHttpRequest(); - request.open("GET", rawDataUri ? rawDataUri : url, true); - request.responseType = "arraybuffer"; - const onerror = () => { - this.finish(url, request.status, request.response); - }; - request.onload = () => { - if (request.status === 200 || request.status === 0) - this.finish(url, 200, new Uint8Array(request.response)); - else - onerror(); - }; - request.onerror = onerror; - request.send(); - } - start(url, success, error) { - let callbacks = this.callbacks[url]; - try { - if (callbacks) return true; - this.callbacks[url] = callbacks = []; - } finally { - callbacks.push(success, error); - } - } - finish(url, status, data) { - const callbacks = this.callbacks[url]; - delete this.callbacks[url]; - if (status === 200 || status === 0) { - for (let i = 0, n = callbacks.length; i < n; i += 2) - callbacks[i](data); - } else { - for (let i = 1, n = callbacks.length; i < n; i += 2) - callbacks[i](status, data); - } - } - }; - - // spine-core/src/attachments/BoundingBoxAttachment.ts - var BoundingBoxAttachment = class _BoundingBoxAttachment extends VertexAttachment { - color = new Color(1, 1, 1, 1); - constructor(name) { - super(name); - } - copy() { - const copy = new _BoundingBoxAttachment(this.name); - this.copyTo(copy); - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/attachments/ClippingAttachment.ts - var ClippingAttachment = class _ClippingAttachment extends VertexAttachment { - /** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of - * the skeleton's rendering. */ - endSlot = null; - // Nonessential. - /** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons - * are not usually rendered at runtime. */ - color = new Color(0.2275, 0.2275, 0.8078, 1); - // ce3a3aff - constructor(name) { - super(name); - } - copy() { - const copy = new _ClippingAttachment(this.name); - this.copyTo(copy); - copy.endSlot = this.endSlot; - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/attachments/MeshAttachment.ts - var MeshAttachment = class _MeshAttachment extends VertexAttachment { - region = null; - /** The name of the texture region for this attachment. */ - path; - /** The UV pair for each vertex, normalized within the texture region. */ - regionUVs = []; - /** The UV pair for each vertex, normalized within the entire texture. - * - * See {@link #updateUVs}. */ - uvs = []; - /** Triplets of vertex indices which describe the mesh's triangulation. */ - triangles = []; - /** The color to tint the mesh. */ - color = new Color(1, 1, 1, 1); - /** The width of the mesh's image. Available only when nonessential data was exported. */ - width = 0; - /** The height of the mesh's image. Available only when nonessential data was exported. */ - height = 0; - /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */ - hullLength = 0; - /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if - * nonessential data was exported. Triangulation is not performed at runtime. */ - edges = []; - parentMesh = null; - sequence = null; - tempColor = new Color(0, 0, 0, 0); - constructor(name, path) { - super(name); - this.path = path; - } - /** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or - * the {@link #regionUVs} are changed. */ - updateRegion() { - if (!this.region) throw new Error("Region not set."); - const regionUVs = this.regionUVs; - if (!this.uvs || this.uvs.length !== regionUVs.length) this.uvs = Utils.newFloatArray(regionUVs.length); - const uvs = this.uvs; - const n = this.uvs.length; - let u = this.region.u, v = this.region.v, width = 0, height = 0; - if (this.region instanceof TextureAtlasRegion) { - const region = this.region, page = region.page; - const textureWidth = page.width, textureHeight = page.height; - switch (region.degrees) { - case 90: - u -= (region.originalHeight - region.offsetY - region.height) / textureWidth; - v -= (region.originalWidth - region.offsetX - region.width) / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + regionUVs[i + 1] * width; - uvs[i + 1] = v + (1 - regionUVs[i]) * height; - } - return; - case 180: - u -= (region.originalWidth - region.offsetX - region.width) / textureWidth; - v -= region.offsetY / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + (1 - regionUVs[i]) * width; - uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height; - } - return; - case 270: - u -= region.offsetY / textureWidth; - v -= region.offsetX / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + (1 - regionUVs[i + 1]) * width; - uvs[i + 1] = v + regionUVs[i] * height; - } - return; - default: - u -= region.offsetX / textureWidth; - v -= (region.originalHeight - region.offsetY - region.height) / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - } - } else if (!this.region) { - u = v = 0; - width = height = 1; - } else { - width = this.region.u2 - u; - height = this.region.v2 - v; - } - for (let i = 0; i < n; i += 2) { - uvs[i] = u + regionUVs[i] * width; - uvs[i + 1] = v + regionUVs[i + 1] * height; - } - } - /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices}, - * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the - * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */ - getParentMesh() { - return this.parentMesh; - } - /** @param parentMesh May be null. */ - setParentMesh(parentMesh) { - this.parentMesh = parentMesh; - if (parentMesh) { - 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; - } - } - copy() { - if (this.parentMesh) return this.newLinkedMesh(); - const copy = new _MeshAttachment(this.name, this.path); - copy.region = this.region; - copy.color.setFromColor(this.color); - this.copyTo(copy); - copy.regionUVs = []; - Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length); - copy.uvs = this.uvs instanceof Float32Array ? Utils.newFloatArray(this.uvs.length) : []; - Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length); - copy.triangles = []; - Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length); - copy.hullLength = this.hullLength; - copy.sequence = this.sequence != null ? this.sequence.copy() : null; - if (this.edges) { - copy.edges = []; - Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length); - } - copy.width = this.width; - copy.height = this.height; - return copy; - } - computeWorldVertices(skeleton, slot, start, count, worldVertices, offset, stride) { - if (this.sequence != null) this.sequence.apply(slot.applied, this); - super.computeWorldVertices(skeleton, slot, start, count, worldVertices, offset, stride); - } - /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/ - newLinkedMesh() { - const copy = new _MeshAttachment(this.name, this.path); - copy.region = this.region; - copy.color.setFromColor(this.color); - copy.timelineAttachment = this.timelineAttachment; - copy.setParentMesh(this.parentMesh ? this.parentMesh : this); - if (copy.region != null) copy.updateRegion(); - return copy; - } - }; - - // spine-core/src/attachments/PathAttachment.ts - var PathAttachment = class _PathAttachment extends VertexAttachment { - /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */ - lengths = []; - /** If true, the start and end knots are connected. */ - closed = false; - /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer - * calculations are performed but calculating positions along the path is less accurate. */ - constantSpeed = false; - /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually - * rendered at runtime. */ - color = new Color(1, 1, 1, 1); - constructor(name) { - super(name); - } - copy() { - const copy = new _PathAttachment(this.name); - this.copyTo(copy); - copy.lengths = []; - Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length); - copy.closed = this.closed; - copy.constantSpeed = this.constantSpeed; - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/attachments/PointAttachment.ts - var PointAttachment = class _PointAttachment extends VertexAttachment { - x = 0; - y = 0; - rotation = 0; - /** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments - * are not usually rendered at runtime. */ - color = new Color(0.38, 0.94, 0, 1); - constructor(name) { - super(name); - } - computeWorldPosition(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; - } - computeWorldRotation(bone) { - const r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - const x = cos * bone.a + sin * bone.b; - const y = cos * bone.c + sin * bone.d; - return MathUtils.atan2Deg(y, x); - } - copy() { - const copy = new _PointAttachment(this.name); - copy.x = this.x; - copy.y = this.y; - copy.rotation = this.rotation; - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/attachments/RegionAttachment.ts - var RegionAttachment = class _RegionAttachment extends Attachment { - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local scaleX. */ - scaleX = 1; - /** The local scaleY. */ - scaleY = 1; - /** The local rotation. */ - rotation = 0; - /** The width of the region attachment in Spine. */ - width = 0; - /** The height of the region attachment in Spine. */ - height = 0; - /** The color to tint the region attachment. */ - color = new Color(1, 1, 1, 1); - /** The name of the texture region for this attachment. */ - path; - region = null; - sequence = null; - /** For each of the 4 vertices, a pair of x,y values that is the local position of the vertex. - * - * See {@link #updateRegion()}. */ - offset = Utils.newFloatArray(8); - uvs = Utils.newFloatArray(8); - tempColor = new Color(1, 1, 1, 1); - constructor(name, path) { - super(name); - this.path = path; - } - /** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */ - updateRegion() { - if (!this.region) throw new Error("Region not set."); - const region = this.region; - const uvs = this.uvs; - const regionScaleX = this.width / this.region.originalWidth * this.scaleX; - const regionScaleY = this.height / this.region.originalHeight * this.scaleY; - const localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; - const localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; - const localX2 = localX + this.region.width * regionScaleX; - const localY2 = localY + this.region.height * regionScaleY; - const radians = this.rotation * MathUtils.degRad; - const cos = Math.cos(radians); - const sin = Math.sin(radians); - const x = this.x, y = this.y; - const localXCos = localX * cos + x; - const localXSin = localX * sin; - const localYCos = localY * cos + y; - const localYSin = localY * sin; - const localX2Cos = localX2 * cos + x; - const localX2Sin = localX2 * sin; - const localY2Cos = localY2 * cos + y; - const localY2Sin = localY2 * sin; - const offset = this.offset; - offset[0] = localXCos - localYSin; - offset[1] = localYCos + localXSin; - offset[2] = localXCos - localY2Sin; - offset[3] = localY2Cos + localXSin; - offset[4] = localX2Cos - localY2Sin; - offset[5] = localY2Cos + localX2Sin; - offset[6] = localX2Cos - localYSin; - offset[7] = localYCos + localX2Sin; - if (region == null) { - uvs[0] = 0; - uvs[1] = 0; - uvs[2] = 0; - uvs[3] = 1; - uvs[4] = 1; - uvs[5] = 1; - uvs[6] = 1; - uvs[7] = 0; - } else if (region.degrees === 90) { - uvs[0] = region.u2; - uvs[1] = region.v2; - uvs[2] = region.u; - uvs[3] = region.v2; - uvs[4] = region.u; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v; - } 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; - } - } - /** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may - * be changed. - *

- * See World transforms in the Spine - * Runtimes Guide. - * @param worldVertices The output world vertices. Must have a length >= offset + 8. - * @param offset The worldVertices index to begin writing values. - * @param stride The number of worldVertices entries between the value pairs written. */ - computeWorldVertices(slot, worldVertices, offset, stride) { - if (this.sequence) this.sequence.apply(slot.applied, this); - const bone = slot.bone.applied; - const vertexOffset = this.offset; - const x = bone.worldX, y = bone.worldY; - const a = bone.a, b = bone.b, c = bone.c, d = bone.d; - let offsetX = 0, offsetY = 0; - offsetX = vertexOffset[0]; - offsetY = vertexOffset[1]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[2]; - offsetY = vertexOffset[3]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[4]; - offsetY = vertexOffset[5]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[6]; - offsetY = vertexOffset[7]; - worldVertices[offset] = offsetX * a + offsetY * b + x; - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - } - copy() { - const copy = new _RegionAttachment(this.name, this.path); - copy.region = this.region; - copy.x = this.x; - copy.y = this.y; - copy.scaleX = this.scaleX; - copy.scaleY = this.scaleY; - copy.rotation = this.rotation; - copy.width = this.width; - copy.height = this.height; - Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8); - Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8); - copy.color.setFromColor(this.color); - copy.sequence = this.sequence != null ? this.sequence.copy() : null; - return copy; - } - static X1 = 0; - static Y1 = 1; - static C1R = 2; - static C1G = 3; - static C1B = 4; - static C1A = 5; - static U1 = 6; - static V1 = 7; - static X2 = 8; - static Y2 = 9; - static C2R = 10; - static C2G = 11; - static C2B = 12; - static C2A = 13; - static U2 = 14; - static V2 = 15; - static X3 = 16; - static Y3 = 17; - static C3R = 18; - static C3G = 19; - static C3B = 20; - static C3A = 21; - static U3 = 22; - static V3 = 23; - static X4 = 24; - static Y4 = 25; - static C4R = 26; - static C4G = 27; - static C4B = 28; - static C4A = 29; - static U4 = 30; - static V4 = 31; - }; - - // spine-core/src/AtlasAttachmentLoader.ts - var AtlasAttachmentLoader = class { - atlas; - allowMissingRegions; - constructor(atlas, allowMissingRegions = false) { - this.atlas = atlas; - this.allowMissingRegions = allowMissingRegions; - } - loadSequence(name, basePath, sequence) { - const regions = sequence.regions; - for (let i = 0, n = regions.length; i < n; i++) { - const path = sequence.getPath(basePath, i); - regions[i] = this.atlas.findRegion(path); - if (regions[i] == null && !this.allowMissingRegions) - throw new Error(`Region not found in atlas: ${path} (sequence: ${name})`); - } - } - newRegionAttachment(skin, name, path, sequence) { - const attachment = new RegionAttachment(name, path); - if (sequence != null) { - this.loadSequence(name, path, sequence); - } else { - const region = this.atlas.findRegion(path); - if (region == null && !this.allowMissingRegions) - throw new Error(`Region not found in atlas: ${path} (region attachment: ${name})`); - attachment.region = region; - } - return attachment; - } - newMeshAttachment(skin, name, path, sequence) { - const attachment = new MeshAttachment(name, path); - if (sequence != null) { - this.loadSequence(name, path, sequence); - } else { - const region = this.atlas.findRegion(path); - if (region == null && !this.allowMissingRegions) - throw new Error(`Region not found in atlas: ${path} (mesh attachment: ${name})`); - attachment.region = region; - } - return attachment; - } - newBoundingBoxAttachment(skin, name) { - return new BoundingBoxAttachment(name); - } - newPathAttachment(skin, name) { - return new PathAttachment(name); - } - newPointAttachment(skin, name) { - return new PointAttachment(name); - } - newClippingAttachment(skin, name) { - return new ClippingAttachment(name); - } - }; - - // spine-core/src/BoneLocal.ts - var BoneLocal = class { - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local rotation in degrees, counter clockwise. */ - rotation = 0; - /** The local scaleX. */ - scaleX = 0; - /** The local scaleY. */ - scaleY = 0; - /** The local shearX. */ - shearX = 0; - /** The local shearY. */ - shearY = 0; - inherit = 0 /* Normal */; - set(pose) { - if (pose == null) throw new Error("pose cannot be null."); - this.x = pose.x; - this.y = pose.y; - this.rotation = pose.rotation; - this.scaleX = pose.scaleX; - this.scaleY = pose.scaleY; - this.shearX = pose.shearX; - this.shearY = pose.shearY; - this.inherit = pose.inherit; - } - setPosition(x, y) { - this.x = x; - this.y = y; - } - setScale(scaleOrX, scaleY) { - this.scaleX = scaleOrX; - this.scaleY = scaleY === void 0 ? scaleOrX : scaleY; - } - /** Determines how parent world transforms affect this bone. */ - getInherit() { - return this.inherit; - } - setInherit(inherit) { - if (inherit == null) throw new Error("inherit cannot be null."); - this.inherit = inherit; - } - }; - - // spine-core/src/PosedData.ts - var PosedData = class { - /** The constraint's name, which is unique across all constraints in the skeleton of the same type. */ - name; - setup; - /** When true, {@link Skeleton.updateWorldTransform} only updates this constraint if the {@link Skeleton.skin} - * contains this constraint. - * - * See {@link Skin.constraints}. */ - skinRequired = false; - constructor(name, setup) { - if (name == null) throw new Error("name cannot be null."); - this.name = name; - this.setup = setup; - } - }; - - // spine-core/src/BoneData.ts - var BoneData = class _BoneData extends PosedData { - /** The index of the bone in {@link Skeleton.getBones}. */ - index = 0; - /** @returns May be null. */ - parent = null; - /** The bone's length. */ - length = 0; - // Nonessential. - /** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually - * rendered at runtime. */ - color = new Color(); - /** The bone icon as it was in Spine, or null if nonessential data was not exported. */ - icon; - /** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */ - visible = false; - constructor(index, name, parent) { - super(name, new BoneLocal()); - if (index < 0) throw new Error("index must be >= 0."); - if (!name) throw new Error("name cannot be null."); - this.index = index; - this.parent = parent; - } - copy(parent) { - const copy = new _BoneData(this.index, this.name, parent); - copy.length = this.length; - copy.setup.set(this.setup); - return copy; - } - }; - var Inherit = /* @__PURE__ */ ((Inherit2) => { - Inherit2[Inherit2["Normal"] = 0] = "Normal"; - Inherit2[Inherit2["OnlyTranslation"] = 1] = "OnlyTranslation"; - Inherit2[Inherit2["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; - Inherit2[Inherit2["NoScale"] = 3] = "NoScale"; - Inherit2[Inherit2["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; - return Inherit2; - })(Inherit || {}); - - // spine-core/src/BonePose.ts - var BonePose = class extends BoneLocal { - bone; - /** Part of the world transform matrix for the X axis. If changed, {@link updateLocalTransform()} should be called. */ - a = 0; - /** Part of the world transform matrix for the Y axis. If changed, {@link updateLocalTransform()} should be called. */ - b = 0; - /** Part of the world transform matrix for the X axis. If changed, {@link updateLocalTransform()} should be called. */ - c = 0; - /** Part of the world transform matrix for the Y axis. If changed, {@link updateLocalTransform()} should be called. */ - d = 0; - /** The world X position. If changed, {@link updateLocalTransform()} should be called. */ - worldY = 0; - /** The world Y position. If changed, {@link updateLocalTransform()} should be called. */ - worldX = 0; - world = 0; - local = 0; - /** Called by {@link Skeleton#updateCache()} to compute the world transform, if needed. */ - update(skeleton, physics) { - if (this.world !== skeleton._update) this.updateWorldTransform(skeleton); - } - /** Computes the world transform using the parent bone's applied pose and this pose. Child bones are not updated. - *

- * See World transforms in the Spine - * Runtimes Guide. */ - updateWorldTransform(skeleton) { - if (this.local === skeleton._update) - this.updateLocalTransform(skeleton); - else - this.world = skeleton._update; - const rotation = this.rotation; - const scaleX = this.scaleX; - const scaleY = this.scaleY; - const shearX = this.shearX; - const shearY = this.shearY; - if (!this.bone.parent) { - const sx = skeleton.scaleX, sy = skeleton.scaleY; - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - this.a = Math.cos(rx) * scaleX * sx; - this.b = Math.cos(ry) * scaleY * sx; - this.c = Math.sin(rx) * scaleX * sy; - this.d = Math.sin(ry) * scaleY * sy; - this.worldX = this.x * sx + skeleton.x; - this.worldY = this.y * sy + skeleton.y; - return; - } - const parent = this.bone.parent.applied; - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - this.worldX = pa * this.x + pb * this.y + parent.worldX; - this.worldY = pc * this.x + pd * this.y + parent.worldY; - switch (this.inherit) { - case 0 /* Normal */: { - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - const la = Math.cos(rx) * scaleX; - const lb = Math.cos(ry) * scaleY; - const lc = Math.sin(rx) * scaleX; - const ld = Math.sin(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; - return; - } - case 1 /* OnlyTranslation */: { - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - this.a = Math.cos(rx) * scaleX; - this.b = Math.cos(ry) * scaleY; - this.c = Math.sin(rx) * scaleX; - this.d = Math.sin(ry) * scaleY; - break; - } - case 2 /* NoRotationOrReflection */: { - const sx = 1 / skeleton.scaleX, sy = 1 / skeleton.scaleY; - pa *= sx; - pc *= sy; - let s = pa * pa + pc * pc; - let prx = 0; - if (s > 1e-4) { - s = Math.abs(pa * pd * sy - pb * sx * pc) / s; - pb = pc * s; - pd = pa * s; - prx = MathUtils.atan2Deg(pc, pa); - } else { - pa = 0; - pc = 0; - prx = 90 - MathUtils.atan2Deg(pd, pb); - } - const rx = (rotation + shearX - prx) * MathUtils.degRad; - const ry = (rotation + shearY - prx + 90) * MathUtils.degRad; - const la = Math.cos(rx) * scaleX; - const lb = Math.cos(ry) * scaleY; - const lc = Math.sin(rx) * scaleX; - const ld = Math.sin(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 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: { - let r = rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - let za = (pa * cos + pb * sin) / skeleton.scaleX; - let zc = (pc * cos + pd * sin) / skeleton.scaleY; - let s = Math.sqrt(za * za + zc * zc); - if (s > 1e-5) s = 1 / s; - za *= s; - zc *= s; - s = Math.sqrt(za * za + zc * zc); - if (this.inherit === 3 /* NoScale */ && pa * pd - pb * pc < 0 !== (skeleton.scaleX < 0 !== skeleton.scaleY < 0)) s = -s; - r = Math.PI / 2 + Math.atan2(zc, za); - const zb = Math.cos(r) * s; - const zd = Math.sin(r) * s; - const rx = shearX * MathUtils.degRad; - const ry = (90 + shearY) * MathUtils.degRad; - const la = Math.cos(rx) * scaleX; - const lb = Math.cos(ry) * scaleY; - const lc = Math.sin(rx) * scaleX; - const ld = Math.sin(ry) * 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 *= skeleton.scaleX; - this.b *= skeleton.scaleX; - this.c *= skeleton.scaleY; - this.d *= skeleton.scaleY; - } - /** Computes the local transform values from the world transform. - *

- * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so - * the local transform matches the world transform. The local transform may be needed by other code (eg to apply another - * constraint). - *

- * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The local transform after - * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */ - updateLocalTransform(skeleton) { - this.local = 0; - this.world = skeleton._update; - if (!this.bone.parent) { - this.x = this.worldX - skeleton.x; - this.y = this.worldY - skeleton.y; - const a = this.a, b = this.b, c = this.c, d = this.d; - this.rotation = MathUtils.atan2Deg(c, a); - this.scaleX = Math.sqrt(a * a + c * c); - this.scaleY = Math.sqrt(b * b + d * d); - this.shearX = 0; - this.shearY = MathUtils.atan2Deg(a * b + c * d, a * d - b * c); - return; - } - const parent = this.bone.parent.applied; - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - let pid = 1 / (pa * pd - pb * pc); - let ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid; - const dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; - this.x = dx * ia - dy * ib; - this.y = dy * id - dx * ic; - let ra, rb, rc, rd; - if (this.inherit === 1 /* OnlyTranslation */) { - ra = this.a; - rb = this.b; - rc = this.c; - rd = this.d; - } else { - switch (this.inherit) { - case 2 /* NoRotationOrReflection */: { - const s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc); - pb = -pc * skeleton.scaleX * s / skeleton.scaleY; - pd = pa * skeleton.scaleY * s / skeleton.scaleX; - pid = 1 / (pa * pd - pb * pc); - ia = pd * pid; - ib = pb * pid; - break; - } - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: { - let r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - pa = (pa * cos + pb * sin) / skeleton.scaleX; - pc = (pc * cos + pd * sin) / skeleton.scaleY; - let s = Math.sqrt(pa * pa + pc * pc); - if (s > 1e-5) s = 1 / s; - pa *= s; - pc *= s; - s = Math.sqrt(pa * pa + pc * pc); - if (this.inherit === 3 /* NoScale */ && pid < 0 !== (skeleton.scaleX < 0 !== skeleton.scaleY < 0)) s = -s; - r = MathUtils.PI / 2 + Math.atan2(pc, pa); - pb = Math.cos(r) * s; - pd = Math.sin(r) * s; - pid = 1 / (pa * pd - pb * pc); - ia = pd * pid; - ib = pb * pid; - ic = pc * pid; - id = pa * pid; - } - } - ra = ia * this.a - ib * this.c; - rb = ia * this.b - ib * this.d; - rc = id * this.c - ic * this.a; - rd = id * this.d - ic * this.b; - } - this.shearX = 0; - this.scaleX = Math.sqrt(ra * ra + rc * rc); - if (this.scaleX > 1e-4) { - const det = ra * rd - rb * rc; - this.scaleY = det / this.scaleX; - this.shearY = -MathUtils.atan2Deg(ra * rb + rc * rd, det); - this.rotation = MathUtils.atan2Deg(rc, ra); - } else { - this.scaleX = 0; - this.scaleY = Math.sqrt(rb * rb + rd * rd); - this.shearY = 0; - this.rotation = 90 - MathUtils.atan2Deg(rd, rb); - } - } - /** If the world transform has been modified and the local transform no longer matches, {@link #updateLocalTransform(Skeleton)} - * is called. */ - validateLocalTransform(skeleton) { - if (this.local === skeleton._update) this.updateLocalTransform(skeleton); - } - modifyLocal(skeleton) { - if (this.local === skeleton._update) this.updateLocalTransform(skeleton); - this.world = 0; - this.resetWorld(skeleton._update); - } - modifyWorld(update) { - this.local = update; - this.world = update; - this.resetWorld(update); - } - resetWorld(update) { - const children = this.bone.children; - for (let i = 0, n = children.length; i < n; i++) { - const child = children[i].applied; - if (child.world === update) { - child.world = 0; - child.local = 0; - child.resetWorld(update); - } - } - } - /** The world rotation for the X axis, calculated using {@link a} and {@link c}. */ - getWorldRotationX() { - return MathUtils.atan2Deg(this.c, this.a); - } - /** The world rotation for the Y axis, calculated using {@link b} and {@link d}. */ - getWorldRotationY() { - return MathUtils.atan2Deg(this.d, this.b); - } - /** The magnitude (always positive) of the world scale X, calculated using {@link a} and {@link c}. */ - getWorldScaleX() { - return Math.sqrt(this.a * this.a + this.c * this.c); - } - /** The magnitude (always positive) of the world scale Y, calculated using {@link b} and {@link d}. */ - getWorldScaleY() { - return Math.sqrt(this.b * this.b + this.d * this.d); - } - // public Matrix3 getWorldTransform (Matrix3 worldTransform) { - // if (worldTransform == null) throw new IllegalArgumentException("worldTransform cannot be null."); - // float[] val = worldTransform.val; - // val[M00] = a; - // val[M01] = b; - // val[M10] = c; - // val[M11] = d; - // val[M02] = worldX; - // val[M12] = worldY; - // val[M20] = 0; - // val[M21] = 0; - // val[M22] = 1; - // return worldTransform; - // } - /** Transforms a point from world coordinates to the bone's local coordinates. */ - worldToLocal(world) { - if (world == null) throw new Error("world cannot be null."); - const det = this.a * this.d - this.b * this.c; - const x = world.x - this.worldX, y = world.y - this.worldY; - world.x = (x * this.d - y * this.b) / det; - world.y = (y * this.a - x * this.c) / det; - return world; - } - /** Transforms a point from the bone's local coordinates to world coordinates. */ - localToWorld(local) { - if (local == null) throw new Error("local cannot be null."); - const 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; - } - /** Transforms a point from world coordinates to the parent bone's local coordinates. */ - worldToParent(world) { - if (world == null) throw new Error("world cannot be null."); - return this.bone.parent == null ? world : this.bone.parent.applied.worldToLocal(world); - } - /** Transforms a point from the parent bone's coordinates to world coordinates. */ - parentToWorld(world) { - if (world == null) throw new Error("world cannot be null."); - return this.bone.parent == null ? world : this.bone.parent.applied.localToWorld(world); - } - /** Transforms a world rotation to a local rotation. */ - worldToLocalRotation(worldRotation) { - worldRotation *= MathUtils.degRad; - const sin = Math.sin(worldRotation), cos = Math.cos(worldRotation); - return MathUtils.atan2Deg(this.a * sin - this.c * cos, this.d * cos - this.b * sin) + this.rotation - this.shearX; - } - /** Transforms a local rotation to a world rotation. */ - localToWorldRotation(localRotation) { - localRotation = (localRotation - this.rotation - this.shearX) * MathUtils.degRad; - const sin = Math.sin(localRotation), cos = Math.cos(localRotation); - return MathUtils.atan2Deg(cos * this.c + sin * this.d, cos * this.a + sin * this.b); - } - /** Rotates the world transform the specified amount. - *

- * After changes are made to the world transform, {@link updateLocalTransform} should be called on this bone and any - * child bones, recursively. */ - rotateWorld(degrees) { - degrees *= MathUtils.degRad; - const sin = Math.sin(degrees), cos = Math.cos(degrees); - const ra = this.a, rb = this.b; - this.a = cos * ra - sin * this.c; - this.b = cos * rb - sin * this.d; - this.c = sin * ra + cos * this.c; - this.d = sin * rb + cos * this.d; - } - }; - - // spine-core/src/Posed.ts - var Posed = class { - /** The constraint's setup pose data. */ - data; - pose; - constrained; - applied; - constructor(data, pose, constrained) { - if (data == null) throw new Error("data cannot be null."); - this.data = data; - this.pose = pose; - this.constrained = constrained; - this.applied = pose; - } - setupPose() { - this.pose.set(this.data.setup); - } - /** The constraint's setup pose data. */ - getData() { - return this.data; - } - getPose() { - return this.pose; - } - getAppliedPose() { - return this.applied; - } - usePose() { - this.applied = this.pose; - } - useConstrained() { - this.applied = this.constrained; - } - resetConstrained() { - this.constrained.set(this.pose); - } - }; - - // spine-core/src/PosedActive.ts - var PosedActive = class extends Posed { - active = false; - constructor(data, pose, constrained) { - super(data, pose, constrained); - this.setupPose(); - } - /** Returns false when this constraint won't be updated by - * {@link Skeleton.updateWorldTransform()} because a skin is required and the - * {@link Skeleton.getSkin() active skin} does not contain this item. - * @see Skin.getBones() - * @see Skin.getConstraints() - * @see PosedData.getSkinRequired() - * @see Skeleton.updateCache() */ - isActive() { - return this.active; - } - }; - - // spine-core/src/Bone.ts - var Bone = class _Bone extends PosedActive { - /** The parent bone, or null if this is the root bone. */ - parent = null; - /** The immediate children of this bone. */ - children = []; - sorted = false; - constructor(data, parent) { - super(data, new BonePose(), new BonePose()); - this.parent = parent; - this.applied.bone = this; - this.constrained.bone = this; - } - /** Make a copy of the bone. Does not copy the {@link #getChildren()} bones. */ - copy(parent) { - const copy = new _Bone(this.data, parent); - copy.pose.set(this.pose); - return copy; - } - }; - - // spine-core/src/Constraint.ts - var Constraint = class extends PosedActive { - constructor(data, pose, constrained) { - super(data, pose, constrained); - } - isSourceActive() { - return true; - } - }; - - // spine-core/src/ConstraintData.ts - var ConstraintData = class extends PosedData { - constructor(name, setup) { - super(name, setup); - } - }; - - // spine-core/src/Event.ts - var Event = class { - data; - intValue = 0; - floatValue = 0; - stringValue = null; - time = 0; - volume = 0; - balance = 0; - constructor(time, data) { - if (!data) throw new Error("data cannot be null."); - this.time = time; - this.data = data; - } - }; - - // spine-core/src/EventData.ts - var EventData = class { - name; - intValue = 0; - floatValue = 0; - stringValue = null; - audioPath = null; - volume = 0; - balance = 0; - constructor(name) { - this.name = name; - } - }; - - // spine-core/src/IkConstraintPose.ts - var IkConstraintPose = class { - /** For two bone IK, controls the bend direction of the IK bones, either 1 or -1. */ - bendDirection = 0; - /** For one bone IK, when true and the target is too close, the bone is scaled to reach it. */ - compress = false; - /** When true and the target is out of range, the parent bone is scaled to reach it. - * - * For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if {@link softness} is - * > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied. */ - stretch = false; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. - * - * For two bone IK: if the parent bone has local nonuniform scale, the child bone's local Y translation is set to 0. */ - mix = 0; - /** For two bone IK, the target bone's distance from the maximum reach of the bones where rotation begins to slow. The bones - * will not straighten completely until the target is this far out of range. */ - softness = 0; - set(pose) { - this.mix = pose.mix; - this.softness = pose.softness; - this.bendDirection = pose.bendDirection; - this.compress = pose.compress; - this.stretch = pose.stretch; - } - }; - - // spine-core/src/IkConstraint.ts - var IkConstraint = class _IkConstraint extends Constraint { - /** The 1 or 2 bones that will be modified by this IK constraint. */ - bones; - /** The bone that is the IK target. */ - target; - constructor(data, skeleton) { - super(data, new IkConstraintPose(), new IkConstraintPose()); - if (!skeleton) throw new Error("skeleton cannot be null."); - this.bones = []; - for (const boneData of data.bones) - this.bones.push(skeleton.bones[boneData.index].constrained); - this.target = skeleton.bones[data.target.index]; - } - copy(skeleton) { - var copy = new _IkConstraint(this.data, skeleton); - copy.pose.set(this.pose); - return copy; - } - update(skeleton, physics) { - const p = this.applied; - if (p.mix === 0) return; - const target = this.target.applied; - const bones = this.bones; - switch (bones.length) { - case 1: - _IkConstraint.apply(skeleton, bones[0], target.worldX, target.worldY, p.compress, p.stretch, this.data.uniform, p.mix); - break; - case 2: - _IkConstraint.apply( - skeleton, - bones[0], - bones[1], - target.worldX, - target.worldY, - p.bendDirection, - p.stretch, - this.data.uniform, - p.softness, - p.mix - ); - break; - } - } - sort(skeleton) { - skeleton.sortBone(this.target); - const parent = this.bones[0].bone; - skeleton.sortBone(parent); - skeleton._updateCache.push(this); - parent.sorted = false; - skeleton.sortReset(parent.children); - skeleton.constrained(parent); - if (this.bones.length > 1) skeleton.constrained(this.bones[1].bone); - } - isSourceActive() { - return this.target.active; - } - static apply(skeleton, boneOrParent, targetXorChild, targetYOrTargetX, compressOrTargetY, stretchOrBendDir, uniformOrStretch, mixOrUniform, softness, mix) { - if (typeof targetXorChild === "number") - _IkConstraint.apply1(skeleton, boneOrParent, targetXorChild, targetYOrTargetX, compressOrTargetY, stretchOrBendDir, uniformOrStretch, mixOrUniform); - else - _IkConstraint.apply2( - skeleton, - boneOrParent, - targetXorChild, - targetYOrTargetX, - compressOrTargetY, - stretchOrBendDir, - uniformOrStretch, - mixOrUniform, - softness, - mix - ); - } - static apply1(skeleton, bone, targetX, targetY, compress, stretch, uniform, mix) { - bone.modifyLocal(skeleton); - const p = bone.bone.parent.applied; - let pa = p.a, pb = p.b, pc = p.c, pd = p.d; - let rotationIK = -bone.shearX - bone.rotation, tx = 0, ty = 0; - switch (bone.inherit) { - case 1 /* OnlyTranslation */: - tx = (targetX - bone.worldX) * MathUtils.signum(skeleton.scaleX); - ty = (targetY - bone.worldY) * MathUtils.signum(skeleton.scaleY); - break; - // biome-ignore lint/suspicious/noFallthroughSwitchClause: reference runtime - case 2 /* NoRotationOrReflection */: { - const s = Math.abs(pa * pd - pb * pc) / Math.max(1e-4, pa * pa + pc * pc); - const sa = pa / skeleton.scaleX; - const sc = pc / skeleton.scaleY; - pb = -sc * s * skeleton.scaleX; - pd = sa * s * skeleton.scaleY; - rotationIK += MathUtils.atan2Deg(sc, sa); - } - // Fall through - default: { - const x = targetX - p.worldX, y = targetY - p.worldY; - const d = pa * pd - pb * pc; - if (Math.abs(d) <= 1e-4) { - tx = 0; - ty = 0; - } else { - tx = (x * pd - y * pb) / d - bone.x; - ty = (y * pa - x * pc) / d - bone.y; - } - } - } - rotationIK += MathUtils.atan2Deg(ty, tx); - if (bone.scaleX < 0) rotationIK += 180; - if (rotationIK > 180) - rotationIK -= 360; - else if (rotationIK < -180) - rotationIK += 360; - bone.rotation += rotationIK * mix; - if (compress || stretch) { - switch (bone.inherit) { - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: - tx = targetX - bone.worldX; - ty = targetY - bone.worldY; - } - const b = bone.bone.data.length * bone.scaleX; - if (b > 1e-4) { - const dd = tx * tx + ty * ty; - if (compress && dd < b * b || stretch && dd > b * b) { - const s = (Math.sqrt(dd) / b - 1) * mix + 1; - bone.scaleX *= s; - if (uniform) bone.scaleY *= s; - } - } - } - } - /** Applies 2 bone IK. The target is specified in the world coordinate system. - * @param child A direct descendant of the parent bone. */ - static apply2(skeleton, parent, child, targetX, targetY, bendDir, stretch, uniform, softness, mix) { - if (parent.inherit !== 0 /* Normal */ || child.inherit !== 0 /* Normal */) return; - parent.modifyLocal(skeleton); - child.modifyLocal(skeleton); - let px = parent.x, py = parent.y, psx = parent.scaleX, psy = parent.scaleY, csx = child.scaleX; - let 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; - let cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; - const u = Math.abs(psx - psy) <= 1e-4; - if (!u || stretch) { - child.y = 0; - cwx = a * child.x + parent.worldX; - cwy = c * child.x + parent.worldY; - } else { - cwx = a * child.x + b * child.y + parent.worldX; - cwy = c * child.x + d * child.y + parent.worldY; - } - const pp = parent.bone.parent.applied; - a = pp.a; - b = pp.b; - c = pp.c; - d = pp.d; - let id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY; - id = Math.abs(id) <= 1e-4 ? 0 : 1 / id; - const dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; - let l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.bone.data.length * csx, a1, a2; - if (l1 < 1e-4) { - _IkConstraint.apply(skeleton, parent, targetX, targetY, false, stretch, false, mix); - child.rotation = 0; - return; - } - x = targetX - pp.worldX; - y = targetY - pp.worldY; - let tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py; - let dd = tx * tx + ty * ty; - if (softness !== 0) { - softness *= psx * (csx + 1) * 0.5; - const td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness; - if (sd > 0) { - let p = Math.min(1, sd / (softness * 2)) - 1; - p = (sd - softness * (1 - p * p)) / td; - tx -= p * tx; - ty -= p * ty; - dd = tx * tx + ty * ty; - } - } - outer: - if (u) { - l2 *= psx; - let cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); - if (cos < -1) { - cos = -1; - a2 = Math.PI * bendDir; - } else if (cos > 1) { - cos = 1; - a2 = 0; - if (stretch) { - a = (Math.sqrt(dd) / (l1 + l2) - 1) * mix + 1; - parent.scaleX *= a; - if (uniform) parent.scaleY *= a; - } - } else - 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; - const aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); - c = bb * l1 * l1 + aa * dd - aa * bb; - const c1 = -2 * bb * l1, c2 = bb - aa; - d = c1 * c1 - 4 * c2 * c; - if (d >= 0) { - let q = Math.sqrt(d); - if (c1 < 0) q = -q; - q = -(c1 + q) * 0.5; - let r0 = q / c2, r1 = c / q; - const r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; - r0 = dd - r * r; - if (r0 >= 0) { - y = Math.sqrt(r0) * bendDir; - a1 = ta - Math.atan2(y, r); - a2 = Math.atan2(y / psy, (r - l1) / psx); - break outer; - } - } - let minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; - let 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) * 0.5) { - a1 = ta - Math.atan2(minY * bendDir, minX); - a2 = minAngle * bendDir; - } else { - a1 = ta - Math.atan2(maxY * bendDir, maxX); - a2 = maxAngle * bendDir; - } - } - const os = Math.atan2(child.y, child.x) * s2; - a1 = (a1 - os) * MathUtils.radDeg + os1 - parent.rotation; - if (a1 > 180) - a1 -= 360; - else if (a1 < -180) - a1 += 360; - parent.rotation += a1 * mix; - a2 = ((a2 + os) * MathUtils.radDeg - child.shearX) * s2 + os2 - child.rotation; - if (a2 > 180) - a2 -= 360; - else if (a2 < -180) - a2 += 360; - child.rotation += a2 * mix; - } - }; - - // spine-core/src/IkConstraintData.ts - var IkConstraintData = class extends ConstraintData { - /** The bones that are constrained by this IK constraint. */ - bones = []; - _target = null; - /** The bone that is the IK target. */ - set target(boneData) { - this._target = boneData; - } - get target() { - if (!this._target) throw new Error("target cannot be null."); - else return this._target; - } - /** When true and {@link IkConstraintPose.compress} or {@link IkConstraintPose.stretch} is used, the bone is scaled - * on both the X and Y axes. */ - uniform = false; - constructor(name) { - super(name, new IkConstraintPose()); - } - create(skeleton) { - return new IkConstraint(this, skeleton); - } - }; - - // spine-core/src/PathConstraintPose.ts - var PathConstraintPose = class { - /** The position along the path. */ - position = 0; - /** The spacing between bones. */ - spacing = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. */ - mixRotate = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. */ - mixX = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. */ - mixY = 0; - set(pose) { - this.position = pose.position; - this.spacing = pose.spacing; - this.mixRotate = pose.mixRotate; - this.mixX = pose.mixX; - this.mixY = pose.mixY; - } - }; - - // spine-core/src/PathConstraintData.ts - var PathConstraintData = class extends ConstraintData { - /** The bones that will be modified by this path constraint. */ - bones = []; - /** The slot whose path attachment will be used to constrained the bones. */ - set slot(slotData) { - this._slot = slotData; - } - get slot() { - if (!this._slot) throw new Error("SlotData not set."); - else return this._slot; - } - _slot = null; - /** The mode for positioning the first bone on the path. */ - positionMode = 0 /* Fixed */; - /** The mode for positioning the bones after the first bone on the path. */ - spacingMode = 1 /* Fixed */; - /** The mode for adjusting the rotation of the bones. */ - rotateMode = 1 /* Chain */; - /** An offset added to the constrained bone rotation. */ - offsetRotation = 0; - constructor(name) { - super(name, new PathConstraintPose()); - } - create(skeleton) { - return new PathConstraint(this, skeleton); - } - }; - var PositionMode = /* @__PURE__ */ ((PositionMode2) => { - PositionMode2[PositionMode2["Fixed"] = 0] = "Fixed"; - PositionMode2[PositionMode2["Percent"] = 1] = "Percent"; - return PositionMode2; - })(PositionMode || {}); - var SpacingMode = /* @__PURE__ */ ((SpacingMode2) => { - SpacingMode2[SpacingMode2["Length"] = 0] = "Length"; - SpacingMode2[SpacingMode2["Fixed"] = 1] = "Fixed"; - SpacingMode2[SpacingMode2["Percent"] = 2] = "Percent"; - SpacingMode2[SpacingMode2["Proportional"] = 3] = "Proportional"; - return SpacingMode2; - })(SpacingMode || {}); - var RotateMode = /* @__PURE__ */ ((RotateMode2) => { - RotateMode2[RotateMode2["Tangent"] = 0] = "Tangent"; - RotateMode2[RotateMode2["Chain"] = 1] = "Chain"; - RotateMode2[RotateMode2["ChainScale"] = 2] = "ChainScale"; - return RotateMode2; - })(RotateMode || {}); - - // spine-core/src/PathConstraint.ts - var PathConstraint = class _PathConstraint extends Constraint { - static NONE = -1; - static BEFORE = -2; - static AFTER = -3; - static epsilon = 1e-5; - /** The path constraint's setup pose data. */ - data; - /** The bones that will be modified by this path constraint. */ - bones; - /** The slot whose path attachment will be used to constrained the bones. */ - slot; - spaces = []; - positions = []; - world = []; - curves = []; - lengths = []; - segments = []; - constructor(data, skeleton) { - super(data, new PathConstraintPose(), new PathConstraintPose()); - if (!skeleton) throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = []; - for (const boneData of this.data.bones) - this.bones.push(skeleton.bones[boneData.index].constrained); - this.slot = skeleton.slots[data.slot.index]; - } - copy(skeleton) { - var copy = new _PathConstraint(this.data, skeleton); - copy.pose.set(this.pose); - return copy; - } - update(skeleton, physics) { - const attachment = this.slot.applied.attachment; - if (!(attachment instanceof PathAttachment)) return; - const p = this.applied; - const mixRotate = p.mixRotate, mixX = p.mixX, mixY = p.mixY; - if (mixRotate === 0 && mixX === 0 && mixY === 0) return; - const data = this.data; - const tangents = data.rotateMode === 0 /* Tangent */, scale = data.rotateMode === 2 /* ChainScale */; - const bones = this.bones; - const boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1; - const spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : []; - const spacing = p.spacing; - switch (data.spacingMode) { - case 2 /* Percent */: - if (scale) { - for (let i = 0, n = spacesCount - 1; i < n; i++) { - const bone = bones[i]; - const setupLength = bone.bone.data.length; - const x = setupLength * bone.a, y = setupLength * bone.c; - lengths[i] = Math.sqrt(x * x + y * y); - } - } - Utils.arrayFill(spaces, 1, spacesCount, spacing); - break; - case 3 /* Proportional */: { - let sum = 0; - for (let i = 0, n = spacesCount - 1; i < n; ) { - const bone = bones[i]; - const setupLength = bone.bone.data.length; - if (setupLength < _PathConstraint.epsilon) { - if (scale) lengths[i] = 0; - spaces[++i] = spacing; - } else { - const x = setupLength * bone.a, y = setupLength * bone.c; - const length = Math.sqrt(x * x + y * y); - if (scale) lengths[i] = length; - spaces[++i] = length; - sum += length; - } - } - if (sum > 0) { - sum = spacesCount / sum * spacing; - for (let i = 1; i < spacesCount; i++) - spaces[i] *= sum; - } - break; - } - default: { - const lengthSpacing = data.spacingMode === 0 /* Length */; - for (let i = 0, n = spacesCount - 1; i < n; ) { - const bone = bones[i]; - const setupLength = bone.bone.data.length; - if (setupLength < _PathConstraint.epsilon) { - if (scale) lengths[i] = 0; - spaces[++i] = spacing; - } else { - const x = setupLength * bone.a, y = setupLength * bone.c; - const length = Math.sqrt(x * x + y * y); - if (scale) lengths[i] = length; - spaces[++i] = (lengthSpacing ? Math.max(0, setupLength + spacing) : spacing) * length / setupLength; - } - } - } - } - const positions = this.computeWorldPositions(skeleton, attachment, spacesCount, tangents); - let boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; - let tip = false; - if (offsetRotation === 0) - tip = data.rotateMode === 1 /* Chain */; - else { - tip = false; - const bone = this.slot.bone.applied; - offsetRotation *= bone.a * bone.d - bone.b * bone.c > 0 ? MathUtils.degRad : -MathUtils.degRad; - } - for (let i = 0, ip = 3, u = skeleton._update; i < boneCount; i++, ip += 3) { - const bone = bones[i]; - bone.worldX += (boneX - bone.worldX) * mixX; - bone.worldY += (boneY - bone.worldY) * mixY; - const x = positions[ip], y = positions[ip + 1], dx = x - boneX, dy = y - boneY; - if (scale) { - const length = lengths[i]; - if (length !== 0) { - const s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1; - bone.a *= s; - bone.c *= s; - } - } - boneX = x; - boneY = y; - if (mixRotate > 0) { - let a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; - if (tangents) - r = positions[ip - 1]; - else if (spaces[i + 1] === 0) - r = positions[ip + 2]; - else - r = Math.atan2(dy, dx); - r -= Math.atan2(c, a); - if (tip) { - cos = Math.cos(r); - sin = Math.sin(r); - const length = bone.bone.data.length; - boneX += (length * (cos * a - sin * c) - dx) * mixRotate; - boneY += (length * (sin * a + cos * c) - dy) * mixRotate; - } else { - r += offsetRotation; - } - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r *= mixRotate; - 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.modifyWorld(u); - } - } - computeWorldPositions(skeleton, path, spacesCount, tangents) { - const slot = this.slot; - let position = this.applied.position; - let spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = this.world; - const closed = path.closed; - let verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = _PathConstraint.NONE; - if (!path.constantSpeed) { - const lengths = path.lengths; - curveCount -= closed ? 1 : 2; - const pathLength2 = lengths[curveCount]; - if (this.data.positionMode === 1 /* Percent */) position *= pathLength2; - let multiplier2; - switch (this.data.spacingMode) { - case 2 /* Percent */: - multiplier2 = pathLength2; - break; - case 3 /* Proportional */: - multiplier2 = pathLength2 / spacesCount; - break; - default: - multiplier2 = 1; - } - world = Utils.setArraySize(this.world, 8); - for (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { - const space = spaces[i] * multiplier2; - position += space; - let p = position; - if (closed) { - p %= pathLength2; - if (p < 0) p += pathLength2; - curve = 0; - } else if (p < 0) { - if (prevCurve !== _PathConstraint.BEFORE) { - prevCurve = _PathConstraint.BEFORE; - path.computeWorldVertices(skeleton, slot, 2, 4, world, 0, 2); - } - this.addBeforePosition(p, world, 0, out, o); - continue; - } else if (p > pathLength2) { - if (prevCurve !== _PathConstraint.AFTER) { - prevCurve = _PathConstraint.AFTER; - path.computeWorldVertices(skeleton, slot, verticesLength - 6, 4, world, 0, 2); - } - this.addAfterPosition(p - pathLength2, world, 0, out, o); - continue; - } - for (; ; curve++) { - const length = lengths[curve]; - if (p > length) continue; - if (curve === 0) - p /= length; - else { - const prev = lengths[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - if (curve !== prevCurve) { - prevCurve = curve; - if (closed && curve === curveCount) { - path.computeWorldVertices(skeleton, slot, verticesLength - 4, 4, world, 0, 2); - path.computeWorldVertices(skeleton, slot, 0, 4, world, 4, 2); - } else - path.computeWorldVertices(skeleton, slot, 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 = Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(skeleton, slot, 2, verticesLength - 4, world, 0, 2); - path.computeWorldVertices(skeleton, slot, 0, 2, world, verticesLength - 4, 2); - world[verticesLength - 2] = world[0]; - world[verticesLength - 1] = world[1]; - } else { - curveCount--; - verticesLength -= 4; - world = Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(skeleton, slot, 2, verticesLength, world, 0, 2); - } - const curves = Utils.setArraySize(this.curves, curveCount); - let pathLength = 0; - let x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; - let tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; - for (let 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 (this.data.positionMode === 1 /* Percent */) position *= pathLength; - let multiplier; - switch (this.data.spacingMode) { - case 2 /* Percent */: - multiplier = pathLength; - break; - case 3 /* Proportional */: - multiplier = pathLength / spacesCount; - break; - default: - multiplier = 1; - } - const segments = this.segments; - let curveLength = 0; - for (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { - const space = spaces[i] * multiplier; - position += space; - let p = position; - if (closed) { - p %= pathLength; - if (p < 0) p += pathLength; - curve = 0; - segment = 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++) { - const length = curves[curve]; - if (p > length) continue; - if (curve === 0) - p /= length; - else { - const prev = curves[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - if (curve !== prevCurve) { - prevCurve = curve; - let 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) * 6e-3; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 6e-3; - 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++) { - const length = segments[segment]; - if (p > length) continue; - if (segment === 0) - p /= length; - else { - const prev = segments[segment - 1]; - p = segment + (p - prev) / (length - prev); - } - break; - } - this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || i > 0 && space === 0); - } - return out; - } - addBeforePosition(p, temp, i, out, o) { - const 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; - } - addAfterPosition(p, temp, i, out, o) { - const 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; - } - addCurvePosition(p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { - if (p === 0 || Number.isNaN(p)) { - out[o] = x1; - out[o + 1] = y1; - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - return; - } - const tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; - const ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; - const 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 < 1e-3) - 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)); - } - } - sort(skeleton) { - const slotIndex = this.slot.data.index; - const slotBone = this.slot.bone; - if (skeleton.skin != null) this.sortPathSlot(skeleton, skeleton.skin, slotIndex, slotBone); - if (skeleton.data.defaultSkin != null && skeleton.data.defaultSkin !== skeleton.skin) - this.sortPathSlot(skeleton, skeleton.data.defaultSkin, slotIndex, slotBone); - this.sortPath(skeleton, this.slot.pose.attachment, slotBone); - const bones = this.bones; - const boneCount = this.bones.length; - for (let i = 0; i < boneCount; i++) { - const bone = bones[i].bone; - skeleton.sortBone(bone); - skeleton.constrained(bone); - } - skeleton._updateCache.push(this); - for (let i = 0; i < boneCount; i++) - skeleton.sortReset(bones[i].bone.children); - for (let i = 0; i < boneCount; i++) - bones[i].bone.sorted = true; - } - sortPathSlot(skeleton, skin, slotIndex, slotBone) { - const entries = skin.getAttachments(); - for (let i = 0, n = entries.length; i < n; i++) { - const entry = entries[i]; - if (entry.slotIndex === slotIndex) this.sortPath(skeleton, entry.attachment, slotBone); - } - } - sortPath(skeleton, attachment, slotBone) { - if (!(attachment instanceof PathAttachment)) return; - const pathBones = attachment.bones; - if (pathBones == null) - skeleton.sortBone(slotBone); - else { - const bones = skeleton.bones; - for (let i = 0, n = pathBones.length; i < n; ) { - let nn = pathBones[i++]; - nn += i; - while (i < nn) - skeleton.sortBone(bones[pathBones[i++]]); - } - } - } - isSourceActive() { - return this.slot.bone.active; - } - }; - - // spine-core/src/Physics.ts - var Physics = /* @__PURE__ */ ((Physics2) => { - Physics2[Physics2["none"] = 0] = "none"; - Physics2[Physics2["reset"] = 1] = "reset"; - Physics2[Physics2["update"] = 2] = "update"; - Physics2[Physics2["pose"] = 3] = "pose"; - return Physics2; - })(Physics || {}); - - // spine-core/src/PhysicsConstraintPose.ts - var PhysicsConstraintPose = class { - inertia = 0; - strength = 0; - damping = 0; - massInverse = 0; - wind = 0; - gravity = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */ - mix = 0; - set(pose) { - this.inertia = pose.inertia; - this.strength = pose.strength; - this.damping = pose.damping; - this.massInverse = pose.massInverse; - this.wind = pose.wind; - this.gravity = pose.gravity; - this.mix = pose.mix; - } - }; - - // spine-core/src/SlotPose.ts - var SlotPose = class { - /** The color used to tint the slot's attachment. If {@link darkColor} is set, this is used as the light color for two - * color tinting. */ - color = new Color(1, 1, 1, 1); - /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark - * color's alpha is not used. */ - darkColor = null; - /** The current attachment for the slot, or null if the slot has no attachment. */ - attachment = null; - // Not used in setup pose. - /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the - * {@link Sequence.getSetupIndex()}. */ - sequenceIndex = 0; - /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a - * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. - * - * See {@link VertexAttachment.computeWorldVertices()} and - * {@link DeformTimeline}. */ - deform = []; - SlotPose() { - } - set(pose) { - if (pose == null) throw new Error("pose cannot be null."); - this.color.setFromColor(pose.color); - if (this.darkColor != null && pose.darkColor != null) this.darkColor.setFromColor(pose.darkColor); - this.attachment = pose.attachment; - this.sequenceIndex = pose.sequenceIndex; - this.deform.length = 0; - this.deform.push(...pose.deform); - } - /** The current attachment for the slot, or null if the slot has no attachment. */ - getAttachment() { - return this.attachment; - } - /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}. - * The deform is not cleared if the old attachment has the same {@link VertexAttachment.getTimelineAttachment()} as the - * specified attachment. */ - setAttachment(attachment) { - if (this.attachment === attachment) return; - if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttachment !== this.attachment.timelineAttachment) { - this.deform.length = 0; - } - this.attachment = attachment; - this.sequenceIndex = -1; - } - }; - - // spine-core/src/Slot.ts - var Slot = class extends Posed { - skeleton; - /** The bone this slot belongs to. */ - bone; - attachmentState = 0; - constructor(data, skeleton) { - super(data, new SlotPose(), new SlotPose()); - if (!skeleton) throw new Error("skeleton cannot be null."); - this.skeleton = skeleton; - this.bone = skeleton.bones[data.boneData.index]; - if (data.setup.darkColor != null) { - this.pose.darkColor = new Color(); - this.constrained.darkColor = new Color(); - } - this.setupPose(); - } - setupPose() { - this.pose.color.setFromColor(this.data.setup.color); - if (this.pose.darkColor) this.pose.darkColor.setFromColor(this.data.setup.darkColor); - this.pose.sequenceIndex = this.data.setup.sequenceIndex; - if (!this.data.attachmentName) - this.pose.setAttachment(null); - else { - this.pose.attachment = null; - this.pose.setAttachment(this.skeleton.getAttachment(this.data.index, this.data.attachmentName)); - } - } - }; - - // spine-core/src/Skeleton.ts - var Skeleton = class _Skeleton { - static quadTriangles = [0, 1, 2, 2, 3, 0]; - static yDown = false; - static get yDir() { - return _Skeleton.yDown ? -1 : 1; - } - /** The skeleton's setup pose data. */ - data; - /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ - bones; - /** The skeleton's slots. */ - slots; - /** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */ - drawOrder; - /** The skeleton's constraints. */ - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - constraints; - /** The skeleton's physics constraints. */ - physics; - /** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link updateCache()}. */ - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - _updateCache = []; - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - resetCache = []; - /** The skeleton's current skin. May be null. */ - skin = null; - /** The color to tint all the skeleton's attachments. */ - color; - /** Scales the entire skeleton on the X axis. - * - * Bones that do not inherit scale are still affected by this property. */ - scaleX = 1; - _scaleY = 1; - /** Scales the entire skeleton on the Y axis. - * - * Bones that do not inherit scale are still affected by this property. */ - get scaleY() { - return this._scaleY * _Skeleton.yDir; - } - set scaleY(scaleY) { - this._scaleY = scaleY; - } - /** Sets the skeleton X position, which is added to the root bone worldX position. - * - * Bones that do not inherit translation are still affected by this property. */ - x = 0; - /** Sets the skeleton Y position, which is added to the root bone worldY position. - * - * Bones that do not inherit translation are still affected by this property. */ - y = 0; - /** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}. - * - * See {@link _update()}. */ - time = 0; - windX = 1; - windY = 0; - gravityX = 0; - gravityY = 1; - _update = 0; - constructor(data) { - if (!data) throw new Error("data cannot be null."); - this.data = data; - this.bones = []; - for (let i = 0; i < data.bones.length; i++) { - const boneData = data.bones[i]; - let bone; - if (!boneData.parent) - bone = new Bone(boneData, null); - else { - const parent = this.bones[boneData.parent.index]; - bone = new Bone(boneData, parent); - parent.children.push(bone); - } - this.bones.push(bone); - } - this.slots = []; - this.drawOrder = []; - for (const slotData of this.data.slots) { - const slot = new Slot(slotData, this); - this.slots.push(slot); - this.drawOrder.push(slot); - } - this.physics = []; - this.constraints = []; - for (const constraintData of this.data.constraints) { - const constraint = constraintData.create(this); - if (constraint instanceof PhysicsConstraint) this.physics.push(constraint); - this.constraints.push(constraint); - } - this.color = new Color(1, 1, 1, 1); - this.updateCache(); - } - /** Caches information about bones and constraints. Must be called if the {@link getSkin()} is modified or if bones, - * constraints, or weighted path attachments are added or removed. */ - updateCache() { - this._updateCache.length = 0; - this.resetCache.length = 0; - const slots = this.slots; - for (let i = 0, n2 = slots.length; i < n2; i++) - slots[i].usePose(); - const bones = this.bones; - const boneCount = bones.length; - for (let i = 0, n2 = boneCount; i < n2; i++) { - const bone = bones[i]; - bone.sorted = bone.data.skinRequired; - bone.active = !bone.sorted; - bone.usePose(); - } - if (this.skin) { - const skinBones = this.skin.bones; - for (let i = 0, n2 = this.skin.bones.length; i < n2; i++) { - let bone = this.bones[skinBones[i].index]; - do { - bone.sorted = false; - bone.active = true; - bone = bone.parent; - } while (bone); - } - } - const constraints = this.constraints; - let n = this.constraints.length; - for (let i = 0; i < n; i++) - constraints[i].usePose(); - for (let i = 0; i < n; i++) { - const constraint = constraints[i]; - constraint.active = constraint.isSourceActive() && (!constraint.data.skinRequired || this.skin != null && this.skin.constraints.includes(constraint.data)); - if (constraint.active) constraint.sort(this); - } - for (let i = 0; i < boneCount; i++) - this.sortBone(bones[i]); - n = this._updateCache.length; - for (let i = 0; i < n; i++) { - const updateable = this._updateCache[i]; - if (updateable instanceof Bone) this._updateCache[i] = updateable.applied; - } - } - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - constrained(object) { - if (object.pose === object.applied) { - object.useConstrained(); - this.resetCache.push(object); - } - } - sortBone(bone) { - if (bone.sorted || !bone.active) return; - const parent = bone.parent; - if (parent) this.sortBone(parent); - bone.sorted = true; - this._updateCache.push(bone); - } - sortReset(bones) { - for (let i = 0, n = bones.length; i < n; i++) { - const bone = bones[i]; - if (bone.active) { - if (bone.sorted) this.sortReset(bone.children); - bone.sorted = false; - } - } - } - /** Updates the world transform for each bone and applies all constraints. - *

- * See World transforms in the Spine - * Runtimes Guide. */ - updateWorldTransform(physics) { - this._update++; - const resetCache = this.resetCache; - for (let i = 0, n = this.resetCache.length; i < n; i++) - resetCache[i].resetConstrained(); - const updateCache = this._updateCache; - for (let i = 0, n = this._updateCache.length; i < n; i++) - updateCache[i].update(this, physics); - } - /** Sets the bones, constraints, and slots to their setup pose values. */ - setupPose() { - this.setupPoseBones(); - this.setupPoseSlots(); - } - /** Sets the bones and constraints to their setup pose values. */ - setupPoseBones() { - const bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) - bones[i].setupPose(); - const constraints = this.constraints; - for (let i = 0, n = constraints.length; i < n; i++) - constraints[i].setupPose(); - } - /** Sets the slots and draw order to their setup pose values. */ - setupPoseSlots() { - const slots = this.slots; - Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); - for (let i = 0, n = slots.length; i < n; i++) - slots[i].setupPose(); - } - /** Returns the root bone, or null if the skeleton has no bones. */ - getRootBone() { - if (this.bones.length === 0) return null; - return this.bones[0]; - } - /** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it - * repeatedly. */ - findBone(boneName) { - if (!boneName) throw new Error("boneName cannot be null."); - const bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) - if (bones[i].data.name === boneName) return bones[i]; - return null; - } - /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it - * repeatedly. */ - findSlot(slotName) { - if (!slotName) throw new Error("slotName cannot be null."); - const slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) - if (slots[i].data.name === slotName) return slots[i]; - return null; - } - setSkin(newSkin) { - if (typeof newSkin === "string") - this.setSkinByName(newSkin); - else - this.setSkinBySkin(newSkin); - } - setSkinByName(skinName) { - const skin = this.data.findSkin(skinName); - if (!skin) throw new Error(`Skin not found: ${skinName}`); - this.setSkin(skin); - } - setSkinBySkin(newSkin) { - if (newSkin === this.skin) return; - if (newSkin) { - if (this.skin) - newSkin.attachAll(this, this.skin); - else { - const slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - const slot = slots[i]; - const name = slot.data.attachmentName; - if (name) { - const attachment = newSkin.getAttachment(i, name); - if (attachment) slot.pose.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - this.updateCache(); - } - getAttachment(slotNameOrIndex, attachmentName) { - if (typeof slotNameOrIndex === "string") - return this.getAttachmentByName(slotNameOrIndex, attachmentName); - return this.getAttachmentByIndex(slotNameOrIndex, attachmentName); - } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment - * name. - * - * See {@link #getAttachment()}. - * @returns May be null. */ - getAttachmentByName(slotName, attachmentName) { - const slot = this.data.findSlot(slotName); - if (!slot) throw new Error(`Can't find slot with name ${slotName}`); - return this.getAttachment(slot.index, attachmentName); - } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#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. - * - * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. - * @returns May be null. */ - getAttachmentByIndex(slotIndex, attachmentName) { - if (!attachmentName) throw new Error("attachmentName cannot be null."); - if (this.skin) { - const attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) return attachment; - } - if (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - } - /** A convenience method to set an attachment by finding the slot with {@link findSlot()}, finding the attachment with - * {@link getAttachment()}, then setting the slot's {@link Slot.attachment}. - * @param attachmentName May be null to clear the slot's attachment. */ - setAttachment(slotName, attachmentName) { - if (!slotName) throw new Error("slotName cannot be null."); - const slot = this.findSlot(slotName); - if (!slot) throw new Error(`Slot not found: ${slotName}`); - let attachment = null; - if (attachmentName) { - attachment = this.getAttachment(slot.data.index, attachmentName); - if (!attachment) - throw new Error(`Attachment not found: ${attachmentName}, for slot: ${slotName}`); - } - slot.pose.setAttachment(attachment); - } - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - findConstraint(constraintName, type) { - if (constraintName == null) throw new Error("constraintName cannot be null."); - if (type == null) throw new Error("type cannot be null."); - const constraints = this.constraints; - for (let i = 0, n = constraints.length; i < n; i++) { - const constraint = constraints[i]; - if (constraint instanceof type && constraint.data.name === constraintName) return constraint; - } - return null; - } - /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`. - * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */ - getBoundsRect(clipper) { - const offset = new Vector2(); - const size = new Vector2(); - this.getBounds(offset, size, void 0, clipper); - return { x: offset.x, y: offset.y, width: size.x, height: size.y }; - } - /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. - * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB. - * @param size An output value, the width and height of the AABB. - * @param temp Working memory to temporarily store attachments' computed world vertices. - * @param clipper {@link SkeletonClipping} to use. If null, no clipping is applied. */ - getBounds(offset, size, temp = new Array(2), clipper = null) { - if (!offset) throw new Error("offset cannot be null."); - if (!size) throw new Error("size cannot be null."); - const drawOrder = this.drawOrder; - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - for (let i = 0, n = drawOrder.length; i < n; i++) { - const slot = drawOrder[i]; - if (!slot.bone.active) continue; - let verticesLength = 0; - let vertices = null; - let triangles = null; - const attachment = slot.pose.attachment; - if (attachment) { - if (attachment instanceof RegionAttachment) { - verticesLength = 8; - vertices = Utils.setArraySize(temp, verticesLength, 0); - attachment.computeWorldVertices(slot, vertices, 0, 2); - triangles = _Skeleton.quadTriangles; - } else if (attachment instanceof MeshAttachment) { - verticesLength = attachment.worldVerticesLength; - vertices = Utils.setArraySize(temp, verticesLength, 0); - attachment.computeWorldVertices(this, slot, 0, verticesLength, vertices, 0, 2); - triangles = attachment.triangles; - } else if (attachment instanceof ClippingAttachment && clipper) { - clipper.clipEnd(slot); - clipper.clipStart(this, slot, attachment); - continue; - } - if (vertices && triangles) { - if (clipper?.isClipping() && clipper.clipTriangles(vertices, triangles, triangles.length)) { - vertices = clipper.clippedVertices; - verticesLength = clipper.clippedVertices.length; - } - for (let ii = 0, nn = vertices.length; ii < nn; ii += 2) { - const 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); - } - } - } - if (clipper) clipper.clipEnd(slot); - } - if (clipper) clipper.clipEnd(); - offset.set(minX, minY); - size.set(maxX - minX, maxY - minY); - } - /** Scales the entire skeleton on the X and Y axes. - * - * Bones that do not inherit scale are still affected by this property. */ - setScale(scaleX, scaleY) { - this.scaleX = scaleX; - this.scaleY = scaleY; - } - /** Sets the skeleton X and Y position, which is added to the root bone worldX and worldY position. - * - * Bones that do not inherit translation are still affected by this property. */ - setPosition(x, y) { - this.x = x; - this.y = y; - } - /** Increments the skeleton's {@link #time}. */ - update(delta) { - this.time += delta; - } - /** Calls {@link PhysicsConstraint.translate} for each physics constraint. */ - physicsTranslate(x, y) { - const constraints = this.physics; - for (let i = 0, n = constraints.length; i < n; i++) - constraints[i].translate(x, y); - } - /** Calls {@link PhysicsConstraint.rotate} for each physics constraint. */ - physicsRotate(x, y, degrees) { - const constraints = this.physics; - for (let i = 0, n = constraints.length; i < n; i++) - constraints[i].rotate(x, y, degrees); - } - }; - - // spine-core/src/PhysicsConstraint.ts - var PhysicsConstraint = class _PhysicsConstraint extends Constraint { - bone; - _reset = true; - ux = 0; - uy = 0; - cx = 0; - cy = 0; - tx = 0; - ty = 0; - xOffset = 0; - xLag = 0; - xVelocity = 0; - yOffset = 0; - yLag = 0; - yVelocity = 0; - rotateOffset = 0; - rotateLag = 0; - rotateVelocity = 0; - scaleOffset = 0; - scaleLag = 0; - scaleVelocity = 0; - remaining = 0; - lastTime = 0; - constructor(data, skeleton) { - super(data, new PhysicsConstraintPose(), new PhysicsConstraintPose()); - if (skeleton == null) throw new Error("skeleton cannot be null."); - this.bone = skeleton.bones[data.bone.index].constrained; - } - copy(skeleton) { - var copy = new _PhysicsConstraint(this.data, skeleton); - copy.pose.set(this.pose); - return copy; - } - reset(skeleton) { - this.remaining = 0; - this.lastTime = skeleton.time; - this._reset = true; - this.xOffset = 0; - this.xLag = 0; - this.xVelocity = 0; - this.yOffset = 0; - this.yLag = 0; - this.yVelocity = 0; - this.rotateOffset = 0; - this.rotateLag = 0; - this.rotateVelocity = 0; - this.scaleOffset = 0; - this.scaleLag = 0; - this.scaleVelocity = 0; - } - /** Translates the physics constraint so next {@link update} forces are applied as if the bone moved an - * additional amount in world space. */ - translate(x, y) { - this.ux -= x; - this.uy -= y; - this.cx -= x; - this.cy -= y; - } - /** Rotates the physics constraint so next {@link update} forces are applied as if the bone rotated around the - * specified point in world space. */ - rotate(x, y, degrees) { - const r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - const dx = this.cx - x, dy = this.cy - y; - this.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy); - } - /** Applies the constraint to the constrained bones. */ - update(skeleton, physics) { - const p = this.applied; - const mix = p.mix; - if (mix === 0) return; - const x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0; - const bone = this.bone; - let l = bone.bone.data.length, t = this.data.step, z = 0; - switch (physics) { - case 0 /* none */: - return; - // biome-ignore lint/suspicious/noFallthroughSwitchClause: fall through expected - case 1 /* reset */: - this.reset(skeleton); - // Fall through. - case 2 /* update */: { - const delta = Math.max(skeleton.time - this.lastTime, 0), aa = this.remaining; - this.remaining += delta; - this.lastTime = skeleton.time; - const bx = bone.worldX, by = bone.worldY; - if (this._reset) { - this._reset = false; - this.ux = bx; - this.uy = by; - } else { - let a = this.remaining, i = p.inertia, f = skeleton.data.referenceScale, d = -1, m = 0, e = 0, qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY); - qx *= Math.abs(skeleton.scaleX); - if (x || y) { - if (x) { - const u = (this.ux - bx) * i; - this.xOffset += u > qx ? qx : u < -qx ? -qx : u; - this.ux = bx; - } - if (y) { - const u = (this.uy - by) * i; - this.yOffset += u > qy ? qy : u < -qy ? -qy : u; - this.uy = by; - } - if (a >= t) { - const xs = this.xOffset, ys = this.yOffset; - d = p.damping ** (60 * t); - m = t * p.massInverse; - e = p.strength; - const w = f * p.wind, g = f * p.gravity; - const ax = (w * skeleton.windX + g * skeleton.gravityX) * skeleton.scaleX; - const ay = (w * skeleton.windY + g * skeleton.gravityY) * skeleton.scaleY; - do { - if (x) { - this.xVelocity += (ax - this.xOffset * e) * m; - this.xOffset += this.xVelocity * t; - this.xVelocity *= d; - } - if (y) { - this.yVelocity -= (ay + this.yOffset * e) * m; - this.yOffset += this.yVelocity * t; - this.yVelocity *= d; - } - a -= t; - } while (a >= t); - this.xLag = this.xOffset - xs; - this.yLag = this.yOffset - ys; - } - z = Math.max(0, 1 - a / t); - if (x) bone.worldX += (this.xOffset - this.xLag * z) * mix * this.data.x; - if (y) bone.worldY += (this.yOffset - this.yLag * z) * mix * this.data.y; - } - if (rotateOrShearX || scaleX) { - let ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0, dx = this.cx - bone.worldX, dy = this.cy - bone.worldY; - if (dx > qx) - dx = qx; - else if (dx < -qx) - dx = -qx; - if (dy > qy) - dy = qy; - else if (dy < -qy) - dy = -qy; - a = this.remaining; - if (rotateOrShearX) { - mr = (this.data.rotate + this.data.shearX) * mix; - z = this.rotateLag * Math.max(0, 1 - aa / t); - let r = Math.atan2(dy + this.ty, dx + this.tx) - ca - (this.rotateOffset - z) * mr; - this.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i; - r = (this.rotateOffset - z) * mr + ca; - c = Math.cos(r); - s = Math.sin(r); - if (scaleX) { - r = l * bone.getWorldScaleX(); - if (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r; - } - } else { - c = Math.cos(ca); - s = Math.sin(ca); - const r = l * bone.getWorldScaleX() - this.scaleLag * Math.max(0, 1 - aa / t); - if (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r; - } - if (a >= t) { - if (d === -1) { - d = p.damping ** (60 * t); - m = t * p.massInverse; - e = p.strength; - } - const ax = p.wind * skeleton.windX + p.gravity * skeleton.gravityX; - const ay = (p.wind * skeleton.windY + p.gravity * skeleton.gravityY) * Skeleton.yDir; - const rs = this.rotateOffset, ss = this.scaleOffset, h = l / f; - while (true) { - a -= t; - if (scaleX) { - this.scaleVelocity += (ax * c - ay * s - this.scaleOffset * e) * m; - this.scaleOffset += this.scaleVelocity * t; - this.scaleVelocity *= d; - } - if (rotateOrShearX) { - this.rotateVelocity -= ((ax * s + ay * c) * h + this.rotateOffset * e) * m; - this.rotateOffset += this.rotateVelocity * t; - this.rotateVelocity *= d; - if (a < t) break; - const r = this.rotateOffset * mr + ca; - c = Math.cos(r); - s = Math.sin(r); - } else if (a < t) - break; - } - this.rotateLag = this.rotateOffset - rs; - this.scaleLag = this.scaleOffset - ss; - } - z = Math.max(0, 1 - a / t); - } - this.remaining = a; - } - this.cx = bone.worldX; - this.cy = bone.worldY; - break; - } - case 3 /* pose */: - z = Math.max(0, 1 - this.remaining / t); - if (x) bone.worldX += (this.xOffset - this.xLag * z) * mix * this.data.x; - if (y) bone.worldY += (this.yOffset - this.yLag * z) * mix * this.data.y; - } - if (rotateOrShearX) { - let o = (this.rotateOffset - this.rotateLag * z) * mix, s = 0, c = 0, a = 0; - if (this.data.shearX > 0) { - let r = 0; - if (this.data.rotate > 0) { - r = o * this.data.rotate; - s = Math.sin(r); - c = Math.cos(r); - a = bone.b; - bone.b = c * a - s * bone.d; - bone.d = s * a + c * bone.d; - } - r += o * this.data.shearX; - s = Math.sin(r); - c = Math.cos(r); - a = bone.a; - bone.a = c * a - s * bone.c; - bone.c = s * a + c * bone.c; - } else { - o *= this.data.rotate; - s = Math.sin(o); - c = Math.cos(o); - a = bone.a; - bone.a = c * a - s * bone.c; - bone.c = s * a + c * bone.c; - a = bone.b; - bone.b = c * a - s * bone.d; - bone.d = s * a + c * bone.d; - } - } - if (scaleX) { - const s = 1 + (this.scaleOffset - this.scaleLag * z) * mix * this.data.scaleX; - bone.a *= s; - bone.c *= s; - } - if (physics !== 3 /* pose */) { - this.tx = l * bone.a; - this.ty = l * bone.c; - } - bone.modifyWorld(skeleton._update); - } - sort(skeleton) { - const bone = this.bone.bone; - skeleton.sortBone(bone); - skeleton._updateCache.push(this); - skeleton.sortReset(bone.children); - skeleton.constrained(bone); - } - isSourceActive() { - return this.bone.bone.active; - } - }; - - // spine-core/src/PhysicsConstraintData.ts - var PhysicsConstraintData = class extends ConstraintData { - /** The bone constrained by this physics constraint. */ - set bone(boneData) { - this._bone = boneData; - } - get bone() { - if (!this._bone) throw new Error("BoneData not set."); - else return this._bone; - } - _bone = null; - x = 0; - y = 0; - rotate = 0; - scaleX = 0; - shearX = 0; - limit = 0; - step = 0; - inertiaGlobal = false; - strengthGlobal = false; - dampingGlobal = false; - massGlobal = false; - windGlobal = false; - gravityGlobal = false; - mixGlobal = false; - constructor(name) { - super(name, new PhysicsConstraintPose()); - } - create(skeleton) { - return new PhysicsConstraint(this, skeleton); - } - }; - - // spine-core/src/polyfills.ts - (() => { - if (typeof Math.fround === "undefined") { - Math.fround = /* @__PURE__ */ ((array) => (x) => { - array[0] = x; - return array[0]; - })(new Float32Array(1)); - } - })(); - - // spine-core/src/SkeletonData.ts - var SkeletonData = class { - /** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */ - name = null; - /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ - bones = []; - // Ordered parents first. - /** The skeleton's slots in the setup pose draw order. */ - slots = []; - // Setup pose draw order. - skins = []; - /** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine. - * - * See {@link Skeleton#getAttachmentByName()}. - * May be null. */ - defaultSkin = null; - /** The skeleton's events. */ - events = []; - /** The skeleton's animations. */ - animations = []; - /** The skeleton's IK constraints. */ - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - constraints = []; - /** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */ - x = 0; - /** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */ - y = 0; - /** The width of the skeleton's axis aligned bounding box in the setup pose. */ - width = 0; - /** The height of the skeleton's axis aligned bounding box in the setup pose. */ - height = 0; - /** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default - * is 100. */ - referenceScale = 100; - /** The Spine version used to export the skeleton data, or null. */ - version = null; - /** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */ - hash = null; - // Nonessential - /** The dopesheet FPS in Spine. Available only when nonessential data was exported. */ - fps = 30; - /** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */ - imagesPath = null; - /** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */ - audioPath = null; - /** 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. - * @returns May be null. */ - findBone(boneName) { - if (!boneName) throw new Error("boneName cannot be null."); - const bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) - if (bones[i].name === boneName) return bones[i]; - return null; - } - /** 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. - * @returns May be null. */ - findSlot(slotName) { - if (!slotName) throw new Error("slotName cannot be null."); - const slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) - if (slots[i].name === slotName) return slots[i]; - return null; - } - /** 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. - * @returns May be null. */ - findSkin(skinName) { - if (!skinName) throw new Error("skinName cannot be null."); - const skins = this.skins; - for (let i = 0, n = skins.length; i < n; i++) - if (skins[i].name === skinName) return skins[i]; - return null; - } - /** 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. - * @returns May be null. */ - findEvent(eventDataName) { - if (!eventDataName) throw new Error("eventDataName cannot be null."); - const events = this.events; - for (let i = 0, n = events.length; i < n; i++) - if (events[i].name === eventDataName) return events[i]; - return null; - } - /** 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. - * @returns May be null. */ - findAnimation(animationName) { - if (!animationName) throw new Error("animationName cannot be null."); - const animations = this.animations; - for (let i = 0, n = animations.length; i < n; i++) - if (animations[i].name === animationName) return animations[i]; - return null; - } - // --- Constraints. - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - findConstraint(constraintName, type) { - if (!constraintName) throw new Error("constraintName cannot be null."); - if (type == null) throw new Error("type cannot be null."); - const constraints = this.constraints; - for (let i = 0, n = this.constraints.length; i < n; i++) { - const constraint = constraints[i]; - if (constraint instanceof type && constraint.name === constraintName) return constraint; - } - return null; - } - }; - - // spine-core/src/Skin.ts - var SkinEntry = class { - constructor(slotIndex = 0, name, attachment) { - this.slotIndex = slotIndex; - this.name = name; - this.attachment = attachment; - } - }; - var Skin = class { - /** The skin's name, which is unique across all skins in the skeleton. */ - name; - attachments = []; - bones = []; - // biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types - constraints = []; - /** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */ - color = new Color(0.99607843, 0.61960787, 0.30980393, 1); - // fe9e4fff - constructor(name) { - if (!name) throw new Error("name cannot be null."); - this.name = name; - } - /** Adds an attachment to the skin for the specified slot index and name. */ - setAttachment(slotIndex, name, attachment) { - if (!attachment) throw new Error("attachment cannot be null."); - const attachments = this.attachments; - if (slotIndex >= attachments.length) attachments.length = slotIndex + 1; - if (!attachments[slotIndex]) attachments[slotIndex] = {}; - attachments[slotIndex][name] = attachment; - } - /** Adds all attachments, bones, and constraints from the specified skin to this skin. */ - addSkin(skin) { - for (let i = 0; i < skin.bones.length; i++) { - const bone = skin.bones[i]; - let contained = false; - for (let ii = 0; ii < this.bones.length; ii++) { - if (this.bones[ii] === bone) { - contained = true; - break; - } - } - if (!contained) this.bones.push(bone); - } - for (let i = 0; i < skin.constraints.length; i++) { - const constraint = skin.constraints[i]; - let contained = false; - for (let ii = 0; ii < this.constraints.length; ii++) { - if (this.constraints[ii] === constraint) { - contained = true; - break; - } - } - if (!contained) this.constraints.push(constraint); - } - const attachments = skin.getAttachments(); - for (let i = 0; i < attachments.length; i++) { - const attachment = attachments[i]; - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } - } - /** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not - * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */ - copySkin(skin) { - for (let i = 0; i < skin.bones.length; i++) { - const bone = skin.bones[i]; - let contained = false; - for (let ii = 0; ii < this.bones.length; ii++) { - if (this.bones[ii] === bone) { - contained = true; - break; - } - } - if (!contained) this.bones.push(bone); - } - for (let i = 0; i < skin.constraints.length; i++) { - const constraint = skin.constraints[i]; - let contained = false; - for (let ii = 0; ii < this.constraints.length; ii++) { - if (this.constraints[ii] === constraint) { - contained = true; - break; - } - } - if (!contained) this.constraints.push(constraint); - } - const attachments = skin.getAttachments(); - for (let i = 0; i < attachments.length; i++) { - const attachment = attachments[i]; - if (!attachment.attachment) continue; - if (attachment.attachment instanceof MeshAttachment) { - attachment.attachment = attachment.attachment.newLinkedMesh(); - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } else { - attachment.attachment = attachment.attachment.copy(); - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } - } - } - /** Returns the attachment for the specified slot index and name, or null. */ - getAttachment(slotIndex, name) { - const dictionary = this.attachments[slotIndex]; - return dictionary ? dictionary[name] : null; - } - /** Removes the attachment in the skin for the specified slot index and name, if any. */ - removeAttachment(slotIndex, name) { - const dictionary = this.attachments[slotIndex]; - if (dictionary) delete dictionary[name]; - } - /** Returns all attachments in this skin. */ - getAttachments() { - const entries = []; - for (let i = 0; i < this.attachments.length; i++) { - const slotAttachments = this.attachments[i]; - if (slotAttachments) { - for (const name in slotAttachments) { - const attachment = slotAttachments[name]; - if (attachment) entries.push(new SkinEntry(i, name, attachment)); - } - } - } - return entries; - } - /** Returns all attachments in this skin for the specified slot index. */ - getAttachmentsForSlot(slotIndex, attachments) { - const slotAttachments = this.attachments[slotIndex]; - if (slotAttachments) { - for (const name in slotAttachments) { - const attachment = slotAttachments[name]; - if (attachment) attachments.push(new SkinEntry(slotIndex, name, attachment)); - } - } - } - /** Clears all attachments, bones, and constraints. */ - clear() { - this.attachments.length = 0; - this.bones.length = 0; - this.constraints.length = 0; - } - /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */ - attachAll(skeleton, oldSkin) { - let slotIndex = 0; - for (let i = 0; i < skeleton.slots.length; i++) { - const slot = skeleton.slots[i]; - const slotAttachment = slot.pose.getAttachment(); - if (slotAttachment && slotIndex < oldSkin.attachments.length) { - const dictionary = oldSkin.attachments[slotIndex]; - for (const key in dictionary) { - const skinAttachment = dictionary[key]; - if (slotAttachment === skinAttachment) { - const attachment = this.getAttachment(slotIndex, key); - if (attachment) slot.pose.setAttachment(attachment); - break; - } - } - } - slotIndex++; - } - } - }; - - // spine-core/src/SliderPose.ts - var SliderPose = class { - time = 0; - mix = 0; - set(pose) { - this.time = pose.time; - this.mix = pose.mix; - } - }; - - // spine-core/src/Slider.ts - var Slider = class _Slider extends Constraint { - static offsets = [0, 0, 0, 0, 0, 0]; - bone = null; - constructor(data, skeleton) { - super(data, new SliderPose(), new SliderPose()); - if (!skeleton) throw new Error("skeleton cannot be null."); - if (data.bone != null) this.bone = skeleton.bones[data.bone.index]; - } - copy(skeleton) { - var copy = new _Slider(this.data, skeleton); - copy.pose.set(this.pose); - return copy; - } - update(skeleton, physics) { - const p = this.applied; - if (p.mix === 0) return; - const data = this.data, animation = data.animation, bone = this.bone; - if (bone !== null) { - if (!bone.active) return; - if (data.local) bone.applied.validateLocalTransform(skeleton); - p.time = data.offset + (data.property.value(skeleton, bone.applied, data.local, _Slider.offsets) - data.property.offset) * data.scale; - if (data.loop) - p.time = animation.duration + p.time % animation.duration; - else - p.time = Math.max(0, p.time); - } - const bones = skeleton.bones; - const indices = animation.bones; - for (let i = 0, n = animation.bones.length; i < n; i++) - bones[indices[i]].applied.modifyLocal(skeleton); - animation.apply( - skeleton, - p.time, - p.time, - data.loop, - null, - p.mix, - data.additive ? 3 /* add */ : 2 /* replace */, - 0 /* in */, - true - ); - } - sort(skeleton) { - const bone = this.bone; - const data = this.data; - if (bone && data.local) skeleton.sortBone(bone); - skeleton._updateCache.push(this); - const bones = skeleton.bones; - const indices = data.animation.bones; - for (let i = 0, n = data.animation.bones.length; i < n; i++) { - const bone2 = bones[indices[i]]; - bone2.sorted = false; - skeleton.sortReset(bone2.children); - skeleton.constrained(bone2); - } - const timelines = data.animation.timelines; - const slots = skeleton.slots; - const constraints = skeleton.constraints; - const physics = skeleton.physics; - const physicsCount = skeleton.physics.length; - for (let i = 0, n = data.animation.timelines.length; i < n; i++) { - const t = timelines[i]; - if (isSlotTimeline(t)) - skeleton.constrained(slots[t.slotIndex]); - else if (t instanceof PhysicsConstraintTimeline) { - if (t.constraintIndex === -1) { - for (let ii = 0; ii < physicsCount; ii++) - skeleton.constrained(physics[ii]); - } else - skeleton.constrained(constraints[t.constraintIndex]); - } else if (isConstraintTimeline(t)) { - const constraintIndex = t.constraintIndex; - if (constraintIndex !== -1) skeleton.constrained(constraints[constraintIndex]); - } - } - } - }; - - // spine-core/src/SliderData.ts - var SliderData = class extends ConstraintData { - animation; - additive = false; - loop = false; - bone = null; - property; - scale = 0; - offset = 0; - local = false; - constructor(name) { - super(name, new SliderPose()); - } - create(skeleton) { - return new Slider(this, skeleton); - } - }; - - // spine-core/src/SlotData.ts - var SlotData = class extends PosedData { - /** The index of the slot in {@link Skeleton.getSlots()}. */ - index = 0; - /** The bone this slot belongs to. */ - boneData; - /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */ - attachmentName = null; - /** The blend mode for drawing the slot's attachment. */ - blendMode = 0 /* Normal */; - // Nonessential. - /** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */ - visible = true; - constructor(index, name, boneData) { - super(name, new SlotPose()); - if (index < 0) throw new Error("index must be >= 0."); - if (!boneData) throw new Error("boneData cannot be null."); - this.index = index; - this.boneData = boneData; - } - }; - var BlendMode = /* @__PURE__ */ ((BlendMode2) => { - BlendMode2[BlendMode2["Normal"] = 0] = "Normal"; - BlendMode2[BlendMode2["Additive"] = 1] = "Additive"; - BlendMode2[BlendMode2["Multiply"] = 2] = "Multiply"; - BlendMode2[BlendMode2["Screen"] = 3] = "Screen"; - return BlendMode2; - })(BlendMode || {}); - - // spine-core/src/TransformConstraintPose.ts - var TransformConstraintPose = class { - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. */ - mixRotate = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. */ - mixX = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. */ - mixY = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained scale X. */ - mixScaleX = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained scale Y. */ - mixScaleY = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained shear Y. */ - mixShearY = 0; - set(pose) { - this.mixRotate = pose.mixRotate; - this.mixX = pose.mixX; - this.mixY = pose.mixY; - this.mixScaleX = pose.mixScaleX; - this.mixScaleY = pose.mixScaleY; - this.mixShearY = pose.mixShearY; - } - }; - - // spine-core/src/TransformConstraint.ts - var TransformConstraint = class _TransformConstraint extends Constraint { - /** The bones that will be modified by this transform constraint. */ - bones; - /** The bone whose world transform will be copied to the constrained bones. */ - source; - constructor(data, skeleton) { - super(data, new TransformConstraintPose(), new TransformConstraintPose()); - if (!skeleton) throw new Error("skeleton cannot be null."); - this.bones = []; - for (const boneData of data.bones) - this.bones.push(skeleton.bones[boneData.index].constrained); - const source = skeleton.bones[data.source.index]; - if (source == null) throw new Error("source cannot be null."); - this.source = source; - } - copy(skeleton) { - var copy = new _TransformConstraint(this.data, skeleton); - copy.pose.set(this.pose); - return copy; - } - update(skeleton, physics) { - const p = this.applied; - if (p.mixRotate === 0 && p.mixX === 0 && p.mixY === 0 && p.mixScaleX === 0 && p.mixScaleY === 0 && p.mixShearY === 0) return; - const data = this.data; - const localSource = data.localSource, localTarget = data.localTarget, additive = data.additive, clamp = data.clamp; - const offsets = data.offsets; - const source = this.source.applied; - if (localSource) source.validateLocalTransform(skeleton); - const fromItems = data.properties; - const fn = data.properties.length, update = skeleton._update; - const bones = this.bones; - for (let i = 0, n = this.bones.length; i < n; i++) { - const bone = bones[i]; - if (localTarget) - bone.modifyLocal(skeleton); - else - bone.modifyWorld(update); - for (let f = 0; f < fn; f++) { - const from = fromItems[f]; - const value = from.value(skeleton, source, localSource, offsets) - from.offset; - const toItems = from.to; - for (let t = 0, tn = from.to.length; t < tn; t++) { - const to = toItems[t]; - if (to.mix(p) !== 0) { - let clamped = to.offset + value * to.scale; - if (clamp) { - if (to.offset < to.max) - clamped = MathUtils.clamp(clamped, to.offset, to.max); - else - clamped = MathUtils.clamp(clamped, to.max, to.offset); - } - to.apply(skeleton, p, bone, clamped, localTarget, additive); - } - } - } - } - } - sort(skeleton) { - if (!this.data.localSource) skeleton.sortBone(this.source); - const bones = this.bones; - const boneCount = this.bones.length; - const worldTarget = !this.data.localTarget; - if (worldTarget) { - for (let i = 0; i < boneCount; i++) - skeleton.sortBone(bones[i].bone); - } - skeleton._updateCache.push(this); - for (let i = 0; i < boneCount; i++) { - const bone = bones[i].bone; - skeleton.sortReset(bone.children); - skeleton.constrained(bone); - } - for (let i = 0; i < boneCount; i++) - bones[i].bone.sorted = worldTarget; - } - isSourceActive() { - return this.source.active; - } - }; - - // spine-core/src/TransformConstraintData.ts - var TransformConstraintData = class _TransformConstraintData extends ConstraintData { - static ROTATION = 0; - static X = 1; - static Y = 2; - static SCALEX = 3; - static SCALEY = 4; - static SHEARY = 5; - /** The bones that will be modified by this transform constraint. */ - bones = []; - /** The bone whose world transform will be copied to the constrained bones. */ - set source(source) { - this._source = source; - } - get source() { - if (!this._source) throw new Error("BoneData not set."); - else return this._source; - } - _source = null; - offsets = [0, 0, 0, 0, 0, 0]; - /** An offset added to the constrained bone X translation. */ - offsetX = 0; - /** An offset added to the constrained bone Y translation. */ - offsetY = 0; - /** Reads the source bone's local transform instead of its world transform. */ - localSource = false; - /** Sets the constrained bones' local transforms instead of their world transforms. */ - localTarget = false; - /** Adds the source bone transform to the constrained bones instead of setting it absolutely. */ - additive = false; - /** Prevents constrained bones from exceeding the ranged defined by {@link ToProperty.offset} and {@link ToProperty.max}. */ - clamp = false; - /** The mapping of transform properties to other transform properties. */ - properties = []; - constructor(name) { - super(name, new TransformConstraintPose()); - } - create(skeleton) { - return new TransformConstraint(this, skeleton); - } - /** An offset added to the constrained bone rotation. */ - getOffsetRotation() { - return this.offsets[_TransformConstraintData.ROTATION]; - } - setOffsetRotation(offsetRotation) { - this.offsets[_TransformConstraintData.ROTATION] = offsetRotation; - } - /** An offset added to the constrained bone X translation. */ - getOffsetX() { - return this.offsets[_TransformConstraintData.X]; - } - setOffsetX(offsetX) { - this.offsets[_TransformConstraintData.X] = offsetX; - } - /** An offset added to the constrained bone Y translation. */ - getOffsetY() { - return this.offsets[_TransformConstraintData.Y]; - } - setOffsetY(offsetY) { - this.offsets[_TransformConstraintData.Y] = offsetY; - } - /** An offset added to the constrained bone scaleX. */ - getOffsetScaleX() { - return this.offsets[_TransformConstraintData.SCALEX]; - } - setOffsetScaleX(offsetScaleX) { - this.offsets[_TransformConstraintData.SCALEX] = offsetScaleX; - } - /** An offset added to the constrained bone scaleY. */ - getOffsetScaleY() { - return this.offsets[_TransformConstraintData.SCALEY]; - } - setOffsetScaleY(offsetScaleY) { - this.offsets[_TransformConstraintData.SCALEY] = offsetScaleY; - } - /** An offset added to the constrained bone shearY. */ - getOffsetShearY() { - return this.offsets[_TransformConstraintData.SHEARY]; - } - setOffsetShearY(offsetShearY) { - this.offsets[_TransformConstraintData.SHEARY] = offsetShearY; - } - }; - var FromProperty = class { - /** The value of this property that corresponds to {@link ToProperty#offset}. */ - offset = 0; - /** Constrained properties. */ - to = []; - }; - var ToProperty = class { - /** The value of this property that corresponds to {@link FromProperty#offset}. */ - offset = 0; - /** The maximum value of this property when {@link TransformConstraintData#clamp clamped}. */ - max = 0; - /** The scale of the {@link FromProperty} value in relation to this property. */ - scale = 0; - }; - var FromRotate = class extends FromProperty { - value(skeleton, source, local, offsets) { - if (local) return source.rotation + offsets[TransformConstraintData.ROTATION]; - const sx = skeleton.scaleX, sy = skeleton.scaleY; - let value = Math.atan2(source.c / sy, source.a / sx) * MathUtils.radDeg + ((source.a * source.d - source.b * source.c) * sx * sy > 0 ? offsets[TransformConstraintData.ROTATION] : -offsets[TransformConstraintData.ROTATION]); - if (value < 0) value += 360; - return value; - } - }; - var ToRotate = class extends ToProperty { - mix(pose) { - return pose.mixRotate; - } - apply(skeleton, pose, bone, value, local, additive) { - if (local) - bone.rotation += (additive ? value : value - bone.rotation) * pose.mixRotate; - else { - const sx = skeleton.scaleX, sy = skeleton.scaleY, ix = 1 / sx, iy = 1 / sy; - const a = bone.a * ix, b = bone.b * ix, c = bone.c * iy, d = bone.d * iy; - value *= MathUtils.degRad; - if (!additive) value -= Math.atan2(c, a); - if (value > MathUtils.PI) - value -= MathUtils.PI2; - else if (value < -MathUtils.PI) - value += MathUtils.PI2; - value *= pose.mixRotate; - const cos = Math.cos(value), sin = Math.sin(value); - bone.a = (cos * a - sin * c) * sx; - bone.b = (cos * b - sin * d) * sx; - bone.c = (sin * a + cos * c) * sy; - bone.d = (sin * b + cos * d) * sy; - } - } - }; - var FromX = class extends FromProperty { - value(skeleton, source, local, offsets) { - return local ? source.x + offsets[TransformConstraintData.X] : (offsets[TransformConstraintData.X] * source.a + offsets[TransformConstraintData.Y] * source.b + source.worldX) / skeleton.scaleX; - } - }; - var ToX = class extends ToProperty { - mix(pose) { - return pose.mixX; - } - apply(skeleton, pose, bone, value, local, additive) { - if (local) - bone.x += (additive ? value : value - bone.x) * pose.mixX; - else { - if (!additive) value -= bone.worldX / skeleton.scaleX; - bone.worldX += value * pose.mixX * skeleton.scaleX; - } - } - }; - var FromY = class extends FromProperty { - value(skeleton, source, local, offsets) { - return local ? source.y + offsets[TransformConstraintData.Y] : (offsets[TransformConstraintData.X] * source.c + offsets[TransformConstraintData.Y] * source.d + source.worldY) / skeleton.scaleY; - } - }; - var ToY = class extends ToProperty { - mix(pose) { - return pose.mixY; - } - apply(skeleton, pose, bone, value, local, additive) { - if (local) - bone.y += (additive ? value : value - bone.y) * pose.mixY; - else { - if (!additive) value -= bone.worldY / skeleton.scaleY; - bone.worldY += value * pose.mixY * skeleton.scaleY; - } - } - }; - var FromScaleX = class extends FromProperty { - value(skeleton, source, local, offsets) { - if (local) return source.scaleX + offsets[TransformConstraintData.SCALEX]; - const a = source.a / skeleton.scaleX, c = source.c / skeleton.scaleY; - return Math.sqrt(a * a + c * c) + offsets[TransformConstraintData.SCALEX]; - } - }; - var ToScaleX = class extends ToProperty { - mix(pose) { - return pose.mixScaleX; - } - apply(skeleton, pose, bone, value, local, additive) { - if (local) { - if (additive) - bone.scaleX *= 1 + (value - 1) * pose.mixScaleX; - else if (bone.scaleX !== 0) - bone.scaleX += (value - bone.scaleX) * pose.mixScaleX; - } else if (additive) { - const s = 1 + (value - 1) * pose.mixScaleX; - bone.a *= s; - bone.c *= s; - } else { - let a = bone.a / skeleton.scaleX, c = bone.c / skeleton.scaleY, s = Math.sqrt(a * a + c * c); - if (s !== 0) { - s = 1 + (value - s) * pose.mixScaleX / s; - bone.a *= s; - bone.c *= s; - } - } - } - }; - var FromScaleY = class extends FromProperty { - value(skeleton, source, local, offsets) { - if (local) return source.scaleY + offsets[TransformConstraintData.SCALEY]; - const b = source.b / skeleton.scaleX, d = source.d / skeleton.scaleY; - return Math.sqrt(b * b + d * d) + offsets[TransformConstraintData.SCALEY]; - } - }; - var ToScaleY = class extends ToProperty { - mix(pose) { - return pose.mixScaleY; - } - apply(skeleton, pose, bone, value, local, additive) { - if (local) { - if (additive) - bone.scaleY *= 1 + (value - 1) * pose.mixScaleY; - else if (bone.scaleY !== 0) - bone.scaleY += (value - bone.scaleY) * pose.mixScaleY; - } else if (additive) { - const s = 1 + (value - 1) * pose.mixScaleY; - bone.b *= s; - bone.d *= s; - } else { - let b = bone.b / skeleton.scaleX, d = bone.d / skeleton.scaleY, s = Math.sqrt(b * b + d * d); - if (s !== 0) { - s = 1 + (value - s) * pose.mixScaleY / s; - bone.b *= s; - bone.d *= s; - } - } - } - }; - var FromShearY = class extends FromProperty { - value(skeleton, source, local, offsets) { - if (local) return source.shearY + offsets[TransformConstraintData.SHEARY]; - const ix = 1 / skeleton.scaleX, iy = 1 / skeleton.scaleY; - return (Math.atan2(source.d * iy, source.b * ix) - Math.atan2(source.c * iy, source.a * ix)) * MathUtils.radDeg - 90 + offsets[TransformConstraintData.SHEARY]; - } - }; - var ToShearY = class extends ToProperty { - mix(pose) { - return pose.mixShearY; - } - apply(skeleton, pose, bone, value, local, additive) { - if (local) { - if (!additive) value -= bone.shearY; - bone.shearY += value * pose.mixShearY; - } else { - const sx = skeleton.scaleX, sy = skeleton.scaleY, b = bone.b / sx, d = bone.d / sy, by = Math.atan2(d, b); - value = (value + 90) * MathUtils.degRad; - if (additive) - value -= MathUtils.PI / 2; - else { - value -= by - Math.atan2(bone.c / sx, bone.a / sy); - if (value > MathUtils.PI) - value -= MathUtils.PI2; - else if (value < -MathUtils.PI) - value += MathUtils.PI2; - } - value = by + value * pose.mixShearY; - const s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(value) * s * sy; - bone.d = Math.sin(value) * s * sx; - } - } - }; - - // spine-core/src/SkeletonBinary.ts - var SkeletonBinary = class { - /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at - * runtime than were used in Spine. - * - * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */ - scale = 1; - attachmentLoader; - linkedMeshes = []; - constructor(attachmentLoader) { - this.attachmentLoader = attachmentLoader; - } - readSkeletonData(binary) { - const scale = this.scale; - const skeletonData = new SkeletonData(); - skeletonData.name = ""; - const input = new BinaryInput(binary); - const lowHash = input.readInt32(); - const highHash = input.readInt32(); - skeletonData.hash = highHash === 0 && lowHash === 0 ? null : highHash.toString(16) + lowHash.toString(16); - skeletonData.version = input.readString(); - skeletonData.x = input.readFloat(); - skeletonData.y = input.readFloat(); - skeletonData.width = input.readFloat(); - skeletonData.height = input.readFloat(); - skeletonData.referenceScale = input.readFloat() * scale; - const nonessential = input.readBoolean(); - if (nonessential) { - skeletonData.fps = input.readFloat(); - skeletonData.imagesPath = input.readString(); - skeletonData.audioPath = input.readString(); - } - let n = 0; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - const str = input.readString(); - if (!str) throw new Error("String in string table must not be null."); - input.strings.push(str); - } - const bones = skeletonData.bones; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - const name = input.readString(); - if (!name) throw new Error("Bone name must not be null."); - const parent = i === 0 ? null : bones[input.readInt(true)]; - const data = new BoneData(i, name, parent); - const setup = data.setup; - setup.rotation = input.readFloat(); - setup.x = input.readFloat() * scale; - setup.y = input.readFloat() * scale; - setup.scaleX = input.readFloat(); - setup.scaleY = input.readFloat(); - setup.shearX = input.readFloat(); - setup.shearY = input.readFloat(); - setup.inherit = input.readByte(); - data.length = input.readFloat() * scale; - data.skinRequired = input.readBoolean(); - if (nonessential) { - Color.rgba8888ToColor(data.color, input.readInt32()); - data.icon = input.readString() ?? void 0; - data.visible = input.readBoolean(); - } - bones.push(data); - } - n = input.readInt(true); - for (let i = 0; i < n; i++) { - const slotName = input.readString(); - if (!slotName) throw new Error("Slot name must not be null."); - const boneData = bones[input.readInt(true)]; - const data = new SlotData(i, slotName, boneData); - Color.rgba8888ToColor(data.setup.color, input.readInt32()); - const darkColor = input.readInt32(); - if (darkColor !== -1) Color.rgb888ToColor(data.setup.darkColor = new Color(), darkColor); - data.attachmentName = input.readStringRef(); - data.blendMode = input.readInt(true); - if (nonessential) data.visible = input.readBoolean(); - skeletonData.slots.push(data); - } - const constraints = skeletonData.constraints; - const constraintCount = input.readInt(true); - for (let i = 0; i < constraintCount; i++) { - const name = input.readString(); - if (!name) throw new Error("Constraint data name must not be null."); - let nn; - switch (input.readByte()) { - case CONSTRAINT_IK: { - const data = new IkConstraintData(name); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(bones[input.readInt(true)]); - data.target = bones[input.readInt(true)]; - const flags = input.readByte(); - data.skinRequired = (flags & 1) !== 0; - data.uniform = (flags & 2) !== 0; - const setup = data.setup; - setup.bendDirection = (flags & 4) !== 0 ? -1 : 1; - setup.compress = (flags & 8) !== 0; - setup.stretch = (flags & 16) !== 0; - if ((flags & 32) !== 0) setup.mix = (flags & 64) !== 0 ? input.readFloat() : 1; - if ((flags & 128) !== 0) setup.softness = input.readFloat() * scale; - constraints.push(data); - break; - } - case CONSTRAINT_TRANSFORM: { - const data = new TransformConstraintData(name); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(bones[input.readInt(true)]); - data.source = bones[input.readInt(true)]; - let flags = input.readUnsignedByte(); - data.skinRequired = (flags & 1) !== 0; - data.localSource = (flags & 2) !== 0; - data.localTarget = (flags & 4) !== 0; - data.additive = (flags & 8) !== 0; - data.clamp = (flags & 16) !== 0; - nn = flags >> 5; - for (let ii = 0, tn; ii < nn; ii++) { - let fromScale = 1; - let from; - switch (input.readByte()) { - case 0: - from = new FromRotate(); - break; - case 1: { - fromScale = scale; - from = new FromX(); - break; - } - case 2: { - fromScale = scale; - from = new FromY(); - break; - } - case 3: - from = new FromScaleX(); - break; - case 4: - from = new FromScaleY(); - break; - case 5: - from = new FromShearY(); - break; - default: - from = null; - } - if (!from) continue; - from.offset = input.readFloat() * fromScale; - tn = input.readByte(); - for (let t = 0; t < tn; t++) { - let toScale = 1; - let to; - switch (input.readByte()) { - case 0: - to = new ToRotate(); - break; - case 1: { - toScale = scale; - to = new ToX(); - break; - } - case 2: { - toScale = scale; - to = new ToY(); - break; - } - case 3: - to = new ToScaleX(); - break; - case 4: - to = new ToScaleY(); - break; - case 5: - to = new ToShearY(); - break; - default: - to = null; - } - if (!to) continue; - to.offset = input.readFloat() * toScale; - to.max = input.readFloat() * toScale; - to.scale = input.readFloat() * toScale / fromScale; - from.to[t] = to; - } - data.properties[ii] = from; - } - flags = input.readByte(); - if ((flags & 1) !== 0) data.offsets[TransformConstraintData.ROTATION] = input.readFloat(); - if ((flags & 2) !== 0) data.offsets[TransformConstraintData.X] = input.readFloat() * scale; - if ((flags & 4) !== 0) data.offsets[TransformConstraintData.Y] = input.readFloat() * scale; - if ((flags & 8) !== 0) data.offsets[TransformConstraintData.SCALEX] = input.readFloat(); - if ((flags & 16) !== 0) data.offsets[TransformConstraintData.SCALEY] = input.readFloat(); - if ((flags & 32) !== 0) data.offsets[TransformConstraintData.SHEARY] = input.readFloat(); - flags = input.readByte(); - const setup = data.setup; - if ((flags & 1) !== 0) setup.mixRotate = input.readFloat(); - if ((flags & 2) !== 0) setup.mixX = input.readFloat(); - if ((flags & 4) !== 0) setup.mixY = input.readFloat(); - if ((flags & 8) !== 0) setup.mixScaleX = input.readFloat(); - if ((flags & 16) !== 0) setup.mixScaleY = input.readFloat(); - if ((flags & 32) !== 0) setup.mixShearY = input.readFloat(); - constraints.push(data); - break; - } - case CONSTRAINT_PATH: { - const data = new PathConstraintData(name); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(bones[input.readInt(true)]); - data.slot = skeletonData.slots[input.readInt(true)]; - const flags = input.readByte(); - data.skinRequired = (flags & 1) !== 0; - data.positionMode = flags >> 1 & 2; - data.spacingMode = flags >> 2 & 3; - data.rotateMode = flags >> 4 & 3; - if ((flags & 128) !== 0) data.offsetRotation = input.readFloat(); - const setup = data.setup; - setup.position = input.readFloat(); - if (data.positionMode === 0 /* Fixed */) setup.position *= scale; - setup.spacing = input.readFloat(); - if (data.spacingMode === 0 /* Length */ || data.spacingMode === 1 /* Fixed */) setup.spacing *= scale; - setup.mixRotate = input.readFloat(); - setup.mixX = input.readFloat(); - setup.mixY = input.readFloat(); - constraints.push(data); - break; - } - case CONSTRAINT_PHYSICS: { - const data = new PhysicsConstraintData(name); - data.bone = bones[input.readInt(true)]; - let flags = input.readByte(); - data.skinRequired = (flags & 1) !== 0; - if ((flags & 2) !== 0) data.x = input.readFloat(); - if ((flags & 4) !== 0) data.y = input.readFloat(); - if ((flags & 8) !== 0) data.rotate = input.readFloat(); - if ((flags & 16) !== 0) data.scaleX = input.readFloat(); - if ((flags & 32) !== 0) data.shearX = input.readFloat(); - data.limit = ((flags & 64) !== 0 ? input.readFloat() : 5e3) * scale; - data.step = 1 / input.readUnsignedByte(); - const setup = data.setup; - setup.inertia = input.readFloat(); - setup.strength = input.readFloat(); - setup.damping = input.readFloat(); - setup.massInverse = (flags & 128) !== 0 ? input.readFloat() : 1; - setup.wind = input.readFloat(); - setup.gravity = input.readFloat(); - flags = input.readByte(); - if ((flags & 1) !== 0) data.inertiaGlobal = true; - if ((flags & 2) !== 0) data.strengthGlobal = true; - if ((flags & 4) !== 0) data.dampingGlobal = true; - if ((flags & 8) !== 0) data.massGlobal = true; - if ((flags & 16) !== 0) data.windGlobal = true; - if ((flags & 32) !== 0) data.gravityGlobal = true; - if ((flags & 64) !== 0) data.mixGlobal = true; - setup.mix = (flags & 128) !== 0 ? input.readFloat() : 1; - constraints.push(data); - break; - } - case CONSTRAINT_SLIDER: { - const data = new SliderData(name); - const flags = input.readByte(); - data.skinRequired = (flags & 1) !== 0; - data.loop = (flags & 2) !== 0; - data.additive = (flags & 4) !== 0; - if ((flags & 8) !== 0) data.setup.time = input.readFloat(); - if ((flags & 16) !== 0) data.setup.mix = (flags & 32) !== 0 ? input.readFloat() : 1; - if ((flags & 64) !== 0) { - data.local = (flags & 128) !== 0; - data.bone = bones[input.readInt(true)]; - const offset = input.readFloat(); - let propertyScale = 1; - switch (input.readByte()) { - case 0: - data.property = new FromRotate(); - break; - case 1: { - propertyScale = scale; - data.property = new FromX(); - break; - } - case 2: { - propertyScale = scale; - data.property = new FromY(); - break; - } - case 3: - data.property = new FromScaleX(); - break; - case 4: - data.property = new FromScaleY(); - break; - case 5: - data.property = new FromShearY(); - break; - default: - continue; - } - ; - data.property.offset = offset * propertyScale; - data.offset = input.readFloat(); - data.scale = input.readFloat() / propertyScale; - } - constraints.push(data); - break; - } - } - } - const defaultSkin = this.readSkin(input, skeletonData, true, nonessential); - if (defaultSkin) { - skeletonData.defaultSkin = defaultSkin; - skeletonData.skins.push(defaultSkin); - } - { - let i = skeletonData.skins.length; - Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true)); - for (; i < n; i++) { - const skin = this.readSkin(input, skeletonData, false, nonessential); - if (!skin) throw new Error("readSkin() should not have returned null."); - skeletonData.skins[i] = skin; - } - } - n = this.linkedMeshes.length; - for (let i = 0; i < n; i++) { - const linkedMesh = this.linkedMeshes[i]; - const skin = skeletonData.skins[linkedMesh.skinIndex]; - if (!linkedMesh.parent) throw new Error("Linked mesh parent must not be null"); - const parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`); - linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh; - linkedMesh.mesh.setParentMesh(parent); - if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion(); - } - this.linkedMeshes.length = 0; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - const eventName = input.readString(); - if (!eventName) throw new Error("Event data name must not be null"); - const data = new EventData(eventName); - data.intValue = input.readInt(false); - data.floatValue = input.readFloat(); - data.stringValue = input.readString(); - data.audioPath = input.readString(); - if (data.audioPath) { - data.volume = input.readFloat(); - data.balance = input.readFloat(); - } - skeletonData.events.push(data); - } - const animations = skeletonData.animations; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - const animationName = input.readString(); - if (!animationName) throw new Error("Animation name must not be null."); - animations.push(this.readAnimation(input, animationName, skeletonData)); - } - for (let i = 0; i < constraintCount; i++) { - const constraint = constraints[i]; - if (constraint instanceof SliderData) constraint.animation = animations[input.readInt(true)]; - } - return skeletonData; - } - readSkin(input, skeletonData, defaultSkin, nonessential) { - let skin = null; - let slotCount = 0; - if (defaultSkin) { - slotCount = input.readInt(true); - if (slotCount === 0) return null; - skin = new Skin("default"); - } else { - const skinName = input.readString(); - if (!skinName) throw new Error("Skin name must not be null."); - skin = new Skin(skinName); - if (nonessential) Color.rgba8888ToColor(skin.color, input.readInt32()); - let n = input.readInt(true); - let from = skeletonData.bones, to = skin.bones; - for (let i = 0; i < n; i++) - to[i] = from[input.readInt(true)]; - n = input.readInt(true); - from = skeletonData.constraints; - to = skin.constraints; - for (let i = 0; i < n; i++) - to[i] = from[input.readInt(true)]; - slotCount = input.readInt(true); - } - for (let i = 0; i < slotCount; i++) { - const slotIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const name = input.readStringRef(); - if (!name) - throw new Error("Attachment name must not be null"); - const attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential); - if (attachment) skin.setAttachment(slotIndex, name, attachment); - } - } - return skin; - } - readAttachment(input, skeletonData, skin, slotIndex, attachmentName, nonessential) { - const scale = this.scale; - const flags = input.readByte(); - const name = (flags & 8) !== 0 ? input.readStringRef() : attachmentName; - if (!name) throw new Error("Attachment name must not be null"); - switch (flags & 7) { - // BUG? - case 0 /* Region */: { - let path = (flags & 16) !== 0 ? input.readStringRef() : null; - const color = (flags & 32) !== 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) !== 0 ? this.readSequence(input) : null; - const rotation = (flags & 128) !== 0 ? input.readFloat() : 0; - const x = input.readFloat(); - const y = input.readFloat(); - const scaleX = input.readFloat(); - const scaleY = input.readFloat(); - const width = input.readFloat(); - const height = input.readFloat(); - if (!path) path = name; - const region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence); - if (!region) return null; - region.path = path; - region.x = x * scale; - region.y = y * scale; - region.scaleX = scaleX; - region.scaleY = scaleY; - region.rotation = rotation; - region.width = width * scale; - region.height = height * scale; - Color.rgba8888ToColor(region.color, color); - region.sequence = sequence; - if (region.region != null) region.updateRegion(); - return region; - } - case 1 /* BoundingBox */: { - const vertices = this.readVertices(input, (flags & 16) !== 0); - const color = nonessential ? input.readInt32() : 0; - const box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (!box) return null; - box.worldVerticesLength = vertices.length; - box.vertices = vertices.vertices; - box.bones = vertices.bones; - if (nonessential) Color.rgba8888ToColor(box.color, color); - return box; - } - case 2 /* Mesh */: { - let path = (flags & 16) !== 0 ? input.readStringRef() : name; - const color = (flags & 32) !== 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) !== 0 ? this.readSequence(input) : null; - const hullLength = input.readInt(true); - const vertices = this.readVertices(input, (flags & 128) !== 0); - const uvs = this.readFloatArray(input, vertices.length, 1); - const triangles = this.readShortArray(input, (vertices.length - hullLength - 2) * 3); - let edges = []; - let width = 0, height = 0; - if (nonessential) { - edges = this.readShortArray(input, input.readInt(true)); - width = input.readFloat(); - height = input.readFloat(); - } - if (!path) path = name; - const mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) return null; - mesh.path = path; - Color.rgba8888ToColor(mesh.color, color); - mesh.bones = vertices.bones; - mesh.vertices = vertices.vertices; - mesh.worldVerticesLength = vertices.length; - mesh.triangles = triangles; - mesh.regionUVs = uvs; - if (mesh.region != null) mesh.updateRegion(); - mesh.hullLength = hullLength << 1; - mesh.sequence = sequence; - if (nonessential) { - mesh.edges = edges; - mesh.width = width * scale; - mesh.height = height * scale; - } - return mesh; - } - case 3 /* LinkedMesh */: { - const path = (flags & 16) !== 0 ? input.readStringRef() : name; - if (path == null) throw new Error("Path of linked mesh must not be null"); - const color = (flags & 32) !== 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) !== 0 ? this.readSequence(input) : null; - const inheritTimelines = (flags & 128) !== 0; - const skinIndex = input.readInt(true); - const parent = input.readStringRef(); - let width = 0, height = 0; - if (nonessential) { - width = input.readFloat(); - height = input.readFloat(); - } - const mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) return null; - mesh.path = path; - Color.rgba8888ToColor(mesh.color, color); - mesh.sequence = sequence; - if (nonessential) { - mesh.width = width * scale; - mesh.height = height * scale; - } - this.linkedMeshes.push(new LinkedMesh(mesh, skinIndex, slotIndex, parent, inheritTimelines)); - return mesh; - } - case 4 /* Path */: { - const closed = (flags & 16) !== 0; - const constantSpeed = (flags & 32) !== 0; - const vertices = this.readVertices(input, (flags & 64) !== 0); - const lengths = Utils.newArray(vertices.length / 6, 0); - for (let i = 0, n = lengths.length; i < n; i++) - lengths[i] = input.readFloat() * scale; - const color = nonessential ? input.readInt32() : 0; - const path = this.attachmentLoader.newPathAttachment(skin, name); - if (!path) return null; - path.closed = closed; - path.constantSpeed = constantSpeed; - path.worldVerticesLength = vertices.length; - path.vertices = vertices.vertices; - path.bones = vertices.bones; - path.lengths = lengths; - if (nonessential) Color.rgba8888ToColor(path.color, color); - return path; - } - case 5 /* Point */: { - const rotation = input.readFloat(); - const x = input.readFloat(); - const y = input.readFloat(); - const color = nonessential ? input.readInt32() : 0; - const point = this.attachmentLoader.newPointAttachment(skin, name); - if (!point) return null; - point.x = x * scale; - point.y = y * scale; - point.rotation = rotation; - if (nonessential) Color.rgba8888ToColor(point.color, color); - return point; - } - case 6 /* Clipping */: { - const endSlotIndex = input.readInt(true); - const vertices = this.readVertices(input, (flags & 16) !== 0); - const color = nonessential ? input.readInt32() : 0; - const clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (!clip) return null; - clip.endSlot = skeletonData.slots[endSlotIndex]; - clip.worldVerticesLength = vertices.length; - clip.vertices = vertices.vertices; - clip.bones = vertices.bones; - if (nonessential) Color.rgba8888ToColor(clip.color, color); - return clip; - } - } - } - readSequence(input) { - const sequence = new Sequence(input.readInt(true)); - sequence.start = input.readInt(true); - sequence.digits = input.readInt(true); - sequence.setupIndex = input.readInt(true); - return sequence; - } - readVertices(input, weighted) { - const scale = this.scale; - const vertexCount = input.readInt(true); - const length = vertexCount << 1; - if (!weighted) - return new Vertices(null, this.readFloatArray(input, length, scale), length); - const weights = []; - const bonesArray = []; - for (let i = 0; i < vertexCount; i++) { - const boneCount = input.readInt(true); - bonesArray.push(boneCount); - for (let ii = 0; ii < boneCount; ii++) { - bonesArray.push(input.readInt(true)); - weights.push(input.readFloat() * scale); - weights.push(input.readFloat() * scale); - weights.push(input.readFloat()); - } - } - return new Vertices(bonesArray, Utils.toFloatArray(weights), length); - } - readFloatArray(input, n, scale) { - const array = []; - if (scale === 1) { - for (let i = 0; i < n; i++) - array[i] = input.readFloat(); - } else { - for (let i = 0; i < n; i++) - array[i] = input.readFloat() * scale; - } - return array; - } - readShortArray(input, n) { - const array = []; - for (let i = 0; i < n; i++) - array[i] = input.readInt(true); - return array; - } - readAnimation(input, name, skeletonData) { - input.readInt(true); - const timelines = []; - const scale = this.scale; - for (let i = 0, n = input.readInt(true); i < n; i++) { - const slotIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const timelineType = input.readByte(); - const frameCount = input.readInt(true); - const frameLast = frameCount - 1; - switch (timelineType) { - case SLOT_ATTACHMENT: { - const timeline = new AttachmentTimeline(frameCount, slotIndex); - for (let frame = 0; frame < frameCount; frame++) - timeline.setFrame(frame, input.readFloat(), input.readStringRef()); - timelines.push(timeline); - break; - } - case SLOT_RGBA: { - const bezierCount = input.readInt(true); - const timeline = new RGBATimeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let a = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, a); - if (frame === frameLast) break; - const time2 = input.readFloat(); - const r2 = input.readUnsignedByte() / 255; - const g2 = input.readUnsignedByte() / 255; - const b2 = input.readUnsignedByte() / 255; - const a2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1); - } - time = time2; - r = r2; - g = g2; - b = b2; - a = a2; - } - timelines.push(timeline); - break; - } - case SLOT_RGB: { - const bezierCount = input.readInt(true); - const timeline = new RGBTimeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b); - if (frame === frameLast) break; - const time2 = input.readFloat(); - const r2 = input.readUnsignedByte() / 255; - const g2 = input.readUnsignedByte() / 255; - const b2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1); - } - time = time2; - r = r2; - g = g2; - b = b2; - } - timelines.push(timeline); - break; - } - case SLOT_RGBA2: { - const bezierCount = input.readInt(true); - const timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let a = input.readUnsignedByte() / 255; - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, a, r2, g2, b2); - if (frame === frameLast) break; - const time2 = input.readFloat(); - const nr = input.readUnsignedByte() / 255; - const ng = input.readUnsignedByte() / 255; - const nb = input.readUnsignedByte() / 255; - const na = input.readUnsignedByte() / 255; - const nr2 = input.readUnsignedByte() / 255; - const ng2 = input.readUnsignedByte() / 255; - const nb2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1); - setBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1); - } - time = time2; - r = nr; - g = ng; - b = nb; - a = na; - r2 = nr2; - g2 = ng2; - b2 = nb2; - } - timelines.push(timeline); - break; - } - case SLOT_RGB2: { - const bezierCount = input.readInt(true); - const timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, r2, g2, b2); - if (frame === frameLast) break; - const time2 = input.readFloat(); - const nr = input.readUnsignedByte() / 255; - const ng = input.readUnsignedByte() / 255; - const nb = input.readUnsignedByte() / 255; - const nr2 = input.readUnsignedByte() / 255; - const ng2 = input.readUnsignedByte() / 255; - const nb2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1); - } - time = time2; - r = nr; - g = ng; - b = nb; - r2 = nr2; - g2 = ng2; - b2 = nb2; - } - timelines.push(timeline); - break; - } - case SLOT_ALPHA: { - const timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex); - let time = input.readFloat(), a = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, a); - if (frame === frameLast) break; - const time2 = input.readFloat(); - const a2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1); - } - time = time2; - a = a2; - } - timelines.push(timeline); - } - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const boneIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true); - if (type === BONE_INHERIT) { - const timeline = new InheritTimeline(frameCount, boneIndex); - for (let frame = 0; frame < frameCount; frame++) { - timeline.setFrame(frame, input.readFloat(), input.readByte()); - } - timelines.push(timeline); - continue; - } - const bezierCount = input.readInt(true); - switch (type) { - case BONE_ROTATE: - readTimeline(input, timelines, new RotateTimeline(frameCount, bezierCount, boneIndex), 1); - break; - case BONE_TRANSLATE: - readTimeline(input, timelines, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale); - break; - case BONE_TRANSLATEX: - readTimeline(input, timelines, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale); - break; - case BONE_TRANSLATEY: - readTimeline(input, timelines, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale); - break; - case BONE_SCALE: - readTimeline(input, timelines, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1); - break; - case BONE_SCALEX: - readTimeline(input, timelines, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1); - break; - case BONE_SCALEY: - readTimeline(input, timelines, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1); - break; - case BONE_SHEAR: - readTimeline(input, timelines, new ShearTimeline(frameCount, bezierCount, boneIndex), 1); - break; - case BONE_SHEARX: - readTimeline(input, timelines, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1); - break; - case BONE_SHEARY: - readTimeline(input, timelines, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1); - break; - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1; - const timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index); - let flags = input.readByte(); - let time = input.readFloat(), mix = (flags & 1) !== 0 ? (flags & 2) !== 0 ? input.readFloat() : 1 : 0; - let softness = (flags & 4) !== 0 ? input.readFloat() * scale : 0; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mix, softness, (flags & 8) !== 0 ? 1 : -1, (flags & 16) !== 0, (flags & 32) !== 0); - if (frame === frameLast) break; - flags = input.readByte(); - const time2 = input.readFloat(), mix2 = (flags & 1) !== 0 ? (flags & 2) !== 0 ? input.readFloat() : 1 : 0; - const softness2 = (flags & 4) !== 0 ? input.readFloat() * scale : 0; - if ((flags & 64) !== 0) { - timeline.setStepped(frame); - } else if ((flags & 128) !== 0) { - setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale); - } - time = time2; - mix = mix2; - softness = softness2; - } - timelines.push(timeline); - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1; - const timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index); - let time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(), mixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat(); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); - if (frame === frameLast) break; - const time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(), mixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - mixScaleX = mixScaleX2; - mixScaleY = mixScaleY2; - mixShearY = mixShearY2; - } - timelines.push(timeline); - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const index = input.readInt(true); - const data = skeletonData.constraints[index]; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true); - switch (type) { - case PATH_POSITION: - readTimeline( - input, - timelines, - new PathConstraintPositionTimeline(frameCount, bezierCount, index), - data.positionMode === 0 /* Fixed */ ? scale : 1 - ); - break; - case PATH_SPACING: - readTimeline( - input, - timelines, - new PathConstraintSpacingTimeline(frameCount, bezierCount, index), - data.spacingMode === 0 /* Length */ || data.spacingMode === 1 /* Fixed */ ? scale : 1 - ); - break; - case PATH_MIX: { - const timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index); - let time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(); - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY); - if (frame === frameLast) break; - const time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - } - timelines.push(timeline); - } - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const index = input.readInt(true) - 1; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true); - if (type === PHYSICS_RESET) { - const timeline = new PhysicsConstraintResetTimeline(frameCount, index); - for (let frame = 0; frame < frameCount; frame++) - timeline.setFrame(frame, input.readFloat()); - timelines.push(timeline); - continue; - } - const bezierCount = input.readInt(true); - switch (type) { - case PHYSICS_INERTIA: - readTimeline(input, timelines, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1); - break; - case PHYSICS_STRENGTH: - readTimeline(input, timelines, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1); - break; - case PHYSICS_DAMPING: - readTimeline(input, timelines, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1); - break; - case PHYSICS_MASS: - readTimeline(input, timelines, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1); - break; - case PHYSICS_WIND: - readTimeline(input, timelines, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1); - break; - case PHYSICS_GRAVITY: - readTimeline(input, timelines, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1); - break; - case PHYSICS_MIX: - readTimeline(input, timelines, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1); - break; - default: - throw new Error("Unknown physics timeline type."); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const index = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true); - switch (type) { - case SLIDER_TIME: - readTimeline(input, timelines, new SliderTimeline(frameCount, bezierCount, index), 1); - break; - case SLIDER_MIX: - readTimeline(input, timelines, new SliderMixTimeline(frameCount, bezierCount, index), 1); - break; - default: - throw new Error(`Uknown slider type: ${type}`); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const skin = skeletonData.skins[input.readInt(true)]; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const slotIndex = input.readInt(true); - for (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) { - const attachmentName = input.readStringRef(); - if (!attachmentName) throw new Error("attachmentName must not be null."); - const attachment = skin.getAttachment(slotIndex, attachmentName); - const timelineType = input.readByte(); - const frameCount = input.readInt(true); - const frameLast = frameCount - 1; - switch (timelineType) { - case ATTACHMENT_DEFORM: { - const vertexAttachment = attachment; - const weighted = vertexAttachment.bones; - const vertices = vertexAttachment.vertices; - const deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - const bezierCount = input.readInt(true); - const timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment); - let time = input.readFloat(); - for (let frame = 0, bezier = 0; ; frame++) { - let deform; - let end = input.readInt(true); - if (end === 0) - deform = weighted ? Utils.newFloatArray(deformLength) : vertices; - else { - deform = Utils.newFloatArray(deformLength); - const start = input.readInt(true); - end += start; - if (scale === 1) { - for (let v = start; v < end; v++) - deform[v] = input.readFloat(); - } else { - for (let v = start; v < end; v++) - deform[v] = input.readFloat() * scale; - } - if (!weighted) { - for (let v = 0, vn = deform.length; v < vn; v++) - deform[v] += vertices[v]; - } - } - timeline.setFrame(frame, time, deform); - if (frame === frameLast) break; - const time2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1); - } - time = time2; - } - timelines.push(timeline); - break; - } - case ATTACHMENT_SEQUENCE: { - const timeline = new SequenceTimeline(frameCount, slotIndex, attachment); - for (let frame = 0; frame < frameCount; frame++) { - const time = input.readFloat(); - const modeAndIndex = input.readInt32(); - timeline.setFrame( - frame, - time, - SequenceModeValues[modeAndIndex & 15], - modeAndIndex >> 4, - input.readFloat() - ); - } - timelines.push(timeline); - break; - } - } - } - } - } - const drawOrderCount = input.readInt(true); - if (drawOrderCount > 0) { - const timeline = new DrawOrderTimeline(drawOrderCount); - const slotCount = skeletonData.slots.length; - for (let i = 0; i < drawOrderCount; i++) { - const time = input.readFloat(); - const offsetCount = input.readInt(true); - const drawOrder = Utils.newArray(slotCount, 0); - for (let ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - const unchanged = Utils.newArray(slotCount - offsetCount, 0); - let originalIndex = 0, unchangedIndex = 0; - for (let ii = 0; ii < offsetCount; ii++) { - const slotIndex = input.readInt(true); - while (originalIndex !== slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + input.readInt(true)] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (let ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] === -1) drawOrder[ii] = unchanged[--unchangedIndex]; - timeline.setFrame(i, time, drawOrder); - } - timelines.push(timeline); - } - const eventCount = input.readInt(true); - if (eventCount > 0) { - const timeline = new EventTimeline(eventCount); - for (let i = 0; i < eventCount; i++) { - const time = input.readFloat(); - const eventData = skeletonData.events[input.readInt(true)]; - const event = new Event(time, eventData); - event.intValue = input.readInt(false); - event.floatValue = input.readFloat(); - event.stringValue = input.readString(); - if (event.stringValue == null) event.stringValue = eventData.stringValue; - if (event.data.audioPath) { - event.volume = input.readFloat(); - event.balance = input.readFloat(); - } - timeline.setFrame(i, event); - } - timelines.push(timeline); - } - let duration = 0; - for (let i = 0, n = timelines.length; i < n; i++) - duration = Math.max(duration, timelines[i].getDuration()); - return new Animation(name, timelines, duration); - } - }; - var BinaryInput = class { - constructor(data, strings = [], index = 0, buffer = new DataView(data instanceof ArrayBuffer ? data : data.buffer)) { - this.strings = strings; - this.index = index; - this.buffer = buffer; - } - readByte() { - return this.buffer.getInt8(this.index++); - } - readUnsignedByte() { - return this.buffer.getUint8(this.index++); - } - readShort() { - const value = this.buffer.getInt16(this.index); - this.index += 2; - return value; - } - readInt32() { - const value = this.buffer.getInt32(this.index); - this.index += 4; - return value; - } - readInt(optimizePositive) { - let b = this.readByte(); - let result = b & 127; - if ((b & 128) !== 0) { - b = this.readByte(); - result |= (b & 127) << 7; - if ((b & 128) !== 0) { - b = this.readByte(); - result |= (b & 127) << 14; - if ((b & 128) !== 0) { - b = this.readByte(); - result |= (b & 127) << 21; - if ((b & 128) !== 0) { - b = this.readByte(); - result |= (b & 127) << 28; - } - } - } - } - return optimizePositive ? result : result >>> 1 ^ -(result & 1); - } - readStringRef() { - const index = this.readInt(true); - return index === 0 ? null : this.strings[index - 1]; - } - readString() { - let byteCount = this.readInt(true); - switch (byteCount) { - case 0: - return null; - case 1: - return ""; - } - byteCount--; - let chars = ""; - for (let i = 0; i < byteCount; ) { - const b = this.readUnsignedByte(); - switch (b >> 4) { - case 12: - case 13: - chars += String.fromCharCode((b & 31) << 6 | this.readByte() & 63); - i += 2; - break; - case 14: - chars += String.fromCharCode((b & 15) << 12 | (this.readByte() & 63) << 6 | this.readByte() & 63); - i += 3; - break; - default: - chars += String.fromCharCode(b); - i++; - } - } - return chars; - } - readFloat() { - const value = this.buffer.getFloat32(this.index); - this.index += 4; - return value; - } - readBoolean() { - return this.readByte() !== 0; - } - }; - var LinkedMesh = class { - parent; - skinIndex; - slotIndex; - mesh; - inheritTimeline; - constructor(mesh, skinIndex, slotIndex, parent, inheritDeform) { - this.mesh = mesh; - this.skinIndex = skinIndex; - this.slotIndex = slotIndex; - this.parent = parent; - this.inheritTimeline = inheritDeform; - } - }; - var Vertices = class { - constructor(bones = null, vertices, length = 0) { - this.bones = bones; - this.vertices = vertices; - this.length = length; - } - }; - function readTimeline(input, timelines, timeline, scale) { - if (timeline instanceof CurveTimeline1) - readTimeline1(input, timelines, timeline, scale); - else - readTimeline2(input, timelines, timeline, scale); - } - function readTimeline1(input, timelines, timeline, scale) { - let time = input.readFloat(), value = input.readFloat() * scale; - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, value); - if (frame === frameLast) break; - const time2 = input.readFloat(), value2 = input.readFloat() * scale; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale); - } - time = time2; - value = value2; - } - timelines.push(timeline); - } - function readTimeline2(input, timelines, timeline, scale) { - let time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale; - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, value1, value2); - if (frame === frameLast) break; - const time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale); - setBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale); - } - time = time2; - value1 = nvalue1; - value2 = nvalue2; - } - timelines.push(timeline); - } - function setBezier(input, timeline, bezier, frame, value, time1, time2, value1, value2, scale) { - timeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2); - } - var BONE_ROTATE = 0; - var BONE_TRANSLATE = 1; - var BONE_TRANSLATEX = 2; - var BONE_TRANSLATEY = 3; - var BONE_SCALE = 4; - var BONE_SCALEX = 5; - var BONE_SCALEY = 6; - var BONE_SHEAR = 7; - var BONE_SHEARX = 8; - var BONE_SHEARY = 9; - var BONE_INHERIT = 10; - var SLOT_ATTACHMENT = 0; - var SLOT_RGBA = 1; - var SLOT_RGB = 2; - var SLOT_RGBA2 = 3; - var SLOT_RGB2 = 4; - var SLOT_ALPHA = 5; - var CONSTRAINT_IK = 0; - var CONSTRAINT_PATH = 1; - var CONSTRAINT_TRANSFORM = 2; - var CONSTRAINT_PHYSICS = 3; - var CONSTRAINT_SLIDER = 4; - var ATTACHMENT_DEFORM = 0; - var ATTACHMENT_SEQUENCE = 1; - var PATH_POSITION = 0; - var PATH_SPACING = 1; - var PATH_MIX = 2; - var PHYSICS_INERTIA = 0; - var PHYSICS_STRENGTH = 1; - var PHYSICS_DAMPING = 2; - var PHYSICS_MASS = 4; - var PHYSICS_WIND = 5; - var PHYSICS_GRAVITY = 6; - var PHYSICS_MIX = 7; - var PHYSICS_RESET = 8; - var SLIDER_TIME = 0; - var SLIDER_MIX = 1; - var CURVE_STEPPED = 1; - var CURVE_BEZIER = 2; - - // spine-core/src/SkeletonBounds.ts - var SkeletonBounds = class { - /** The left edge of the axis aligned bounding box. */ - minX = 0; - /** The bottom edge of the axis aligned bounding box. */ - minY = 0; - /** The right edge of the axis aligned bounding box. */ - maxX = 0; - /** The top edge of the axis aligned bounding box. */ - maxY = 0; - /** The visible bounding boxes. */ - boundingBoxes = []; - /** The world vertices for the bounding box polygons. */ - polygons = []; - polygonPool = new Pool(() => { - return Utils.newFloatArray(16); - }); - /** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding - * box's polygon. - * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the - * SkeletonBounds AABB methods will always return true. */ - update(skeleton, updateAabb) { - if (!skeleton) throw new Error("skeleton cannot be null."); - const boundingBoxes = this.boundingBoxes; - const polygons = this.polygons; - const polygonPool = this.polygonPool; - const slots = skeleton.slots; - const slotCount = slots.length; - boundingBoxes.length = 0; - polygonPool.freeAll(polygons); - polygons.length = 0; - for (let i = 0; i < slotCount; i++) { - const slot = slots[i]; - if (!slot.bone.active) continue; - const attachment = slot.applied.attachment; - if (attachment instanceof BoundingBoxAttachment) { - boundingBoxes.push(attachment); - let polygon = polygonPool.obtain(); - if (polygon.length !== attachment.worldVerticesLength) { - polygon = Utils.newFloatArray(attachment.worldVerticesLength); - } - polygons.push(polygon); - attachment.computeWorldVertices(skeleton, slot, 0, attachment.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; - } - } - aabbCompute() { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - const polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) { - const polygon = polygons[i]; - const vertices = polygon; - for (let ii = 0, nn = polygon.length; ii < nn; ii += 2) { - const x = vertices[ii]; - const 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; - } - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint(x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - } - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment(x1, y1, x2, y2) { - const minX = this.minX; - const minY = this.minY; - const maxX = this.maxX; - const maxY = this.maxY; - if (x1 <= minX && x2 <= minX || y1 <= minY && y2 <= minY || x1 >= maxX && x2 >= maxX || y1 >= maxY && y2 >= maxY) - return false; - const m = (y2 - y1) / (x2 - x1); - let y = m * (minX - x1) + y1; - if (y > minY && y < maxY) return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) return true; - let 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; - } - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton(bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - } - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint(x, y) { - const polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) - if (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i]; - return null; - } - /** Returns true if the polygon contains the point. */ - containsPointPolygon(polygon, x, y) { - const vertices = polygon; - const nn = polygon.length; - let prevIndex = nn - 2; - let inside = false; - for (let ii = 0; ii < nn; ii += 2) { - const vertexY = vertices[ii + 1]; - const prevY = vertices[prevIndex + 1]; - if (vertexY < y && prevY >= y || prevY < y && vertexY >= y) { - const vertexX = vertices[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside; - } - prevIndex = ii; - } - return inside; - } - /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it - * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns - * true. */ - intersectsSegment(x1, y1, x2, y2) { - const polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) - if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i]; - return null; - } - /** Returns true if the polygon contains any part of the line segment. */ - intersectsSegmentPolygon(polygon, x1, y1, x2, y2) { - const vertices = polygon; - const nn = polygon.length; - const width12 = x1 - x2, height12 = y1 - y2; - const det1 = x1 * y2 - y1 * x2; - let x3 = vertices[nn - 2], y3 = vertices[nn - 1]; - for (let ii = 0; ii < nn; ii += 2) { - const x4 = vertices[ii], y4 = vertices[ii + 1]; - const det2 = x3 * y4 - y3 * x4; - const width34 = x3 - x4, height34 = y3 - y4; - const det3 = width12 * height34 - height12 * width34; - const x = (det1 * width34 - width12 * det2) / det3; - if ((x >= x3 && x <= x4 || x >= x4 && x <= x3) && (x >= x1 && x <= x2 || x >= x2 && x <= x1)) { - const 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; - } - /** Returns the polygon for the specified bounding box, or null. */ - getPolygon(boundingBox) { - if (!boundingBox) throw new Error("boundingBox cannot be null."); - const index = this.boundingBoxes.indexOf(boundingBox); - return index === -1 ? null : this.polygons[index]; - } - /** The width of the axis aligned bounding box. */ - getWidth() { - return this.maxX - this.minX; - } - /** The height of the axis aligned bounding box. */ - getHeight() { - return this.maxY - this.minY; - } - }; - - // spine-core/src/Triangulator.ts - var Triangulator = class _Triangulator { - convexPolygons = []; - convexPolygonsIndices = []; - indicesArray = []; - isConcaveArray = []; - triangles = []; - polygonPool = new Pool(() => { - return []; - }); - polygonIndicesPool = new Pool(() => { - return []; - }); - triangulate(verticesArray) { - const vertices = verticesArray; - let vertexCount = verticesArray.length >> 1; - const indices = this.indicesArray; - indices.length = 0; - for (let i = 0; i < vertexCount; i++) - indices[i] = i; - const isConcave = this.isConcaveArray; - isConcave.length = 0; - for (let i = 0, n = vertexCount; i < n; ++i) - isConcave[i] = _Triangulator.isConcave(i, vertexCount, vertices, indices); - const triangles = this.triangles; - triangles.length = 0; - while (vertexCount > 3) { - let previous = vertexCount - 1, i = 0, next = 1; - while (true) { - outer: - if (!isConcave[i]) { - const p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; - const p1x = vertices[p1], p1y = vertices[p1 + 1]; - const p2x = vertices[p2], p2y = vertices[p2 + 1]; - const p3x = vertices[p3], p3y = vertices[p3 + 1]; - for (let ii = (next + 1) % vertexCount; ii !== previous; ii = (ii + 1) % vertexCount) { - if (!isConcave[ii]) continue; - const v = indices[ii] << 1; - const 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--; - const previousIndex = (vertexCount + i - 1) % vertexCount; - const 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; - } - decompose(verticesArray, triangles) { - const vertices = verticesArray; - const convexPolygons = this.convexPolygons; - this.polygonPool.freeAll(convexPolygons); - convexPolygons.length = 0; - const convexPolygonsIndices = this.convexPolygonsIndices; - this.polygonIndicesPool.freeAll(convexPolygonsIndices); - convexPolygonsIndices.length = 0; - let polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - let polygon = this.polygonPool.obtain(); - polygon.length = 0; - let fanBaseIndex = -1, lastWinding = 0; - for (let i = 0, n = triangles.length; i < n; i += 3) { - const t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; - const x1 = vertices[t1], y1 = vertices[t1 + 1]; - const x2 = vertices[t2], y2 = vertices[t2 + 1]; - const x3 = vertices[t3], y3 = vertices[t3 + 1]; - let merged = false; - if (fanBaseIndex === t1) { - const o = polygon.length - 4; - const winding1 = _Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); - const 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 (let i = 0, n = convexPolygons.length; i < n; i++) { - polygonIndices = convexPolygonsIndices[i]; - if (polygonIndices.length === 0) continue; - const firstIndex = polygonIndices[0]; - const lastIndex = polygonIndices[polygonIndices.length - 1]; - polygon = convexPolygons[i]; - const o = polygon.length - 4; - let prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; - let prevX = polygon[o + 2], prevY = polygon[o + 3]; - const firstX = polygon[0], firstY = polygon[1]; - const secondX = polygon[2], secondY = polygon[3]; - const winding = _Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); - for (let ii = 0; ii < n; ii++) { - if (ii === i) continue; - const otherIndices = convexPolygonsIndices[ii]; - if (otherIndices.length !== 3) continue; - const otherFirstIndex = otherIndices[0]; - const otherSecondIndex = otherIndices[1]; - const otherLastIndex = otherIndices[2]; - const otherPoly = convexPolygons[ii]; - const x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; - if (otherFirstIndex !== firstIndex || otherSecondIndex !== lastIndex) continue; - const winding1 = _Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); - const 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 (let 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; - } - static isConcave(index, vertexCount, vertices, indices) { - const previous = indices[(vertexCount + index - 1) % vertexCount] << 1; - const current = indices[index] << 1; - const next = indices[(index + 1) % vertexCount] << 1; - return !_Triangulator.positiveArea( - vertices[previous], - vertices[previous + 1], - vertices[current], - vertices[current + 1], - vertices[next], - vertices[next + 1] - ); - } - static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y) { - return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; - } - static winding(p1x, p1y, p2x, p2y, p3x, p3y) { - const px = p2x - p1x, py = p2y - p1y; - return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; - } - }; - - // spine-core/src/SkeletonClipping.ts - var SkeletonClipping = class _SkeletonClipping { - triangulator = new Triangulator(); - clippingPolygon = []; - clipOutput = []; - clippedVertices = []; - /** An empty array unless {@link clipTrianglesUnpacked} was used. **/ - clippedUVs = []; - clippedTriangles = []; - _clippedVerticesTyped = new Float32Array(1024); - _clippedUVsTyped = new Float32Array(1024); - _clippedTrianglesTyped = new Uint32Array(1024); - clippedVerticesTyped = new Float32Array(0); - clippedUVsTyped = new Float32Array(0); - clippedTrianglesTyped = new Uint32Array(0); - clippedVerticesLength = 0; - clippedUVsLength = 0; - clippedTrianglesLength = 0; - scratch = []; - clipAttachment = null; - clippingPolygons = null; - clipStart(skeleton, slot, clip) { - if (this.clipAttachment) return 0; - this.clipAttachment = clip; - const n = clip.worldVerticesLength; - const vertices = Utils.setArraySize(this.clippingPolygon, n); - clip.computeWorldVertices(skeleton, slot, 0, n, vertices, 0, 2); - const clippingPolygon = this.clippingPolygon; - _SkeletonClipping.makeClockwise(clippingPolygon); - const clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); - for (let i = 0, n2 = clippingPolygons.length; i < n2; i++) { - const polygon = clippingPolygons[i]; - _SkeletonClipping.makeClockwise(polygon); - polygon.push(polygon[0]); - polygon.push(polygon[1]); - } - return clippingPolygons.length; - } - clipEnd(slot) { - if (!this.clipAttachment) return; - if (slot && this.clipAttachment.endSlot !== slot.data) return; - this.clipAttachment = null; - this.clippingPolygons = null; - this.clippedVertices.length = 0; - this.clippedTriangles.length = 0; - this.clippingPolygon.length = 0; - this.clippedVerticesLength = 0; - this.clippedUVsLength = 0; - this.clippedTrianglesLength = 0; - } - isClipping() { - return this.clipAttachment != null; - } - clipTriangles(vertices, triangles, trianglesLength, uvs, light, dark, twoColor, stride) { - return uvs && light && dark && typeof twoColor === "boolean" && typeof stride === "number" ? this.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor, stride) : this.clipTrianglesNoRender(vertices, triangles, trianglesLength); - } - clipTrianglesNoRender(vertices, triangles, trianglesLength) { - const clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - const clippedTriangles = this.clippedTriangles; - const polygons = this.clippingPolygons; - const polygonsCount = polygons.length; - let index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - let clipOutputItems = null; - for (let i = 0; i < trianglesLength; i += 3) { - let v = triangles[i] << 1; - const x1 = vertices[v], y1 = vertices[v + 1]; - v = triangles[i + 1] << 1; - const x2 = vertices[v], y2 = vertices[v + 1]; - v = triangles[i + 2] << 1; - const x3 = vertices[v], y3 = vertices[v + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - clipOutputItems = this.clipOutput; - const clipOutputLength = clipOutput.length; - if (clipOutputLength === 0) continue; - let clipOutputCount = clipOutputLength >> 1; - const clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) { - const x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - } - s = clippedTriangles.length; - const clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - const clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = x2; - clippedVerticesItems[s + 3] = y2; - clippedVerticesItems[s + 4] = x3; - clippedVerticesItems[s + 5] = y3; - s = clippedTriangles.length; - const clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - return clipOutputItems != null; - } - clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor, stride) { - const clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - const clippedTriangles = this.clippedTriangles; - const polygons = this.clippingPolygons; - const polygonsCount = polygons.length; - let index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - let clipOutputItems = null; - for (let i = 0; i < trianglesLength; i += 3) { - let t = triangles[i]; - const u1 = uvs[t << 1], v1 = uvs[(t << 1) + 1]; - const x1 = vertices[t * stride], y1 = vertices[t * stride + 1]; - t = triangles[i + 1]; - const u2 = uvs[t << 1], v2 = uvs[(t << 1) + 1]; - const x2 = vertices[t * stride], y2 = vertices[t * stride + 1]; - t = triangles[i + 2]; - const u3 = uvs[t << 1], v3 = uvs[(t << 1) + 1]; - const x3 = vertices[t * stride], y3 = vertices[t * stride + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - clipOutputItems = this.clipOutput; - const clipOutputLength = clipOutput.length; - if (clipOutputLength === 0) continue; - const d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - const d = 1 / (d0 * d2 + d1 * (y1 - y3)); - let clipOutputCount = clipOutputLength >> 1; - const clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * stride); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += stride) { - const 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; - const c0 = x - x3, c1 = y - y3; - const a = (d0 * c0 + d1 * c1) * d; - const b = (d4 * c0 + d2 * c1) * d; - const 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 = clippedTriangles.length; - const clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - const clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * stride); - 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; - const clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - return clipOutputItems != null; - } - clipTrianglesUnpacked(vertices, triangles, trianglesLength, uvs) { - const clipOutput = this.clipOutput; - let clippedVertices = this._clippedVerticesTyped, clippedUVs = this._clippedUVsTyped, clippedTriangles = this._clippedTrianglesTyped; - const polygons = this.clippingPolygons; - const polygonsCount = polygons.length; - let index = 0; - this.clippedVerticesLength = 0; - this.clippedUVsLength = 0; - this.clippedTrianglesLength = 0; - this._clippedVerticesTyped; - this._clippedUVsTyped; - this._clippedTrianglesTyped; - let clipped = false; - for (let i = 0; i < trianglesLength; i += 3) { - let v = triangles[i] << 1; - const x1 = vertices[v], y1 = vertices[v + 1]; - const u1 = uvs[v], v1 = uvs[v + 1]; - v = triangles[i + 1] << 1; - const x2 = vertices[v], y2 = vertices[v + 1]; - const u2 = uvs[v], v2 = uvs[v + 1]; - v = triangles[i + 2] << 1; - const x3 = vertices[v], y3 = vertices[v + 1]; - const u3 = uvs[v], v3 = uvs[v + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = this.clippedVerticesLength; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - const clipOutputLength = clipOutput.length; - if (clipOutputLength === 0) continue; - clipped = true; - const d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - const d = 1 / (d0 * d2 + d1 * (y1 - y3)); - let clipOutputCount = clipOutputLength >> 1; - const clipOutputItems = this.clipOutput; - const newLength = s + clipOutputCount * 2; - if (clippedVertices.length < newLength) { - this._clippedVerticesTyped = new Float32Array(newLength * 2); - this._clippedVerticesTyped.set(clippedVertices.subarray(0, s)); - this._clippedUVsTyped = new Float32Array(newLength * 2); - this._clippedUVsTyped.set(clippedUVs.subarray(0, s)); - clippedVertices = this._clippedVerticesTyped; - clippedUVs = this._clippedUVsTyped; - } - const clippedVerticesItems = clippedVertices; - const clippedUVsItems = clippedUVs; - this.clippedVerticesLength = newLength; - this.clippedUVsLength = newLength; - for (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) { - const x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - const c0 = x - x3, c1 = y - y3; - const a = (d0 * c0 + d1 * c1) * d; - const b = (d4 * c0 + d2 * c1) * d; - const c = 1 - a - b; - clippedUVsItems[s] = u1 * a + u2 * b + u3 * c; - clippedUVsItems[s + 1] = v1 * a + v2 * b + v3 * c; - } - s = this.clippedTrianglesLength; - const newLengthTriangles = s + 3 * (clipOutputCount - 2); - if (clippedTriangles.length < newLengthTriangles) { - this._clippedTrianglesTyped = new Uint32Array(newLengthTriangles * 2); - this._clippedTrianglesTyped.set(clippedTriangles.subarray(0, s)); - clippedTriangles = this._clippedTrianglesTyped; - } - this.clippedTrianglesLength = newLengthTriangles; - const clippedTrianglesItems = clippedTriangles; - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - let newLength = s + 3 * 2; - if (clippedVertices.length < newLength) { - this._clippedVerticesTyped = new Float32Array(newLength * 2); - this._clippedVerticesTyped.set(clippedVertices.subarray(0, s)); - clippedVertices = this._clippedVerticesTyped; - } - clippedVertices[s] = x1; - clippedVertices[s + 1] = y1; - clippedVertices[s + 2] = x2; - clippedVertices[s + 3] = y2; - clippedVertices[s + 4] = x3; - clippedVertices[s + 5] = y3; - if (clippedUVs.length < newLength) { - this._clippedUVsTyped = new Float32Array(newLength * 2); - this._clippedUVsTyped.set(clippedUVs.subarray(0, s)); - clippedUVs = this._clippedUVsTyped; - } - clippedUVs[s] = u1; - clippedUVs[s + 1] = v1; - clippedUVs[s + 2] = u2; - clippedUVs[s + 3] = v2; - clippedUVs[s + 4] = u3; - clippedUVs[s + 5] = v3; - this.clippedVerticesLength = newLength; - this.clippedUVsLength = newLength; - s = this.clippedTrianglesLength; - newLength = s + 3; - if (clippedTriangles.length < newLength) { - this._clippedTrianglesTyped = new Uint32Array(newLength * 2); - this._clippedTrianglesTyped.set(clippedTriangles.subarray(0, s)); - clippedTriangles = this._clippedTrianglesTyped; - } - clippedTriangles[s] = index; - clippedTriangles[s + 1] = index + 1; - clippedTriangles[s + 2] = index + 2; - index += 3; - this.clippedTrianglesLength = newLength; - break; - } - } - } - this.clippedVerticesTyped = this._clippedVerticesTyped.subarray(0, this.clippedVerticesLength); - this.clippedUVsTyped = this._clippedUVsTyped.subarray(0, this.clippedUVsLength); - this.clippedTrianglesTyped = this._clippedTrianglesTyped.subarray(0, this.clippedTrianglesLength); - return clipped; - } - /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping - * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */ - clip(x1, y1, x2, y2, x3, y3, clippingArea, output) { - const originalOutput = output; - let clipped = false; - let input; - 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; - const clippingVerticesLast = clippingArea.length - 4; - const clippingVertices = clippingArea; - for (let i = 0; ; i += 2) { - const edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; - const ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3]; - const outputStart = output.length; - const inputVertices = input; - for (let ii = 0, nn = input.length - 2; ii < nn; ) { - const inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; - ii += 2; - const inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1]; - const s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2); - const s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY); - if (s1 > 0) { - if (s2) { - output.push(inputX2); - output.push(inputY2); - continue; - } - const ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex); - if (t >= 0 && t <= 1) { - output.push(inputX + ix * t); - output.push(inputY + iy * t); - } else { - output.push(inputX2); - output.push(inputY2); - continue; - } - } else if (s2) { - const ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex); - if (t >= 0 && t <= 1) { - output.push(inputX + ix * t); - output.push(inputY + iy * t); - output.push(inputX2); - output.push(inputY2); - } else { - output.push(inputX2); - output.push(inputY2); - continue; - } - } - clipped = true; - } - if (outputStart === output.length) { - originalOutput.length = 0; - return true; - } - output.push(output[0]); - output.push(output[1]); - if (i === clippingVerticesLast) break; - const temp = output; - output = input; - output.length = 0; - input = temp; - } - if (originalOutput !== output) { - originalOutput.length = 0; - for (let i = 0, n = output.length - 2; i < n; i++) - originalOutput[i] = output[i]; - } else - originalOutput.length = originalOutput.length - 2; - return clipped; - } - static makeClockwise(polygon) { - const vertices = polygon; - const verticeslength = polygon.length; - let area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; - for (let 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 (let i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { - const x = vertices[i], y = vertices[i + 1]; - const other = lastX - i; - vertices[i] = vertices[other]; - vertices[i + 1] = vertices[other + 1]; - vertices[other] = x; - vertices[other + 1] = y; - } - } - }; - - // spine-core/src/SkeletonJson.ts - var SkeletonJson = class { - attachmentLoader; - /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at - * runtime than were used in Spine. - * - * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */ - scale = 1; - linkedMeshes = []; - constructor(attachmentLoader) { - this.attachmentLoader = attachmentLoader; - } - // biome-ignore lint/suspicious/noExplicitAny: it is any until we define a schema - readSkeletonData(json) { - const scale = this.scale; - const skeletonData = new SkeletonData(); - const root = typeof json === "string" ? JSON.parse(json) : json; - const skeletonMap = root.skeleton; - if (skeletonMap) { - skeletonData.hash = skeletonMap.hash; - skeletonData.version = skeletonMap.spine; - skeletonData.x = skeletonMap.x; - skeletonData.y = skeletonMap.y; - skeletonData.width = skeletonMap.width; - skeletonData.height = skeletonMap.height; - skeletonData.referenceScale = getValue(skeletonMap, "referenceScale", 100) * scale; - skeletonData.fps = skeletonMap.fps; - skeletonData.imagesPath = skeletonMap.images ?? null; - skeletonData.audioPath = skeletonMap.audio ?? null; - } - if (root.bones) { - for (let i = 0; i < root.bones.length; i++) { - const boneMap = root.bones[i]; - let parent = null; - const parentName = getValue(boneMap, "parent", null); - if (parentName) parent = skeletonData.findBone(parentName); - const data = new BoneData(skeletonData.bones.length, boneMap.name, parent); - data.length = getValue(boneMap, "length", 0) * scale; - const setup = data.setup; - setup.x = getValue(boneMap, "x", 0) * scale; - setup.y = getValue(boneMap, "y", 0) * scale; - setup.rotation = getValue(boneMap, "rotation", 0); - setup.scaleX = getValue(boneMap, "scaleX", 1); - setup.scaleY = getValue(boneMap, "scaleY", 1); - setup.shearX = getValue(boneMap, "shearX", 0); - setup.shearY = getValue(boneMap, "shearY", 0); - setup.inherit = Utils.enumValue(Inherit, getValue(boneMap, "inherit", "Normal")); - data.skinRequired = getValue(boneMap, "skin", false); - const color = getValue(boneMap, "color", null); - if (color) data.color.setFromString(color); - skeletonData.bones.push(data); - } - } - if (root.slots) { - for (let i = 0; i < root.slots.length; i++) { - const slotMap = root.slots[i]; - const slotName = slotMap.name; - const boneData = skeletonData.findBone(slotMap.bone); - if (!boneData) throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`); - const data = new SlotData(skeletonData.slots.length, slotName, boneData); - const color = getValue(slotMap, "color", null); - if (color) data.setup.color.setFromString(color); - const dark = getValue(slotMap, "dark", null); - if (dark) data.setup.darkColor = Color.fromString(dark); - data.attachmentName = getValue(slotMap, "attachment", null); - data.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, "blend", "normal")); - data.visible = getValue(slotMap, "visible", true); - skeletonData.slots.push(data); - } - } - if (root.constraints) { - for (const constraintMap of root.constraints) { - const name = constraintMap.name; - const skinRequired = getValue(constraintMap, "skin", false); - switch (getValue(constraintMap, "type", false)) { - case "ik": { - const data = new IkConstraintData(name); - data.skinRequired = skinRequired; - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - const bone = skeletonData.findBone(constraintMap.bones[ii]); - if (!bone) throw new Error(`Couldn't find bone ${constraintMap.bones[ii]} for IK constraint ${name}.`); - data.bones.push(bone); - } - const targetName = constraintMap.target; - const target = skeletonData.findBone(targetName); - if (!target) throw new Error(`Couldn't find target bone ${targetName} for IK constraint ${name}.`); - data.target = target; - data.uniform = getValue(constraintMap, "uniform", false); - const setup = data.setup; - setup.mix = getValue(constraintMap, "mix", 1); - setup.softness = getValue(constraintMap, "softness", 0) * scale; - setup.bendDirection = getValue(constraintMap, "bendPositive", true) ? 1 : -1; - setup.compress = getValue(constraintMap, "compress", false); - setup.stretch = getValue(constraintMap, "stretch", false); - skeletonData.constraints.push(data); - break; - } - case "transform": { - const data = new TransformConstraintData(name); - data.skinRequired = skinRequired; - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - const boneName = constraintMap.bones[ii]; - const bone = skeletonData.findBone(boneName); - if (!bone) throw new Error(`Couldn't find bone ${boneName} for transform constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - const sourceName = constraintMap.source; - const source = skeletonData.findBone(sourceName); - if (!source) throw new Error(`Couldn't find source bone ${sourceName} for transform constraint ${constraintMap.name}.`); - data.source = source; - data.localSource = getValue(constraintMap, "localSource", false); - data.localTarget = getValue(constraintMap, "localTarget", false); - data.additive = getValue(constraintMap, "additive", false); - data.clamp = getValue(constraintMap, "clamp", false); - let rotate = false, x = false, y = false, scaleX = false, scaleY = false, shearY = false; - const fromEntries = Object.entries(getValue(constraintMap, "properties", {})); - for (const [name2, fromEntry] of fromEntries) { - const from = this.fromProperty(name2); - const fromScale = this.propertyScale(name2, scale); - from.offset = getValue(fromEntry, "offset", 0) * fromScale; - const toEntries = Object.entries(getValue(fromEntry, "to", {})); - for (const [name3, toEntry] of toEntries) { - let toScale = 1; - let to; - switch (name3) { - case "rotate": { - rotate = true; - to = new ToRotate(); - break; - } - case "x": { - x = true; - to = new ToX(); - toScale = scale; - break; - } - case "y": { - y = true; - to = new ToY(); - toScale = scale; - break; - } - case "scaleX": { - scaleX = true; - to = new ToScaleX(); - break; - } - case "scaleY": { - scaleY = true; - to = new ToScaleY(); - break; - } - case "shearY": { - shearY = true; - to = new ToShearY(); - break; - } - default: - throw new Error(`Invalid transform constraint to property: ${name3}`); - } - to.offset = getValue(toEntry, "offset", 0) * toScale; - to.max = getValue(toEntry, "max", 1) * toScale; - to.scale = getValue(toEntry, "scale", 1) * toScale / fromScale; - from.to.push(to); - } - if (from.to.length > 0) data.properties.push(from); - } - data.offsets[TransformConstraintData.ROTATION] = getValue(constraintMap, "rotation", 0); - data.offsets[TransformConstraintData.X] = getValue(constraintMap, "x", 0) * scale; - data.offsets[TransformConstraintData.Y] = getValue(constraintMap, "y", 0) * scale; - data.offsets[TransformConstraintData.SCALEX] = getValue(constraintMap, "scaleX", 0); - data.offsets[TransformConstraintData.SCALEY] = getValue(constraintMap, "scaleY", 0); - data.offsets[TransformConstraintData.SHEARY] = getValue(constraintMap, "shearY", 0); - const setup = data.setup; - if (rotate) setup.mixRotate = getValue(constraintMap, "mixRotate", 1); - if (x) setup.mixX = getValue(constraintMap, "mixX", 1); - if (y) setup.mixY = getValue(constraintMap, "mixY", setup.mixX); - if (scaleX) setup.mixScaleX = getValue(constraintMap, "mixScaleX", 1); - if (scaleY) setup.mixScaleY = getValue(constraintMap, "mixScaleY", setup.mixScaleX); - if (shearY) setup.mixShearY = getValue(constraintMap, "mixShearY", 1); - skeletonData.constraints.push(data); - break; - } - case "path": { - const data = new PathConstraintData(name); - data.skinRequired = skinRequired; - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - const boneName = constraintMap.bones[ii]; - const bone = skeletonData.findBone(boneName); - if (!bone) throw new Error(`Couldn't find bone ${boneName} for path constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - const slotName = constraintMap.slot; - const slot = skeletonData.findSlot(slotName); - if (!slot) throw new Error(`Couldn't find slot ${slotName} for path constraint ${constraintMap.name}.`); - data.slot = slot; - data.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, "positionMode", "Percent")); - data.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, "spacingMode", "Length")); - data.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, "rotateMode", "Tangent")); - data.offsetRotation = getValue(constraintMap, "rotation", 0); - const setup = data.setup; - setup.position = getValue(constraintMap, "position", 0); - if (data.positionMode === 0 /* Fixed */) setup.position *= scale; - setup.spacing = getValue(constraintMap, "spacing", 0); - if (data.spacingMode === 0 /* Length */ || data.spacingMode === 1 /* Fixed */) setup.spacing *= scale; - setup.mixRotate = getValue(constraintMap, "mixRotate", 1); - setup.mixX = getValue(constraintMap, "mixX", 1); - setup.mixY = getValue(constraintMap, "mixY", setup.mixX); - skeletonData.constraints.push(data); - break; - } - case "physics": { - const data = new PhysicsConstraintData(name); - data.skinRequired = skinRequired; - const boneName = constraintMap.bone; - const bone = skeletonData.findBone(boneName); - if (bone == null) throw new Error(`Physics bone not found: ${boneName}`); - data.bone = bone; - data.x = getValue(constraintMap, "x", 0); - data.y = getValue(constraintMap, "y", 0); - data.rotate = getValue(constraintMap, "rotate", 0); - data.scaleX = getValue(constraintMap, "scaleX", 0); - data.shearX = getValue(constraintMap, "shearX", 0); - data.limit = getValue(constraintMap, "limit", 5e3) * scale; - data.step = 1 / getValue(constraintMap, "fps", 60); - const setup = data.setup; - setup.inertia = getValue(constraintMap, "inertia", 0.5); - setup.strength = getValue(constraintMap, "strength", 100); - setup.damping = getValue(constraintMap, "damping", 0.85); - setup.massInverse = 1 / getValue(constraintMap, "mass", 1); - setup.wind = getValue(constraintMap, "wind", 0); - setup.gravity = getValue(constraintMap, "gravity", 0); - setup.mix = getValue(constraintMap, "mix", 1); - data.inertiaGlobal = getValue(constraintMap, "inertiaGlobal", false); - data.strengthGlobal = getValue(constraintMap, "strengthGlobal", false); - data.dampingGlobal = getValue(constraintMap, "dampingGlobal", false); - data.massGlobal = getValue(constraintMap, "massGlobal", false); - data.windGlobal = getValue(constraintMap, "windGlobal", false); - data.gravityGlobal = getValue(constraintMap, "gravityGlobal", false); - data.mixGlobal = getValue(constraintMap, "mixGlobal", false); - skeletonData.constraints.push(data); - break; - } - case "slider": { - const data = new SliderData(name); - data.skinRequired = skinRequired; - data.additive = getValue(constraintMap, "additive", false); - data.loop = getValue(constraintMap, "loop", false); - data.setup.time = getValue(constraintMap, "time", 0); - data.setup.mix = getValue(constraintMap, "mix", 1); - const boneName = constraintMap.bone; - if (boneName) { - data.bone = skeletonData.findBone(boneName); - if (!data.bone) throw new Error(`Slider bone not found: ${boneName}`); - const property = constraintMap.property; - data.property = this.fromProperty(property); - const propertyScale = this.propertyScale(property, scale); - data.property.offset = getValue(constraintMap, "from", 0) * propertyScale; - data.offset = getValue(constraintMap, "to", 0); - data.scale = getValue(constraintMap, "scale", 1) / propertyScale; - data.local = getValue(constraintMap, "local", false); - } - skeletonData.constraints.push(data); - break; - } - } - } - } - if (root.skins) { - for (let i = 0; i < root.skins.length; i++) { - const skinMap = root.skins[i]; - const skin = new Skin(skinMap.name); - if (skinMap.bones) { - for (let ii = 0; ii < skinMap.bones.length; ii++) { - const boneName = skinMap.bones[ii]; - const bone = skeletonData.findBone(boneName); - if (!bone) throw new Error(`Couldn't find bone ${boneName} for skin ${skinMap.name}.`); - skin.bones.push(bone); - } - } - if (skinMap.ik) { - for (let ii = 0; ii < skinMap.ik.length; ii++) { - const constraintName = skinMap.ik[ii]; - const constraint = skeletonData.findConstraint(constraintName, IkConstraintData); - if (!constraint) throw new Error(`Couldn't find IK constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.transform) { - for (let ii = 0; ii < skinMap.transform.length; ii++) { - const constraintName = skinMap.transform[ii]; - const constraint = skeletonData.findConstraint(constraintName, TransformConstraintData); - if (!constraint) throw new Error(`Couldn't find transform constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.path) { - for (let ii = 0; ii < skinMap.path.length; ii++) { - const constraintName = skinMap.path[ii]; - const constraint = skeletonData.findConstraint(constraintName, PathConstraintData); - if (!constraint) throw new Error(`Couldn't find path constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.physics) { - for (let ii = 0; ii < skinMap.physics.length; ii++) { - const constraintName = skinMap.physics[ii]; - const constraint = skeletonData.findConstraint(constraintName, PhysicsConstraintData); - if (!constraint) throw new Error(`Couldn't find physics constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.slider) { - for (let ii = 0; ii < skinMap.slider.length; ii++) { - const constraintName = skinMap.slider[ii]; - const constraint = skeletonData.findConstraint(constraintName, SliderData); - if (!constraint) throw new Error(`Couldn't find slider constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - for (const slotName in skinMap.attachments) { - const slot = skeletonData.findSlot(slotName); - if (!slot) throw new Error(`Couldn't find slot ${slotName} for skin ${skinMap.name}.`); - const slotMap = skinMap.attachments[slotName]; - for (const entryName in slotMap) { - const attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData); - if (attachment) skin.setAttachment(slot.index, entryName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name === "default") skeletonData.defaultSkin = skin; - } - } - for (let i = 0, n = this.linkedMeshes.length; i < n; i++) { - const linkedMesh = this.linkedMeshes[i]; - const skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); - if (!skin) throw new Error(`Skin not found: ${linkedMesh.skin}`); - const parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`); - linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh; - linkedMesh.mesh.setParentMesh(parent); - if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion(); - } - this.linkedMeshes.length = 0; - if (root.events) { - for (const eventName in root.events) { - const eventMap = root.events[eventName]; - const data = new EventData(eventName); - data.intValue = getValue(eventMap, "int", 0); - data.floatValue = getValue(eventMap, "float", 0); - data.stringValue = getValue(eventMap, "string", ""); - data.audioPath = getValue(eventMap, "audio", null); - if (data.audioPath) { - data.volume = getValue(eventMap, "volume", 1); - data.balance = getValue(eventMap, "balance", 0); - } - skeletonData.events.push(data); - } - } - if (root.animations) { - for (const animationName in root.animations) { - const animationMap = root.animations[animationName]; - this.readAnimation(animationMap, animationName, skeletonData); - } - } - if (root.constraints) { - for (const animationName in root.constraints) { - const animationMap = root.constraints[animationName]; - if (animationMap.type === "slider") { - const data = skeletonData.findConstraint(animationMap.name, SliderData); - const animationName2 = animationMap.animation; - const animation = skeletonData.findAnimation(animationName2); - if (!animation) throw new Error(`Slider animation not found: ${animationName2}`); - data.animation = animation; - } - } - } - return skeletonData; - } - fromProperty(type) { - let from; - switch (type) { - case "rotate": - from = new FromRotate(); - break; - case "x": - from = new FromX(); - break; - case "y": - from = new FromY(); - break; - case "scaleX": - from = new FromScaleX(); - break; - case "scaleY": - from = new FromScaleY(); - break; - case "shearY": - from = new FromShearY(); - break; - default: - throw new Error(`Invalid transform constraint from property: ${type}`); - } - return from; - } - propertyScale(type, scale) { - switch (type) { - case "x": - case "y": - return scale; - default: - return 1; - } - } - // biome-ignore lint/suspicious/noExplicitAny: it is any until we define a schema - readAttachment(map, skin, slotIndex, name, skeletonData) { - const scale = this.scale; - name = getValue(map, "name", name); - switch (getValue(map, "type", "region")) { - case "region": { - const path = getValue(map, "path", name); - const sequence = this.readSequence(getValue(map, "sequence", null)); - const region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence); - if (!region) return null; - region.path = path; - region.x = getValue(map, "x", 0) * scale; - region.y = getValue(map, "y", 0) * scale; - region.scaleX = getValue(map, "scaleX", 1); - region.scaleY = getValue(map, "scaleY", 1); - region.rotation = getValue(map, "rotation", 0); - region.width = map.width * scale; - region.height = map.height * scale; - region.sequence = sequence; - const color = getValue(map, "color", null); - if (color) region.color.setFromString(color); - if (region.region != null) region.updateRegion(); - return region; - } - case "boundingbox": { - const box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (!box) return null; - this.readVertices(map, box, map.vertexCount << 1); - const color = getValue(map, "color", null); - if (color) box.color.setFromString(color); - return box; - } - case "mesh": - case "linkedmesh": { - const path = getValue(map, "path", name); - const sequence = this.readSequence(getValue(map, "sequence", null)); - const mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) return null; - mesh.path = path; - const color = getValue(map, "color", null); - if (color) mesh.color.setFromString(color); - mesh.width = getValue(map, "width", 0) * scale; - mesh.height = getValue(map, "height", 0) * scale; - mesh.sequence = sequence; - const parent = getValue(map, "parent", null); - if (parent) { - this.linkedMeshes.push(new LinkedMesh2(mesh, getValue(map, "skin", null), slotIndex, parent, getValue(map, "timelines", true))); - return mesh; - } - const uvs = map.uvs; - this.readVertices(map, mesh, uvs.length); - mesh.triangles = map.triangles; - mesh.regionUVs = uvs; - if (mesh.region != null) mesh.updateRegion(); - mesh.edges = getValue(map, "edges", null); - mesh.hullLength = getValue(map, "hull", 0) * 2; - return mesh; - } - case "path": { - const path = this.attachmentLoader.newPathAttachment(skin, name); - if (!path) return null; - path.closed = getValue(map, "closed", false); - path.constantSpeed = getValue(map, "constantSpeed", true); - const vertexCount = map.vertexCount; - this.readVertices(map, path, vertexCount << 1); - const lengths = Utils.newArray(vertexCount / 3, 0); - for (let i = 0; i < map.lengths.length; i++) - lengths[i] = map.lengths[i] * scale; - path.lengths = lengths; - const color = getValue(map, "color", null); - if (color) path.color.setFromString(color); - return path; - } - case "point": { - const point = this.attachmentLoader.newPointAttachment(skin, name); - if (!point) return null; - point.x = getValue(map, "x", 0) * scale; - point.y = getValue(map, "y", 0) * scale; - point.rotation = getValue(map, "rotation", 0); - const color = getValue(map, "color", null); - if (color) point.color.setFromString(color); - return point; - } - case "clipping": { - const clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (!clip) return null; - const end = getValue(map, "end", null); - if (end) clip.endSlot = skeletonData.findSlot(end); - const vertexCount = map.vertexCount; - this.readVertices(map, clip, vertexCount << 1); - const color = getValue(map, "color", null); - if (color) clip.color.setFromString(color); - return clip; - } - } - return null; - } - readSequence(map) { - if (map == null) return null; - const sequence = new Sequence(getValue(map, "count", 0)); - sequence.start = getValue(map, "start", 1); - sequence.digits = getValue(map, "digits", 0); - sequence.setupIndex = getValue(map, "setup", 0); - return sequence; - } - // biome-ignore lint/suspicious/noExplicitAny: it is any until we define a schema - readVertices(map, attachment, verticesLength) { - const scale = this.scale; - attachment.worldVerticesLength = verticesLength; - const vertices = map.vertices; - if (verticesLength === vertices.length) { - const scaledVertices = Utils.toFloatArray(vertices); - if (scale !== 1) { - for (let i = 0, n = vertices.length; i < n; i++) - scaledVertices[i] *= scale; - } - attachment.vertices = scaledVertices; - return; - } - const weights = []; - const bones = []; - for (let i = 0, n = vertices.length; i < n; ) { - const boneCount = vertices[i++]; - bones.push(boneCount); - for (let 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 = Utils.toFloatArray(weights); - } - // biome-ignore lint/suspicious/noExplicitAny: it is any untile we define a schema - readAnimation(map, name, skeletonData) { - const scale = this.scale; - const timelines = []; - if (map.slots) { - for (const slotName in map.slots) { - const slotMap = map.slots[slotName]; - const slot = skeletonData.findSlot(slotName); - if (!slot) throw new Error(`Slot not found: ${slotName}`); - const slotIndex = slot.index; - for (const timelineName in slotMap) { - const timelineMap = slotMap[timelineName]; - if (!timelineMap) continue; - const frames = timelineMap.length; - switch (timelineName) { - case "attachment": { - const timeline = new AttachmentTimeline(frames, slotIndex); - for (let frame = 0; frame < frames; frame++) { - const keyMap = timelineMap[frame]; - timeline.setFrame(frame, getValue(keyMap, "time", 0), getValue(keyMap, "name", null)); - } - timelines.push(timeline); - break; - } - case "rgba": { - const timeline = new RGBATimeline(frames, frames << 2, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.color); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color.a); - const nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const newColor = Color.fromString(nextMap.color); - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1); - } - time = time2; - color = newColor; - keyMap = nextMap; - } - timelines.push(timeline); - break; - } - case "rgb": { - const timeline = new RGBTimeline(frames, frames * 3, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.color); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b); - const nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const newColor = Color.fromString(nextMap.color); - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - } - time = time2; - color = newColor; - keyMap = nextMap; - } - timelines.push(timeline); - break; - } - case "alpha": { - readTimeline12(timelines, timelineMap, new AlphaTimeline(frames, frames, slotIndex), 0, 1); - break; - } - case "rgba2": { - const timeline = new RGBA2Timeline(frames, frames * 7, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.light); - let color2 = Color.fromString(keyMap.dark); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b); - const nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const newColor = Color.fromString(nextMap.light); - const newColor2 = Color.fromString(nextMap.dark); - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1); - } - time = time2; - color = newColor; - color2 = newColor2; - keyMap = nextMap; - } - timelines.push(timeline); - break; - } - case "rgb2": { - const timeline = new RGB2Timeline(frames, frames * 6, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.light); - let color2 = Color.fromString(keyMap.dark); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b); - const nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const newColor = Color.fromString(nextMap.light); - const newColor2 = Color.fromString(nextMap.dark); - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1); - } - time = time2; - color = newColor; - color2 = newColor2; - keyMap = nextMap; - } - timelines.push(timeline); - break; - } - default: - throw new Error(`Invalid timeline type for a slot: ${timelineMap.name} (${slotMap.name})`); - } - } - } - } - if (map.bones) { - for (const boneName in map.bones) { - const boneMap = map.bones[boneName]; - const bone = skeletonData.findBone(boneName); - if (!bone) throw new Error(`Bone not found: ${boneName}`); - const boneIndex = bone.index; - for (const timelineName in boneMap) { - const timelineMap = boneMap[timelineName]; - const frames = timelineMap.length; - if (frames === 0) continue; - switch (timelineName) { - case "rotate": - readTimeline12(timelines, timelineMap, new RotateTimeline(frames, frames, boneIndex), 0, 1); - break; - case "translate": - readTimeline22(timelines, timelineMap, new TranslateTimeline(frames, frames << 1, boneIndex), "x", "y", 0, scale); - break; - case "translatex": - readTimeline12(timelines, timelineMap, new TranslateXTimeline(frames, frames, boneIndex), 0, scale); - break; - case "translatey": - readTimeline12(timelines, timelineMap, new TranslateYTimeline(frames, frames, boneIndex), 0, scale); - break; - case "scale": - readTimeline22(timelines, timelineMap, new ScaleTimeline(frames, frames << 1, boneIndex), "x", "y", 1, 1); - break; - case "scalex": - readTimeline12(timelines, timelineMap, new ScaleXTimeline(frames, frames, boneIndex), 1, 1); - break; - case "scaley": - readTimeline12(timelines, timelineMap, new ScaleYTimeline(frames, frames, boneIndex), 1, 1); - break; - case "shear": - readTimeline22(timelines, timelineMap, new ShearTimeline(frames, frames << 1, boneIndex), "x", "y", 0, 1); - break; - case "shearx": - readTimeline12(timelines, timelineMap, new ShearXTimeline(frames, frames, boneIndex), 0, 1); - break; - case "sheary": - readTimeline12(timelines, timelineMap, new ShearYTimeline(frames, frames, boneIndex), 0, 1); - break; - case "inherit": { - const timeline = new InheritTimeline(frames, bone.index); - for (let frame = 0; frame < timelineMap.length; frame++) { - const aFrame = timelineMap[frame]; - timeline.setFrame(frame, getValue(aFrame, "time", 0), Utils.enumValue(Inherit, getValue(aFrame, "inherit", "Normal"))); - } - timelines.push(timeline); - break; - } - default: - throw new Error(`Invalid timeline type for a bone: ${timelineMap.name} (${boneMap.name})`); - } - } - } - } - if (map.ik) { - for (const constraintName in map.ik) { - const constraintMap = map.ik[constraintName]; - let keyMap = constraintMap[0]; - if (!keyMap) continue; - const constraint = skeletonData.findConstraint(constraintName, IkConstraintData); - if (!constraint) throw new Error(`IK Constraint not found: ${constraintName}`); - const timeline = new IkConstraintTimeline( - constraintMap.length, - constraintMap.length << 1, - skeletonData.constraints.indexOf(constraint) - ); - let time = getValue(keyMap, "time", 0); - let mix = getValue(keyMap, "mix", 1); - let softness = getValue(keyMap, "softness", 0) * scale; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mix, softness, getValue(keyMap, "bendPositive", true) ? 1 : -1, getValue(keyMap, "compress", false), getValue(keyMap, "stretch", false)); - const nextMap = constraintMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const mix2 = getValue(nextMap, "mix", 1); - const softness2 = getValue(nextMap, "softness", 0) * scale; - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale); - } - time = time2; - mix = mix2; - softness = softness2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - if (map.transform) { - for (const constraintName in map.transform) { - const timelineMap = map.transform[constraintName]; - let keyMap = timelineMap[0]; - if (!keyMap) continue; - const constraint = skeletonData.findConstraint(constraintName, TransformConstraintData); - if (!constraint) throw new Error(`Transform constraint not found: ${constraintName}`); - const timeline = new TransformConstraintTimeline( - timelineMap.length, - timelineMap.length * 6, - skeletonData.constraints.indexOf(constraint) - ); - let time = getValue(keyMap, "time", 0); - let mixRotate = getValue(keyMap, "mixRotate", 1); - let mixX = getValue(keyMap, "mixX", 1), mixY = getValue(keyMap, "mixY", mixX); - let mixScaleX = getValue(keyMap, "mixScaleX", 1), mixScaleY = getValue(keyMap, "mixScaleY", 1); - const mixShearY = getValue(keyMap, "mixShearY", 1); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); - const nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const mixRotate2 = getValue(nextMap, "mixRotate", 1); - const mixX2 = getValue(nextMap, "mixX", 1), mixY2 = getValue(nextMap, "mixY", mixX2); - const mixScaleX2 = getValue(nextMap, "mixScaleX", 1), mixScaleY2 = getValue(nextMap, "mixScaleY", 1); - const mixShearY2 = getValue(nextMap, "mixShearY", 1); - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - mixScaleX = mixScaleX2; - mixScaleY = mixScaleY2; - mixScaleX = mixScaleX2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - if (map.path) { - for (const constraintName in map.path) { - const constraintMap = map.path[constraintName]; - const constraint = skeletonData.findConstraint(constraintName, PathConstraintData); - if (!constraint) throw new Error(`Path constraint not found: ${constraintName}`); - const index = skeletonData.constraints.indexOf(constraint); - for (const timelineName in constraintMap) { - const timelineMap = constraintMap[timelineName]; - let keyMap = timelineMap[0]; - if (!keyMap) continue; - const frames = timelineMap.length; - switch (timelineName) { - case "position": { - const timeline = new PathConstraintPositionTimeline(frames, frames, index); - readTimeline12(timelines, timelineMap, timeline, 0, constraint.positionMode === 0 /* Fixed */ ? scale : 1); - break; - } - case "spacing": { - const timeline = new PathConstraintSpacingTimeline(frames, frames, index); - readTimeline12(timelines, timelineMap, timeline, 0, constraint.spacingMode === 0 /* Length */ || constraint.spacingMode === 1 /* Fixed */ ? scale : 1); - break; - } - case "mix": { - const timeline = new PathConstraintMixTimeline(frames, frames * 3, index); - let time = getValue(keyMap, "time", 0); - let mixRotate = getValue(keyMap, "mixRotate", 1); - let mixX = getValue(keyMap, "mixX", 1); - let mixY = getValue(keyMap, "mixY", mixX); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY); - const nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const mixRotate2 = getValue(nextMap, "mixRotate", 1); - const mixX2 = getValue(nextMap, "mixX", 1); - const mixY2 = getValue(nextMap, "mixY", mixX2); - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - keyMap = nextMap; - } - timelines.push(timeline); - break; - } - } - } - } - } - if (map.physics) { - for (const constraintName in map.physics) { - const constraintMap = map.physics[constraintName]; - let index = -1; - if (constraintName.length > 0) { - const constraint = skeletonData.findConstraint(constraintName, PhysicsConstraintData); - if (!constraint) throw new Error(`Physics constraint not found: ${constraintName}`); - index = skeletonData.constraints.indexOf(constraint); - } - for (const timelineName in constraintMap) { - const timelineMap = constraintMap[timelineName]; - let keyMap = timelineMap[0]; - if (!keyMap) continue; - const frames = timelineMap.length; - let timeline; - let defaultValue = 0; - if (timelineName === "reset") { - const resetTimeline = new PhysicsConstraintResetTimeline(frames, index); - for (let frame = 0; keyMap != null; keyMap = timelineMap[frame + 1], frame++) - resetTimeline.setFrame(frame, getValue(keyMap, "time", 0)); - timelines.push(resetTimeline); - continue; - } - switch (timelineName) { - case "inertia": - timeline = new PhysicsConstraintInertiaTimeline(frames, frames, index); - break; - case "strength": - timeline = new PhysicsConstraintStrengthTimeline(frames, frames, index); - break; - case "damping": - timeline = new PhysicsConstraintDampingTimeline(frames, frames, index); - break; - case "mass": - timeline = new PhysicsConstraintMassTimeline(frames, frames, index); - break; - case "wind": - timeline = new PhysicsConstraintWindTimeline(frames, frames, index); - break; - case "gravity": - timeline = new PhysicsConstraintGravityTimeline(frames, frames, index); - break; - case "mix": { - defaultValue = 1; - timeline = new PhysicsConstraintMixTimeline(frames, frames, index); - break; - } - default: - continue; - } - readTimeline12(timelines, timelineMap, timeline, defaultValue, 1); - } - } - } - if (map.slider) { - for (const constraintName in map.slider) { - const constraintMap = map.slider[constraintName]; - const constraint = skeletonData.findConstraint(constraintName, SliderData); - if (!constraint) throw new Error(`Slider not found: ${constraintName}`); - const index = skeletonData.constraints.indexOf(constraint); - for (const timelineName in constraintMap) { - const timelineMap = constraintMap[timelineName]; - const keyMap = timelineMap[0]; - if (!keyMap) continue; - const frames = timelineMap.length; - switch (timelineName) { - case "time": - readTimeline12(timelines, timelineMap, new SliderTimeline(frames, frames, index), 1, 1); - break; - case "mix": - readTimeline12(timelines, timelineMap, new SliderMixTimeline(frames, frames, index), 1, 1); - break; - } - } - } - } - if (map.attachments) { - for (const attachmentsName in map.attachments) { - const attachmentsMap = map.attachments[attachmentsName]; - const skin = skeletonData.findSkin(attachmentsName); - if (!skin) throw new Error(`Skin not found: ${attachmentsName}`); - for (const slotMapName in attachmentsMap) { - const slotMap = attachmentsMap[slotMapName]; - const slot = skeletonData.findSlot(slotMapName); - if (!slot) throw new Error(`Slot not found: ${slotMapName}`); - const slotIndex = slot.index; - for (const attachmentMapName in slotMap) { - const attachmentMap = slotMap[attachmentMapName]; - const attachment = skin.getAttachment(slotIndex, attachmentMapName); - if (!attachment) throw new Error(`Timeline attachment not found: ${attachmentMapName}`); - for (const timelineMapName in attachmentMap) { - const timelineMap = attachmentMap[timelineMapName]; - let keyMap = timelineMap[0]; - if (!keyMap) continue; - if (timelineMapName === "deform") { - const weighted = attachment.bones; - const vertices = attachment.vertices; - const deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - const timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment); - let time = getValue(keyMap, "time", 0); - for (let frame = 0, bezier = 0; ; frame++) { - let deform; - const verticesValue = getValue(keyMap, "vertices", null); - if (!verticesValue) - deform = weighted ? Utils.newFloatArray(deformLength) : vertices; - else { - deform = Utils.newFloatArray(deformLength); - const start = getValue(keyMap, "offset", 0); - Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); - if (scale !== 1) { - for (let i = start, n = i + verticesValue.length; i < n; i++) - deform[i] *= scale; - } - if (!weighted) { - for (let i = 0; i < deformLength; i++) - deform[i] += vertices[i]; - } - } - timeline.setFrame(frame, time, deform); - const nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - const time2 = getValue(nextMap, "time", 0); - const curve = keyMap.curve; - if (curve) bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1); - time = time2; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineMapName === "sequence") { - const timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment); - let lastDelay = 0; - for (let frame = 0; frame < timelineMap.length; frame++) { - const delay = getValue(keyMap, "delay", lastDelay); - const time = getValue(keyMap, "time", 0); - const mode = SequenceMode[getValue(keyMap, "mode", "hold")]; - const index = getValue(keyMap, "index", 0); - timeline.setFrame(frame, time, mode, index, delay); - lastDelay = delay; - keyMap = timelineMap[frame + 1]; - } - timelines.push(timeline); - } - } - } - } - } - } - if (map.drawOrder) { - const timeline = new DrawOrderTimeline(map.drawOrder.length); - const slotCount = skeletonData.slots.length; - let frame = 0; - for (let i = 0; i < map.drawOrder.length; i++, frame++) { - const drawOrderMap = map.drawOrder[i]; - let drawOrder = null; - const offsets = getValue(drawOrderMap, "offsets", null); - if (offsets) { - drawOrder = Utils.newArray(slotCount, -1); - const unchanged = Utils.newArray(slotCount - offsets.length, 0); - let originalIndex = 0, unchangedIndex = 0; - for (let ii = 0; ii < offsets.length; ii++) { - const offsetMap = offsets[ii]; - const slot = skeletonData.findSlot(offsetMap.slot); - if (!slot) throw new Error(`Slot not found: ${slot}`); - const slotIndex = slot.index; - while (originalIndex !== slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + offsetMap.offset] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (let ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] === -1) drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frame, getValue(drawOrderMap, "time", 0), drawOrder); - } - timelines.push(timeline); - } - if (map.events) { - const timeline = new EventTimeline(map.events.length); - let frame = 0; - for (let i = 0; i < map.events.length; i++, frame++) { - const eventMap = map.events[i]; - const eventData = skeletonData.findEvent(eventMap.name); - if (!eventData) throw new Error(`Event not found: ${eventMap.name}`); - const event = new Event(Utils.toSinglePrecision(getValue(eventMap, "time", 0)), eventData); - event.intValue = getValue(eventMap, "int", eventData.intValue); - event.floatValue = getValue(eventMap, "float", eventData.floatValue); - event.stringValue = getValue(eventMap, "string", eventData.stringValue); - if (event.data.audioPath) { - event.volume = getValue(eventMap, "volume", 1); - event.balance = getValue(eventMap, "balance", 0); - } - timeline.setFrame(frame, event); - } - timelines.push(timeline); - } - let duration = 0; - for (let i = 0, n = timelines.length; i < n; i++) - duration = Math.max(duration, timelines[i].getDuration()); - skeletonData.animations.push(new Animation(name, timelines, duration)); - } - }; - var LinkedMesh2 = class { - parent; - skin; - slotIndex; - mesh; - inheritTimeline; - constructor(mesh, skin, slotIndex, parent, inheritDeform) { - this.mesh = mesh; - this.skin = skin; - this.slotIndex = slotIndex; - this.parent = parent; - this.inheritTimeline = inheritDeform; - } - }; - function readTimeline12(timelines, keys, timeline, defaultValue, scale) { - let keyMap = keys[0]; - let time = keyMap.time ?? 0; - let value = (keyMap.value ?? defaultValue) * scale; - let bezier = 0; - for (let frame = 0; ; frame++) { - timeline.setFrame(frame, time, value); - const nextMap = keys[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - timelines.push(timeline); - return; - } - const time2 = nextMap.time ?? 0; - const value2 = (nextMap.value ?? defaultValue) * scale; - if (keyMap.curve) bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale); - time = time2; - value = value2; - keyMap = nextMap; - } - } - function readTimeline22(timelines, keys, timeline, name1, name2, defaultValue, scale) { - let keyMap = keys[0]; - let time = keyMap.time ?? 0; - let value1 = (keyMap[name1] ?? defaultValue) * scale; - let value2 = (keyMap[name2] ?? defaultValue) * scale; - let bezier = 0; - for (let frame = 0; ; frame++) { - timeline.setFrame(frame, time, value1, value2); - const nextMap = keys[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - timelines.push(timeline); - return; - } - const time2 = nextMap.time ?? 0; - const nvalue1 = (nextMap[name1] ?? defaultValue) * scale; - const nvalue2 = (nextMap[name2] ?? defaultValue) * scale; - const curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale); - } - time = time2; - value1 = nvalue1; - value2 = nvalue2; - keyMap = nextMap; - } - } - function readCurve(curve, timeline, bezier, frame, value, time1, time2, value1, value2, scale) { - if (curve === "stepped") { - timeline.setStepped(frame); - return bezier; - } - const i = value << 2; - const cx1 = curve[i]; - const cy1 = curve[i + 1] * scale; - const cx2 = curve[i + 2]; - const cy2 = curve[i + 3] * scale; - timeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); - return bezier + 1; - } - function getValue(map, property, defaultValue) { - return map[property] !== void 0 ? map[property] : defaultValue; - } - - // spine-core/src/SkeletonRendererCore.ts - var SkeletonRendererCore = class { - commandPool = new CommandPool(); - worldVertices = new Float32Array(12 * 1024); - quadIndices = new Uint32Array([0, 1, 2, 2, 3, 0]); - clipping = new SkeletonClipping(); - renderCommands = []; - render(skeleton) { - this.commandPool.reset(); - this.renderCommands.length = 0; - const clipper = this.clipping; - for (let i = 0; i < skeleton.slots.length; i++) { - const slot = skeleton.drawOrder[i]; - const attachment = slot.applied.attachment; - if (!attachment) { - clipper.clipEnd(slot); - continue; - } - const slotApplied = slot.applied; - const color = slotApplied.color; - const alpha = color.a; - if ((alpha === 0 || !slot.bone.active) && !(attachment instanceof ClippingAttachment)) { - clipper.clipEnd(slot); - continue; - } - let vertices; - let verticesCount; - let uvs; - let indices; - let indicesCount; - let attachmentColor; - let texture; - if (attachment instanceof RegionAttachment) { - attachmentColor = attachment.color; - if (attachmentColor.a === 0) { - clipper.clipEnd(slot); - continue; - } - attachment.computeWorldVertices(slot, this.worldVertices, 0, 2); - vertices = this.worldVertices; - verticesCount = 4; - uvs = attachment.uvs; - indices = this.quadIndices; - indicesCount = 6; - texture = attachment.region?.texture; - } else if (attachment instanceof MeshAttachment) { - attachmentColor = attachment.color; - if (attachmentColor.a === 0) { - clipper.clipEnd(slot); - continue; - } - if (this.worldVertices.length < attachment.worldVerticesLength) - this.worldVertices = new Float32Array(attachment.worldVerticesLength); - attachment.computeWorldVertices(skeleton, slot, 0, attachment.worldVerticesLength, this.worldVertices, 0, 2); - vertices = this.worldVertices; - verticesCount = attachment.worldVerticesLength >> 1; - uvs = attachment.uvs; - indices = attachment.triangles; - indicesCount = indices.length; - texture = attachment.region?.texture; - } else if (attachment instanceof ClippingAttachment) { - clipper.clipStart(skeleton, slot, attachment); - continue; - } else { - continue; - } - const skelColor = skeleton.color; - const r = Math.floor(skelColor.r * slotApplied.color.r * attachmentColor.r * 255); - const g = Math.floor(skelColor.g * slotApplied.color.g * attachmentColor.g * 255); - const b = Math.floor(skelColor.b * slotApplied.color.b * attachmentColor.b * 255); - const a = Math.floor(skelColor.a * slotApplied.color.a * attachmentColor.a * 255); - let darkColor = 4278190080; - if (slotApplied.darkColor) { - const { r: r2, g: g2, b: b2 } = slotApplied.darkColor; - darkColor = 4278190080 | Math.floor(r2 * 255) << 16 | Math.floor(g2 * 255) << 8 | Math.floor(b2 * 255); - } - if (clipper.isClipping()) { - clipper.clipTrianglesUnpacked(vertices, indices, indicesCount, uvs); - vertices = clipper.clippedVerticesTyped; - verticesCount = clipper.clippedVerticesLength >> 1; - uvs = clipper.clippedUVsTyped; - indices = clipper.clippedTrianglesTyped; - indicesCount = clipper.clippedTrianglesLength; - } - const cmd = this.commandPool.getCommand(verticesCount, indicesCount); - cmd.blendMode = slot.data.blendMode; - cmd.texture = texture; - cmd.positions.set(vertices.subarray(0, verticesCount << 1)); - cmd.uvs.set(uvs.subarray(0, verticesCount << 1)); - for (let j = 0; j < verticesCount; j++) { - cmd.colors[j] = a << 24 | r << 16 | g << 8 | b; - cmd.darkColors[j] = darkColor; - } - if (indices instanceof Uint16Array) { - cmd.indices.set(indices.subarray(0, indicesCount)); - } else { - cmd.indices.set(indices.slice(0, indicesCount)); - } - this.renderCommands.push(cmd); - clipper.clipEnd(slot); - } - clipper.clipEnd(); - return this.batchCommands(); - } - batchSubCommands(commands, first, last, numVertices, numIndices) { - const firstCmd = commands[first]; - const batched = this.commandPool.getCommand(numVertices, numIndices); - batched.blendMode = firstCmd.blendMode; - batched.texture = firstCmd.texture; - let positionsOffset = 0; - let uvsOffset = 0; - let colorsOffset = 0; - let indicesOffset = 0; - let vertexOffset = 0; - for (let i = first; i <= last; i++) { - const cmd = commands[i]; - batched.positions.set(cmd.positions, positionsOffset); - positionsOffset += cmd.numVertices << 1; - batched.uvs.set(cmd.uvs, uvsOffset); - uvsOffset += cmd.numVertices << 1; - batched.colors.set(cmd.colors, colorsOffset); - batched.darkColors.set(cmd.darkColors, colorsOffset); - colorsOffset += cmd.numVertices; - for (let j = 0; j < cmd.numIndices; j++) - batched.indices[indicesOffset + j] = cmd.indices[j] + vertexOffset; - indicesOffset += cmd.numIndices; - vertexOffset += cmd.numVertices; - } - return batched; - } - batchCommands() { - if (this.renderCommands.length === 0) return void 0; - let root; - let last; - let first = this.renderCommands[0]; - let startIndex = 0; - let i = 1; - let numVertices = first.numVertices; - let numIndices = first.numIndices; - while (i <= this.renderCommands.length) { - const cmd = i < this.renderCommands.length ? this.renderCommands[i] : null; - if (cmd && cmd.numVertices === 0 && cmd.numIndices === 0) { - i++; - continue; - } - const canBatch = cmd !== null && cmd.texture === first.texture && cmd.blendMode === first.blendMode && cmd.colors[0] === first.colors[0] && cmd.darkColors[0] === first.darkColors[0] && numIndices + cmd.numIndices < 65535; - if (canBatch) { - numVertices += cmd.numVertices; - numIndices += cmd.numIndices; - } else { - const batched = this.batchSubCommands( - this.renderCommands, - startIndex, - i - 1, - numVertices, - numIndices - ); - if (!last) { - root = last = batched; - } else { - last.next = batched; - last = batched; - } - if (i === this.renderCommands.length) break; - first = this.renderCommands[i]; - startIndex = i; - numVertices = first.numVertices; - numIndices = first.numIndices; - } - i++; - } - return root; - } - }; - var CommandPool = class { - pool = []; - inUse = []; - getCommand(numVertices, numIndices) { - let cmd; - for (const c of this.pool) { - if (c._positions.length >= numVertices << 1 && c._indices.length >= numIndices) { - cmd = c; - break; - } - } - if (!cmd) { - const _positions = new Float32Array(numVertices << 1); - const _uvs = new Float32Array(numVertices << 1); - const _colors = new Uint32Array(numVertices); - const _darkColors = new Uint32Array(numVertices); - const _indices = new Uint16Array(numIndices); - cmd = { - positions: _positions, - uvs: _uvs, - colors: _colors, - darkColors: _darkColors, - indices: _indices, - _positions, - _uvs, - _colors, - _darkColors, - _indices, - numVertices, - numIndices, - blendMode: 0 /* Normal */, - texture: null - }; - } else { - this.pool.splice(this.pool.indexOf(cmd), 1); - cmd.next = void 0; - cmd.numVertices = numVertices; - cmd.numIndices = numIndices; - cmd.positions = cmd._positions.subarray(0, numVertices << 1); - cmd.uvs = cmd._uvs.subarray(0, numVertices * 2); - cmd.colors = cmd._colors.subarray(0, numVertices); - cmd.darkColors = cmd._darkColors.subarray(0, numVertices); - cmd.indices = cmd._indices.subarray(0, numIndices); - } - this.inUse.push(cmd); - return cmd; - } - reset() { - this.pool.push(...this.inUse); - this.inUse.length = 0; - } - }; - - // spine-construct3/spine-construct3-lib/src/C3Texture.ts - var C3TextureEditor = class extends Texture { - texture; - renderer; - constructor(image, renderer, page) { - super(image); - this.renderer = renderer; - const options = { - wrapX: toC3TextureWrap(page.uWrap), - wrapY: toC3TextureWrap(page.vWrap), - sampling: toC3Filter(page.minFilter), - mipMap: toC3MipMap(page.minFilter) - }; - this.texture = renderer.CreateDynamicTexture(image.width, image.height, options); - this.renderer.UpdateTexture(image, this.texture, { premultiplyAlpha: !page.pma }); - } - setFilters() { - } - setWraps() { - } - dispose() { - this.renderer.DeleteTexture(this.texture); - } - }; - var C3Texture = class extends Texture { - texture; - renderer; - constructor(image, renderer, page) { - super(image); - this.renderer = renderer; - const options = { - wrapX: toC3TextureWrap(page.uWrap), - wrapY: toC3TextureWrap(page.vWrap), - sampling: toC3Filter(page.minFilter), - mipMap: toC3MipMap(page.minFilter) - }; - this.texture = renderer.createDynamicTexture(image.width, image.height, options); - this.renderer.updateTexture(image, this.texture, { premultiplyAlpha: !page.pma }); - } - setFilters() { - } - setWraps() { - } - dispose() { - this.renderer.deleteTexture(this.texture); - } - }; - function toC3TextureWrap(wrap) { - if (wrap === 33071 /* ClampToEdge */) return "clamp-to-edge"; - else if (wrap === 33648 /* MirroredRepeat */) return "mirror-repeat"; - else if (wrap === 10497 /* Repeat */) return "repeat"; - else throw new Error(`Unknown texture wrap: ${wrap}`); - } - function toC3MipMap(filter) { - switch (filter) { - case 9987 /* MipMap */: - case 9985 /* MipMapLinearNearest */: - case 9986 /* MipMapNearestLinear */: - case 9984 /* MipMapNearestNearest */: - return true; - case 9729 /* Linear */: - case 9728 /* Nearest */: - return false; - default: - throw new Error(`Unknown texture filter: ${filter}`); - } - } - function toC3Filter(filter) { - switch (filter) { - case 9728 /* Nearest */: - case 9984 /* MipMapNearestNearest */: - return "nearest"; - case 9729 /* Linear */: - case 9985 /* MipMapLinearNearest */: - case 9986 /* MipMapNearestLinear */: - return "bilinear"; - case 9987 /* MipMap */: - case 9987 /* MipMapLinearLinear */: - return "trilinear"; - default: - throw new Error(`Unknown texture filter: ${filter}`); - } - } - var BlendingModeSpineToC3 = { - [0 /* Normal */]: "normal", - [1 /* Additive */]: "additive", - [2 /* Multiply */]: "multiply", - [3 /* Screen */]: "screen" - }; - - // spine-construct3/spine-construct3-lib/src/AssetLoader.ts - var AssetLoader = class _AssetLoader { - async loadSkeletonEditor(sid, textureAtlas, scale = 1, instance) { - const projectFile = instance.GetProject().GetProjectFileBySID(sid); - if (!projectFile) return null; - const blob = projectFile.GetBlob(); - const atlasLoader = new AtlasAttachmentLoader(textureAtlas); - const isBinary = projectFile.GetName().endsWith(".skel"); - if (isBinary) { - const skeletonFile2 = await blob.arrayBuffer(); - const skeletonLoader2 = new SkeletonBinary(atlasLoader); - skeletonLoader2.scale = scale; - return skeletonLoader2.readSkeletonData(skeletonFile2); - } - const skeletonFile = await blob.text(); - const skeletonLoader = new SkeletonJson(atlasLoader); - skeletonLoader.scale = scale; - return skeletonLoader.readSkeletonData(skeletonFile); - } - async loadAtlasEditor(sid, instance, renderer) { - const projectFile = instance.GetProject().GetProjectFileBySID(sid); - if (!projectFile) return null; - const blob = projectFile.GetBlob(); - const content = await blob.text(); - const path = projectFile.GetPath(); - const basePath = path.substring(0, path.lastIndexOf("/") + 1); - const textureAtlas = new TextureAtlas(content); - await Promise.all(textureAtlas.pages.map(async (page) => { - const texture = await this.loadSpineTextureEditor(basePath + page.name, page.pma, instance); - if (texture) { - const spineTexture = new C3TextureEditor(texture, renderer, page); - page.setTexture(spineTexture); - } - return texture; - })); - return textureAtlas; - } - async loadSpineTextureEditor(pageName, pma = false, instance) { - const projectFile = instance.GetProject().GetProjectFileByExportPath(pageName); - if (!projectFile) { - throw new Error(`An error occured while loading the texture: ${pageName}`); - } - const content = projectFile.GetBlob(); - return _AssetLoader.createImageBitmapFromBlob(content, pma); - } - async loadSkeletonRuntime(path, textureAtlas, scale = 1, instance) { - const fullPath = await instance.assets.getProjectFileUrl(path); - if (!fullPath) return null; - const atlasLoader = new AtlasAttachmentLoader(textureAtlas); - const isBinary = path.endsWith(".skel"); - if (isBinary) { - const content2 = await instance.assets.fetchArrayBuffer(fullPath); - if (!content2) return null; - const skeletonLoader2 = new SkeletonBinary(atlasLoader); - skeletonLoader2.scale = scale; - return skeletonLoader2.readSkeletonData(content2); - } - const content = await instance.assets.fetchJson(fullPath); - if (!content) return null; - const skeletonLoader = new SkeletonJson(atlasLoader); - skeletonLoader.scale = scale; - return skeletonLoader.readSkeletonData(content); - } - async loadAtlasRuntime(path, instance, renderer) { - const fullPath = await instance.assets.getProjectFileUrl(path); - if (!fullPath) return null; - const content = await instance.assets.fetchText(fullPath); - if (!content) return null; - const basePath = path.substring(0, path.lastIndexOf("/") + 1); - const textureAtlas = new TextureAtlas(content); - await Promise.all(textureAtlas.pages.map(async (page) => { - const texture = await this.loadSpineTextureRuntime(basePath + page.name, page.pma, instance); - if (texture) { - const spineTexture = new C3Texture(texture, renderer, page); - page.setTexture(spineTexture); - } - return texture; - })); - return textureAtlas; - } - async loadSpineTextureRuntime(pageName, pma = false, instance) { - const fullPath = await instance.assets.getProjectFileUrl(pageName); - if (!fullPath) return null; - const content = await instance.assets.fetchBlob(fullPath); - if (!content) return null; - return _AssetLoader.createImageBitmapFromBlob(content, pma); - } - static async createImageBitmapFromBlob(blob, pma) { - try { - return createImageBitmap(blob, { premultiplyAlpha: pma ? "none" : "premultiply" }); - } catch (e) { - console.error("Failed to create ImageBitmap from blob:", e); - return null; - } - } - }; - - // spine-construct3/spine-construct3-lib/src/SpineBoundsProvider.ts - var AABBRectangleBoundsProvider = class { - constructor(x, y, width, height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - calculateBounds() { - return { x: this.x, y: this.y, width: this.width, height: this.height }; - } - }; - var SetupPoseBoundsProvider = class { - /** - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(clipping = false) { - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton) return { x: 0, y: 0, width: 0, height: 0 }; - const skeleton = new Skeleton(gameObject.skeleton.data); - skeleton.setupPose(); - skeleton.updateWorldTransform(2 /* update */); - const bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : void 0); - return bounds.width === Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } - }; - var SkinsAndAnimationBoundsProvider = class { - /** - * @param animation The animation to use for calculating the bounds. If null, the setup pose is used. - * @param skins The skins to use for calculating the bounds. If empty, the default skin is used. - * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation. - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(animation, skins = [], timeStep = 0.05, clipping = false) { - this.animation = animation; - this.skins = skins; - this.timeStep = timeStep; - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton || !gameObject.state) - return { x: 0, y: 0, width: 0, height: 0 }; - const animationState = new AnimationState(gameObject.state.data); - const skeleton = new Skeleton(gameObject.skeleton.data); - const clipper = this.clipping ? new SkeletonClipping() : void 0; - const data = skeleton.data; - if (this.skins.length > 0) { - const customSkin = new Skin("custom-skin"); - for (const skinName of this.skins) { - const skin = data.findSkin(skinName); - if (skin == null) continue; - customSkin.addSkin(skin); - } - skeleton.setSkin(customSkin); - } - skeleton.setupPose(); - const animation = this.animation != null ? data.findAnimation(this.animation) : null; - if (animation == null) { - skeleton.updateWorldTransform(2 /* update */); - const bounds = skeleton.getBoundsRect(clipper); - return bounds.width === Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } else { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - animationState.clearTracks(); - animationState.setAnimation(0, animation, false); - const steps = Math.max(animation.duration / this.timeStep, 1); - for (let i = 0; i < steps; i++) { - const delta = i > 0 ? this.timeStep : 0; - animationState.update(delta); - animationState.apply(skeleton); - skeleton.update(delta); - skeleton.updateWorldTransform(2 /* update */); - const bounds2 = skeleton.getBoundsRect(clipper); - minX = Math.min(minX, bounds2.x); - minY = Math.min(minY, bounds2.y); - maxX = Math.max(maxX, bounds2.x + bounds2.width); - maxY = Math.max(maxY, bounds2.y + bounds2.height); - } - const bounds = { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; - return bounds.width === Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } - } - }; - return __toCommonJS(index_exports); -})(); -if(!globalThis.spine)globalThis.spine=spine; -//# sourceMappingURL=spine-construct3-lib.js.map diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/iife/spine-construct3-lib.js.map b/spine-ts/spine-construct3/spine-construct3-lib/dist/iife/spine-construct3-lib.js.map deleted file mode 100644 index ef3a4658a..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/iife/spine-construct3-lib.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../src/index.ts", "../../../../spine-core/src/Utils.ts", "../../../../spine-core/src/attachments/Attachment.ts", "../../../../spine-core/src/attachments/Sequence.ts", "../../../../spine-core/src/Animation.ts", "../../../../spine-core/src/AnimationState.ts", "../../../../spine-core/src/AnimationStateData.ts", "../../../../spine-core/src/Texture.ts", "../../../../spine-core/src/TextureAtlas.ts", "../../../../spine-core/src/AssetManagerBase.ts", "../../../../spine-core/src/attachments/BoundingBoxAttachment.ts", "../../../../spine-core/src/attachments/ClippingAttachment.ts", "../../../../spine-core/src/attachments/MeshAttachment.ts", "../../../../spine-core/src/attachments/PathAttachment.ts", "../../../../spine-core/src/attachments/PointAttachment.ts", "../../../../spine-core/src/attachments/RegionAttachment.ts", "../../../../spine-core/src/AtlasAttachmentLoader.ts", "../../../../spine-core/src/BoneLocal.ts", "../../../../spine-core/src/PosedData.ts", "../../../../spine-core/src/BoneData.ts", "../../../../spine-core/src/BonePose.ts", "../../../../spine-core/src/Posed.ts", "../../../../spine-core/src/PosedActive.ts", "../../../../spine-core/src/Bone.ts", "../../../../spine-core/src/Constraint.ts", "../../../../spine-core/src/ConstraintData.ts", "../../../../spine-core/src/Event.ts", "../../../../spine-core/src/EventData.ts", "../../../../spine-core/src/IkConstraintPose.ts", "../../../../spine-core/src/IkConstraint.ts", "../../../../spine-core/src/IkConstraintData.ts", "../../../../spine-core/src/PathConstraintPose.ts", "../../../../spine-core/src/PathConstraintData.ts", "../../../../spine-core/src/PathConstraint.ts", "../../../../spine-core/src/Physics.ts", "../../../../spine-core/src/PhysicsConstraintPose.ts", "../../../../spine-core/src/SlotPose.ts", "../../../../spine-core/src/Slot.ts", "../../../../spine-core/src/Skeleton.ts", "../../../../spine-core/src/PhysicsConstraint.ts", "../../../../spine-core/src/PhysicsConstraintData.ts", "../../../../spine-core/src/polyfills.ts", "../../../../spine-core/src/SkeletonData.ts", "../../../../spine-core/src/Skin.ts", "../../../../spine-core/src/SliderPose.ts", "../../../../spine-core/src/Slider.ts", "../../../../spine-core/src/SliderData.ts", "../../../../spine-core/src/SlotData.ts", "../../../../spine-core/src/TransformConstraintPose.ts", "../../../../spine-core/src/TransformConstraint.ts", "../../../../spine-core/src/TransformConstraintData.ts", "../../../../spine-core/src/SkeletonBinary.ts", "../../../../spine-core/src/SkeletonBounds.ts", "../../../../spine-core/src/Triangulator.ts", "../../../../spine-core/src/SkeletonClipping.ts", "../../../../spine-core/src/SkeletonJson.ts", "../../../../spine-core/src/SkeletonRendererCore.ts", "../../src/C3Texture.ts", "../../src/AssetLoader.ts", "../../src/SpineBoundsProvider.ts"], - "sourcesContent": ["export * from \"@esotericsoftware/spine-core\";\nexport * from './AssetLoader.js';\nexport * from './C3Texture.js';\nexport * from './SpineBoundsProvider.js';\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** biome-ignore-all lint/complexity/noStaticOnlyClass: too much things to update */\n\nimport type { MixBlend } from \"./Animation.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\n\nexport interface StringMap {\n\t[key: string]: T;\n}\n\nexport class IntSet {\n\tarray = [] as (number | undefined)[];\n\n\tadd (value: number): boolean {\n\t\tconst contains = this.contains(value);\n\t\tthis.array[value | 0] = value | 0;\n\t\treturn !contains;\n\t}\n\n\tcontains (value: number) {\n\t\treturn this.array[value | 0] !== undefined;\n\t}\n\n\tremove (value: number) {\n\t\tthis.array[value | 0] = undefined;\n\t}\n\n\tclear () {\n\t\tthis.array.length = 0;\n\t}\n}\n\nexport class StringSet {\n\tentries: StringMap = {};\n\tsize = 0;\n\n\tadd (value: string): boolean {\n\t\tconst contains = this.entries[value];\n\t\tthis.entries[value] = true;\n\t\tif (!contains) {\n\t\t\tthis.size++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\taddAll (values: string[]): boolean {\n\t\tconst oldSize = this.size;\n\t\tfor (let i = 0, n = values.length; i < n; i++)\n\t\t\tthis.add(values[i]);\n\t\treturn oldSize !== this.size;\n\t}\n\n\tcontains (value: string) {\n\t\treturn this.entries[value];\n\t}\n\n\tclear () {\n\t\tthis.entries = {};\n\t\tthis.size = 0;\n\t}\n}\n\nexport type NumberArrayLike = Array | Float32Array;\nexport type IntArrayLike = Array | Int16Array;\n\nexport interface Disposable {\n\tdispose (): void;\n}\n\nexport interface Restorable {\n\trestore (): void;\n}\n\nexport class Color {\n\tpublic static WHITE = new Color(1, 1, 1, 1);\n\tpublic static RED = new Color(1, 0, 0, 1);\n\tpublic static GREEN = new Color(0, 1, 0, 1);\n\tpublic static BLUE = new Color(0, 0, 1, 1);\n\tpublic static MAGENTA = new Color(1, 0, 1, 1);\n\n\tconstructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\n\t}\n\n\tset (r: number, g: number, b: number, a: number) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tthis.a = a;\n\t\treturn this.clamp();\n\t}\n\n\tsetFromColor (c: Color) {\n\t\tthis.r = c.r;\n\t\tthis.g = c.g;\n\t\tthis.b = c.b;\n\t\tthis.a = c.a;\n\t\treturn this;\n\t}\n\n\tsetFromString (hex: string) {\n\t\thex = hex.charAt(0) === '#' ? hex.substr(1) : hex;\n\t\tthis.r = parseInt(hex.substr(0, 2), 16) / 255;\n\t\tthis.g = parseInt(hex.substr(2, 2), 16) / 255;\n\t\tthis.b = parseInt(hex.substr(4, 2), 16) / 255;\n\t\tthis.a = hex.length !== 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255;\n\t\treturn this;\n\t}\n\n\tadd (r: number, g: number, b: number, a: number) {\n\t\tthis.r += r;\n\t\tthis.g += g;\n\t\tthis.b += b;\n\t\tthis.a += a;\n\t\treturn this.clamp();\n\t}\n\n\tclamp () {\n\t\tif (this.r < 0) this.r = 0;\n\t\telse if (this.r > 1) this.r = 1;\n\n\t\tif (this.g < 0) this.g = 0;\n\t\telse if (this.g > 1) this.g = 1;\n\n\t\tif (this.b < 0) this.b = 0;\n\t\telse if (this.b > 1) this.b = 1;\n\n\t\tif (this.a < 0) this.a = 0;\n\t\telse if (this.a > 1) this.a = 1;\n\t\treturn this;\n\t}\n\n\tstatic rgba8888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0xff000000) >>> 24) / 255;\n\t\tcolor.g = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.b = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.a = ((value & 0x000000ff)) / 255;\n\t}\n\n\tstatic rgb888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.g = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.b = ((value & 0x000000ff)) / 255;\n\t}\n\n\ttoRgb888 () {\n\t\tconst hex = (x: number) => (`0${(x * 255).toString(16)}`).slice(-2);\n\t\treturn Number(`0x${hex(this.r)}${hex(this.g)}${hex(this.b)}`);\n\t}\n\n\tstatic fromString (hex: string, color = new Color()): Color {\n\t\treturn color.setFromString(hex);\n\t}\n}\n\nexport class MathUtils {\n\t// biome-ignore lint/suspicious/noApproximativeNumericConstant: reference runtime\n\tstatic PI = 3.1415927;\n\tstatic PI2 = MathUtils.PI * 2;\n\tstatic invPI2 = 1 / MathUtils.PI2;\n\tstatic radiansToDegrees = 180 / MathUtils.PI;\n\tstatic radDeg = MathUtils.radiansToDegrees;\n\tstatic degreesToRadians = MathUtils.PI / 180;\n\tstatic degRad = MathUtils.degreesToRadians;\n\n\tstatic clamp (value: number, min: number, max: number) {\n\t\tif (value < min) return min;\n\t\tif (value > max) return max;\n\t\treturn value;\n\t}\n\n\tstatic cosDeg (degrees: number) {\n\t\treturn Math.cos(degrees * MathUtils.degRad);\n\t}\n\n\tstatic sinDeg (degrees: number) {\n\t\treturn Math.sin(degrees * MathUtils.degRad);\n\t}\n\n\tstatic atan2Deg (y: number, x: number) {\n\t\treturn Math.atan2(y, x) * MathUtils.radDeg;\n\t}\n\n\tstatic signum (value: number): number {\n\t\treturn value > 0 ? 1 : value < 0 ? -1 : 0;\n\t}\n\n\tstatic toInt (x: number) {\n\t\treturn x > 0 ? Math.floor(x) : Math.ceil(x);\n\t}\n\n\tstatic cbrt (x: number) {\n\t\tconst y = Math.pow(Math.abs(x), 1 / 3);\n\t\treturn x < 0 ? -y : y;\n\t}\n\n\tstatic randomTriangular (min: number, max: number): number {\n\t\treturn MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\n\t}\n\n\tstatic randomTriangularWith (min: number, max: number, mode: number): number {\n\t\tconst u = Math.random();\n\t\tconst d = max - min;\n\t\tif (u <= (mode - min) / d) return min + Math.sqrt(u * d * (mode - min));\n\t\treturn max - Math.sqrt((1 - u) * d * (max - mode));\n\t}\n\n\tstatic isPowerOfTwo (value: number) {\n\t\treturn value && (value & (value - 1)) === 0;\n\t}\n}\n\nexport abstract class Interpolation {\n\tprotected abstract applyInternal (a: number): number;\n\tapply (start: number, end: number, a: number): number {\n\t\treturn start + (end - start) * this.applyInternal(a);\n\t}\n}\n\nexport class Pow extends Interpolation {\n\tprotected power = 2;\n\n\tconstructor (power: number) {\n\t\tsuper();\n\t\tthis.power = power;\n\t}\n\n\tapplyInternal (a: number): number {\n\t\tif (a <= 0.5) return Math.pow(a * 2, this.power) / 2;\n\t\treturn Math.pow((a - 1) * 2, this.power) / (this.power % 2 === 0 ? -2 : 2) + 1;\n\t}\n}\n\nexport class PowOut extends Pow {\n\tconstructor (power: number) {\n\t\tsuper(power);\n\t}\n\n\tapplyInternal (a: number): number {\n\t\treturn Math.pow(a - 1, this.power) * (this.power % 2 === 0 ? -1 : 1) + 1;\n\t}\n}\n\nexport class Utils {\n\tstatic SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\n\n\tstatic arrayCopy (source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number) {\n\t\tfor (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\n\t\t\tdest[j] = source[i];\n\t\t}\n\t}\n\n\tstatic arrayFill (array: ArrayLike, fromIndex: number, toIndex: number, value: T) {\n\t\tfor (let i = fromIndex; i < toIndex; i++)\n\t\t\tarray[i] = value;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: ok any in this case\n\tstatic setArraySize (array: Array, size: number, value: any = 0): Array {\n\t\tconst oldSize = array.length;\n\t\tif (oldSize === size) return array;\n\t\tarray.length = size;\n\t\tif (oldSize < size) {\n\t\t\tfor (let i = oldSize; i < size; i++) array[i] = value;\n\t\t}\n\t\treturn array;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: ok any in this case\n\tstatic ensureArrayCapacity (array: Array, size: number, value: any = 0): Array {\n\t\tif (array.length >= size) return array;\n\t\treturn Utils.setArraySize(array, size, value);\n\t}\n\n\tstatic newArray (size: number, defaultValue: T): Array {\n\t\tconst array: T[] = [];\n\t\tfor (let i = 0; i < size; i++) array[i] = defaultValue;\n\t\treturn array;\n\t}\n\n\tstatic newFloatArray (size: number): NumberArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Float32Array(size)\n\t\telse {\n\t\t\tconst array: number[] = [];\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic newShortArray (size: number): IntArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Int16Array(size)\n\t\telse {\n\t\t\tconst array: number[] = [];\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic toFloatArray (array: Array) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\n\t}\n\n\tstatic toSinglePrecision (value: number) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\n\t}\n\n\t// This function is used to fix WebKit 602 specific issue described at https://esotericsoftware.com/forum/d/10109-ios-10-disappearing-graphics\n\tstatic webkit602BugfixHelper (alpha: number, blend: MixBlend) {\n\t}\n\n\tstatic contains (array: Array, element: T, identity = true) {\n\t\tfor (let i = 0; i < array.length; i++)\n\t\t\tif (array[i] === element) return true;\n\t\treturn false;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: ok any in this case\n\tstatic enumValue (type: any, name: string) {\n\t\treturn type[name[0].toUpperCase() + name.slice(1)];\n\t}\n}\n\nexport class DebugUtils {\n\tstatic logBones (skeleton: Skeleton) {\n\t\tfor (let i = 0; i < skeleton.bones.length; i++) {\n\t\t\tconst bone = skeleton.bones[i].applied;\n\t\t\tconsole.log(`${bone.bone.data.name}, ${bone.a}, ${bone.b}, ${bone.c}, ${bone.d}, ${bone.worldX}, ${bone.worldY}`);\n\t\t}\n\t}\n}\n\nexport class Pool {\n\tprivate items = [] as T[];\n\tprivate instantiator: () => T;\n\n\tconstructor (instantiator: () => T) {\n\t\tthis.instantiator = instantiator;\n\t}\n\n\tobtain () {\n\t\t// biome-ignore lint/style/noNonNullAssertion: length check\n\t\treturn this.items.length > 0 ? this.items.pop()! : this.instantiator();\n\t}\n\n\tfree (item: T) {\n\t\t// biome-ignore lint/suspicious/noExplicitAny: T can be anything\n\t\t(item as any).reset?.();\n\t\tthis.items.push(item);\n\t}\n\n\tfreeAll (items: ArrayLike) {\n\t\tfor (let i = 0; i < items.length; i++)\n\t\t\tthis.free(items[i]);\n\t}\n\n\tclear () {\n\t\tthis.items.length = 0;\n\t}\n}\n\nexport class Vector2 {\n\tconstructor (public x = 0, public y = 0) {\n\t}\n\n\tset (x: number, y: number): Vector2 {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tlength () {\n\t\tconst x = this.x;\n\t\tconst y = this.y;\n\t\treturn Math.sqrt(x * x + y * y);\n\t}\n\n\tnormalize () {\n\t\tconst len = this.length();\n\t\tif (len !== 0) {\n\t\t\tthis.x /= len;\n\t\t\tthis.y /= len;\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport class TimeKeeper {\n\tmaxDelta = 0.064;\n\tframesPerSecond = 0;\n\tdelta = 0;\n\ttotalTime = 0;\n\n\tprivate lastTime = Date.now() / 1000;\n\tprivate frameCount = 0;\n\tprivate frameTime = 0;\n\n\tupdate () {\n\t\tconst now = Date.now() / 1000;\n\t\tthis.delta = now - this.lastTime;\n\t\tthis.frameTime += this.delta;\n\t\tthis.totalTime += this.delta;\n\t\tif (this.delta > this.maxDelta) this.delta = this.maxDelta;\n\t\tthis.lastTime = now;\n\n\t\tthis.frameCount++;\n\t\tif (this.frameTime > 1) {\n\t\t\tthis.framesPerSecond = this.frameCount / this.frameTime;\n\t\t\tthis.frameTime = 0;\n\t\t\tthis.frameCount = 0;\n\t\t}\n\t}\n}\n\nexport interface ArrayLike {\n\tlength: number;\n\t[n: number]: T;\n}\n\nexport class WindowedMean {\n\tvalues: Array;\n\taddedValues = 0;\n\tlastValue = 0;\n\tmean = 0;\n\tdirty = true;\n\n\tconstructor (windowSize: number = 32) {\n\t\tthis.values = new Array(windowSize);\n\t}\n\n\thasEnoughData () {\n\t\treturn this.addedValues >= this.values.length;\n\t}\n\n\taddValue (value: number) {\n\t\tif (this.addedValues < this.values.length) this.addedValues++;\n\t\tthis.values[this.lastValue++] = value;\n\t\tif (this.lastValue > this.values.length - 1) this.lastValue = 0;\n\t\tthis.dirty = true;\n\t}\n\n\tgetMean () {\n\t\tif (this.hasEnoughData()) {\n\t\t\tif (this.dirty) {\n\t\t\t\tlet mean = 0;\n\t\t\t\tfor (let i = 0; i < this.values.length; i++)\n\t\t\t\t\tmean += this.values[i];\n\t\t\t\tthis.mean = mean / this.values.length;\n\t\t\t\tthis.dirty = false;\n\t\t\t}\n\t\t\treturn this.mean;\n\t\t}\n\t\treturn 0;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Skeleton } from \"src/Skeleton.js\";\nimport type { Slot } from \"../Slot.js\";\nimport { type NumberArrayLike, Utils } from \"../Utils.js\";\n\n/** The base class for all attachments. */\nexport abstract class Attachment {\n\tname: string;\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\tabstract copy (): Attachment;\n}\n\n/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's\n * {@link SlotPose.deform}. */\nexport abstract class VertexAttachment extends Attachment {\n\tprivate static nextID = 0;\n\n\t/** The unique ID for this attachment. */\n\tid = VertexAttachment.nextID++;\n\n\t/** The bones which affect the {@link vertices}. The array entries are, for each vertex, the number of bones affecting\n\t * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton.bones}. Will be null\n\t * if this attachment has no weights. */\n\tbones: Array | null = null;\n\n\t/** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`\n\t * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting\n\t * each vertex. */\n\tvertices: NumberArrayLike = [];\n\n\t/** The maximum number of world vertex values that can be output by\n\t * {@link computeWorldVertices} using the `count` parameter. */\n\tworldVerticesLength = 0;\n\n\t/** Timelines for the timeline attachment are also applied to this attachment.\n\t * May be null if no attachment-specific timelines should be applied. */\n\ttimelineAttachment: Attachment = this;\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\t/** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link SlotPose.deform} is\n\t * not empty, it is used to deform the vertices.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide.\n\t * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.\n\t * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.\n\t * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *\n\t * `stride` / 2.\n\t * @param offset The `worldVertices` index to begin writing values.\n\t * @param stride The number of `worldVertices` entries between the value pairs written. */\n\tcomputeWorldVertices (skeleton: Skeleton, slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number,\n\t\tstride: number) {\n\n\t\tcount = offset + (count >> 1) * stride;\n\t\tconst deformArray = slot.applied.deform;\n\t\tlet vertices = this.vertices;\n\t\tconst bones = this.bones;\n\t\tif (!bones) {\n\t\t\tif (deformArray.length > 0) vertices = deformArray;\n\t\t\tconst bone = slot.bone.applied;\n\t\t\tconst x = bone.worldX;\n\t\t\tconst y = bone.worldY;\n\t\t\tconst a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\tfor (let v = start, w = offset; w < count; v += 2, w += stride) {\n\t\t\t\tconst vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\tworldVertices[w] = vx * a + vy * b + x;\n\t\t\t\tworldVertices[w + 1] = vx * c + vy * d + y;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet v = 0, skip = 0;\n\t\tfor (let i = 0; i < start; i += 2) {\n\t\t\tconst n = bones[v];\n\t\t\tv += n + 1;\n\t\t\tskip += n;\n\t\t}\n\t\tconst skeletonBones = skeleton.bones;\n\t\tif (deformArray.length === 0) {\n\t\t\tfor (let w = offset, b = skip * 3; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3) {\n\t\t\t\t\tconst bone = skeletonBones[bones[v]].applied;\n\t\t\t\t\tconst vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t} else {\n\t\t\tconst deform = deformArray;\n\t\t\tfor (let w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3, f += 2) {\n\t\t\t\t\tconst bone = skeletonBones[bones[v]].applied;\n\t\t\t\t\tconst vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Does not copy id (generated) or name (set on construction). **/\n\tcopyTo (attachment: VertexAttachment) {\n\t\tif (this.bones) {\n\t\t\tattachment.bones = [];\n\t\t\tUtils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\n\t\t} else\n\t\t\tattachment.bones = null;\n\n\t\tif (this.vertices) {\n\t\t\tattachment.vertices = Utils.newFloatArray(this.vertices.length);\n\t\t\tUtils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\n\t\t}\n\n\t\tattachment.worldVerticesLength = this.worldVerticesLength;\n\t\tattachment.timelineAttachment = this.timelineAttachment;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { SlotPose } from \"src/SlotPose.js\";\nimport type { TextureRegion } from \"../Texture.js\";\nimport { Utils } from \"../Utils.js\";\nimport type { HasTextureRegion } from \"./HasTextureRegion.js\";\n\n\nexport class Sequence {\n\tprivate static _nextID = 0;\n\n\tid = Sequence.nextID();\n\tregions: Array;\n\tstart = 0;\n\tdigits = 0;\n\t/** The index of the region to show for the setup pose. */\n\tsetupIndex = 0;\n\n\tconstructor (count: number) {\n\t\tthis.regions = new Array(count);\n\t}\n\n\tcopy (): Sequence {\n\t\tconst copy = new Sequence(this.regions.length);\n\t\tUtils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length);\n\t\tcopy.start = this.start;\n\t\tcopy.digits = this.digits;\n\t\tcopy.setupIndex = this.setupIndex;\n\t\treturn copy;\n\t}\n\n\tapply (slot: SlotPose, attachment: HasTextureRegion) {\n\t\tlet index = slot.sequenceIndex;\n\t\tif (index === -1) index = this.setupIndex;\n\t\tif (index >= this.regions.length) index = this.regions.length - 1;\n\t\tconst region = this.regions[index];\n\t\tif (attachment.region !== region) {\n\t\t\tattachment.region = region;\n\t\t\tattachment.updateRegion();\n\t\t}\n\t}\n\n\tgetPath (basePath: string, index: number): string {\n\t\tlet result = basePath;\n\t\tconst frame = (this.start + index).toString();\n\t\tfor (let i = this.digits - frame.length; i > 0; i--)\n\t\t\tresult += \"0\";\n\t\tresult += frame;\n\t\treturn result;\n\t}\n\n\tprivate static nextID (): number {\n\t\treturn Sequence._nextID++;\n\t}\n}\n\nexport enum SequenceMode {\n\thold = 0,\n\tonce = 1,\n\tloop = 2,\n\tpingpong = 3,\n\tonceReverse = 4,\n\tloopReverse = 5,\n\tpingpongReverse = 6\n}\n\nexport const SequenceModeValues = [\n\tSequenceMode.hold,\n\tSequenceMode.once,\n\tSequenceMode.loop,\n\tSequenceMode.pingpong,\n\tSequenceMode.onceReverse,\n\tSequenceMode.loopReverse,\n\tSequenceMode.pingpongReverse\n];\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { type Attachment, VertexAttachment } from \"./attachments/Attachment.js\";\nimport type { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { SequenceMode, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport type { Inherit } from \"./BoneData.js\";\nimport type { BoneLocal } from \"./BoneLocal.js\";\nimport type { Event } from \"./Event.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport type { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport type { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport type { PhysicsConstraintPose } from \"./PhysicsConstraintPose.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { Slot } from \"./Slot.js\";\nimport type { SlotPose } from \"./SlotPose.js\";\nimport { MathUtils, type NumberArrayLike, StringSet, Utils } from \"./Utils.js\";\n\n/** A simple container for a list of timelines and a name. */\nexport class Animation {\n\t/** The animation's name, which is unique across all animations in the skeleton. */\n\treadonly name: string;\n\n\t/** If the returned array or the timelines it contains are modified, {@link setTimelines()} must be called. */\n\ttimelines: Array = [];\n\n\treadonly timelineIds: StringSet;\n\treadonly bones: Array;\n\n\t/** The duration of the animation in seconds, which is usually the highest time of all frames in the timeline. The duration is\n\t * used to know when it has completed and when it should loop back to the start. */\n\tduration: number;\n\n\tconstructor (name: string, timelines: Array, duration: number) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t\tthis.duration = duration;\n\t\tthis.timelineIds = new StringSet();\n\t\tthis.bones = [] as number[];\n\t\tthis.setTimelines(timelines);\n\t}\n\n\tsetTimelines (timelines: Array) {\n\t\tif (!timelines) throw new Error(\"timelines cannot be null.\");\n\t\tthis.timelines = timelines;\n\n\t\tconst n = timelines.length;\n\t\tthis.timelineIds.clear();\n\t\tthis.bones.length = 0;\n\t\tconst boneSet = new Set();\n\t\tconst items = timelines;\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst timeline = items[i];\n\t\t\tthis.timelineIds.addAll(timeline.getPropertyIds());\n\t\t\tif (isBoneTimeline(timeline) && boneSet.add(timeline.boneIndex))\n\t\t\t\tthis.bones.push(timeline.boneIndex);\n\t\t}\n\t}\n\n\thasTimeline (ids: string[]): boolean {\n\t\tfor (let i = 0; i < ids.length; i++)\n\t\t\tif (this.timelineIds.contains(ids[i])) return true;\n\t\treturn false;\n\t}\n\n\t/** Applies the animation's timelines to the specified skeleton.\n\t *\n\t * See Timeline {@link Timeline.apply}.\n\t * @param skeleton The skeleton the animation is being applied to. This provides access to the bones, slots, and other skeleton\n\t * components the timelines may change.\n\t * @param lastTime The last time in seconds this animation was applied. Some timelines trigger only at specific times rather\n\t * than every frame. Pass -1 the first time an animation is applied to ensure frame 0 is triggered.\n\t * @param time The time in seconds the skeleton is being posed for. Most timelines find the frame before and the frame after\n\t * this time and interpolate between the frame values. If beyond the {@link duration} and loop is\n\t * true then the animation will repeat, else the last frame will be applied.\n\t * @param loop If true, the animation repeats after the {@link duration}.\n\t * @param events If any events are fired, they are added to this list. Can be null to ignore fired events or if no timelines\n\t * fire events.\n\t * @param alpha 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between\n\t * 0 and 1 applies values between the current or setup values and the timeline values. By adjusting\n\t * alpha over time, an animation can be mixed in or out. alpha can also be useful to apply\n\t * animations on top of each other (layering).\n\t * @param blend Controls how mixing is applied when alpha < 1.\n\t * @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions,\n\t * such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}.\n\t * @param appliedPose True to to modify the applied pose. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array | null, alpha: number,\n\t\tblend: MixBlend, direction: MixDirection, appliedPose: boolean) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\n\t\tif (loop && this.duration !== 0) {\n\t\t\ttime %= this.duration;\n\t\t\tif (lastTime > 0) lastTime %= this.duration;\n\t\t}\n\n\t\tconst timelines = this.timelines;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\ttimelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction, appliedPose);\n\t}\n}\n\n/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`\n * < 1.\n *\n * See Timeline {@link Timeline.apply}. */\nexport enum MixBlend {\n\t/** Transitions between the setup and timeline values (the current value is not used). Before the first frame, the setup\n\t * value is used.\n\t *

\n\t * setup is intended to transition to or from the setup pose, not for animations layered on top of others. */\n\tsetup,\n\t/** Transitions between the current and timeline values. Before the first frame, transitions between the current and setup\n\t * values. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}, use\n\t * the setup value before the first frame.\n\t *

\n\t * first is intended for the first animations applied, not for animations layered on top of others. */\n\tfirst,\n\t/** Transitions between the current and timeline values. No change is made before the first frame.\n\t *

\n\t * replace is intended for animations layered on top of others, not for the first animations applied. */\n\treplace,\n\t/** Transitions between the current value and the current plus timeline values. No change is made before the first frame.\n\t *

\n\t * add is intended for animations layered on top of others, not for the first animations applied.\n\t *

\n\t * Properties set by additive animations must be set manually or by another animation before applying the additive\n\t * animations, else the property values will increase each time the additive animations are applied. */\n\tadd\n}\n\n/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or\n * mixing in toward 1 (the timeline's value).\n *\n * See Timeline {@link Timeline#apply}. */\nexport enum MixDirection {\n\tin, out\n}\n\nexport enum Property {\n\trotate,\n\tx,\n\ty,\n\tscaleX,\n\tscaleY,\n\tshearX,\n\tshearY,\n\tinherit,\n\trgb,\n\talpha,\n\trgb2,\n\tattachment,\n\tdeform,\n\tevent,\n\tdrawOrder,\n\tikConstraint,\n\ttransformConstraint,\n\tpathConstraintPosition,\n\tpathConstraintSpacing,\n\tpathConstraintMix,\n\tphysicsConstraintInertia,\n\tphysicsConstraintStrength,\n\tphysicsConstraintDamping,\n\tphysicsConstraintMass,\n\tphysicsConstraintWind,\n\tphysicsConstraintGravity,\n\tphysicsConstraintMix,\n\tphysicsConstraintReset,\n\tsequence,\n\tsliderTime,\n\tsliderMix,\n}\n\n/** The interface for all timelines. */\nexport abstract class Timeline {\n\tpropertyIds: string[];\n\tframes: NumberArrayLike;\n\n\tconstructor (frameCount: number, ...propertyIds: string[]) {\n\t\tthis.propertyIds = propertyIds;\n\t\tthis.frames = Utils.newFloatArray(frameCount * this.getFrameEntries());\n\t}\n\n\tgetPropertyIds () {\n\t\treturn this.propertyIds;\n\t}\n\n\tgetFrameEntries (): number {\n\t\treturn 1;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length / this.getFrameEntries();\n\t}\n\n\tgetDuration (): number {\n\t\treturn this.frames[this.frames.length - this.getFrameEntries()];\n\t}\n\n\t/** Applies this timeline to the skeleton.\n\t * @param skeleton The skeleton to which the timeline is being applied. This provides access to the bones, slots, and other\n\t * skeleton components that the timeline may change.\n\t * @param lastTime The last time in seconds this timeline was applied. Timelines such as {@link EventTimeline} trigger only\n\t * at specific times rather than every frame. In that case, the timeline triggers everything between\n\t * lastTime (exclusive) and time (inclusive). Pass -1 the first time an animation is\n\t * applied to ensure frame 0 is triggered.\n\t * @param time The time in seconds that the skeleton is being posed for. Most timelines find the frame before and the frame\n\t * after this time and interpolate between the frame values. If beyond the last frame, the last frame will be\n\t * applied.\n\t * @param events If any events are fired, they are added to this list. Can be null to ignore fired events or if the timeline\n\t * does not fire events.\n\t * @param alpha 0 applies the current or setup value (depending on blend). 1 applies the timeline value.\n\t * Between 0 and 1 applies a value between the current or setup value and the timeline value. By adjusting\n\t * alpha over time, an animation can be mixed in or out. alpha can also be useful to\n\t * apply animations on top of each other (layering).\n\t * @param blend Controls how mixing is applied when alpha < 1.\n\t * @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions,\n\t * such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}, and others such as {@link ScaleTimeline}.\n\t * @param appliedPose True to to modify the applied pose. */\n\tabstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number,\n\t\tblend: MixBlend, direction: MixDirection, appliedPose: boolean): void;\n\n\t/** Linear search using the specified stride (default 1).\n\t * @param time Must be >= the first value in frames.\n\t * @return The index of the first value <= time. */\n\tstatic search (frames: NumberArrayLike, time: number, step = 1) {\n\t\tconst n = frames.length;\n\t\tfor (let i = step; i < n; i += step)\n\t\t\tif (frames[i] > time) return i - step;\n\t\treturn n - step;\n\t}\n}\n\n/** An interface for timelines which change the property of a slot. */\nexport interface SlotTimeline {\n\t/** The index of the slot in {@link Skeleton.slots} that will be changed when this timeline is applied. */\n\tslotIndex: number;\n}\n\nexport function isSlotTimeline (obj: Timeline & Partial): obj is Timeline & SlotTimeline {\n\treturn typeof obj === 'object' && obj !== null && typeof obj.slotIndex === 'number';\n}\n\n/** The base class for timelines that interpolate between frame values using stepped, linear, or a Bezier curve. */\nexport abstract class CurveTimeline extends Timeline {\n\tprotected curves: NumberArrayLike; // type, x, y, ...\n\n\tconstructor (frameCount: number, bezierCount: number, ...propertyIds: string[]) {\n\t\tsuper(frameCount, ...propertyIds);\n\t\tthis.curves = Utils.newFloatArray(frameCount + bezierCount * 18/*BEZIER_SIZE*/);\n\t\tthis.curves[frameCount - 1] = 1/*STEPPED*/;\n\t}\n\n\t/** Sets the specified key frame to linear interpolation. */\n\tsetLinear (frame: number) {\n\t\tthis.curves[frame] = 0/*LINEAR*/;\n\t}\n\n\t/** Sets the specified key frame to stepped interpolation. */\n\tsetStepped (frame: number) {\n\t\tthis.curves[frame] = 1/*STEPPED*/;\n\t}\n\n\t/** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger\n\t * than the actual number of Bezier curves. */\n\tshrink (bezierCount: number) {\n\t\tconst size = this.getFrameCount() + bezierCount * 18/*BEZIER_SIZE*/;\n\t\tif (this.curves.length > size) {\n\t\t\tconst newCurves = Utils.newFloatArray(size);\n\t\t\tUtils.arrayCopy(this.curves, 0, newCurves, 0, size);\n\t\t\tthis.curves = newCurves;\n\t\t}\n\t}\n\n\t/** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than\n\t * one curve per frame.\n\t * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified\n\t * in the constructor), inclusive.\n\t * @param frame Between 0 and frameCount - 1, inclusive.\n\t * @param value The index of the value for this frame that this curve is used for.\n\t * @param time1 The time for the first key.\n\t * @param value1 The value for the first key.\n\t * @param cx1 The time for the first Bezier handle.\n\t * @param cy1 The value for the first Bezier handle.\n\t * @param cx2 The time of the second Bezier handle.\n\t * @param cy2 The value for the second Bezier handle.\n\t * @param time2 The time for the second key.\n\t * @param value2 The value for the second key. */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tconst curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value === 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tconst tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03;\n\t\tconst dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 0.006;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = value1 + dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\t/** Returns the Bezier interpolated value for the specified time.\n\t * @param frameIndex The index into {@link #getFrames()} for the values of the frame before time.\n\t * @param valueOffset The offset from frameIndex to the value this curve is used for.\n\t * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */\n\tgetBezierValue (time: number, frameIndex: number, valueOffset: number, i: number) {\n\t\tconst curves = this.curves;\n\t\tif (curves[i] > time) {\n\t\t\tconst x = this.frames[frameIndex], y = this.frames[frameIndex + valueOffset];\n\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t}\n\t\tconst n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tconst x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tframeIndex += this.getFrameEntries();\n\t\tconst x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y);\n\t}\n}\n\nexport abstract class CurveTimeline1 extends CurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, propertyId: string) {\n\t\tsuper(frameCount, bezierCount, propertyId);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and value for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value: number) {\n\t\tframe <<= 1;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE*/] = value;\n\t}\n\n\t/** Returns the interpolated value for the specified time. */\n\tgetCurveValue (time: number) {\n\t\tconst frames = this.frames;\n\t\tlet i = frames.length - 2;\n\t\tfor (let ii = 2; ii <= i; ii += 2) {\n\t\t\tif (frames[ii] > time) {\n\t\t\t\ti = ii - 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tconst curveType = this.curves[i >> 1];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i], value = frames[i + 1/*VALUE*/];\n\t\t\t\treturn value + (time - before) / (frames[i + 2/*ENTRIES*/] - before) * (frames[i + 2/*ENTRIES*/ + 1/*VALUE*/] - value);\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn frames[i + 1/*VALUE*/];\n\t\t}\n\t\treturn this.getBezierValue(time, i, 1/*VALUE*/, curveType - 2/*BEZIER*/);\n\t}\n\n\tgetRelativeValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tconst value = this.getCurveValue(time);\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup: return setup + value * alpha;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace: return current + (value + setup - current) * alpha;\n\t\t\tcase MixBlend.add: return current + value * alpha;\n\t\t}\n\t}\n\n\tgetAbsoluteValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number, value?: number) {\n\t\tif (value === undefined)\n\t\t\treturn this.getAbsoluteValue1(time, alpha, blend, current, setup);\n\t\telse\n\t\t\treturn this.getAbsoluteValue2(time, alpha, blend, current, setup, value);\n\t}\n\n\tprivate getAbsoluteValue1 (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: return setup;\n\t\t\t\tcase MixBlend.first: return current + (setup - current) * alpha;\n\t\t\t\tdefault: return current;\n\t\t\t}\n\t\t}\n\t\tconst value = this.getCurveValue(time);\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup: return setup + (value - setup) * alpha;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace: return current + (value - current) * alpha;\n\t\t\tcase MixBlend.add: return current + value * alpha;\n\t\t}\n\t}\n\n\tprivate getAbsoluteValue2 (time: number, alpha: number, blend: MixBlend, current: number, setup: number, value: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: return setup;\n\t\t\t\tcase MixBlend.first: return current + (setup - current) * alpha;\n\t\t\t\tdefault: return current;\n\t\t\t}\n\t\t}\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup: return setup + (value - setup) * alpha;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace: return current + (value - current) * alpha;\n\t\t\tcase MixBlend.add: return current + value * alpha;\n\t\t}\n\t}\n\n\tgetScaleValue (time: number, alpha: number, blend: MixBlend, direction: MixDirection, current: number, setup: number) {\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: return setup;\n\t\t\t\tcase MixBlend.first: return current + (setup - current) * alpha;\n\t\t\t\tdefault: return current;\n\t\t\t}\n\t\t}\n\t\tconst value = this.getCurveValue(time) * setup;\n\t\tif (alpha === 1) return blend === MixBlend.add ? current + value - setup : value;\n\t\t// Mixing out uses sign of setup or current pose, else use sign of key.\n\t\tif (direction === MixDirection.out) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup + (Math.abs(value) * MathUtils.signum(setup) - setup) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\treturn current + (Math.abs(value) * MathUtils.signum(current) - current) * alpha;\n\t\t\t}\n\t\t} else {\n\t\t\tlet s = 0;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\ts = Math.abs(setup) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\ts = Math.abs(current) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t}\n\t\t}\n\t\treturn current + (value - setup) * alpha;\n\t}\n}\n\n/** The base class for a {@link CurveTimeline} that is a {@link BoneTimeline} and sets two properties. */\nexport abstract class BoneTimeline2 extends CurveTimeline implements BoneTimeline {\n\treadonly boneIndex;\n\n\t/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}.\n\t * @param propertyIds Unique identifiers for the properties the timeline modifies. */\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number, property1: Property, property2: Property) {\n\t\tsuper(frameCount, bezierCount, `${property1}|${boneIndex}`, `${property2}|${boneIndex}`);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 3/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and values for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value1: number, value2: number) {\n\t\tframe *= 3/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE1*/] = value1;\n\t\tthis.frames[frame + 2/*VALUE2*/] = value2;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number,\n\t\tblend: MixBlend, direction: MixDirection, appliedPose: boolean): void {\n\t\tconst bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) this.apply1(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, blend, direction);\n\t}\n\n\tprotected abstract apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection): void;\n}\n\nexport interface BoneTimeline {\n\t/** The index of the bone in {@link Skeleton.bones} that will be changed when this timeline is applied. */\n\tboneIndex: number;\n}\n\nexport function isBoneTimeline (obj: Timeline & Partial): obj is Timeline & BoneTimeline {\n\treturn typeof obj === 'object' && obj !== null && typeof obj.boneIndex === 'number';\n}\n\nexport abstract class BoneTimeline1 extends CurveTimeline1 implements BoneTimeline {\n\treadonly boneIndex: number;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number, property: Property) {\n\t\tsuper(frameCount, bezierCount, `${property}|${boneIndex}`);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tpublic apply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number,\n\t\tblend: MixBlend, direction: MixDirection, appliedPose: boolean) {\n\n\t\tconst bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) this.apply1(appliedPose ? bone.applied : bone.pose, bone.data.setup, time, alpha, blend, direction);\n\t}\n\n\tprotected abstract apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection): void;\n}\n\n/** Changes a bone's local {@link Bone#rotation}. */\nexport class RotateTimeline extends BoneTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.rotate);\n\t}\n\n\tapply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tpose.rotation = this.getRelativeValue(time, alpha, blend, pose.rotation, setup.rotation);\n\t}\n}\n\n/** Changes a bone's local {@link BoneLocal.x} and {@link BoneLocal.y}. */\nexport class TranslateTimeline extends BoneTimeline2 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.x, Property.y);\n\t}\n\n\tapply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tpose.x = setup.x;\n\t\t\t\t\tpose.y = setup.y;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tpose.x += (setup.x - pose.x) * alpha;\n\t\t\t\t\tpose.y += (setup.y - pose.y) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tconst i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tconst curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tpose.x = setup.x + x * alpha;\n\t\t\t\tpose.y = setup.y + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tpose.x += (setup.x + x - pose.x) * alpha;\n\t\t\t\tpose.y += (setup.y + y - pose.y) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tpose.x += x * alpha;\n\t\t\t\tpose.y += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link BoneLocal.x}. */\nexport class TranslateXTimeline extends BoneTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.x);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tpose.x = this.getRelativeValue(time, alpha, blend, pose.x, setup.x);\n\t}\n}\n\n/** Changes a bone's local {@link BoneLocal.y}. */\nexport class TranslateYTimeline extends BoneTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.y);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tpose.y = this.getRelativeValue(time, alpha, blend, pose.y, setup.y);\n\t}\n}\n\n/** Changes a bone's local {@link BoneLocal.scaleX} and {@link BoneLocal.scaleY}. */\nexport class ScaleTimeline extends BoneTimeline2 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.scaleX, Property.scaleY);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tpose.scaleX = setup.scaleX;\n\t\t\t\t\tpose.scaleY = setup.scaleY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tpose.scaleX += (setup.scaleX - pose.scaleX) * alpha;\n\t\t\t\t\tpose.scaleY += (setup.scaleY - pose.scaleY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x: number, y: number;\n\t\tconst i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tconst curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\t\tx *= setup.scaleX;\n\t\ty *= setup.scaleY;\n\n\t\tif (alpha === 1) {\n\t\t\tif (blend === MixBlend.add) {\n\t\t\t\tpose.scaleX += x - setup.scaleX;\n\t\t\t\tpose.scaleY += y - setup.scaleY;\n\t\t\t} else {\n\t\t\t\tpose.scaleX = x;\n\t\t\t\tpose.scaleY = y;\n\t\t\t}\n\t\t} else {\n\t\t\tlet bx = 0, by = 0;\n\t\t\tif (direction === MixDirection.out) {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = setup.scaleX;\n\t\t\t\t\t\tby = setup.scaleY;\n\t\t\t\t\t\tpose.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tpose.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = pose.scaleX;\n\t\t\t\t\t\tby = pose.scaleY;\n\t\t\t\t\t\tpose.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tpose.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tpose.scaleX += (x - setup.scaleX) * alpha;\n\t\t\t\t\t\tpose.scaleY += (y - setup.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = Math.abs(setup.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(setup.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tpose.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tpose.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = Math.abs(pose.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(pose.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tpose.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tpose.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tpose.scaleX += (x - setup.scaleX) * alpha;\n\t\t\t\t\t\tpose.scaleY += (y - setup.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link BoneLocal.scaleX}. */\nexport class ScaleXTimeline extends BoneTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.scaleX);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tpose.scaleX = this.getScaleValue(time, alpha, blend, direction, pose.scaleX, setup.scaleX);\n\t}\n}\n\n/** Changes a bone's local {@link BoneLocal.scaleY}. */\nexport class ScaleYTimeline extends BoneTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.scaleY);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tpose.scaleY = this.getScaleValue(time, alpha, blend, direction, pose.scaleY, setup.scaleY);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearTimeline extends BoneTimeline2 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.shearX, Property.shearY);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tpose.shearX = setup.shearX;\n\t\t\t\t\tpose.shearY = setup.shearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tpose.shearX += (setup.shearX - pose.shearX) * alpha;\n\t\t\t\t\tpose.shearY += (setup.shearY - pose.shearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tconst i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tconst curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tpose.shearX = setup.shearX + x * alpha;\n\t\t\t\tpose.shearY = setup.shearY + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tpose.shearX += (setup.shearX + x - pose.shearX) * alpha;\n\t\t\t\tpose.shearY += (setup.shearY + y - pose.shearY) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tpose.shearX += x * alpha;\n\t\t\t\tpose.shearY += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearXTimeline extends BoneTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.shearX);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tpose.shearX = this.getRelativeValue(time, alpha, blend, pose.shearX, setup.shearX);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearYTimeline extends BoneTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, boneIndex, Property.shearY);\n\t}\n\n\tprotected apply1 (pose: BoneLocal, setup: BoneLocal, time: number, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tpose.shearY = this.getRelativeValue(time, alpha, blend, pose.shearY, setup.shearY);\n\t}\n}\n\n/** Changes a bone's {@link BoneLocal.inherit}. */\nexport class InheritTimeline extends Timeline implements BoneTimeline {\n\treadonly boneIndex: number;\n\n\tconstructor (frameCount: number, boneIndex: number) {\n\t\tsuper(frameCount, `${Property.inherit}|${boneIndex}`);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tpublic getFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the inherit transform mode for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tpublic setFrame (frame: number, time: number, inherit: Inherit) {\n\t\tframe *= 2/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*INHERIT*/] = inherit;\n\t}\n\n\tpublic apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\t\tconst pose = appliedPose ? bone.applied : bone.pose;\n\n\t\tif (direction === MixDirection.out) {\n\t\t\tif (blend === MixBlend.setup) pose.inherit = bone.data.setup.inherit;\n\t\t\treturn;\n\t\t}\n\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend === MixBlend.setup || blend === MixBlend.first) pose.inherit = bone.data.setup.inherit;\n\t\t} else\n\t\t\tpose.inherit = this.frames[Timeline.search(frames, time, 2/*ENTRIES*/) + 1/*INHERIT*/];\n\t}\n}\n\nexport abstract class SlotCurveTimeline extends CurveTimeline implements SlotTimeline {\n\treadonly slotIndex: number;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number, ...propertyIds: string[]) {\n\t\tsuper(frameCount, bezierCount, ...propertyIds);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst slot = skeleton.slots[this.slotIndex];\n\t\tif (slot.bone.active) this.apply1(slot, appliedPose ? slot.applied : slot.pose, time, alpha, blend);\n\t}\n\n\tprotected abstract apply1 (slot: Slot, pose: SlotPose, time: number, alpha: number, blend: MixBlend): void;\n}\n\n/** Changes a slot's {@link SlotPose.color}. */\nexport class RGBATimeline extends SlotCurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, slotIndex, //\n\t\t\t`${Property.rgb}|${slotIndex}`, //\n\t\t\t`${Property.alpha}|${slotIndex}`);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 5/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number) {\n\t\tframe *= 5/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t}\n\n\tprotected apply1 (slot: Slot, pose: SlotPose, time: number, alpha: number, blend: MixBlend) {\n\t\tconst frames = this.frames;\n\t\tconst color = pose.color;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = slot.data.setup.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: color.setFromColor(setup); break;\n\t\t\t\tcase MixBlend.first: color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha,\n\t\t\t\t\t(setup.a - color.a) * alpha); break;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0;\n\t\tconst i = Timeline.search(frames, time, 5/*ENTRIES*/);\n\t\tconst curveType = this.curves[i / 5/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 5/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 5/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 5/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 5/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 5/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha === 1)\n\t\t\tcolor.set(r, g, b, a);\n\t\telse {\n\t\t\tif (blend === MixBlend.setup) color.setFromColor(slot.data.setup.color);\n\t\t\tcolor.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\n\t\t}\n\t}\n}\n\n/** Changes the RGB for a slot's {@link SlotPose.color}. */\nexport class RGBTimeline extends SlotCurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, slotIndex, `${Property.rgb}|${slotIndex}`);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number) {\n\t\tframe <<= 2;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t}\n\n\tprotected apply1 (slot: Slot, pose: SlotPose, time: number, alpha: number, blend: MixBlend) {\n\t\tconst frames = this.frames;\n\t\tconst color = pose.color;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = slot.data.setup.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.r = setup.r;\n\t\t\t\t\tcolor.g = setup.g;\n\t\t\t\t\tcolor.b = setup.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.r += (setup.r - color.r) * alpha;\n\t\t\t\t\tcolor.g += (setup.g - color.g) * alpha;\n\t\t\t\t\tcolor.b += (setup.b - color.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0;\n\t\tconst i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tconst curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 4/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 4/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 4/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha === 1) {\n\t\t\tcolor.r = r;\n\t\t\tcolor.g = g;\n\t\t\tcolor.b = b;\n\t\t} else {\n\t\t\tif (blend === MixBlend.setup) {\n\t\t\t\tconst setup = slot.data.setup.color;\n\t\t\t\tcolor.r = setup.r;\n\t\t\t\tcolor.g = setup.g;\n\t\t\t\tcolor.b = setup.b;\n\t\t\t}\n\t\t\tcolor.r += (r - color.r) * alpha;\n\t\t\tcolor.g += (g - color.g) * alpha;\n\t\t\tcolor.b += (b - color.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes the alpha for a slot's {@link SlotPose.color}. */\nexport class AlphaTimeline extends CurveTimeline1 implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, `${Property.alpha}|${slotIndex}`);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tconst color = (appliedPose ? slot.applied : slot.pose).color;\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = slot.data.setup.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: color.a = setup.a; break;\n\t\t\t\tcase MixBlend.first: color.a += (setup.a - color.a) * alpha; break;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst a = this.getCurveValue(time);\n\t\tif (alpha === 1)\n\t\t\tcolor.a = a;\n\t\telse {\n\t\t\tif (blend === MixBlend.setup) color.a = slot.data.setup.color.a;\n\t\t\tcolor.a += (a - color.a) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link SlotPose.color} and {@link SlotPose.darkColor} for two color tinting. */\nexport class RGBA2Timeline extends SlotCurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, slotIndex, //\n\t\t\t`${Property.rgb}|${slotIndex}`, //\n\t\t\t`${Property.alpha}|${slotIndex}`, //\n\t\t\t`${Property.rgb2}|${slotIndex}`);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 8/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number) {\n\t\tframe <<= 3;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t\tthis.frames[frame + 5/*R2*/] = r2;\n\t\tthis.frames[frame + 6/*G2*/] = g2;\n\t\tthis.frames[frame + 7/*B2*/] = b2;\n\t}\n\n\tprotected apply1 (slot: Slot, pose: SlotPose, time: number, alpha: number, blend: MixBlend) {\n\t\tconst frames = this.frames;\n\t\t// biome-ignore lint/style/noNonNullAssertion: expected behavior from reference runtime\n\t\tconst light = pose.color, dark = pose.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = slot.data.setup;\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: expected behavior from reference runtime\n\t\t\tconst setupLight = setup.color, setupDark = setup.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.setFromColor(setupLight);\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha,\n\t\t\t\t\t\t(setupLight.a - light.a) * alpha);\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tconst i = Timeline.search(frames, time, 8/*ENTRIES*/);\n\t\tconst curveType = this.curves[i >> 3];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 8/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 8/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 8/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 8/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 8/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tr2 += (frames[i + 8/*ENTRIES*/ + 5/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 8/*ENTRIES*/ + 6/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 8/*ENTRIES*/ + 7/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 5/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 6/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 7/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 6 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha === 1) {\n\t\t\tlight.set(r, g, b, a);\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend === MixBlend.setup) {\n\t\t\t\tconst setup = slot.data.setup;\n\t\t\t\tlight.setFromColor(setup.color);\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: expected behavior from reference runtime\n\t\t\t\tconst setupDark = setup.darkColor!;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link SlotPose.color} and {@link SlotPose.darkColor} for two color tinting. */\nexport class RGB2Timeline extends SlotCurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, slotIndex, //\n\t\t\t`${Property.rgb}|${slotIndex}`, //\n\t\t\t`${Property.rgb2}|${slotIndex}`);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, r2: number, g2: number, b2: number) {\n\t\tframe *= 7/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*R2*/] = r2;\n\t\tthis.frames[frame + 5/*G2*/] = g2;\n\t\tthis.frames[frame + 6/*B2*/] = b2;\n\t}\n\n\tprotected apply1 (slot: Slot, pose: SlotPose, time: number, alpha: number, blend: MixBlend) {\n\t\tconst frames = this.frames;\n\t\t// biome-ignore lint/style/noNonNullAssertion: expected behavior from reference runtime\n\t\tconst light = pose.color, dark = pose.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = slot.data.setup;\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: expected behavior from reference runtime\n\t\t\tconst setupLight = setup.color, setupDark = setup.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.r = setupLight.r;\n\t\t\t\t\tlight.g = setupLight.g;\n\t\t\t\t\tlight.b = setupLight.b;\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.r += (setupLight.r - light.r) * alpha;\n\t\t\t\t\tlight.g += (setupLight.g - light.g) * alpha;\n\t\t\t\t\tlight.b += (setupLight.b - light.b) * alpha;\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tconst i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tconst curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 7/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 7/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 7/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tr2 += (frames[i + 7/*ENTRIES*/ + 4/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 7/*ENTRIES*/ + 5/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 7/*ENTRIES*/ + 6/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 4/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 5/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 6/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha === 1) {\n\t\t\tlight.r = r;\n\t\t\tlight.g = g;\n\t\t\tlight.b = b;\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend === MixBlend.setup) {\n\t\t\t\tconst setup = slot.data.setup;\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: expected behavior from reference runtime\n\t\t\t\tconst setupLight = setup.color, setupDark = setup.darkColor!;\n\t\t\t\tlight.r = setupLight.r;\n\t\t\t\tlight.g = setupLight.g;\n\t\t\t\tlight.b = setupLight.b;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.r += (r - light.r) * alpha;\n\t\t\tlight.g += (g - light.g) * alpha;\n\t\t\tlight.b += (b - light.b) * alpha;\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link SlotPose.ttachment}. */\nexport class AttachmentTimeline extends Timeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\t/** The attachment name for each key frame. May contain null values to clear the attachment. */\n\tattachmentNames: Array;\n\n\tconstructor (frameCount: number, slotIndex: number) {\n\t\tsuper(frameCount, `${Property.attachment}|${slotIndex}`);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachmentNames = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the attachment name for the specified key frame. */\n\tsetFrame (frame: number, time: number, attachmentName: string | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.attachmentNames[frame] = attachmentName;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tconst pose = appliedPose ? slot.applied : slot.pose;\n\n\t\tif (direction === MixDirection.out) {\n\t\t\tif (blend === MixBlend.setup) this.setAttachment(skeleton, pose, slot.data.attachmentName);\n\t\t} else if (time < this.frames[0]) {\n\t\t\tif (blend === MixBlend.setup || blend === MixBlend.first) this.setAttachment(skeleton, pose, slot.data.attachmentName);\n\t\t} else\n\t\t\tthis.setAttachment(skeleton, pose, this.attachmentNames[Timeline.search(this.frames, time)]);\n\t}\n\n\tsetAttachment (skeleton: Skeleton, pose: SlotPose, attachmentName: string | null) {\n\t\tpose.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\n\t}\n}\n\n/** Changes a slot's {@link SlotPose.deform} to deform a {@link VertexAttachment}. */\nexport class DeformTimeline extends SlotCurveTimeline {\n\t/** The attachment that will be deformed.\n\t *\n\t * See {@link VertexAttachment.getTimelineAttachment()}. */\n\treadonly attachment: VertexAttachment;\n\n\t/** The vertices for each key frame. */\n\tvertices: Array;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number, attachment: VertexAttachment) {\n\t\tsuper(frameCount, bezierCount, slotIndex, `${Property.deform}|${slotIndex}|${attachment.id}`);\n\t\tthis.attachment = attachment;\n\t\tthis.vertices = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time and vertices for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds.\n\t * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\n\tsetFrame (frame: number, time: number, vertices: NumberArrayLike) {\n\t\tthis.frames[frame] = time;\n\t\tthis.vertices[frame] = vertices;\n\t}\n\n\t/** @param value1 Ignored (0 is used for a deform timeline).\n\t * @param value2 Ignored (1 is used for a deform timeline). */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tconst curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value === 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tconst tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06;\n\t\tconst dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = (cy1 - cy2 + 0.33333333) * 0.018;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\tgetCurvePercent (time: number, frame: number) {\n\t\tconst curves = this.curves;\n\t\tlet i = curves[frame];\n\t\tswitch (i) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst x = this.frames[frame];\n\t\t\t\treturn (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn 0;\n\t\t}\n\t\ti -= 2/*BEZIER*/;\n\t\tif (curves[i] > time) {\n\t\t\tconst x = this.frames[frame];\n\t\t\treturn curves[i + 1] * (time - x) / (curves[i] - x);\n\t\t}\n\t\tconst n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tconst x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tconst x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t}\n\n\tprotected apply1 (slot: Slot, pose: SlotPose, time: number, alpha: number, blend: MixBlend) {\n\t\tif (!(pose.attachment instanceof VertexAttachment)) return;\n\t\tconst vertexAttachment = pose.attachment;\n\t\tif (vertexAttachment.timelineAttachment !== this.attachment) return;\n\n\t\tconst deform = pose.deform;\n\t\tif (deform.length === 0) blend = MixBlend.setup;\n\n\t\tconst vertices = this.vertices;\n\t\tconst vertexCount = vertices[0].length;\n\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tif (alpha === 1) {\n\t\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdeform.length = vertexCount;\n\t\t\t\t\tif (!vertexAttachment.bones) { // Unweighted vertex positions.\n\t\t\t\t\t\tconst setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (setupVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t} else { // Weighted deform offsets.\n\t\t\t\t\t\talpha = 1 - alpha;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] *= alpha;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tdeform.length = vertexCount;\n\t\tif (time >= frames[frames.length - 1]) { // Time is after last frame.\n\t\t\tconst lastVertices = vertices[frames.length - 1];\n\t\t\tif (alpha === 1) {\n\t\t\t\tif (blend === MixBlend.add) {\n\t\t\t\t\tif (!vertexAttachment.bones) { // Unweighted vertex positions, no alpha.\n\t\t\t\t\t\tconst setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i] - setupVertices[i];\n\t\t\t\t\t} else { // Weighted deform offsets, no alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else // Vertex positions or deform offsets, no alpha.\n\t\t\t\t\tUtils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\t\tif (!vertexAttachment.bones) { // Unweighted vertex positions, with alpha.\n\t\t\t\t\t\t\tconst setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\t\tconst setup = setupVertices[i];\n\t\t\t\t\t\t\t\tdeform[i] = setup + (lastVertices[i] - setup) * alpha;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // Weighted deform offsets, with alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] = lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace: // Vertex positions or deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tif (!vertexAttachment.bones) { // Unweighted vertex positions, no alpha.\n\t\t\t\t\t\t\tconst setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - setupVertices[i]) * alpha;\n\t\t\t\t\t\t} else { // Weighted deform offsets, alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst frame = Timeline.search(frames, time);\n\t\tconst percent = this.getCurvePercent(time, frame);\n\t\tconst prevVertices = vertices[frame];\n\t\tconst nextVertices = vertices[frame + 1];\n\n\t\tif (alpha === 1) {\n\t\t\tif (blend === MixBlend.add) {\n\t\t\t\tif (!vertexAttachment.bones) { // Unweighted vertex positions, no alpha.\n\t\t\t\t\tconst setupVertices = vertexAttachment.vertices;\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tconst prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else { // Weighted deform offsets, no alpha.\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tconst prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (percent === 0)\n\t\t\t\tUtils.arrayCopy(prevVertices, 0, deform, 0, vertexCount)\n\t\t\telse { // Vertex positions or deform offsets, no alpha.\n\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\tconst prev = prevVertices[i];\n\t\t\t\t\tdeform[i] = prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\tif (!vertexAttachment.bones) { // Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tconst setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tconst prev = prevVertices[i], setup = setupVertices[i];\n\t\t\t\t\t\t\tdeform[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tconst prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace: // Vertex positions or deform offsets, with alpha.\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tconst prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - deform[i]) * alpha;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MixBlend.add:\n\t\t\t\t\tif (!vertexAttachment.bones) { // Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tconst setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tconst prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tconst prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */\nexport class SequenceTimeline extends Timeline implements SlotTimeline {\n\tstatic ENTRIES = 3;\n\tstatic MODE = 1;\n\tstatic DELAY = 2;\n\n\treadonly slotIndex: number;\n\treadonly attachment: HasTextureRegion;\n\n\tconstructor (frameCount: number, slotIndex: number, attachment: HasTextureRegion) {\n\t\t// biome-ignore lint/style/noNonNullAssertion: expected behavior from reference runtime\n\t\tsuper(frameCount, `${Property.sequence}|${slotIndex}|${attachment.sequence!.id}`);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachment = attachment;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn SequenceTimeline.ENTRIES;\n\t}\n\n\tgetSlotIndex () {\n\t\treturn this.slotIndex;\n\t}\n\n\tgetAttachment () {\n\t\treturn this.attachment as unknown as Attachment;\n\t}\n\n\t/** Sets the time, mode, index, and frame time for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time Seconds between frames. */\n\tsetFrame (frame: number, time: number, mode: SequenceMode, index: number, delay: number) {\n\t\tconst frames = this.frames;\n\t\tframe *= SequenceTimeline.ENTRIES;\n\t\tframes[frame] = time;\n\t\tframes[frame + SequenceTimeline.MODE] = mode | (index << 4);\n\t\tframes[frame + SequenceTimeline.DELAY] = delay;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tconst pose = appliedPose ? slot.applied : slot.pose;\n\n\t\tconst slotAttachment = pose.attachment;\n\t\tconst attachment = this.attachment as unknown as Attachment;\n\t\tif (slotAttachment !== attachment) {\n\t\t\tif (!(slotAttachment instanceof VertexAttachment)\n\t\t\t\t|| slotAttachment.timelineAttachment !== attachment) return;\n\t\t}\n\n\t\tconst sequence = (slotAttachment as unknown as HasTextureRegion).sequence;\n\t\tif (!sequence) return;\n\n\t\tif (direction === MixDirection.out) {\n\t\t\tif (blend === MixBlend.setup) pose.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend === MixBlend.setup || blend === MixBlend.first) pose.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tconst i = Timeline.search(frames, time, SequenceTimeline.ENTRIES);\n\t\tconst before = frames[i];\n\t\tconst modeAndIndex = frames[i + SequenceTimeline.MODE];\n\t\tconst delay = frames[i + SequenceTimeline.DELAY];\n\n\t\tlet index = modeAndIndex >> 4, count = sequence.regions.length;\n\t\tconst mode = SequenceModeValues[modeAndIndex & 0xf];\n\t\tif (mode !== SequenceMode.hold) {\n\t\t\tindex += (((time - before) / delay + 0.00001) | 0);\n\t\t\tswitch (mode) {\n\t\t\t\tcase SequenceMode.once: index = Math.min(count - 1, index); break;\n\t\t\t\tcase SequenceMode.loop: index %= count; break;\n\t\t\t\tcase SequenceMode.pingpong: {\n\t\t\t\t\tconst n = (count << 1) - 2;\n\t\t\t\t\tindex = n === 0 ? 0 : index % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase SequenceMode.onceReverse: index = Math.max(count - 1 - index, 0); break;\n\t\t\t\tcase SequenceMode.loopReverse: index = count - 1 - (index % count); break;\n\t\t\t\tcase SequenceMode.pingpongReverse: {\n\t\t\t\t\tconst n = (count << 1) - 2;\n\t\t\t\t\tindex = n === 0 ? 0 : (index + count - 1) % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpose.sequenceIndex = index;\n\t}\n}\n\n/** Fires an {@link Event} when specific animation times are reached. */\nexport class EventTimeline extends Timeline {\n\tstatic propertyIds = [`${Property.event}`];\n\n\t/** The event for each key frame. */\n\tevents: Array;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, ...EventTimeline.propertyIds);\n\n\t\tthis.events = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the event for the specified key frame. */\n\tsetFrame (frame: number, event: Event) {\n\t\tthis.frames[frame] = event.time;\n\t\tthis.events[frame] = event;\n\t}\n\n\t/** Fires events for frames > `lastTime` and <= `time`. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number,\n\t\tblend: MixBlend, direction: MixDirection, appliedPose: boolean) {\n\n\t\tif (!firedEvents) return;\n\n\t\tconst frames = this.frames;\n\t\tconst frameCount = this.frames.length;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction, appliedPose);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tlet i = 0;\n\t\tif (lastTime < frames[0])\n\t\t\ti = 0;\n\t\telse {\n\t\t\ti = Timeline.search(frames, lastTime) + 1;\n\t\t\tconst frameTime = frames[i];\n\t\t\twhile (i > 0) { // Fire multiple events with the same frame.\n\t\t\t\tif (frames[i - 1] !== frameTime) break;\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfor (; i < frameCount && time >= frames[i]; i++)\n\t\t\tfiredEvents.push(this.events[i]);\n\t}\n}\n\n/** Changes a skeleton's {@link Skeleton#drawOrder}. */\nexport class DrawOrderTimeline extends Timeline {\n\tstatic propertyIds = [`${Property.drawOrder}`];\n\n\t/** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */\n\tdrawOrders: Array | null>;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, ...DrawOrderTimeline.propertyIds);\n\t\tthis.drawOrders = new Array | null>(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the draw order for the specified key frame.\n\t * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\n\t * draw order. */\n\tsetFrame (frame: number, time: number, drawOrder: Array | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.drawOrders[frame] = drawOrder;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number,\n\t\tblend: MixBlend, direction: MixDirection, appliedPose: boolean) {\n\n\t\tif (direction === MixDirection.out) {\n\t\t\tif (blend === MixBlend.setup) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tif (time < this.frames[0]) {\n\t\t\tif (blend === MixBlend.setup || blend === MixBlend.first) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tconst idx = Timeline.search(this.frames, time);\n\t\tconst drawOrderToSetupIndex = this.drawOrders[idx];\n\t\tif (!drawOrderToSetupIndex)\n\t\t\tUtils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\telse {\n\t\t\tconst drawOrder: Array = skeleton.drawOrder;\n\t\t\tconst slots: Array = skeleton.slots;\n\t\t\tfor (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\n\t\t\t\tdrawOrder[i] = slots[drawOrderToSetupIndex[i]];\n\t\t}\n\t}\n}\n\nexport interface ConstraintTimeline {\n\t/** The index of the constraint in {@link Skeleton.constraints} that will be changed when this timeline is applied, or\n\t * -1 if a specific constraint will not be changed. */\n\treadonly constraintIndex: number;\n}\n\nexport function isConstraintTimeline (obj: Timeline & Partial): obj is Timeline & ConstraintTimeline {\n\treturn typeof obj === 'object' && obj !== null && typeof obj.constraintIndex === 'number';\n}\n\n/** Changes an IK constraint's {@link IkConstraintPose.mix)}, {@link IkConstraintPose.softness},\n * {@link IkConstraintPose.bendDirection}, {@link IkConstraintPose.stretch}, and\n * {@link IkConstraintPose.compress}. */\nexport class IkConstraintTimeline extends CurveTimeline implements ConstraintTimeline {\n\treadonly constraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, `${Property.ikConstraint}|${constraintIndex}`);\n\t\tthis.constraintIndex = constraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 6/*ENTRIES*/;\n\t}\n\n\t/** Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds.\n\t * @param bendDirection 1 or -1. */\n\tsetFrame (frame: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean) {\n\t\tframe *= 6/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*MIX*/] = mix;\n\t\tthis.frames[frame + 2/*SOFTNESS*/] = softness;\n\t\tthis.frames[frame + 3/*BEND_DIRECTION*/] = bendDirection;\n\t\tthis.frames[frame + 4/*COMPRESS*/] = compress ? 1 : 0;\n\t\tthis.frames[frame + 5/*STRETCH*/] = stretch ? 1 : 0;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = constraint.data.setup;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tpose.mix = setup.mix;\n\t\t\t\t\tpose.softness = setup.softness;\n\t\t\t\t\tpose.bendDirection = setup.bendDirection;\n\t\t\t\t\tpose.compress = setup.compress;\n\t\t\t\t\tpose.stretch = setup.stretch;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tpose.mix += (setup.mix - pose.mix) * alpha;\n\t\t\t\t\tpose.softness += (setup.softness - pose.softness) * alpha;\n\t\t\t\t\tpose.bendDirection = setup.bendDirection;\n\t\t\t\t\tpose.compress = setup.compress;\n\t\t\t\t\tpose.stretch = setup.stretch;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet mix = 0, softness = 0;\n\t\tconst i = Timeline.search(frames, time, 6/*ENTRIES*/)\n\t\tconst curveType = this.curves[i / 6/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 6/*ENTRIES*/] - before);\n\t\t\t\tmix += (frames[i + 6/*ENTRIES*/ + 1/*MIX*/] - mix) * t;\n\t\t\t\tsoftness += (frames[i + 6/*ENTRIES*/ + 2/*SOFTNESS*/] - softness) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmix = this.getBezierValue(time, i, 1/*MIX*/, curveType - 2/*BEZIER*/);\n\t\t\t\tsoftness = this.getBezierValue(time, i, 2/*SOFTNESS*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup: {\n\t\t\t\tconst setup = constraint.data.setup;\n\t\t\t\tpose.mix = setup.mix + (mix - setup.mix) * alpha;\n\t\t\t\tpose.softness = setup.softness + (softness - setup.softness) * alpha;\n\t\t\t\tif (direction === MixDirection.out) {\n\t\t\t\t\tpose.bendDirection = setup.bendDirection;\n\t\t\t\t\tpose.compress = setup.compress;\n\t\t\t\t\tpose.stretch = setup.stretch;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tpose.mix += (mix - pose.mix) * alpha;\n\t\t\t\tpose.softness += (softness - pose.softness) * alpha;\n\t\t\t\tif (direction === MixDirection.out) return;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tpose.mix += mix * alpha;\n\t\t\t\tpose.softness += softness * alpha;\n\t\t\t\tif (direction === MixDirection.out) return;\n\t\t\t\tbreak;\n\t\t}\n\t\tpose.bendDirection = frames[i + 3/*BEND_DIRECTION*/];\n\t\tpose.compress = frames[i + 4/*COMPRESS*/] !== 0;\n\t\tpose.stretch = frames[i + 5/*STRETCH*/] !== 0;\n\t}\n}\n\n/** Changes a transform constraint's {@link TransformConstraintPose.mixRotate}, {@link TransformConstraintPose.mixX},\n * {@link TransformConstraintPose.mixY}, {@link TransformConstraintPose.mixScaleX},\n * {@link TransformConstraintPose.mixScaleY}, and {@link TransformConstraintPose.mixShearY}. */\nexport class TransformConstraintTimeline extends CurveTimeline implements ConstraintTimeline {\n\t/** The index of the transform constraint slot in {@link Skeleton.transformConstraints} that will be changed. */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, `${Property.transformConstraint}|${constraintIndex}`);\n\t\tthis.constraintIndex = constraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** Sets the time, rotate mix, translate mix, scale mix, and shear mix for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number, mixScaleX: number, mixScaleY: number,\n\t\tmixShearY: number) {\n\t\tconst frames = this.frames;\n\t\tframe *= 7/*ENTRIES*/;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t\tframes[frame + 4/*SCALEX*/] = mixScaleX;\n\t\tframes[frame + 5/*SCALEY*/] = mixScaleY;\n\t\tframes[frame + 6/*SHEARY*/] = mixShearY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = constraint.data.setup;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tpose.mixRotate = setup.mixRotate;\n\t\t\t\t\tpose.mixX = setup.mixX;\n\t\t\t\t\tpose.mixY = setup.mixY;\n\t\t\t\t\tpose.mixScaleX = setup.mixScaleX;\n\t\t\t\t\tpose.mixScaleY = setup.mixScaleY;\n\t\t\t\t\tpose.mixShearY = setup.mixShearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tpose.mixRotate += (setup.mixRotate - pose.mixRotate) * alpha;\n\t\t\t\t\tpose.mixX += (setup.mixX - pose.mixX) * alpha;\n\t\t\t\t\tpose.mixY += (setup.mixY - pose.mixY) * alpha;\n\t\t\t\t\tpose.mixScaleX += (setup.mixScaleX - pose.mixScaleX) * alpha;\n\t\t\t\t\tpose.mixScaleY += (setup.mixScaleY - pose.mixScaleY) * alpha;\n\t\t\t\t\tpose.mixShearY += (setup.mixShearY - pose.mixShearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate: number, x: number, y: number, scaleX: number, scaleY: number, shearY: number;\n\t\tconst i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tconst curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 7/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 7/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 7/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tscaleX += (frames[i + 7/*ENTRIES*/ + 4/*SCALEX*/] - scaleX) * t;\n\t\t\t\tscaleY += (frames[i + 7/*ENTRIES*/ + 5/*SCALEY*/] - scaleY) * t;\n\t\t\t\tshearY += (frames[i + 7/*ENTRIES*/ + 6/*SHEARY*/] - shearY) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tscaleX = this.getBezierValue(time, i, 4/*SCALEX*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tscaleY = this.getBezierValue(time, i, 5/*SCALEY*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tshearY = this.getBezierValue(time, i, 6/*SHEARY*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup: {\n\t\t\t\tconst setup = constraint.data.setup;\n\t\t\t\tpose.mixRotate = setup.mixRotate + (rotate - setup.mixRotate) * alpha;\n\t\t\t\tpose.mixX = setup.mixX + (x - setup.mixX) * alpha;\n\t\t\t\tpose.mixY = setup.mixY + (y - setup.mixY) * alpha;\n\t\t\t\tpose.mixScaleX = setup.mixScaleX + (scaleX - setup.mixScaleX) * alpha;\n\t\t\t\tpose.mixScaleY = setup.mixScaleY + (scaleY - setup.mixScaleY) * alpha;\n\t\t\t\tpose.mixShearY = setup.mixShearY + (shearY - setup.mixShearY) * alpha;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tpose.mixRotate += (rotate - pose.mixRotate) * alpha;\n\t\t\t\tpose.mixX += (x - pose.mixX) * alpha;\n\t\t\t\tpose.mixY += (y - pose.mixY) * alpha;\n\t\t\t\tpose.mixScaleX += (scaleX - pose.mixScaleX) * alpha;\n\t\t\t\tpose.mixScaleY += (scaleY - pose.mixScaleY) * alpha;\n\t\t\t\tpose.mixShearY += (shearY - pose.mixShearY) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tpose.mixRotate += rotate * alpha;\n\t\t\t\tpose.mixX += x * alpha;\n\t\t\t\tpose.mixY += y * alpha;\n\t\t\t\tpose.mixScaleX += scaleX * alpha;\n\t\t\t\tpose.mixScaleY += scaleY * alpha;\n\t\t\t\tpose.mixShearY += shearY * alpha;\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nexport abstract class ConstraintTimeline1 extends CurveTimeline1 implements ConstraintTimeline {\n\treadonly constraintIndex: number;\n\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number, property: Property) {\n\t\tsuper(frameCount, bezierCount, `${property}|${constraintIndex}`);\n\t\tthis.constraintIndex = constraintIndex;\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraintPose.position}. */\nexport class PathConstraintPositionTimeline extends ConstraintTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.pathConstraintPosition);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\tif (constraint.active) {\n\t\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\t\t\tpose.position = this.getAbsoluteValue(time, alpha, blend, pose.position, constraint.data.setup.position);\n\t\t}\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraintPose.spacing}. */\nexport class PathConstraintSpacingTimeline extends ConstraintTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.pathConstraintSpacing);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\tif (constraint.active) {\n\t\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\t\t\tpose.spacing = this.getAbsoluteValue(time, alpha, blend, pose.spacing, constraint.data.setup.spacing);\n\t\t}\n\t}\n}\n\n/** Changes a transform constraint's {@link PathConstraint.mixRotate()}, {@link PathConstraint.mixX()}, and\n * {@link PathConstraint.mixY()}. */\nexport class PathConstraintMixTimeline extends CurveTimeline implements ConstraintTimeline {\n\treadonly constraintIndex: number;\n\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, `${Property.pathConstraintMix}|${constraintIndex}`);\n\t\tthis.constraintIndex = constraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and color for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number) {\n\t\tconst frames = this.frames;\n\t\tframe <<= 2;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tconst setup = constraint.data.setup;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tpose.mixRotate = setup.mixRotate;\n\t\t\t\t\tpose.mixX = setup.mixX;\n\t\t\t\t\tpose.mixY = setup.mixY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tpose.mixRotate += (setup.mixRotate - pose.mixRotate) * alpha;\n\t\t\t\t\tpose.mixX += (setup.mixX - pose.mixX) * alpha;\n\t\t\t\t\tpose.mixY += (setup.mixY - pose.mixY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate: number, x: number, y: number;\n\t\tconst i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tconst curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/: {\n\t\t\t\tconst before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tconst t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 4/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 4/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 4/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup: {\n\t\t\t\tconst setup = constraint.data.setup;\n\t\t\t\tpose.mixRotate = setup.mixRotate + (rotate - setup.mixRotate) * alpha;\n\t\t\t\tpose.mixX = setup.mixX + (x - setup.mixX) * alpha;\n\t\t\t\tpose.mixY = setup.mixY + (y - setup.mixY) * alpha;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tpose.mixRotate += (rotate - pose.mixRotate) * alpha;\n\t\t\t\tpose.mixX += (x - pose.mixX) * alpha;\n\t\t\t\tpose.mixY += (y - pose.mixY) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tpose.mixRotate += rotate * alpha;\n\t\t\t\tpose.mixX += x * alpha;\n\t\t\t\tpose.mixY += y * alpha;\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/** The base class for most {@link PhysicsConstraint} timelines. */\nexport abstract class PhysicsConstraintTimeline extends ConstraintTimeline1 {\n\t/** @param constraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number, property: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, property);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tif (this.constraintIndex === -1) {\n\t\t\tconst value = time >= this.frames[0] ? this.getCurveValue(time) : 0;\n\t\t\tconst constraints = skeleton.physics;\n\t\t\tfor (const constraint of constraints) {\n\t\t\t\tif (constraint.active && this.global(constraint.data)) {\n\t\t\t\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\t\t\t\t\tthis.set(pose, this.getAbsoluteValue(time, alpha, blend, this.get(pose), this.get(constraint.data.setup), value));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\t\tif (constraint.active) {\n\t\t\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\t\t\t\tthis.set(pose, this.getAbsoluteValue(time, alpha, blend, this.get(pose), this.get(constraint.data.setup)));\n\t\t\t}\n\t\t}\n\t}\n\n\tabstract get (pose: PhysicsConstraintPose): number;\n\n\tabstract set (pose: PhysicsConstraintPose, value: number): void;\n\n\tabstract global (constraint: PhysicsConstraintData): boolean;\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraintPose.inertia}. */\nexport class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.physicsConstraintInertia);\n\t}\n\n\tget (pose: PhysicsConstraintPose): number {\n\t\treturn pose.inertia;\n\t}\n\n\tset (pose: PhysicsConstraintPose, value: number): void {\n\t\tpose.inertia = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.inertiaGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraintPose.strength}. */\nexport class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.physicsConstraintStrength);\n\t}\n\tget (pose: PhysicsConstraintPose): number {\n\t\treturn pose.strength;\n\t}\n\n\tset (pose: PhysicsConstraintPose, value: number): void {\n\t\tpose.strength = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.strengthGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraintPose.damping}. */\nexport class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.physicsConstraintDamping);\n\t}\n\n\tget (pose: PhysicsConstraintPose): number {\n\t\treturn pose.damping;\n\t}\n\n\tset (pose: PhysicsConstraintPose, value: number): void {\n\t\tpose.damping = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.dampingGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraintPose.massInverse}. The timeline values are not inverted. */\nexport class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.physicsConstraintMass);\n\t}\n\n\tget (pose: PhysicsConstraintPose): number {\n\t\treturn 1 / pose.massInverse;\n\t}\n\n\tset (pose: PhysicsConstraintPose, value: number): void {\n\t\tpose.massInverse = 1 / value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.massGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraintPose.wind}. */\nexport class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.physicsConstraintWind);\n\t}\n\n\tget (pose: PhysicsConstraintPose): number {\n\t\treturn pose.wind;\n\t}\n\n\tset (pose: PhysicsConstraintPose, value: number): void {\n\t\tpose.wind = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.windGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraintPose.gravity}. */\nexport class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.physicsConstraintGravity);\n\t}\n\n\tget (pose: PhysicsConstraintPose): number {\n\t\treturn pose.gravity;\n\t}\n\n\tset (pose: PhysicsConstraintPose, value: number): void {\n\t\tpose.gravity = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.gravityGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraintPose.mix}. */\nexport class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.physicsConstraintMix);\n\t}\n\n\tget (pose: PhysicsConstraintPose): number {\n\t\treturn pose.mix;\n\t}\n\n\tset (pose: PhysicsConstraintPose, value: number): void {\n\t\tpose.mix = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.mixGlobal;\n\t}\n}\n\n/** Resets a physics constraint when specific animation times are reached. */\nexport class PhysicsConstraintResetTimeline extends Timeline implements ConstraintTimeline {\n\tprivate static propertyIds: string[] = [Property.physicsConstraintReset.toString()];\n\n\t/** The index of the physics constraint in {@link Skeleton.contraints} that will be reset when this timeline is\n\t* applied, or -1 if all physics constraints in the skeleton will be reset. */\n\treadonly constraintIndex: number;\n\n\t/** @param constraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, ...PhysicsConstraintResetTimeline.propertyIds);\n\t\tthis.constraintIndex = constraintIndex;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive. */\n\tsetFrame (frame: number, time: number) {\n\t\tthis.frames[frame] = time;\n\t}\n\n\t/** Resets the physics constraint when frames > lastTime and <= time. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tlet constraint: PhysicsConstraint | undefined;\n\t\tif (this.constraintIndex !== -1) {\n\t\t\tconstraint = skeleton.constraints[this.constraintIndex] as PhysicsConstraint;\n\t\t\tif (!constraint.active) return;\n\t\t}\n\n\t\tconst frames = this.frames;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, [], alpha, blend, direction, appliedPose);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frames.length - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tif (lastTime < frames[0] || time >= frames[Timeline.search(frames, lastTime) + 1]) {\n\t\t\tif (constraint != null)\n\t\t\t\tconstraint.reset(skeleton);\n\t\t\telse {\n\t\t\t\tfor (const constraint of skeleton.physics) {\n\t\t\t\t\tif (constraint.active) constraint.reset(skeleton);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a slider's {@link SliderPose.time()}. */\nexport class SliderTimeline extends ConstraintTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.sliderTime);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\tif (constraint.active) {\n\t\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\t\t\tpose.time = this.getAbsoluteValue(time, alpha, blend, pose.time, constraint.data.setup.time);\n\t\t}\n\t}\n}\n\n/** Changes a slider's {@link SliderPose.mix()}. */\nexport class SliderMixTimeline extends ConstraintTimeline1 {\n\tconstructor (frameCount: number, bezierCount: number, constraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, constraintIndex, Property.sliderMix);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend,\n\t\tdirection: MixDirection, appliedPose: boolean) {\n\n\t\tconst constraint = skeleton.constraints[this.constraintIndex];\n\t\tif (constraint.active) {\n\t\t\tconst pose = appliedPose ? constraint.applied : constraint.pose;\n\t\t\tpose.mix = this.getAbsoluteValue(time, alpha, blend, pose.mix, constraint.data.setup.mix);\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** biome-ignore-all lint/style/noNonNullAssertion: reference runtime expects some nullable to not be null */\n\nimport { Animation, AttachmentTimeline, DrawOrderTimeline, EventTimeline, MixBlend, MixDirection, RotateTimeline, Timeline } from \"./Animation.js\";\nimport type { AnimationStateData } from \"./AnimationStateData.js\";\nimport type { Event } from \"./Event.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { Slot } from \"./Slot.js\";\nimport { MathUtils, Pool, StringSet, Utils } from \"./Utils.js\";\n\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\n * multiple animations on top of each other (layering).\n *\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */\nexport class AnimationState {\n\tstatic readonly emptyAnimation = new Animation(\"\", [], 0);\n\n\t/** The AnimationStateData to look up mix durations. */\n\tdata: AnimationStateData;\n\n\t/** The list of tracks that currently have animations, which may contain null entries. */\n\treadonly tracks = [] as (TrackEntry | null)[];\n\n\t/** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\n\t * or faster. Defaults to 1.\n\t *\n\t * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\n\ttimeScale = 1;\n\tunkeyedState = 0;\n\n\treadonly events = [] as Event[];\n\treadonly listeners = [] as AnimationStateListener[];\n\tqueue = new EventQueue(this);\n\tpropertyIDs = new StringSet();\n\tanimationsChanged = false;\n\n\ttrackEntryPool = new Pool(() => new TrackEntry());\n\n\tconstructor (data: AnimationStateData) {\n\t\tthis.data = data;\n\t}\n\n\t/** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\n\tupdate (delta: number) {\n\t\tdelta *= this.timeScale;\n\t\tconst tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tconst current = tracks[i];\n\t\t\tif (!current) continue;\n\n\t\t\tcurrent.animationLast = current.nextAnimationLast;\n\t\t\tcurrent.trackLast = current.nextTrackLast;\n\n\t\t\tlet currentDelta = delta * current.timeScale;\n\n\t\t\tif (current.delay > 0) {\n\t\t\t\tcurrent.delay -= currentDelta;\n\t\t\t\tif (current.delay > 0) continue;\n\t\t\t\tcurrentDelta = -current.delay;\n\t\t\t\tcurrent.delay = 0;\n\t\t\t}\n\n\t\t\tlet next = current.next;\n\t\t\tif (next) {\n\t\t\t\t// When the next entry's delay is passed, change to the next entry, preserving leftover time.\n\t\t\t\tconst nextTime = current.trackLast - next.delay;\n\t\t\t\tif (nextTime >= 0) {\n\t\t\t\t\tnext.delay = 0;\n\t\t\t\t\tnext.trackTime += current.timeScale === 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\n\t\t\t\t\tcurrent.trackTime += currentDelta;\n\t\t\t\t\tthis.setCurrent(i, next, true);\n\t\t\t\t\twhile (next.mixingFrom) {\n\t\t\t\t\t\tnext.mixTime += delta;\n\t\t\t\t\t\tnext = next.mixingFrom;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {\n\t\t\t\ttracks[i] = null;\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (current.mixingFrom && this.updateMixingFrom(current, delta)) {\n\t\t\t\t// End mixing from entries once all have completed.\n\t\t\t\tlet from: TrackEntry | null = current.mixingFrom;\n\t\t\t\tcurrent.mixingFrom = null;\n\t\t\t\tif (from) from.mixingTo = null;\n\t\t\t\twhile (from) {\n\t\t\t\t\tthis.queue.end(from);\n\t\t\t\t\tfrom = from.mixingFrom;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent.trackTime += currentDelta;\n\t\t}\n\n\t\tthis.queue.drain();\n\t}\n\n\t/** Returns true when all mixing from entries are complete. */\n\tupdateMixingFrom (to: TrackEntry, delta: number): boolean {\n\t\tconst from = to.mixingFrom;\n\t\tif (!from) return true;\n\n\t\tconst finished = this.updateMixingFrom(from, delta);\n\n\t\tfrom.animationLast = from.nextAnimationLast;\n\t\tfrom.trackLast = from.nextTrackLast;\n\n\t\t// The from entry was applied at least once and the mix is complete.\n\t\tif (to.nextTrackLast !== -1 && to.mixTime >= to.mixDuration) {\n\t\t\t// Mixing is complete for all entries before the from entry or the mix is instantaneous.\n\t\t\tif (from.totalAlpha === 0 || to.mixDuration === 0) {\n\t\t\t\tto.mixingFrom = from.mixingFrom;\n\t\t\t\tif (from.mixingFrom != null) from.mixingFrom.mixingTo = to;\n\t\t\t\tto.interruptAlpha = from.interruptAlpha;\n\t\t\t\tthis.queue.end(from);\n\t\t\t}\n\t\t\treturn finished;\n\t\t}\n\n\t\tfrom.trackTime += delta * from.timeScale;\n\t\tto.mixTime += delta;\n\t\treturn false;\n\t}\n\n\t/** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\n\t * animation state can be applied to multiple skeletons to pose them identically.\n\t * @returns True if any animations were applied. */\n\tapply (skeleton: Skeleton): boolean {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tif (this.animationsChanged) this._animationsChanged();\n\n\t\tconst events = this.events;\n\t\tconst tracks = this.tracks;\n\t\tlet applied = false;\n\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tconst current = tracks[i];\n\t\t\tif (!current || current.delay > 0) continue;\n\t\t\tapplied = true;\n\t\t\tconst blend: MixBlend = i === 0 ? MixBlend.first : current.mixBlend;\n\n\t\t\t// Apply mixing from entries first.\n\t\t\tlet alpha = current.alpha;\n\t\t\tif (current.mixingFrom)\n\t\t\t\talpha *= this.applyMixingFrom(current, skeleton, blend);\n\t\t\telse if (current.trackTime >= current.trackEnd && !current.next)\n\t\t\t\talpha = 0;\n\t\t\tlet attachments = alpha >= current.alphaAttachmentThreshold;\n\n\n\t\t\t// Apply current entry.\n\t\t\tlet animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime;\n\t\t\tlet applyEvents: Event[] | null = events;\n\t\t\tif (current.reverse) {\n\t\t\t\tapplyTime = current.animation!.duration - applyTime;\n\t\t\t\tapplyEvents = null;\n\t\t\t}\n\t\t\tconst timelines = current.animation!.timelines;\n\t\t\tconst timelineCount = timelines.length;\n\t\t\tif ((i === 0 && alpha === 1) || blend === MixBlend.add) {\n\t\t\t\tif (i === 0) attachments = true;\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\t// Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\n\t\t\t\t\t// to sometimes stop rendering when using color correction, as their RGBA values become NaN.\n\t\t\t\t\t// (https://github.com/pixijs/pixi-spine/issues/302)\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tconst timeline = timelines[ii];\n\t\t\t\t\tif (timeline instanceof AttachmentTimeline)\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\telse\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection.in, false);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst timelineMode = current.timelineMode;\n\n\t\t\t\tconst shortestRotation = current.shortestRotation;\n\t\t\t\tconst firstFrame = !shortestRotation && current.timelinesRotation.length !== timelineCount << 1;\n\t\t\t\tif (firstFrame) current.timelinesRotation.length = timelineCount << 1;\n\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\tconst timeline = timelines[ii];\n\t\t\t\t\tconst timelineBlend = timelineMode[ii] === SUBSEQUENT ? blend : MixBlend.setup;\n\t\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline) {\n\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);\n\t\t\t\t\t} else if (timeline instanceof AttachmentTimeline) {\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This fixes the WebKit 602 specific issue described at https://esotericsoftware.com/forum/d/10109-ios-10-disappearing-graphics\n\t\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection.in, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.queueEvents(current, animationTime);\n\t\t\tevents.length = 0;\n\t\t\tcurrent.nextAnimationLast = animationTime;\n\t\t\tcurrent.nextTrackLast = current.trackTime;\n\t\t}\n\n\t\t// Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\n\t\t// subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\n\t\t// the time is before the first key).\n\t\tconst setupState = this.unkeyedState + SETUP;\n\t\tconst slots = skeleton.slots;\n\t\tfor (let i = 0, n = skeleton.slots.length; i < n; i++) {\n\t\t\tconst slot = slots[i];\n\t\t\tif (slot.attachmentState === setupState) {\n\t\t\t\tconst attachmentName = slot.data.attachmentName;\n\t\t\t\tslot.pose.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\t\t}\n\t\t}\n\t\tthis.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\n\n\t\tthis.queue.drain();\n\t\treturn applied;\n\t}\n\n\tapplyMixingFrom (to: TrackEntry, skeleton: Skeleton, blend: MixBlend) {\n\t\tconst from = to.mixingFrom!;\n\t\tif (from.mixingFrom) this.applyMixingFrom(from, skeleton, blend);\n\n\t\tlet mix = 0;\n\t\tif (to.mixDuration === 0) { // Single frame mix to undo mixingFrom changes.\n\t\t\tmix = 1;\n\t\t\tif (blend === MixBlend.first) blend = MixBlend.setup;\n\t\t} else {\n\t\t\tmix = to.mixTime / to.mixDuration;\n\t\t\tif (mix > 1) mix = 1;\n\t\t\tif (blend !== MixBlend.first) blend = from.mixBlend;\n\t\t}\n\n\t\tconst attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold;\n\t\tconst timelines = from.animation!.timelines;\n\t\tconst timelineCount = timelines.length;\n\t\tconst alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\n\t\tlet animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime;\n\t\tlet events = null;\n\t\tif (from.reverse)\n\t\t\tapplyTime = from.animation!.duration - applyTime;\n\t\telse if (mix < from.eventThreshold)\n\t\t\tevents = this.events;\n\n\t\tif (blend === MixBlend.add) {\n\t\t\tfor (let i = 0; i < timelineCount; i++)\n\t\t\t\ttimelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, MixDirection.out, false);\n\t\t} else {\n\t\t\tconst timelineMode = from.timelineMode;\n\t\t\tconst timelineHoldMix = from.timelineHoldMix;\n\n\t\t\tconst shortestRotation = from.shortestRotation;\n\t\t\tconst firstFrame = !shortestRotation && from.timelinesRotation.length !== timelineCount << 1;\n\t\t\tif (firstFrame) from.timelinesRotation.length = timelineCount << 1;\n\n\t\t\tfrom.totalAlpha = 0;\n\t\t\tfor (let i = 0; i < timelineCount; i++) {\n\t\t\t\tconst timeline = timelines[i];\n\t\t\t\tlet direction = MixDirection.out;\n\t\t\t\tlet timelineBlend: MixBlend;\n\t\t\t\tlet alpha = 0;\n\t\t\t\tswitch (timelineMode[i]) {\n\t\t\t\t\tcase SUBSEQUENT:\n\t\t\t\t\t\tif (!drawOrder && timeline instanceof DrawOrderTimeline) continue;\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_SUBSEQUENT:\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: { // HOLD_MIX\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\tconst holdMix = timelineHoldMix[i];\n\t\t\t\t\t\talpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfrom.totalAlpha += alpha;\n\n\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline)\n\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);\n\t\t\t\telse if (timeline instanceof AttachmentTimeline)\n\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments && alpha >= from.alphaAttachmentThreshold);\n\t\t\t\telse {\n\t\t\t\t\t// This fixes the WebKit 602 specific issue described at https://esotericsoftware.com/forum/d/10109-ios-10-disappearing-graphics\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tif (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend === MixBlend.setup)\n\t\t\t\t\t\tdirection = MixDirection.in;\n\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (to.mixDuration > 0) this.queueEvents(from, animationTime);\n\t\tthis.events.length = 0;\n\t\tfrom.nextAnimationLast = animationTime;\n\t\tfrom.nextTrackLast = from.trackTime;\n\n\t\treturn mix;\n\t}\n\n\tapplyAttachmentTimeline (timeline: AttachmentTimeline, skeleton: Skeleton, time: number, blend: MixBlend, attachments: boolean) {\n\t\tconst slot = skeleton.slots[timeline.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tif (time < timeline.frames[0]) { // Time is before first frame.\n\t\t\tif (blend === MixBlend.setup || blend === MixBlend.first)\n\t\t\t\tthis.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\n\t\t} else\n\t\t\tthis.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search(timeline.frames, time)], attachments);\n\n\t\t// If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\n\t\tif (slot.attachmentState <= this.unkeyedState) slot.attachmentState = this.unkeyedState + SETUP;\n\t}\n\n\tsetAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string | null, attachments: boolean) {\n\t\tslot.pose.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\tif (attachments) slot.attachmentState = this.unkeyedState + CURRENT;\n\t}\n\n\tapplyRotateTimeline (timeline: RotateTimeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend,\n\t\ttimelinesRotation: Array, i: number, firstFrame: boolean) {\n\n\t\tif (firstFrame) timelinesRotation[i] = 0;\n\n\t\tif (alpha === 1) {\n\t\t\ttimeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.in, false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst bone = skeleton.bones[timeline.boneIndex];\n\t\tif (!bone.active) return;\n\t\tconst pose = bone.pose, setup = bone.data.setup;\n\t\tconst frames = timeline.frames;\n\t\tlet r1 = 0, r2 = 0;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\t// biome-ignore lint/suspicious/noFallthroughSwitchClause: reference runtime does fall through\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tpose.rotation = setup.rotation;\n\t\t\t\t// biome-ignore lint/suspicious/useDefaultSwitchClauseLast: needed for fall through\n\t\t\t\tdefault:\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tr1 = pose.rotation;\n\t\t\t\t\tr2 = setup.rotation;\n\t\t\t}\n\t\t} else {\n\t\t\tr1 = blend === MixBlend.setup ? setup.rotation : pose.rotation;\n\t\t\tr2 = setup.rotation + timeline.getCurveValue(time);\n\t\t}\n\n\t\t// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\n\t\tlet total = 0, diff = r2 - r1;\n\t\tdiff -= Math.ceil(diff / 360 - 0.5) * 360;\n\t\tif (diff === 0) {\n\t\t\ttotal = timelinesRotation[i];\n\t\t} else {\n\t\t\tlet lastTotal = 0, lastDiff = 0;\n\t\t\tif (firstFrame) {\n\t\t\t\tlastTotal = 0;\n\t\t\t\tlastDiff = diff;\n\t\t\t} else {\n\t\t\t\tlastTotal = timelinesRotation[i];\n\t\t\t\tlastDiff = timelinesRotation[i + 1];\n\t\t\t}\n\t\t\tconst loops = lastTotal - lastTotal % 360;\n\t\t\ttotal = diff + loops;\n\t\t\tlet current = diff >= 0, dir = lastTotal >= 0;\n\t\t\tif (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) !== MathUtils.signum(diff)) {\n\t\t\t\tif (Math.abs(lastTotal - loops) > 180) {\n\t\t\t\t\ttotal += 360 * MathUtils.signum(lastTotal);\n\t\t\t\t\tdir = current;\n\t\t\t\t} else if (loops !== 0)\n\t\t\t\t\ttotal -= 360 * MathUtils.signum(lastTotal);\n\t\t\t\telse\n\t\t\t\t\tdir = current;\n\t\t\t}\n\t\t\tif (dir !== current) total += 360 * MathUtils.signum(lastTotal);\n\t\t\ttimelinesRotation[i] = total;\n\t\t}\n\t\ttimelinesRotation[i + 1] = diff;\n\t\tpose.rotation = r1 + total * alpha;\n\t}\n\n\tqueueEvents (entry: TrackEntry, animationTime: number) {\n\t\tconst animationStart = entry.animationStart, animationEnd = entry.animationEnd;\n\t\tconst duration = animationEnd - animationStart;\n\t\tconst trackLastWrapped = entry.trackLast % duration;\n\n\t\t// Queue events before complete.\n\t\tconst events = this.events;\n\t\tlet i = 0, n = events.length;\n\t\tfor (; i < n; i++) {\n\t\t\tconst event = events[i];\n\t\t\tif (event.time < trackLastWrapped) break;\n\t\t\tif (event.time > animationEnd) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\n\t\t// Queue complete if completed a loop iteration or the animation.\n\t\tlet complete = false;\n\t\tif (entry.loop) {\n\t\t\tif (duration === 0)\n\t\t\t\tcomplete = true;\n\t\t\telse {\n\t\t\t\tconst cycles = Math.floor(entry.trackTime / duration);\n\t\t\t\tcomplete = cycles > 0 && cycles > Math.floor(entry.trackLast / duration);\n\t\t\t}\n\t\t} else\n\t\t\tcomplete = animationTime >= animationEnd && entry.animationLast < animationEnd;\n\t\tif (complete) this.queue.complete(entry);\n\n\t\t// Queue events after complete.\n\t\tfor (; i < n; i++) {\n\t\t\tconst event = events[i];\n\t\t\tif (event.time < animationStart) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\t}\n\n\t/** Removes all animations from all tracks, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTracks () {\n\t\tconst oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++)\n\t\t\tthis.clearTrack(i);\n\t\tthis.tracks.length = 0;\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\t/** Removes all animations from the track, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTrack (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return;\n\t\tconst current = this.tracks[trackIndex];\n\t\tif (!current) return;\n\n\t\tthis.queue.end(current);\n\n\t\tthis.clearNext(current);\n\n\t\tlet entry = current;\n\t\twhile (true) {\n\t\t\tconst from = entry.mixingFrom;\n\t\t\tif (!from) break;\n\t\t\tthis.queue.end(from);\n\t\t\tentry.mixingFrom = null;\n\t\t\tentry.mixingTo = null;\n\t\t\tentry = from;\n\t\t}\n\n\t\tthis.tracks[current.trackIndex] = null;\n\n\t\tthis.queue.drain();\n\t}\n\n\tsetCurrent (index: number, current: TrackEntry, interrupt: boolean) {\n\t\tconst from = this.expandToIndex(index);\n\t\tthis.tracks[index] = current;\n\t\tcurrent.previous = null;\n\n\t\tif (from) {\n\t\t\tif (interrupt) this.queue.interrupt(from);\n\t\t\tcurrent.mixingFrom = from;\n\t\t\tfrom.mixingTo = current;\n\t\t\tcurrent.mixTime = 0;\n\n\t\t\t// Store the interrupted mix percentage.\n\t\t\tif (from.mixingFrom && from.mixDuration > 0)\n\t\t\t\tcurrent.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\n\n\t\t\tfrom.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\n\t\t}\n\n\t\tthis.queue.start(current);\n\t}\n\n\t/** Sets an animation by name.\n\t *\n\t * See {@link setAnimation}. */\n\tsetAnimation (trackIndex: number, animationName: string, loop?: boolean): TrackEntry;\n\n\t/** Sets the current animation for a track, discarding any queued animations.\n\t *\n\t * If the formerly current track entry is for the same animation and was never applied to a skeleton, it is replaced (not mixed\n\t * from).\n\t * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. In either case {@link TrackEntry.trackEnd} determines when the track is cleared.\n\t * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener.dispose} event occurs. */\n\tsetAnimation (trackIndex: number, animation: Animation, loop?: boolean): TrackEntry;\n\n\tsetAnimation (trackIndex: number, animationNameOrAnimation: string | Animation, loop = false): TrackEntry {\n\t\tif (typeof animationNameOrAnimation === \"string\")\n\t\t\treturn this.setAnimation1(trackIndex, animationNameOrAnimation, loop);\n\t\treturn this.setAnimation2(trackIndex, animationNameOrAnimation, loop);\n\t}\n\n\tprivate setAnimation1 (trackIndex: number, animationName: string, loop: boolean = false) {\n\t\tconst animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(`Animation not found: ${animationName}`);\n\t\treturn this.setAnimation2(trackIndex, animation, loop);\n\t}\n\n\t/** Sets the current animation for a track, discarding any queued animations.\n\t *

\n\t * If the formerly current track entry is for the same animation and was never applied to a skeleton, it is replaced (not mixed\n\t * from).\n\t * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. In either case {@link TrackEntry#getTrackEnd()} determines when the track is cleared.\n\t * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */\n\tprivate setAnimation2 (trackIndex: number, animation: Animation, loop: boolean = false) {\n\t\tif (trackIndex < 0) throw new Error(\"trackIndex must be >= 0.\");\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\t\tlet interrupt = true;\n\t\tlet current = this.expandToIndex(trackIndex);\n\t\tif (current) {\n\t\t\tif (current.nextTrackLast === -1 && current.animation === animation) {\n\t\t\t\t// Don't mix from an entry that was never applied.\n\t\t\t\tthis.tracks[trackIndex] = current.mixingFrom;\n\t\t\t\tthis.queue.interrupt(current);\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcurrent = current.mixingFrom;\n\t\t\t\tinterrupt = false;\n\t\t\t} else\n\t\t\t\tthis.clearNext(current);\n\t\t}\n\t\tconst entry = this.trackEntry(trackIndex, animation, loop, current);\n\t\tthis.setCurrent(trackIndex, entry, interrupt);\n\t\tthis.queue.drain();\n\t\treturn entry;\n\t}\n\n\t/** Queues an animation by name.\n\t *\n\t * See {@link addAnimation}. */\n\taddAnimation (trackIndex: number, animationName: string, loop?: boolean, delay?: number): TrackEntry;\n\n\t/** Adds an animation to be played after the current or last queued animation for a track. If the track has no entries, this is\n\t * equivalent to calling {@link setAnimation}.\n\t * @param delay If > 0, sets {@link TrackEntry.delay}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration (from the {@link AnimationStateData}) plus the specified delay (ie the mix\n\t * ends at (delay = 0) or before (delay < 0) the previous track entry duration). If the\n\t * previous entry is looping, its next loop completion is used instead of its duration.\n\t * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener.dispose} event occurs. */\n\taddAnimation (trackIndex: number, animation: Animation, loop?: boolean, delay?: number): TrackEntry;\n\n\taddAnimation (trackIndex: number, animationNameOrAnimation: string | Animation, loop = false, delay: number = 0): TrackEntry {\n\t\tif (typeof animationNameOrAnimation === \"string\")\n\t\t\treturn this.addAnimation1(trackIndex, animationNameOrAnimation, loop, delay);\n\t\treturn this.addAnimation2(trackIndex, animationNameOrAnimation, loop, delay);\n\t}\n\n\tprivate addAnimation1 (trackIndex: number, animationName: string, loop: boolean = false, delay: number = 0) {\n\t\tconst animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(`Animation not found: ${animationName}`);\n\t\treturn this.addAnimation2(trackIndex, animation, loop, delay);\n\t}\n\n\tprivate addAnimation2 (trackIndex: number, animation: Animation, loop: boolean = false, delay: number = 0) {\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\n\t\tlet last = this.expandToIndex(trackIndex);\n\t\tif (last) {\n\t\t\twhile (last.next)\n\t\t\t\tlast = last.next;\n\t\t}\n\n\t\tconst entry = this.trackEntry(trackIndex, animation, loop, last);\n\n\t\tif (!last) {\n\t\t\tthis.setCurrent(trackIndex, entry, true);\n\t\t\tthis.queue.drain();\n\t\t\tif (delay < 0) delay = 0;\n\t\t} else {\n\t\t\tlast.next = entry;\n\t\t\tentry.previous = last;\n\t\t\tif (delay <= 0) delay = Math.max(delay + last.getTrackComplete() - entry.mixDuration, 0);\n\t\t}\n\n\t\tentry.delay = delay;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\n\t * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\n\t *\n\t * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\n\t * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\n\t * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\n\t * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\n\t * 0 still mixes out over one frame.\n\t *\n\t * Mixing in is done by first setting an empty animation, then adding an animation using\n\t * {@link #addAnimation()} and on the returned track entry, set the\n\t * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\n\t * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\n\t * setup pose value if no lower tracks key the property to the value keyed in the new animation.\n\t *\n\t * See Empty animations in the Spine\n\t * Runtimes Guide. */\n\tsetEmptyAnimation (trackIndex: number, mixDuration: number = 0) {\n\t\tconst entry = this.setAnimation(trackIndex, AnimationState.emptyAnimation, false);\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\n\t * {@link TrackEntry#getMixDuration()}. If the track has no entries, it is equivalent to calling\n\t * {@link #setEmptyAnimation(int, float)}.\n\t *\n\t * See {@link #setEmptyAnimation(int, float)} and\n\t * Empty animations in the Spine\n\t * Runtimes Guide.\n\t * @param delay If > 0, sets {@link TrackEntry#getDelay()}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration plus the specified delay (ie the mix ends at (delay = 0) or\n\t * before (delay < 0) the previous track entry duration). If the previous entry is looping, its next\n\t * loop completion is used instead of its duration.\n\t * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose(TrackEntry)} event occurs. */\n\taddEmptyAnimation (trackIndex: number, mixDuration: number = 0, delay: number = 0) {\n\t\tconst entry = this.addAnimation(trackIndex, AnimationState.emptyAnimation, false, delay);\n\t\tif (delay <= 0) entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0);\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration.\n\t *\n\t * See Empty animations in the Spine\n\t * Runtimes Guide. */\n\tsetEmptyAnimations (mixDuration: number = 0) {\n\t\tconst oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++) {\n\t\t\tconst current = this.tracks[i];\n\t\t\tif (current) this.setEmptyAnimation(current.trackIndex, mixDuration);\n\t\t}\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\texpandToIndex (index: number) {\n\t\tif (index < this.tracks.length) return this.tracks[index];\n\t\tUtils.ensureArrayCapacity(this.tracks, index + 1, null);\n\t\tthis.tracks.length = index + 1;\n\t\treturn null;\n\t}\n\n\t/** @param last May be null. */\n\ttrackEntry (trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry | null) {\n\t\tconst entry = this.trackEntryPool.obtain();\n\t\tentry.reset();\n\t\tentry.trackIndex = trackIndex;\n\t\tentry.animation = animation;\n\t\tentry.loop = loop;\n\t\tentry.holdPrevious = false;\n\n\t\tentry.reverse = false;\n\t\tentry.shortestRotation = false;\n\n\t\tentry.eventThreshold = 0;\n\t\tentry.alphaAttachmentThreshold = 0;\n\t\tentry.mixAttachmentThreshold = 0;\n\t\tentry.mixDrawOrderThreshold = 0;\n\n\t\tentry.animationStart = 0;\n\t\tentry.animationEnd = animation.duration;\n\t\tentry.animationLast = -1;\n\t\tentry.nextAnimationLast = -1;\n\n\t\tentry.delay = 0;\n\t\tentry.trackTime = 0;\n\t\tentry.trackLast = -1;\n\t\tentry.nextTrackLast = -1;\n\t\tentry.trackEnd = Number.MAX_VALUE;\n\t\tentry.timeScale = 1;\n\n\t\tentry.alpha = 1;\n\t\tentry.mixTime = 0;\n\t\tentry.mixDuration = !last ? 0 : this.data.getMix(last.animation!, animation);\n\t\tentry.interruptAlpha = 1;\n\t\tentry.totalAlpha = 0;\n\t\tentry.mixBlend = MixBlend.replace;\n\t\treturn entry;\n\t}\n\n\t/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */\n\tclearNext (entry: TrackEntry) {\n\t\tlet next = entry.next;\n\t\twhile (next) {\n\t\t\tthis.queue.dispose(next);\n\t\t\tnext = next.next;\n\t\t}\n\t\tentry.next = null;\n\t}\n\n\t_animationsChanged () {\n\t\tthis.animationsChanged = false;\n\n\t\tthis.propertyIDs.clear();\n\t\tconst tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet entry = tracks[i];\n\t\t\tif (!entry) continue;\n\t\t\twhile (entry.mixingFrom)\n\t\t\t\tentry = entry.mixingFrom;\n\t\t\tdo {\n\t\t\t\tif (!entry.mixingTo || entry.mixBlend !== MixBlend.add) this.computeHold(entry);\n\t\t\t\tentry = entry.mixingTo;\n\t\t\t} while (entry);\n\t\t}\n\t}\n\n\tcomputeHold (entry: TrackEntry) {\n\t\tconst to = entry.mixingTo;\n\t\tconst timelines = entry.animation!.timelines;\n\t\tconst timelinesCount = entry.animation!.timelines.length;\n\t\tconst timelineMode = entry.timelineMode;\n\t\ttimelineMode.length = timelinesCount;\n\t\tconst timelineHoldMix = entry.timelineHoldMix;\n\t\ttimelineHoldMix.length = 0;\n\t\tconst propertyIDs = this.propertyIDs;\n\n\t\tif (to?.holdPrevious) {\n\t\t\tfor (let i = 0; i < timelinesCount; i++)\n\t\t\t\ttimelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT;\n\t\t\treturn;\n\t\t}\n\n\t\touter:\n\t\tfor (let i = 0; i < timelinesCount; i++) {\n\t\t\tconst timeline = timelines[i];\n\t\t\tconst ids = timeline.getPropertyIds();\n\t\t\tif (!propertyIDs.addAll(ids))\n\t\t\t\ttimelineMode[i] = SUBSEQUENT;\n\t\t\telse if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\n\t\t\t\t|| timeline instanceof EventTimeline || !to.animation!.hasTimeline(ids)) {\n\t\t\t\ttimelineMode[i] = FIRST;\n\t\t\t} else {\n\t\t\t\tfor (let next = to.mixingTo; next; next = next!.mixingTo) {\n\t\t\t\t\tif (next.animation!.hasTimeline(ids)) continue;\n\t\t\t\t\tif (entry.mixDuration > 0) {\n\t\t\t\t\t\ttimelineMode[i] = HOLD_MIX;\n\t\t\t\t\t\ttimelineHoldMix[i] = next;\n\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttimelineMode[i] = HOLD_FIRST;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\n\tgetCurrent (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return null;\n\t\treturn this.tracks[trackIndex];\n\t}\n\n\t/** Adds a listener to receive events for all track entries. */\n\taddListener (listener: AnimationStateListener) {\n\t\tif (!listener) throw new Error(\"listener cannot be null.\");\n\t\tthis.listeners.push(listener);\n\t}\n\n\t/** Removes the listener added with {@link #addListener()}. */\n\tremoveListener (listener: AnimationStateListener) {\n\t\tconst index = this.listeners.indexOf(listener);\n\t\tif (index >= 0) this.listeners.splice(index, 1);\n\t}\n\n\t/** Removes all listeners added with {@link #addListener()}. */\n\tclearListeners () {\n\t\tthis.listeners.length = 0;\n\t}\n\n\t/** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\n\t * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\n\t * are not wanted because new animations are being set. */\n\tclearListenerNotifications () {\n\t\tthis.queue.clear();\n\t}\n}\n\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\n *\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */\nexport class TrackEntry {\n\t/** The animation to apply for this track entry. */\n\tanimation: Animation | null = null;\n\n\tprevious: TrackEntry | null = null;\n\n\t/** The animation queued to start after this animation, or null. `next` makes up a linked list. */\n\tnext: TrackEntry | null = null;\n\n\t/** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no\n\t * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */\n\tmixingFrom: TrackEntry | null = null;\n\n\t/** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is\n\t * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */\n\tmixingTo: TrackEntry | null = null;\n\n\t/** The listener for events generated by this track entry, or null.\n\t *\n\t * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation\n\t * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */\n\tlistener: AnimationStateListener | null = null;\n\n\t/** The index of the track where this track entry is either current or queued.\n\t *\n\t * See {@link AnimationState#getCurrent()}. */\n\ttrackIndex: number = 0;\n\n\t/** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. */\n\tloop: boolean = false;\n\n\t/** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead\n\t * of being mixed out.\n\t *\n\t * When mixing between animations that key the same property, if a lower track also keys that property then the value will\n\t * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%\n\t * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation\n\t * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which\n\t * keys the property, only when a higher track also keys the property.\n\t *\n\t * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the\n\t * previous animation. */\n\tholdPrevious: boolean = false;\n\n\treverse: boolean = false;\n\n\tshortestRotation: boolean = false;\n\n\t/** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\n\t * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event\n\t * timelines are not applied while this animation is being mixed out. */\n\teventThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the\n\t * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so attachment timelines are not applied while this animation is being mixed out. */\n\tmixAttachmentThreshold: number = 0;\n\n\t/** When {@link #getAlpha()} is greater than alphaAttachmentThreshold, attachment timelines are applied.\n\t * Defaults to 0, so attachment timelines are always applied. */\n\talphaAttachmentThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the\n\t * mixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so draw order timelines are not applied while this animation is being mixed out. */\n\tmixDrawOrderThreshold: number = 0;\n\n\t/** Seconds when this animation starts, both initially and after looping. Defaults to 0.\n\t *\n\t * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same\n\t * value to prevent timeline keys before the start time from triggering. */\n\tanimationStart: number = 0;\n\n\t/** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will\n\t * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */\n\tanimationEnd: number = 0;\n\n\n\t/** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this\n\t * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and\n\t * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation\n\t * is applied. */\n\tanimationLast: number = 0;\n\n\tnextAnimationLast: number = 0;\n\n\t/** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`\n\t * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from\n\t * the start of the previous animation to when this track entry will become the current track entry (ie when the previous\n\t * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).\n\t *\n\t * {@link #timeScale} affects the delay. */\n\tdelay: number = 0;\n\n\t/** Current time in seconds this track entry has been the current track entry. The track time determines\n\t * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting\n\t * looping. */\n\ttrackTime: number = 0;\n\n\ttrackLast: number = 0; nextTrackLast: number = 0;\n\n\t/** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float\n\t * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time\n\t * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the\n\t * properties keyed by the animation are set to the setup pose and the track is cleared.\n\t *\n\t * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation\n\t * abruptly cease being applied. */\n\ttrackEnd: number = 0;\n\n\t/** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or\n\t * faster. Defaults to 1.\n\t *\n\t * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to\n\t * match the animation speed.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If\n\t * the time scale is not 1, the delay may need to be adjusted.\n\t *\n\t * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */\n\ttimeScale: number = 0;\n\n\t/** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults\n\t * to 1, which overwrites the skeleton's current pose with this animation.\n\t *\n\t * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to\n\t * use alpha on track 0 if the skeleton pose is from the last frame render. */\n\talpha: number = 0;\n\n\t/** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be\n\t * slightly more than `mixDuration` when the mix is complete. */\n\tmixTime: number = 0;\n\n\t/** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData\n\t * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).\n\t *\n\t * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the\n\t * properties it was animating.\n\t *\n\t * The `mixDuration` can be set manually rather than use the value from\n\t * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new\n\t * track entry only before {@link AnimationState#update(float)} is next called.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set\n\t * afterward. */\n\tmixDuration: number = 0;\n\n\tinterruptAlpha: number = 0; totalAlpha: number = 0;\n\n\t/** Sets both {@link #getMixDuration()} and {@link #getDelay()}.\n\t * @param delay If > 0, sets {@link TrackEntry#getDelay()}. If <= 0, the delay set is the duration of the previous track\n\t * entry minus the specified mix duration plus the specified delay (ie the mix ends at\n\t * (delay = 0) or before (delay < 0) the previous track entry duration). If the previous\n\t * entry is looping, its next loop completion is used instead of its duration. */\n\tsetMixDuration (mixDuration: number, delay?: number) {\n\t\tthis.mixDuration = mixDuration;\n\t\tif (delay !== undefined) {\n\t\t\tif (delay <= 0) {\n\t\t\t\tif (this.previous != null)\n\t\t\t\t\tdelay = Math.max(delay + this.previous.getTrackComplete() - mixDuration, 0);\n\t\t\t\telse\n\t\t\t\t\tdelay = 0;\n\t\t\t}\n\t\t\tthis.delay = delay;\n\t\t}\n\t}\n\n\t/** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\n\t * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\n\t * the values from the lower tracks.\n\t *\n\t * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is next\n\t * called. */\n\tmixBlend = MixBlend.replace;\n\ttimelineMode = [] as number[];\n\ttimelineHoldMix = [] as TrackEntry[];\n\ttimelinesRotation = [] as number[];\n\n\treset () {\n\t\tthis.next = null;\n\t\tthis.previous = null;\n\t\tthis.mixingFrom = null;\n\t\tthis.mixingTo = null;\n\t\tthis.animation = null;\n\t\tthis.listener = null;\n\t\tthis.timelineMode.length = 0;\n\t\tthis.timelineHoldMix.length = 0;\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\t/** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\n\t * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\n\t * `animationStart` time. */\n\tgetAnimationTime () {\n\t\tif (this.loop) {\n\t\t\tconst duration = this.animationEnd - this.animationStart;\n\t\t\tif (duration === 0) return this.animationStart;\n\t\t\treturn (this.trackTime % duration) + this.animationStart;\n\t\t}\n\t\treturn Math.min(this.trackTime + this.animationStart, this.animationEnd);\n\t}\n\n\tsetAnimationLast (animationLast: number) {\n\t\tthis.animationLast = animationLast;\n\t\tthis.nextAnimationLast = animationLast;\n\t}\n\n\t/** Returns true if at least one loop has been completed.\n\t *\n\t * See {@link AnimationStateListener#complete()}. */\n\tisComplete () {\n\t\treturn this.trackTime >= this.animationEnd - this.animationStart;\n\t}\n\n\t/** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\n\t * long way around when using {@link #alpha} and starting animations on other tracks.\n\t *\n\t * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\n\t * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\n\t * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\n\t * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\n\tresetRotationDirections () {\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\tgetTrackComplete () {\n\t\tconst duration = this.animationEnd - this.animationStart;\n\t\tif (duration !== 0) {\n\t\t\tif (this.loop) return duration * (1 + ((this.trackTime / duration) | 0)); // Completion of next loop.\n\t\t\tif (this.trackTime < duration) return duration; // Before duration.\n\t\t}\n\t\treturn this.trackTime; // Next update.\n\t}\n\n\t/** Returns true if this track entry has been applied at least once.\n\t *

\n\t * See {@link AnimationState#apply(Skeleton)}. */\n\twasApplied () {\n\t\treturn this.nextTrackLast !== -1;\n\t}\n\n\t/** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next\n\t * {@link AnimationState#update(float)}. */\n\tisNextReady () {\n\t\treturn this.next != null && this.nextTrackLast - this.next.delay >= 0;\n\t}\n}\n\nexport class EventQueue {\n\tobjects: Array = [];\n\tdrainDisabled = false;\n\tanimState: AnimationState;\n\n\tconstructor (animState: AnimationState) {\n\t\tthis.animState = animState;\n\t}\n\n\tstart (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.start);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.interrupt);\n\t\tthis.objects.push(entry);\n\t}\n\n\tend (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.end);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.dispose);\n\t\tthis.objects.push(entry);\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.complete);\n\t\tthis.objects.push(entry);\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t\tthis.objects.push(EventType.event);\n\t\tthis.objects.push(entry);\n\t\tthis.objects.push(event);\n\t}\n\n\tdrain () {\n\t\tif (this.drainDisabled) return; // Not reentrant.\n\t\tthis.drainDisabled = true;\n\n\t\tconst listeners = this.animState.listeners;\n\t\tconst objects = this.objects;\n\n\t\tfor (let i = 0; i < objects.length; i += 2) {\n\t\t\tconst type = objects[i] as EventType;\n\t\t\tconst entry = objects[i + 1] as TrackEntry;\n\t\t\tswitch (type) {\n\t\t\t\tcase EventType.start:\n\t\t\t\t\tif (entry.listener?.start) entry.listener.start(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tconst listener = listeners[ii];\n\t\t\t\t\t\tif (listener.start) listener.start(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.interrupt:\n\t\t\t\t\tif (entry.listener?.interrupt) entry.listener.interrupt(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tconst listener = listeners[ii];\n\t\t\t\t\t\tif (listener.interrupt) listener.interrupt(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// biome-ignore lint/suspicious/noFallthroughSwitchClause: reference runtime does fall through\n\t\t\t\tcase EventType.end:\n\t\t\t\t\tif (entry.listener?.end) entry.listener.end(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tconst listener = listeners[ii];\n\t\t\t\t\t\tif (listener.end) listener.end(entry);\n\t\t\t\t\t}\n\t\t\t\t// Fall through.\n\t\t\t\tcase EventType.dispose:\n\t\t\t\t\tif (entry.listener?.dispose) entry.listener.dispose(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tconst listener = listeners[ii];\n\t\t\t\t\t\tif (listener.dispose) listener.dispose(entry);\n\t\t\t\t\t}\n\t\t\t\t\tthis.animState.trackEntryPool.free(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.complete:\n\t\t\t\t\tif (entry.listener?.complete) entry.listener.complete(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tconst listener = listeners[ii];\n\t\t\t\t\t\tif (listener.complete) listener.complete(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.event: {\n\t\t\t\t\tconst event = objects[i++ + 2] as Event;\n\t\t\t\t\tif (entry.listener?.event) entry.listener.event(entry, event);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tconst listener = listeners[ii];\n\t\t\t\t\t\tif (listener.event) listener.event(entry, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.clear();\n\n\t\tthis.drainDisabled = false;\n\t}\n\n\tclear () {\n\t\tthis.objects.length = 0;\n\t}\n}\n\nexport enum EventType {\n\tstart, interrupt, end, dispose, complete, event\n}\n\n/** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving\n * events.\n *

\n * TrackEntry events are collected during {@link AnimationState#update} and {@link AnimationState#apply} and\n * fired only after those methods are finished.\n *

\n * See TrackEntry {@link TrackEntry#listener} and AnimationState\n * {@link AnimationState#addListener}. */\nexport interface AnimationStateListener {\n\t/** Invoked when this entry has been set as the current entry. {@link end} will occur when this entry will no\n\t * longer be applied.\n\t *\n\t * When this event is triggered by calling {@link AnimationState.setAnimation}, take care not to\n\t * call {@link AnimationState.update} until after the TrackEntry has been configured. */\n\tstart?: (entry: TrackEntry) => void;\n\n\t/** Invoked when another entry has replaced this entry as the current entry. This entry may continue being applied for\n\t * mixing. */\n\tinterrupt?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry is no longer the current entry and will never be applied again. */\n\tend?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry.\n\t * References to the entry should not be kept after dispose is called, as it may be destroyed or reused. */\n\tdispose?: (entry: TrackEntry) => void;\n\n\t/** Invoked every time this entry's animation completes a loop. */\n\tcomplete?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry's animation triggers an event. */\n\tevent?: (entry: TrackEntry, event: Event) => void;\n}\n\nexport abstract class AnimationStateAdapter implements AnimationStateListener {\n\tstart (entry: TrackEntry) {\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t}\n\n\tend (entry: TrackEntry) {\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t}\n}\n\n/** 1. A previously applied timeline has set this property.\n *\n * Result: Mix from the current pose to the timeline pose. */\nexport const SUBSEQUENT = 0;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry applied after this one does not have a timeline to set this property.\n *\n * Result: Mix from the setup pose to the timeline pose. */\nexport const FIRST = 1;\n/** 1) A previously applied timeline has set this property.
\n * 2) The next track entry to be applied does have a timeline to set this property.
\n * 3) The next track entry after that one does not have a timeline to set this property.
\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_SUBSEQUENT = 2;\n/** 1) This is the first timeline to set this property.
\n * 2) The next track entry to be applied does have a timeline to set this property.
\n * 3) The next track entry after that one does not have a timeline to set this property.
\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\n * that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_FIRST = 3;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry to be applied does have a timeline to set this property.\n * 3. The next track entry after that one does have a timeline to set this property.\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\n *\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\n * 2 track entries in a row have a timeline that sets the same property.\n *\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\n * place. */\nexport const HOLD_MIX = 4;\n\nexport const SETUP = 1;\nexport const CURRENT = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Animation } from \"./Animation.js\";\nimport type { SkeletonData } from \"./SkeletonData.js\";\nimport type { StringMap } from \"./Utils.js\";\n\n\n/** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed. */\nexport class AnimationStateData {\n\t/** The SkeletonData to look up animations when they are specified by name. */\n\tskeletonData: SkeletonData;\n\n\tanimationToMixTime: StringMap = {};\n\n\t/** The mix duration to use when no mix duration has been defined between two animations. */\n\tdefaultMix = 0;\n\n\tconstructor (skeletonData: SkeletonData) {\n\t\tif (!skeletonData) throw new Error(\"skeletonData cannot be null.\");\n\t\tthis.skeletonData = skeletonData;\n\t}\n\n\t/** Sets a mix duration by animation name.\n\t *\n\t * See {@link #setMix()}. */\n\tsetMix (fromName: string, to: string, duration: number): void;\n\n\t/** Sets the mix duration when changing from the specified animation to the other.\n\t *\n\t * See {@link TrackEntry#mixDuration}. */\n\tsetMix (from: Animation, to: Animation, duration: number): void;\n\n\tsetMix (from: string | Animation, to: string | Animation, duration: number) {\n\t\tif (typeof from === \"string\")\n\t\t\treturn this.setMix1(from, to as string, duration);\n\t\treturn this.setMix2(from, to as Animation, duration);\n\t}\n\n\tprivate setMix1 (fromName: string, toName: string, duration: number) {\n\t\tconst from = this.skeletonData.findAnimation(fromName);\n\t\tif (!from) throw new Error(`Animation not found: ${fromName}`);\n\t\tconst to = this.skeletonData.findAnimation(toName);\n\t\tif (!to) throw new Error(`Animation not found: ${toName}`);\n\t\tthis.setMix2(from, to, duration);\n\t}\n\n\tprivate setMix2 (from: Animation, to: Animation, duration: number) {\n\t\tif (!from) throw new Error(\"from cannot be null.\");\n\t\tif (!to) throw new Error(\"to cannot be null.\");\n\t\tconst key = `${from.name}.${to.name}`;\n\t\tthis.animationToMixTime[key] = duration;\n\t}\n\n\t/** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if\n\t * no mix duration has been set. */\n\tgetMix (from: Animation, to: Animation) {\n\t\tconst key = `${from.name}.${to.name}`;\n\t\tconst value = this.animationToMixTime[key];\n\t\treturn value === undefined ? this.defaultMix : value;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** biome-ignore-all lint/suspicious/noExplicitAny: textures can be various type */\n\nexport abstract class Texture {\n\tprotected _image: HTMLImageElement | ImageBitmap | any;\n\n\tconstructor (image: HTMLImageElement | ImageBitmap | any) {\n\t\tthis._image = image;\n\t}\n\n\tgetImage (): HTMLImageElement | ImageBitmap | any {\n\t\treturn this._image;\n\t}\n\n\tabstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\n\tabstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\n\tabstract dispose (): void;\n}\n\nexport enum TextureFilter {\n\tNearest = 9728, // WebGLRenderingContext.NEAREST\n\tLinear = 9729, // WebGLRenderingContext.LINEAR\n\tMipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n\tMipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\n\tMipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\n\tMipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\n\tMipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n}\n\nexport enum TextureWrap {\n\tMirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\n\tClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\n\tRepeat = 10497 // WebGLRenderingContext.REPEAT\n}\n\nexport class TextureRegion {\n\ttexture: any;\n\tu = 0; v = 0;\n\tu2 = 0; v2 = 0;\n\twidth = 0; height = 0;\n\tdegrees = 0;\n\toffsetX = 0; offsetY = 0;\n\toriginalWidth = 0; originalHeight = 0;\n}\n\nexport class FakeTexture extends Texture {\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }\n\tdispose () { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { AssetManagerBase } from \"./AssetManagerBase.js\";\nimport { type Texture, TextureFilter, TextureRegion, TextureWrap } from \"./Texture.js\";\nimport { type Disposable, type StringMap, Utils } from \"./Utils.js\";\n\nexport class TextureAtlas implements Disposable {\n\tpages = [] as TextureAtlasPage[];\n\tregions = [] as TextureAtlasRegion[];\n\n\tconstructor (atlasText: string) {\n\t\tconst reader = new TextureAtlasReader(atlasText);\n\t\tconst entry = new Array(4);\n\n\t\tconst pageFields: StringMap<(page: TextureAtlasPage) => void> = {};\n\t\tpageFields.size = (page: TextureAtlasPage) => {\n\t\t\tpage.width = parseInt(entry[1]);\n\t\t\tpage.height = parseInt(entry[2]);\n\t\t};\n\t\tpageFields.format = () => {\n\t\t\t// page.format = Format[tuple[0]]; we don't need format in WebGL\n\t\t};\n\t\tpageFields.filter = (page: TextureAtlasPage) => {\n\t\t\tpage.minFilter = Utils.enumValue(TextureFilter, entry[1]);\n\t\t\tpage.magFilter = Utils.enumValue(TextureFilter, entry[2]);\n\t\t};\n\t\tpageFields.repeat = (page: TextureAtlasPage) => {\n\t\t\tif (entry[1].indexOf('x') !== -1) page.uWrap = TextureWrap.Repeat;\n\t\t\tif (entry[1].indexOf('y') !== -1) page.vWrap = TextureWrap.Repeat;\n\t\t};\n\t\tpageFields.pma = (page: TextureAtlasPage) => {\n\t\t\tpage.pma = entry[1] === \"true\";\n\t\t};\n\n\t\tvar regionFields: StringMap<(region: TextureAtlasRegion) => void> = {};\n\t\tregionFields.xy = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t};\n\t\tregionFields.size = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.width = parseInt(entry[1]);\n\t\t\tregion.height = parseInt(entry[2]);\n\t\t};\n\t\tregionFields.bounds = (region: TextureAtlasRegion) => {\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t\tregion.width = parseInt(entry[3]);\n\t\t\tregion.height = parseInt(entry[4]);\n\t\t};\n\t\tregionFields.offset = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t};\n\t\tregionFields.orig = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.originalWidth = parseInt(entry[1]);\n\t\t\tregion.originalHeight = parseInt(entry[2]);\n\t\t};\n\t\tregionFields.offsets = (region: TextureAtlasRegion) => {\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t\tregion.originalWidth = parseInt(entry[3]);\n\t\t\tregion.originalHeight = parseInt(entry[4]);\n\t\t};\n\t\tregionFields.rotate = (region: TextureAtlasRegion) => {\n\t\t\tconst value = entry[1];\n\t\t\tif (value === \"true\")\n\t\t\t\tregion.degrees = 90;\n\t\t\telse if (value !== \"false\")\n\t\t\t\tregion.degrees = parseInt(value);\n\t\t};\n\t\tregionFields.index = (region: TextureAtlasRegion) => {\n\t\t\tregion.index = parseInt(entry[1]);\n\t\t};\n\n\t\tlet line = reader.readLine();\n\t\t// Ignore empty lines before first entry.\n\t\twhile (line && line.trim().length === 0)\n\t\t\tline = reader.readLine();\n\t\t// Header entries.\n\t\twhile (true) {\n\t\t\tif (!line || line.trim().length === 0) break;\n\t\t\tif (reader.readEntry(entry, line) === 0) break; // Silently ignore all header fields.\n\t\t\tline = reader.readLine();\n\t\t}\n\n\t\t// Page and region entries.\n\t\tlet page: TextureAtlasPage | null = null;\n\t\tlet names: string[] | null = null;\n\t\tlet values: number[][] | null = null;\n\t\twhile (true) {\n\t\t\tif (line === null) break;\n\t\t\tif (line.trim().length === 0) {\n\t\t\t\tpage = null;\n\t\t\t\tline = reader.readLine();\n\t\t\t} else if (!page) {\n\t\t\t\tpage = new TextureAtlasPage(line.trim());\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (reader.readEntry(entry, line = reader.readLine()) === 0) break;\n\t\t\t\t\tconst field = pageFields[entry[0]];\n\t\t\t\t\tif (field) field(page);\n\t\t\t\t}\n\t\t\t\tthis.pages.push(page);\n\t\t\t} else {\n\t\t\t\tconst region = new TextureAtlasRegion(page, line);\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst count = reader.readEntry(entry, line = reader.readLine());\n\t\t\t\t\tif (count === 0) break;\n\t\t\t\t\tconst field = regionFields[entry[0]];\n\t\t\t\t\tif (field)\n\t\t\t\t\t\tfield(region);\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (!names) names = [];\n\t\t\t\t\t\tif (!values) values = [];\n\t\t\t\t\t\tnames.push(entry[0]);\n\t\t\t\t\t\tconst entryValues: number[] = [];\n\t\t\t\t\t\tfor (let i = 0; i < count; i++)\n\t\t\t\t\t\t\tentryValues.push(parseInt(entry[i + 1]));\n\t\t\t\t\t\tvalues.push(entryValues);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (region.originalWidth === 0 && region.originalHeight === 0) {\n\t\t\t\t\tregion.originalWidth = region.width;\n\t\t\t\t\tregion.originalHeight = region.height;\n\t\t\t\t}\n\t\t\t\tif (names && names.length > 0 && values && values.length > 0) {\n\t\t\t\t\tregion.names = names;\n\t\t\t\t\tregion.values = values;\n\t\t\t\t\tnames = null;\n\t\t\t\t\tvalues = null;\n\t\t\t\t}\n\t\t\t\tregion.u = region.x / page.width;\n\t\t\t\tregion.v = region.y / page.height;\n\t\t\t\tif (region.degrees === 90) {\n\t\t\t\t\tregion.u2 = (region.x + region.height) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.width) / page.height;\n\t\t\t\t} else {\n\t\t\t\t\tregion.u2 = (region.x + region.width) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.height) / page.height;\n\t\t\t\t}\n\t\t\t\tthis.regions.push(region);\n\t\t\t}\n\t\t}\n\t}\n\n\tfindRegion (name: string): TextureAtlasRegion | null {\n\t\tfor (let i = 0; i < this.regions.length; i++) {\n\t\t\tif (this.regions[i].name === name) {\n\t\t\t\treturn this.regions[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tsetTextures (assetManager: AssetManagerBase, pathPrefix: string = \"\") {\n\t\tfor (const page of this.pages)\n\t\t\tpage.setTexture(assetManager.get(pathPrefix + page.name) as Texture);\n\t}\n\n\tdispose () {\n\t\tfor (let i = 0; i < this.pages.length; i++) {\n\t\t\tthis.pages[i].texture?.dispose();\n\t\t}\n\t}\n}\n\nclass TextureAtlasReader {\n\tlines: Array;\n\tindex: number = 0;\n\n\tconstructor (text: string) {\n\t\tthis.lines = text.split(/\\r\\n|\\r|\\n/);\n\t}\n\n\treadLine (): string | null {\n\t\tif (this.index >= this.lines.length)\n\t\t\treturn null;\n\t\treturn this.lines[this.index++];\n\t}\n\n\treadEntry (entry: string[], line: string | null): number {\n\t\tif (!line) return 0;\n\t\tline = line.trim();\n\t\tif (line.length === 0) return 0;\n\n\t\tconst colon = line.indexOf(':');\n\t\tif (colon === -1) return 0;\n\t\tentry[0] = line.substr(0, colon).trim();\n\t\tfor (let i = 1, lastMatch = colon + 1; ; i++) {\n\t\t\tconst comma = line.indexOf(',', lastMatch);\n\t\t\tif (comma === -1) {\n\t\t\t\tentry[i] = line.substr(lastMatch).trim();\n\t\t\t\treturn i;\n\t\t\t}\n\t\t\tentry[i] = line.substr(lastMatch, comma - lastMatch).trim();\n\t\t\tlastMatch = comma + 1;\n\t\t\tif (i === 4) return 4;\n\t\t}\n\t}\n}\n\nexport class TextureAtlasPage {\n\tname: string;\n\tminFilter: TextureFilter = TextureFilter.Nearest;\n\tmagFilter: TextureFilter = TextureFilter.Nearest;\n\tuWrap: TextureWrap = TextureWrap.ClampToEdge;\n\tvWrap: TextureWrap = TextureWrap.ClampToEdge;\n\ttexture: Texture | null = null;\n\twidth: number = 0;\n\theight: number = 0;\n\tpma: boolean = false;\n\tregions = [] as TextureAtlasRegion[];\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n\n\tsetTexture (texture: Texture) {\n\t\tthis.texture = texture;\n\t\ttexture.setFilters(this.minFilter, this.magFilter);\n\t\ttexture.setWraps(this.uWrap, this.vWrap);\n\t\tfor (const region of this.regions)\n\t\t\tregion.texture = texture;\n\t}\n}\n\nexport class TextureAtlasRegion extends TextureRegion {\n\tpage: TextureAtlasPage;\n\tname: string;\n\tx: number = 0;\n\ty: number = 0;\n\toffsetX: number = 0;\n\toffsetY: number = 0;\n\toriginalWidth: number = 0;\n\toriginalHeight: number = 0;\n\tindex: number = 0;\n\tdegrees: number = 0;\n\tnames: string[] | null = null;\n\tvalues: number[][] | null = null;\n\n\tconstructor (page: TextureAtlasPage, name: string) {\n\t\tsuper();\n\t\tthis.page = page;\n\t\tthis.name = name;\n\t\tpage.regions.push(this);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Texture } from \"./Texture.js\";\nimport { TextureAtlas } from \"./TextureAtlas.js\";\nimport type { Disposable, StringMap } from \"./Utils.js\";\n\ntype AssetData = (Uint8Array | string | Texture | TextureAtlas | object) & Partial;\ntype AssetCallback = (path: string, data: T) => void;\ntype ErrorCallback = (path: string, message: string) => void;\n\nexport class AssetManagerBase implements Disposable {\n\tprivate pathPrefix: string = \"\";\n\tprivate textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture;\n\tprivate downloader: Downloader;\n\tprivate cache: AssetCache;\n\tprivate errors: StringMap = {};\n\tprivate toLoad = 0;\n\tprivate loaded = 0;\n\n\tconstructor (textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture, pathPrefix: string = \"\", downloader = new Downloader(), cache = new AssetCache()) {\n\t\tthis.textureLoader = textureLoader;\n\t\tthis.pathPrefix = pathPrefix;\n\t\tthis.downloader = downloader;\n\t\tthis.cache = cache;\n\t}\n\n\tprivate start (path: string): string {\n\t\tthis.toLoad++;\n\t\treturn this.pathPrefix + path;\n\t}\n\n\tprivate success (callback: AssetCallback, path: string, asset: T) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.cache.assets[path] = asset;\n\t\tthis.cache.assetsRefCount[path] = (this.cache.assetsRefCount[path] || 0) + 1;\n\t\tif (callback) callback(path, asset);\n\t}\n\n\tprivate error (callback: (path: string, message: string) => void, path: string, message: string) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.errors[path] = message;\n\t\tif (callback) callback(path, message);\n\t}\n\n\tloadAll () {\n\t\tconst promise = new Promise((resolve: (assetManager: AssetManagerBase) => void, reject: (errors: StringMap) => void) => {\n\t\t\tconst check = () => {\n\t\t\t\tif (this.isLoadingComplete()) {\n\t\t\t\t\tif (this.hasErrors()) reject(this.errors);\n\t\t\t\t\telse resolve(this);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trequestAnimationFrame(check);\n\t\t\t}\n\t\t\trequestAnimationFrame(check);\n\t\t});\n\t\treturn promise;\n\t}\n\n\tsetRawDataURI (path: string, data: string) {\n\t\tthis.downloader.rawDataUris[this.pathPrefix + path] = data;\n\t}\n\n\tloadBinary (path: string,\n\t\tsuccess: (path: string, binary: Uint8Array) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tif (this.reuseAssets(path, success, error)) return;\n\n\t\tthis.cache.assetsLoaded[path] = new Promise((resolve, reject) => {\n\t\t\tthis.downloader.downloadBinary(path, (data: Uint8Array): void => {\n\t\t\t\tthis.success(success, path, data);\n\t\t\t\tresolve(data);\n\t\t\t}, (status: number, responseText: string): void => {\n\t\t\t\tconst errorMsg = `Couldn't load binary ${path}: status ${status}, ${responseText}`;\n\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\treject(errorMsg);\n\t\t\t});\n\t\t});\n\t}\n\n\tloadText (path: string,\n\t\tsuccess: (path: string, text: string) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadText(path, (data: string): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load text ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadJson (path: string,\n\t\tsuccess: (path: string, object: object) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tif (this.reuseAssets(path, success, error)) return;\n\n\t\tthis.cache.assetsLoaded[path] = new Promise((resolve, reject) => {\n\t\t\tthis.downloader.downloadJson(path, (data: object): void => {\n\t\t\t\tthis.success(success, path, data);\n\t\t\t\tresolve(data);\n\t\t\t}, (status: number, responseText: string): void => {\n\t\t\t\tconst errorMsg = `Couldn't load JSON ${path}: status ${status}, ${responseText}`;\n\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\treject(errorMsg);\n\t\t\t});\n\t\t});\n\t}\n\n\n\treuseAssets (\n\t\tpath: string,\n\t\tsuccess: AssetCallback = () => { },\n\t\terror: ErrorCallback = () => { }\n\t) {\n\t\tconst loadedStatus = this.cache.getAsset(path);\n\t\tconst alreadyExistsOrLoading = loadedStatus !== undefined;\n\t\tif (alreadyExistsOrLoading) {\n\t\t\tthis.cache.assetsLoaded[path] = loadedStatus\n\t\t\t\t.then(data => {\n\t\t\t\t\t// necessary when user preloads an image into the cache.\n\t\t\t\t\t// texture loader is not avaiable in the cache, so we transform in GLTexture at first use\n\t\t\t\t\tdata = (data instanceof Image || data instanceof ImageBitmap) ? this.textureLoader(data) as T : data;\n\t\t\t\t\tthis.success(success, path, data as T);\n\t\t\t\t\treturn data;\n\t\t\t\t})\n\t\t\t\t.catch(errorMsg => {\n\t\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\t\treturn undefined;\n\t\t\t\t});\n\t\t}\n\t\treturn alreadyExistsOrLoading;\n\t}\n\n\tloadTexture (\n\t\tpath: string,\n\t\tsuccess: AssetCallback = () => { },\n\t\terror: ErrorCallback = () => { }\n\t) {\n\n\t\tpath = this.start(path);\n\n\t\tif (this.reuseAssets(path, success, error)) return;\n\n\t\tthis.cache.assetsLoaded[path] = new Promise((resolve, reject) => {\n\t\t\tconst isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document);\n\t\t\tconst isWebWorker = !isBrowser; // && typeof importScripts !== 'undefined';\n\t\t\tif (isWebWorker) {\n\t\t\t\tfetch(path, { mode: \"cors\" }).then((response) => {\n\t\t\t\t\tif (response.ok) return response.blob();\n\t\t\t\t\tconst errorMsg = `Couldn't load image: ${path}`;\n\t\t\t\t\tthis.error(error, path, `Couldn't load image: ${path}`);\n\t\t\t\t\treject(errorMsg);\n\t\t\t\t}).then((blob) => {\n\t\t\t\t\treturn blob ? createImageBitmap(blob, { premultiplyAlpha: \"none\", colorSpaceConversion: \"none\" }) : null;\n\t\t\t\t}).then((bitmap) => {\n\t\t\t\t\tif (bitmap) {\n\t\t\t\t\t\tconst texture = this.createTexture(path, bitmap);\n\t\t\t\t\t\tthis.success(success, path, texture);\n\t\t\t\t\t\tresolve(texture);\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst image = new Image();\n\t\t\t\timage.crossOrigin = \"anonymous\";\n\t\t\t\timage.onload = () => {\n\t\t\t\t\tconst texture = this.createTexture(path, image);\n\t\t\t\t\tthis.success(success, path, texture);\n\t\t\t\t\tresolve(texture);\n\t\t\t\t};\n\t\t\t\timage.onerror = () => {\n\t\t\t\t\tconst errorMsg = `Couldn't load image: ${path}`;\n\t\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\t\treject(errorMsg);\n\t\t\t\t};\n\t\t\t\tif (this.downloader.rawDataUris[path]) path = this.downloader.rawDataUris[path];\n\t\t\t\timage.src = path;\n\t\t\t}\n\t\t});\n\t}\n\n\tloadTextureAtlas (\n\t\tpath: string,\n\t\tsuccess: AssetCallback = () => { },\n\t\terror: ErrorCallback = () => { },\n\t\tfileAlias?: { [keyword: string]: string }\n\t) {\n\t\tconst index = path.lastIndexOf(\"/\");\n\t\tconst parent = index >= 0 ? path.substring(0, index + 1) : \"\";\n\t\tpath = this.start(path);\n\n\t\tif (this.reuseAssets(path, success, error)) return;\n\n\t\tthis.cache.assetsLoaded[path] = new Promise((resolve, reject) => {\n\t\t\tthis.downloader.downloadText(path, (atlasText: string): void => {\n\t\t\t\ttry {\n\t\t\t\t\tconst atlas = this.createTextureAtlas(path, atlasText);\n\t\t\t\t\tlet toLoad = atlas.pages.length, abort = false;\n\t\t\t\t\tfor (const page of atlas.pages) {\n\t\t\t\t\t\tthis.loadTexture(!fileAlias ? parent + page.name : fileAlias[page.name],\n\t\t\t\t\t\t\t(imagePath: string, texture: Texture) => {\n\t\t\t\t\t\t\t\tif (!abort) {\n\t\t\t\t\t\t\t\t\tpage.setTexture(texture);\n\t\t\t\t\t\t\t\t\tif (--toLoad === 0) {\n\t\t\t\t\t\t\t\t\t\tthis.success(success, path, atlas);\n\t\t\t\t\t\t\t\t\t\tresolve(atlas);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(imagePath: string, message: string) => {\n\t\t\t\t\t\t\t\tif (!abort) {\n\t\t\t\t\t\t\t\t\tconst errorMsg = `Couldn't load texture ${path} page image: ${imagePath}`;\n\t\t\t\t\t\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\t\t\t\t\t\treject(errorMsg);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tabort = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} catch (e: unknown) {\n\t\t\t\t\tconst errorMsg = `Couldn't parse texture atlas ${path}: ${(e as Error).message}`;\n\t\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\t\treject(errorMsg);\n\t\t\t\t}\n\t\t\t}, (status: number, responseText: string): void => {\n\t\t\t\tconst errorMsg = `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`;\n\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\treject(errorMsg);\n\t\t\t});\n\t\t});\n\t}\n\n\tloadTextureAtlasButNoTextures (\n\t\tpath: string,\n\t\tsuccess: AssetCallback = () => { },\n\t\terror: ErrorCallback = () => { },\n\t) {\n\t\tpath = this.start(path);\n\n\t\tif (this.reuseAssets(path, success, error)) return;\n\n\t\tthis.cache.assetsLoaded[path] = new Promise((resolve, reject) => {\n\t\t\tthis.downloader.downloadText(path, (atlasText: string): void => {\n\t\t\t\ttry {\n\t\t\t\t\tconst atlas = this.createTextureAtlas(path, atlasText);\n\t\t\t\t\tthis.success(success, path, atlas);\n\t\t\t\t\tresolve(atlas);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconst errorMsg = `Couldn't parse texture atlas ${path}: ${(e as Error).message}`;\n\t\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\t\treject(errorMsg);\n\t\t\t\t}\n\t\t\t}, (status: number, responseText: string): void => {\n\t\t\t\tconst errorMsg = `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`;\n\t\t\t\tthis.error(error, path, errorMsg);\n\t\t\t\treject(errorMsg);\n\t\t\t});\n\t\t});\n\t}\n\n\t// Promisified versions of load function\n\tasync loadBinaryAsync (path: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.loadBinary(path,\n\t\t\t\t(_, binary) => resolve(binary),\n\t\t\t\t(_, message) => reject(message),\n\t\t\t);\n\t\t});\n\t}\n\n\tasync loadJsonAsync (path: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.loadJson(path,\n\t\t\t\t(_, object) => resolve(object),\n\t\t\t\t(_, message) => reject(message),\n\t\t\t);\n\t\t});\n\t}\n\n\tasync loadTextureAsync (path: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.loadTexture(path,\n\t\t\t\t(_, texture) => resolve(texture),\n\t\t\t\t(_, message) => reject(message),\n\t\t\t);\n\t\t});\n\t}\n\n\tasync loadTextureAtlasAsync (path: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.loadTextureAtlas(path,\n\t\t\t\t(_, atlas) => resolve(atlas),\n\t\t\t\t(_, message) => reject(message),\n\t\t\t);\n\t\t});\n\t}\n\n\tasync loadTextureAtlasButNoTexturesAsync (path: string) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.loadTextureAtlasButNoTextures(path,\n\t\t\t\t(_, atlas) => resolve(atlas),\n\t\t\t\t(_, message) => reject(message),\n\t\t\t);\n\t\t});\n\t}\n\n\tsetCache (cache: AssetCache) {\n\t\tthis.cache = cache;\n\t}\n\n\tget (path: string) {\n\t\treturn this.cache.assets[this.pathPrefix + path];\n\t}\n\n\trequire (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tconst asset = this.cache.assets[path];\n\t\tif (asset) return asset;\n\t\tconst error = this.errors[path];\n\t\tthrow Error(`Asset not found: ${path}${error ? `\\n${error}` : \"\"}`);\n\t}\n\n\tremove (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tconst asset = this.cache.assets[path];\n\t\tif (asset.dispose) asset.dispose();\n\t\tdelete this.cache.assets[path];\n\t\tdelete this.cache.assetsRefCount[path];\n\t\tdelete this.cache.assetsLoaded[path];\n\t\treturn asset;\n\t}\n\n\tremoveAll () {\n\t\tfor (const path in this.cache.assets) {\n\t\t\tconst asset = this.cache.assets[path];\n\t\t\tif (asset.dispose) asset.dispose();\n\t\t}\n\t\tthis.cache.assets = {};\n\t\tthis.cache.assetsLoaded = {};\n\t\tthis.cache.assetsRefCount = {};\n\t}\n\n\tisLoadingComplete (): boolean {\n\t\treturn this.toLoad === 0;\n\t}\n\n\tgetToLoad (): number {\n\t\treturn this.toLoad;\n\t}\n\n\tgetLoaded (): number {\n\t\treturn this.loaded;\n\t}\n\n\tdispose () {\n\t\tthis.removeAll();\n\t}\n\n\t// dispose asset only if it's not used by others\n\tdisposeAsset (path: string) {\n\t\tconst asset = this.cache.assets[path];\n\t\tif (asset instanceof TextureAtlas) {\n\t\t\tasset.dispose();\n\t\t\treturn;\n\t\t}\n\t\tthis.disposeAssetInternal(path);\n\t}\n\n\thasErrors () {\n\t\treturn Object.keys(this.errors).length > 0;\n\t}\n\n\tgetErrors () {\n\t\treturn this.errors;\n\t}\n\n\tprivate disposeAssetInternal (path: string) {\n\t\tif (this.cache.assetsRefCount[path] > 0 && --this.cache.assetsRefCount[path] === 0) {\n\t\t\treturn this.remove(path);\n\t\t}\n\t}\n\n\tprivate createTextureAtlas (path: string, atlasText: string): TextureAtlas {\n\t\tconst atlas = new TextureAtlas(atlasText);\n\t\tatlas.dispose = () => {\n\t\t\tif (this.cache.assetsRefCount[path] <= 0) return;\n\t\t\tthis.disposeAssetInternal(path);\n\t\t\tfor (const page of atlas.pages) {\n\t\t\t\tpage.texture?.dispose();\n\t\t\t}\n\t\t}\n\t\treturn atlas;\n\t}\n\n\tprivate createTexture (path: string, image: HTMLImageElement | ImageBitmap): Texture {\n\t\tconst texture = this.textureLoader(image);\n\t\tconst textureDispose = texture.dispose.bind(texture);\n\t\ttexture.dispose = () => {\n\t\t\tif (this.disposeAssetInternal(path)) textureDispose();\n\t\t}\n\t\treturn texture;\n\t}\n}\n\nexport class AssetCache {\n\tpublic assets: StringMap = {};\n\tpublic assetsRefCount: StringMap = {};\n\tpublic assetsLoaded: StringMap> = {};\n\n\tstatic AVAILABLE_CACHES = new Map();\n\tstatic getCache (id: string) {\n\t\tconst cache = AssetCache.AVAILABLE_CACHES.get(id);\n\t\tif (cache) return cache;\n\n\t\tconst newCache = new AssetCache();\n\t\tAssetCache.AVAILABLE_CACHES.set(id, newCache);\n\t\treturn newCache;\n\t}\n\n\tasync addAsset (path: string, asset: T): Promise {\n\t\tthis.assetsLoaded[path] = Promise.resolve(asset);\n\t\tthis.assets[path] = asset;\n\t\treturn asset;\n\t}\n\n\tgetAsset (path: string): Promise | undefined {\n\t\treturn this.assetsLoaded[path] as Promise | undefined;\n\t}\n}\n\ntype DownloaderSuccessCallback = (data: T) => void;\ntype DownloaderErrorCallback = (status: number, responseText: string) => void;\n\nexport class Downloader {\n\tprivate callbacks: StringMap> = {};\n\trawDataUris: StringMap = {};\n\n\tdataUriToString (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx !== -1) {\n\t\t\tbase64Idx += \"base64,\".length;\n\t\t\treturn atob(dataUri.substr(base64Idx));\n\t\t} else {\n\t\t\treturn dataUri.substr(dataUri.indexOf(\",\") + 1);\n\t\t}\n\t}\n\n\tbase64ToUint8Array (base64: string) {\n\t\tvar binary_string = window.atob(base64);\n\t\tvar len = binary_string.length;\n\t\tvar bytes = new Uint8Array(len);\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tbytes[i] = binary_string.charCodeAt(i);\n\t\t}\n\t\treturn bytes;\n\t}\n\n\tdataUriToUint8Array (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx === -1) throw new Error(\"Not a binary data URI.\");\n\t\tbase64Idx += \"base64,\".length;\n\t\treturn this.base64ToUint8Array(dataUri.substr(base64Idx));\n\t}\n\n\tdownloadText (url: string, success: DownloaderSuccessCallback, error: DownloaderErrorCallback) {\n\t\tif (this.start(url, success, error)) return;\n\n\t\tconst rawDataUri = this.rawDataUris[url];\n\t\t// we assume if a \".\" is included in a raw data uri, it is used to rewrite an asset URL\n\t\tif (rawDataUri && !rawDataUri.includes(\".\")) {\n\t\t\ttry {\n\t\t\t\tthis.finish(url, 200, this.dataUriToString(rawDataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst request = new XMLHttpRequest();\n\t\trequest.overrideMimeType(\"text/html\");\n\t\trequest.open(\"GET\", rawDataUri ? rawDataUri : url, true);\n\t\tconst done = () => {\n\t\t\tthis.finish(url, request.status, request.responseText);\n\t\t};\n\t\trequest.onload = done;\n\t\trequest.onerror = done;\n\t\trequest.send();\n\t}\n\n\tdownloadJson (url: string, success: DownloaderSuccessCallback, error: DownloaderErrorCallback) {\n\t\tthis.downloadText(url, (data: string): void => {\n\t\t\tsuccess(JSON.parse(data));\n\t\t}, error);\n\t}\n\n\tdownloadBinary (url: string, success: (data: Uint8Array) => void, error: DownloaderErrorCallback) {\n\t\tif (this.start(url, success, error)) return;\n\n\t\tconst rawDataUri = this.rawDataUris[url];\n\t\t// we assume if a \".\" is included in a raw data uri, it is used to rewrite an asset URL\n\t\tif (rawDataUri && !rawDataUri.includes(\".\")) {\n\t\t\ttry {\n\t\t\t\tthis.finish(url, 200, this.dataUriToUint8Array(rawDataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst request = new XMLHttpRequest();\n\t\trequest.open(\"GET\", rawDataUri ? rawDataUri : url, true);\n\t\trequest.responseType = \"arraybuffer\";\n\t\tconst onerror = () => {\n\t\t\tthis.finish(url, request.status, request.response);\n\t\t};\n\t\trequest.onload = () => {\n\t\t\tif (request.status === 200 || request.status === 0)\n\t\t\t\tthis.finish(url, 200, new Uint8Array(request.response as ArrayBuffer));\n\t\t\telse\n\t\t\t\tonerror();\n\t\t};\n\t\trequest.onerror = onerror;\n\t\trequest.send();\n\t}\n\n\tprivate start (url: string, success: DownloaderSuccessCallback, error: DownloaderErrorCallback) {\n\t\tlet callbacks = this.callbacks[url];\n\t\ttry {\n\t\t\tif (callbacks) return true;\n\t\t\tthis.callbacks[url] = callbacks = [];\n\t\t} finally {\n\t\t\tcallbacks.push(success as DownloaderSuccessCallback, error);\n\t\t}\n\t}\n\n\tprivate finish (url: string, status: number, data: AssetData) {\n\t\tconst callbacks = this.callbacks[url];\n\t\tdelete this.callbacks[url];\n\t\tif (status === 200 || status === 0) {\n\t\t\tfor (let i = 0, n = callbacks.length; i < n; i += 2)\n\t\t\t\t(callbacks[i] as DownloaderSuccessCallback)(data);\n\t\t} else {\n\t\t\tfor (let i = 1, n = callbacks.length; i < n; i += 2)\n\t\t\t\t(callbacks[i] as DownloaderErrorCallback)(status, data as string);\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"../Utils.js\";\nimport { type Attachment, VertexAttachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon. Can be used for hit detection, creating physics bodies, spawning particle\n * effects, and more.\n *\n * See {@link SkeletonBounds} and [Bounding Boxes](http://esotericsoftware.com/spine-bounding-boxes) in the Spine User\n * Guide. */\nexport class BoundingBoxAttachment extends VertexAttachment {\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tconst copy = new BoundingBoxAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { SlotData } from \"../SlotData.js\";\nimport { Color } from \"../Utils.js\";\nimport { type Attachment, VertexAttachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */\nexport class ClippingAttachment extends VertexAttachment {\n\t/** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of\n\t * the skeleton's rendering. */\n\tendSlot: SlotData | null = null;\n\n\t// Nonessential.\n\t/** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tconst copy = new ClippingAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.endSlot = this.endSlot;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Skeleton } from \"src/Skeleton.js\";\nimport type { Slot } from \"../Slot.js\";\nimport type { TextureRegion } from \"../Texture.js\";\nimport { TextureAtlasRegion } from \"../TextureAtlas.js\";\nimport { Color, type NumberArrayLike, Utils } from \"../Utils.js\";\nimport { type Attachment, VertexAttachment } from \"./Attachment.js\";\nimport type { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport type { Sequence } from \"./Sequence.js\";\n\n/** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not\n * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.\n *\n * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */\nexport class MeshAttachment extends VertexAttachment implements HasTextureRegion {\n\tregion: TextureRegion | null = null;\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\t/** The UV pair for each vertex, normalized within the texture region. */\n\tregionUVs: NumberArrayLike = [];\n\n\t/** The UV pair for each vertex, normalized within the entire texture.\n\t *\n\t * See {@link #updateUVs}. */\n\tuvs: NumberArrayLike = [];\n\n\t/** Triplets of vertex indices which describe the mesh's triangulation. */\n\ttriangles: Array = [];\n\n\t/** The color to tint the mesh. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The width of the mesh's image. Available only when nonessential data was exported. */\n\twidth: number = 0;\n\n\t/** The height of the mesh's image. Available only when nonessential data was exported. */\n\theight: number = 0;\n\n\t/** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */\n\thullLength: number = 0;\n\n\t/** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if\n\t * nonessential data was exported. Triangulation is not performed at runtime. */\n\tedges: Array = [];\n\n\tprivate parentMesh: MeshAttachment | null = null;\n\n\tsequence: Sequence | null = null;\n\n\ttempColor = new Color(0, 0, 0, 0);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or\n\t * the {@link #regionUVs} are changed. */\n\tupdateRegion () {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tconst regionUVs = this.regionUVs;\n\t\tif (!this.uvs || this.uvs.length !== regionUVs.length) this.uvs = Utils.newFloatArray(regionUVs.length);\n\t\tconst uvs = this.uvs;\n\t\tconst n = this.uvs.length;\n\t\tlet u = this.region.u, v = this.region.v, width = 0, height = 0;\n\t\tif (this.region instanceof TextureAtlasRegion) {\n\t\t\tconst region = this.region, page = region.page;\n\t\t\tconst textureWidth = page.width, textureHeight = page.height;\n\t\t\tswitch (region.degrees) {\n\t\t\t\tcase 90:\n\t\t\t\t\tu -= (region.originalHeight - region.offsetY - region.height) / textureWidth;\n\t\t\t\t\tv -= (region.originalWidth - region.offsetX - region.width) / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 180:\n\t\t\t\t\tu -= (region.originalWidth - region.offsetX - region.width) / textureWidth;\n\t\t\t\t\tv -= region.offsetY / textureHeight;\n\t\t\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\t\t\theight = region.originalHeight / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 270:\n\t\t\t\t\tu -= region.offsetY / textureWidth;\n\t\t\t\t\tv -= region.offsetX / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i + 1]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + regionUVs[i] * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tdefault:\n\t\t\t\t\tu -= region.offsetX / textureWidth;\n\t\t\t\t\tv -= (region.originalHeight - region.offsetY - region.height) / textureHeight;\n\t\t\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\t\t\theight = region.originalHeight / textureHeight;\n\t\t\t}\n\t\t} else if (!this.region) {\n\t\t\tu = v = 0;\n\t\t\twidth = height = 1;\n\t\t} else {\n\t\t\twidth = this.region.u2 - u;\n\t\t\theight = this.region.v2 - v;\n\t\t}\n\n\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\tuvs[i] = u + regionUVs[i] * width;\n\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\n\t\t}\n\t}\n\n\t/** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},\n\t * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the\n\t * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */\n\tgetParentMesh () {\n\t\treturn this.parentMesh;\n\t}\n\n\t/** @param parentMesh May be null. */\n\tsetParentMesh (parentMesh: MeshAttachment) {\n\t\tthis.parentMesh = parentMesh;\n\t\tif (parentMesh) {\n\t\t\tthis.bones = parentMesh.bones;\n\t\t\tthis.vertices = parentMesh.vertices;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\n\t\t\tthis.regionUVs = parentMesh.regionUVs;\n\t\t\tthis.triangles = parentMesh.triangles;\n\t\t\tthis.hullLength = parentMesh.hullLength;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength\n\t\t}\n\t}\n\n\tcopy (): Attachment {\n\t\tif (this.parentMesh) return this.newLinkedMesh();\n\n\t\tconst copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\n\t\tthis.copyTo(copy);\n\t\tcopy.regionUVs = [];\n\t\tUtils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\n\t\tcopy.uvs = this.uvs instanceof Float32Array ? Utils.newFloatArray(this.uvs.length) : [];\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);\n\t\tcopy.triangles = [];\n\t\tUtils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\n\t\tcopy.hullLength = this.hullLength;\n\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\n\t\t// Nonessential.\n\t\tif (this.edges) {\n\t\t\tcopy.edges = [];\n\t\t\tUtils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\n\t\t}\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\n\t\treturn copy;\n\t}\n\n\tcomputeWorldVertices (skeleton: Skeleton, slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence != null) this.sequence.apply(slot.applied, this);\n\t\tsuper.computeWorldVertices(skeleton, slot, start, count, worldVertices, offset, stride);\n\t}\n\n\t/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/\n\tnewLinkedMesh (): MeshAttachment {\n\t\tconst copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.timelineAttachment = this.timelineAttachment;\n\t\tcopy.setParentMesh(this.parentMesh ? this.parentMesh : this);\n\t\tif (copy.region != null) copy.updateRegion();\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Utils } from \"../Utils.js\";\nimport { type Attachment, VertexAttachment } from \"./Attachment.js\";\n\n/** An attachment whose vertices make up a composite Bezier curve.\n *\n * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */\nexport class PathAttachment extends VertexAttachment {\n\n\t/** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */\n\tlengths: Array = [];\n\n\t/** If true, the start and end knots are connected. */\n\tclosed = false;\n\n\t/** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer\n\t * calculations are performed but calculating positions along the path is less accurate. */\n\tconstantSpeed = false;\n\n\t/** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually\n\t * rendered at runtime. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tconst copy = new PathAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.lengths = [];\n\t\tUtils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\n\t\tcopy.closed = this.closed;\n\t\tcopy.constantSpeed = this.constantSpeed;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BonePose } from \"src/BonePose.js\";\nimport { Color, MathUtils, type Vector2 } from \"../Utils.js\";\nimport { type Attachment, VertexAttachment } from \"./Attachment.js\";\n\n/** An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be\n * used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a\n * skin.\n *\n * See [Point Attachments](https://esotericsoftware.com/spine-points) in the Spine User Guide. */\nexport class PointAttachment extends VertexAttachment {\n\tx: number = 0;\n\ty: number = 0;\n\trotation: number = 0;\n\n\t/** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.38, 0.94, 0, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcomputeWorldPosition (bone: BonePose, point: Vector2) {\n\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\n\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\n\t\treturn point;\n\t}\n\n\tcomputeWorldRotation (bone: BonePose) {\n\t\tconst r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst x = cos * bone.a + sin * bone.b;\n\t\tconst y = cos * bone.c + sin * bone.d;\n\t\treturn MathUtils.atan2Deg(y, x);\n\t}\n\n\tcopy (): Attachment {\n\t\tconst copy = new PointAttachment(this.name);\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Slot } from \"../Slot.js\";\nimport type { TextureRegion } from \"../Texture.js\";\nimport { Color, MathUtils, type NumberArrayLike, Utils } from \"../Utils.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport type { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport type { Sequence } from \"./Sequence.js\";\n\n/** An attachment that displays a textured quadrilateral.\n *\n * See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */\nexport class RegionAttachment extends Attachment implements HasTextureRegion {\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local rotation. */\n\trotation = 0;\n\n\t/** The width of the region attachment in Spine. */\n\twidth = 0;\n\n\t/** The height of the region attachment in Spine. */\n\theight = 0;\n\n\t/** The color to tint the region attachment. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\tregion: TextureRegion | null = null;\n\tsequence: Sequence | null = null;\n\n\t/** For each of the 4 vertices, a pair of x,y values that is the local position of the vertex.\n\t *\n\t * See {@link #updateRegion()}. */\n\toffset = Utils.newFloatArray(8);\n\n\tuvs = Utils.newFloatArray(8);\n\n\ttempColor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */\n\tupdateRegion (): void {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tconst region = this.region;\n\t\tconst uvs = this.uvs;\n\t\tconst regionScaleX = this.width / this.region.originalWidth * this.scaleX;\n\t\tconst regionScaleY = this.height / this.region.originalHeight * this.scaleY;\n\t\tconst localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\n\t\tconst localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\n\t\tconst localX2 = localX + this.region.width * regionScaleX;\n\t\tconst localY2 = localY + this.region.height * regionScaleY;\n\t\tconst radians = this.rotation * MathUtils.degRad;\n\t\tconst cos = Math.cos(radians);\n\t\tconst sin = Math.sin(radians);\n\t\tconst x = this.x, y = this.y;\n\t\tconst localXCos = localX * cos + x;\n\t\tconst localXSin = localX * sin;\n\t\tconst localYCos = localY * cos + y;\n\t\tconst localYSin = localY * sin;\n\t\tconst localX2Cos = localX2 * cos + x;\n\t\tconst localX2Sin = localX2 * sin;\n\t\tconst localY2Cos = localY2 * cos + y;\n\t\tconst localY2Sin = localY2 * sin;\n\t\tconst offset = this.offset;\n\t\toffset[0] = localXCos - localYSin;\n\t\toffset[1] = localYCos + localXSin;\n\t\toffset[2] = localXCos - localY2Sin;\n\t\toffset[3] = localY2Cos + localXSin;\n\t\toffset[4] = localX2Cos - localY2Sin;\n\t\toffset[5] = localY2Cos + localX2Sin;\n\t\toffset[6] = localX2Cos - localYSin;\n\t\toffset[7] = localYCos + localX2Sin;\n\n\t\tif (region == null) {\n\t\t\tuvs[0] = 0;\n\t\t\tuvs[1] = 0;\n\t\t\tuvs[2] = 0;\n\t\t\tuvs[3] = 1;\n\t\t\tuvs[4] = 1;\n\t\t\tuvs[5] = 1;\n\t\t\tuvs[6] = 1;\n\t\t\tuvs[7] = 0;\n\t\t} else if (region.degrees === 90) {\n\t\t\tuvs[0] = region.u2;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v2;\n\t\t\tuvs[4] = region.u;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v;\n\t\t} else {\n\t\t\tuvs[0] = region.u;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v;\n\t\t\tuvs[4] = region.u2;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v2;\n\t\t}\n\t}\n\n\t/** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may\n\t * be changed.\n\t *

\n\t * See World transforms in the Spine\n\t * Runtimes Guide.\n\t * @param worldVertices The output world vertices. Must have a length >= offset + 8.\n\t * @param offset The worldVertices index to begin writing values.\n\t * @param stride The number of worldVertices entries between the value pairs written. */\n\tcomputeWorldVertices (slot: Slot, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence) this.sequence.apply(slot.applied, this);\n\n\t\tconst bone = slot.bone.applied;\n\t\tconst vertexOffset = this.offset;\n\t\tconst x = bone.worldX, y = bone.worldY;\n\t\tconst a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\tlet offsetX = 0, offsetY = 0;\n\n\t\toffsetX = vertexOffset[0];\n\t\toffsetY = vertexOffset[1];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // br\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[2];\n\t\toffsetY = vertexOffset[3];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // bl\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[4];\n\t\toffsetY = vertexOffset[5];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ul\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[6];\n\t\toffsetY = vertexOffset[7];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ur\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t}\n\n\tcopy (): Attachment {\n\t\tconst copy = new RegionAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.scaleX = this.scaleX;\n\t\tcopy.scaleY = this.scaleY;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\n\t\tUtils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\t\treturn copy;\n\t}\n\n\tstatic X1 = 0;\n\tstatic Y1 = 1;\n\tstatic C1R = 2;\n\tstatic C1G = 3;\n\tstatic C1B = 4;\n\tstatic C1A = 5;\n\tstatic U1 = 6;\n\tstatic V1 = 7;\n\n\tstatic X2 = 8;\n\tstatic Y2 = 9;\n\tstatic C2R = 10;\n\tstatic C2G = 11;\n\tstatic C2B = 12;\n\tstatic C2A = 13;\n\tstatic U2 = 14;\n\tstatic V2 = 15;\n\n\tstatic X3 = 16;\n\tstatic Y3 = 17;\n\tstatic C3R = 18;\n\tstatic C3G = 19;\n\tstatic C3B = 20;\n\tstatic C3A = 21;\n\tstatic U3 = 22;\n\tstatic V3 = 23;\n\n\tstatic X4 = 24;\n\tstatic Y4 = 25;\n\tstatic C4R = 26;\n\tstatic C4G = 27;\n\tstatic C4B = 28;\n\tstatic C4A = 29;\n\tstatic U4 = 30;\n\tstatic V4 = 31;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { PointAttachment } from \"./attachments/PointAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport type { Sequence } from \"./attachments/Sequence.js\"\nimport type { Skin } from \"./Skin.js\";\nimport type { TextureAtlas } from \"./TextureAtlas.js\";\n\n/** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.\n *\n * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the\n * Spine Runtimes Guide. */\nexport class AtlasAttachmentLoader implements AttachmentLoader {\n\tatlas: TextureAtlas;\n\tallowMissingRegions: boolean;\n\n\tconstructor (atlas: TextureAtlas, allowMissingRegions = false) {\n\t\tthis.atlas = atlas;\n\t\tthis.allowMissingRegions = allowMissingRegions;\n\t}\n\n\tloadSequence (name: string, basePath: string, sequence: Sequence) {\n\t\tconst regions = sequence.regions;\n\t\tfor (let i = 0, n = regions.length; i < n; i++) {\n\t\t\tconst path = sequence.getPath(basePath, i);\n\t\t\tregions[i] = this.atlas.findRegion(path);\n\t\t\tif (regions[i] == null && !this.allowMissingRegions)\n\t\t\t\tthrow new Error(`Region not found in atlas: ${path} (sequence: ${name})`);\n\t\t}\n\t}\n\n\tnewRegionAttachment (skin: Skin, name: string, path: string, sequence: Sequence): RegionAttachment {\n\t\tconst attachment = new RegionAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tconst region = this.atlas.findRegion(path);\n\t\t\tif (region == null && !this.allowMissingRegions)\n\t\t\t\tthrow new Error(`Region not found in atlas: ${path} (region attachment: ${name})`);\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewMeshAttachment (skin: Skin, name: string, path: string, sequence: Sequence): MeshAttachment {\n\t\tconst attachment = new MeshAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tconst region = this.atlas.findRegion(path);\n\t\t\tif (region == null && !this.allowMissingRegions)\n\t\t\t\tthrow new Error(`Region not found in atlas: ${path} (mesh attachment: ${name})`);\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewBoundingBoxAttachment (skin: Skin, name: string): BoundingBoxAttachment {\n\t\treturn new BoundingBoxAttachment(name);\n\t}\n\n\tnewPathAttachment (skin: Skin, name: string): PathAttachment {\n\t\treturn new PathAttachment(name);\n\t}\n\n\tnewPointAttachment (skin: Skin, name: string): PointAttachment {\n\t\treturn new PointAttachment(name);\n\t}\n\n\tnewClippingAttachment (skin: Skin, name: string): ClippingAttachment {\n\t\treturn new ClippingAttachment(name);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Inherit } from \"./BoneData.js\";\nimport type { Pose } from \"./Pose.js\"\n\n/** Stores a bone's local pose. */\nexport class BoneLocal implements Pose {\n\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local rotation in degrees, counter clockwise. */\n\trotation = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 0;\n\n\t/** The local scaleY. */\n\tscaleY = 0;\n\n\t/** The local shearX. */\n\tshearX = 0;\n\n\t/** The local shearY. */\n\tshearY = 0;\n\n\tinherit = Inherit.Normal;\n\n\tset (pose: BoneLocal): void {\n\t\tif (pose == null) throw new Error(\"pose cannot be null.\");\n\t\tthis.x = pose.x;\n\t\tthis.y = pose.y;\n\t\tthis.rotation = pose.rotation;\n\t\tthis.scaleX = pose.scaleX;\n\t\tthis.scaleY = pose.scaleY;\n\t\tthis.shearX = pose.shearX;\n\t\tthis.shearY = pose.shearY;\n\t\tthis.inherit = pose.inherit;\n\t}\n\n\tsetPosition (x: number, y: number): void {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tsetScale (scaleX: number, scaleY: number): void;\n\tsetScale (scale: number): void;\n\tsetScale (scaleOrX: number, scaleY?: number): void {\n\t\tthis.scaleX = scaleOrX;\n\t\tthis.scaleY = scaleY === undefined ? scaleOrX : scaleY;\n\t}\n\n\t/** Determines how parent world transforms affect this bone. */\n\tpublic getInherit (): Inherit {\n\t\treturn this.inherit;\n\t}\n\n\tpublic setInherit (inherit: Inherit): void {\n\t\tif (inherit == null) throw new Error(\"inherit cannot be null.\");\n\t\tthis.inherit = inherit;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose.js\";\n\n/** The base class for all constrained datas. */\nexport abstract class PosedData

> {\n\t/** The constraint's name, which is unique across all constraints in the skeleton of the same type. */\n\treadonly name: string;\n\n\treadonly setup: P;\n\n\t/** When true, {@link Skeleton.updateWorldTransform} only updates this constraint if the {@link Skeleton.skin}\n\t * contains this constraint.\n\t *\n\t * See {@link Skin.constraints}. */\n\tskinRequired = false;\n\n\tconstructor (name: string, setup: P) {\n\t\tif (name == null) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t\tthis.setup = setup;\n\t}\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneLocal } from \"./BoneLocal.js\";\nimport { PosedData } from \"./PosedData.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport { Color } from \"./Utils.js\";\n\n/** The setup pose for a bone. */\nexport class BoneData extends PosedData {\n\t/** The index of the bone in {@link Skeleton.getBones}. */\n\tindex: number = 0;\n\n\t/** @returns May be null. */\n\tparent: BoneData | null = null;\n\n\t/** The bone's length. */\n\tlength: number = 0;\n\n\t// Nonessential.\n\t/** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually\n\t * rendered at runtime. */\n\treadonly color = new Color();\n\n\t/** The bone icon as it was in Spine, or null if nonessential data was not exported. */\n\ticon?: string;\n\n\t/** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = false;\n\n\tconstructor (index: number, name: string, parent: BoneData | null) {\n\t\tsuper(name, new BoneLocal());\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.parent = parent;\n\t}\n\n\tcopy (parent: BoneData | null): BoneData {\n\t\tconst copy = new BoneData(this.index, this.name, parent);\n\t\tcopy.length = this.length;\n\t\tcopy.setup.set(this.setup);\n\t\treturn copy;\n\t}\n}\n\n/** Determines how a bone inherits world transforms from parent bones. */\nexport enum Inherit { Normal, OnlyTranslation, NoRotationOrReflection, NoScale, NoScaleOrReflection }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Bone } from \"./Bone.js\";\nimport { Inherit } from \"./BoneData.js\";\nimport { BoneLocal } from \"./BoneLocal.js\";\nimport type { Physics } from \"./Physics.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { Update } from \"./Update.js\";\nimport { MathUtils, type Vector2 } from \"./Utils.js\";\n\n/** The applied pose for a bone. This is the {@link Bone} pose with constraints applied and the world transform computed by\n * {@link Skeleton#updateWorldTransform()}. */\nexport class BonePose extends BoneLocal implements Update {\n\tbone!: Bone;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link updateLocalTransform()} should be called. */\n\ta = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link updateLocalTransform()} should be called. */\n\tb = 0;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link updateLocalTransform()} should be called. */\n\tc = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link updateLocalTransform()} should be called. */\n\td = 0;\n\n\t/** The world X position. If changed, {@link updateLocalTransform()} should be called. */\n\tworldY = 0;\n\n\t/** The world Y position. If changed, {@link updateLocalTransform()} should be called. */\n\tworldX = 0;\n\n\tworld = 0;\n\tlocal = 0;\n\n\t/** Called by {@link Skeleton#updateCache()} to compute the world transform, if needed. */\n\tpublic update (skeleton: Skeleton, physics: Physics): void {\n\t\tif (this.world !== skeleton._update) this.updateWorldTransform(skeleton);\n\t}\n\n\t/** Computes the world transform using the parent bone's applied pose and this pose. Child bones are not updated.\n\t *

\n\t * See World transforms in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransform (skeleton: Skeleton): void {\n\t\tif (this.local === skeleton._update)\n\t\t\tthis.updateLocalTransform(skeleton);\n\t\telse\n\t\t\tthis.world = skeleton._update;\n\n\t\tconst rotation = this.rotation;\n\t\tconst scaleX = this.scaleX;\n\t\tconst scaleY = this.scaleY;\n\t\tconst shearX = this.shearX;\n\t\tconst shearY = this.shearY;\n\t\tif (!this.bone.parent) { // Root bone.\n\t\t\tconst sx = skeleton.scaleX, sy = skeleton.scaleY;\n\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\tthis.a = Math.cos(rx) * scaleX * sx;\n\t\t\tthis.b = Math.cos(ry) * scaleY * sx;\n\t\t\tthis.c = Math.sin(rx) * scaleX * sy;\n\t\t\tthis.d = Math.sin(ry) * scaleY * sy;\n\t\t\tthis.worldX = this.x * sx + skeleton.x;\n\t\t\tthis.worldY = this.y * sy + skeleton.y;\n\t\t\treturn;\n\t\t}\n\n\t\tconst parent = this.bone.parent.applied;\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tthis.worldX = pa * this.x + pb * this.y + parent.worldX;\n\t\tthis.worldY = pc * this.x + pd * this.y + parent.worldY;\n\n\t\tswitch (this.inherit) {\n\t\t\tcase Inherit.Normal: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la + pb * lc;\n\t\t\t\tthis.b = pa * lb + pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase Inherit.OnlyTranslation: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tthis.a = Math.cos(rx) * scaleX;\n\t\t\t\tthis.b = Math.cos(ry) * scaleY;\n\t\t\t\tthis.c = Math.sin(rx) * scaleX;\n\t\t\t\tthis.d = Math.sin(ry) * scaleY;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\tconst sx = 1 / skeleton.scaleX, sy = 1 / skeleton.scaleY;\n\t\t\t\tpa *= sx;\n\t\t\t\tpc *= sy;\n\t\t\t\tlet s = pa * pa + pc * pc;\n\t\t\t\tlet prx = 0;\n\t\t\t\tif (s > 0.0001) {\n\t\t\t\t\ts = Math.abs(pa * pd * sy - pb * sx * pc) / s;\n\t\t\t\t\tpb = pc * s;\n\t\t\t\t\tpd = pa * s;\n\t\t\t\t\tprx = MathUtils.atan2Deg(pc, pa);\n\t\t\t\t} else {\n\t\t\t\t\tpa = 0;\n\t\t\t\t\tpc = 0;\n\t\t\t\t\tprx = 90 - MathUtils.atan2Deg(pd, pb);\n\t\t\t\t}\n\t\t\t\tconst rx = (rotation + shearX - prx) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + shearY - prx + 90) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la - pb * lc;\n\t\t\t\tthis.b = pa * lb - pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoScale:\n\t\t\tcase Inherit.NoScaleOrReflection: {\n\t\t\t\tlet r = rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\tlet za = (pa * cos + pb * sin) / skeleton.scaleX;\n\t\t\t\tlet zc = (pc * cos + pd * sin) / skeleton.scaleY;\n\t\t\t\tlet s = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\tza *= s;\n\t\t\t\tzc *= s;\n\t\t\t\ts = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (this.inherit === Inherit.NoScale && (pa * pd - pb * pc < 0) !== (skeleton.scaleX < 0 !== skeleton.scaleY < 0)) s = -s;\n\t\t\t\tr = Math.PI / 2 + Math.atan2(zc, za);\n\t\t\t\tconst zb = Math.cos(r) * s;\n\t\t\t\tconst zd = Math.sin(r) * s;\n\t\t\t\tconst rx = shearX * MathUtils.degRad;\n\t\t\t\tconst ry = (90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = za * la + zb * lc;\n\t\t\t\tthis.b = za * lb + zb * ld;\n\t\t\t\tthis.c = zc * la + zd * lc;\n\t\t\t\tthis.d = zc * lb + zd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.a *= skeleton.scaleX;\n\t\tthis.b *= skeleton.scaleX;\n\t\tthis.c *= skeleton.scaleY;\n\t\tthis.d *= skeleton.scaleY;\n\t}\n\n\t/** Computes the local transform values from the world transform.\n\t *

\n\t * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so\n\t * the local transform matches the world transform. The local transform may be needed by other code (eg to apply another\n\t * constraint).\n\t *

\n\t * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The local transform after\n\t * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */\n\tpublic updateLocalTransform (skeleton: Skeleton): void {\n\t\tthis.local = 0;\n\t\tthis.world = skeleton._update;\n\n\t\tif (!this.bone.parent) {\n\t\t\tthis.x = this.worldX - skeleton.x;\n\t\t\tthis.y = this.worldY - skeleton.y;\n\t\t\tconst a = this.a, b = this.b, c = this.c, d = this.d;\n\t\t\tthis.rotation = MathUtils.atan2Deg(c, a);\n\t\t\tthis.scaleX = Math.sqrt(a * a + c * c);\n\t\t\tthis.scaleY = Math.sqrt(b * b + d * d);\n\t\t\tthis.shearX = 0;\n\t\t\tthis.shearY = MathUtils.atan2Deg(a * b + c * d, a * d - b * c);\n\t\t\treturn;\n\t\t}\n\n\t\tconst parent = this.bone.parent.applied;\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tlet pid = 1 / (pa * pd - pb * pc);\n\t\tlet ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid;\n\t\tconst dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\n\t\tthis.x = (dx * ia - dy * ib);\n\t\tthis.y = (dy * id - dx * ic);\n\n\t\tlet ra: number, rb: number, rc: number, rd: number;\n\t\tif (this.inherit === Inherit.OnlyTranslation) {\n\t\t\tra = this.a;\n\t\t\trb = this.b;\n\t\t\trc = this.c;\n\t\t\trd = this.d;\n\t\t} else {\n\t\t\tswitch (this.inherit) {\n\t\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\t\tconst s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\n\t\t\t\t\tpb = -pc * skeleton.scaleX * s / skeleton.scaleY;\n\t\t\t\t\tpd = pa * skeleton.scaleY * s / skeleton.scaleX;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection: {\n\t\t\t\t\tlet r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\t\tpa = (pa * cos + pb * sin) / skeleton.scaleX;\n\t\t\t\t\tpc = (pc * cos + pd * sin) / skeleton.scaleY;\n\t\t\t\t\tlet s = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\t\tpa *= s;\n\t\t\t\t\tpc *= s;\n\t\t\t\t\ts = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (this.inherit === Inherit.NoScale && pid < 0 !== (skeleton.scaleX < 0 !== skeleton.scaleY < 0)) s = -s;\n\t\t\t\t\tr = MathUtils.PI / 2 + Math.atan2(pc, pa);\n\t\t\t\t\tpb = Math.cos(r) * s;\n\t\t\t\t\tpd = Math.sin(r) * s;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tic = pc * pid;\n\t\t\t\t\tid = pa * pid;\n\t\t\t\t}\n\t\t\t}\n\t\t\tra = ia * this.a - ib * this.c;\n\t\t\trb = ia * this.b - ib * this.d;\n\t\t\trc = id * this.c - ic * this.a;\n\t\t\trd = id * this.d - ic * this.b;\n\t\t}\n\n\t\tthis.shearX = 0;\n\t\tthis.scaleX = Math.sqrt(ra * ra + rc * rc);\n\t\tif (this.scaleX > 0.0001) {\n\t\t\tconst det = ra * rd - rb * rc;\n\t\t\tthis.scaleY = det / this.scaleX;\n\t\t\tthis.shearY = -MathUtils.atan2Deg(ra * rb + rc * rd, det);\n\t\t\tthis.rotation = MathUtils.atan2Deg(rc, ra);\n\t\t} else {\n\t\t\tthis.scaleX = 0;\n\t\t\tthis.scaleY = Math.sqrt(rb * rb + rd * rd);\n\t\t\tthis.shearY = 0;\n\t\t\tthis.rotation = 90 - MathUtils.atan2Deg(rd, rb);\n\t\t}\n\t}\n\n\t/** If the world transform has been modified and the local transform no longer matches, {@link #updateLocalTransform(Skeleton)}\n\t * is called. */\n\tpublic validateLocalTransform (skeleton: Skeleton): void {\n\t\tif (this.local === skeleton._update) this.updateLocalTransform(skeleton);\n\t}\n\n\tmodifyLocal (skeleton: Skeleton): void {\n\t\tif (this.local === skeleton._update) this.updateLocalTransform(skeleton);\n\t\tthis.world = 0;\n\t\tthis.resetWorld(skeleton._update);\n\t}\n\n\tmodifyWorld (update: number): void {\n\t\tthis.local = update;\n\t\tthis.world = update;\n\t\tthis.resetWorld(update);\n\t}\n\n\tresetWorld (update: number): void {\n\t\tconst children = this.bone.children;\n\t\tfor (let i = 0, n = children.length; i < n; i++) {\n\t\t\tconst child = children[i].applied;\n\t\t\tif (child.world === update) {\n\t\t\t\tchild.world = 0;\n\t\t\t\tchild.local = 0;\n\t\t\t\tchild.resetWorld(update);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** The world rotation for the X axis, calculated using {@link a} and {@link c}. */\n\tpublic getWorldRotationX (): number {\n\t\treturn MathUtils.atan2Deg(this.c, this.a);\n\t}\n\n\t/** The world rotation for the Y axis, calculated using {@link b} and {@link d}. */\n\tpublic getWorldRotationY (): number {\n\t\treturn MathUtils.atan2Deg(this.d, this.b);\n\t}\n\n\t/** The magnitude (always positive) of the world scale X, calculated using {@link a} and {@link c}. */\n\tpublic getWorldScaleX (): number {\n\t\treturn Math.sqrt(this.a * this.a + this.c * this.c);\n\t}\n\n\t/** The magnitude (always positive) of the world scale Y, calculated using {@link b} and {@link d}. */\n\tpublic getWorldScaleY (): number {\n\t\treturn Math.sqrt(this.b * this.b + this.d * this.d);\n\t}\n\n\t// public Matrix3 getWorldTransform (Matrix3 worldTransform) {\n\t// \tif (worldTransform == null) throw new IllegalArgumentException(\"worldTransform cannot be null.\");\n\t// \tfloat[] val = worldTransform.val;\n\t// \tval[M00] = a;\n\t// \tval[M01] = b;\n\t// \tval[M10] = c;\n\t// \tval[M11] = d;\n\t// \tval[M02] = worldX;\n\t// \tval[M12] = worldY;\n\t// \tval[M20] = 0;\n\t// \tval[M21] = 0;\n\t// \tval[M22] = 1;\n\t// \treturn worldTransform;\n\t// }\n\n\t/** Transforms a point from world coordinates to the bone's local coordinates. */\n\tpublic worldToLocal (world: Vector2): Vector2 {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\tconst det = this.a * this.d - this.b * this.c;\n\t\tconst x = world.x - this.worldX, y = world.y - this.worldY;\n\t\tworld.x = (x * this.d - y * this.b) / det;\n\t\tworld.y = (y * this.a - x * this.c) / det;\n\t\treturn world;\n\t}\n\n\t/** Transforms a point from the bone's local coordinates to world coordinates. */\n\tpublic localToWorld (local: Vector2): Vector2 {\n\t\tif (local == null) throw new Error(\"local cannot be null.\");\n\t\tconst x = local.x, y = local.y;\n\t\tlocal.x = x * this.a + y * this.b + this.worldX;\n\t\tlocal.y = x * this.c + y * this.d + this.worldY;\n\t\treturn local;\n\t}\n\n\t/** Transforms a point from world coordinates to the parent bone's local coordinates. */\n\tpublic worldToParent (world: Vector2): Vector2 {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.bone.parent == null ? world : this.bone.parent.applied.worldToLocal(world);\n\t}\n\n\t/** Transforms a point from the parent bone's coordinates to world coordinates. */\n\tpublic parentToWorld (world: Vector2): Vector2 {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.bone.parent == null ? world : this.bone.parent.applied.localToWorld(world);\n\t}\n\n\t/** Transforms a world rotation to a local rotation. */\n\tpublic worldToLocalRotation (worldRotation: number): number {\n\t\tworldRotation *= MathUtils.degRad;\n\t\tconst sin = Math.sin(worldRotation), cos = Math.cos(worldRotation);\n\t\treturn MathUtils.atan2Deg(this.a * sin - this.c * cos, this.d * cos - this.b * sin) + this.rotation - this.shearX;\n\t}\n\n\t/** Transforms a local rotation to a world rotation. */\n\tlocalToWorldRotation (localRotation: number): number {\n\t\tlocalRotation = (localRotation - this.rotation - this.shearX) * MathUtils.degRad;\n\t\tconst sin = Math.sin(localRotation), cos = Math.cos(localRotation);\n\t\treturn MathUtils.atan2Deg(cos * this.c + sin * this.d, cos * this.a + sin * this.b);\n\t}\n\n\t/** Rotates the world transform the specified amount.\n\t *

\n\t * After changes are made to the world transform, {@link updateLocalTransform} should be called on this bone and any\n\t * child bones, recursively. */\n\trotateWorld (degrees: number) {\n\t\tdegrees *= MathUtils.degRad;\n\t\tconst sin = Math.sin(degrees), cos = Math.cos(degrees);\n\t\tconst ra = this.a, rb = this.b;\n\t\tthis.a = cos * ra - sin * this.c;\n\t\tthis.b = cos * rb - sin * this.d;\n\t\tthis.c = sin * ra + cos * this.c;\n\t\tthis.d = sin * rb + cos * this.d;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose.js\";\nimport type { PosedData } from \"./PosedData.js\";\n\nexport abstract class Posed<\n\tD extends PosedData

,\n\tP extends Pose

,\n\tA extends P> {\n\n\t/** The constraint's setup pose data. */\n\treadonly data: D;\n\treadonly pose: A;\n\treadonly constrained: A;\n\tapplied: A;\n\n\tconstructor (data: D, pose: A, constrained: A) {\n\t\tif (data == null) throw new Error(\"data cannot be null.\");\n\t\tthis.data = data;\n\t\tthis.pose = pose;\n\t\tthis.constrained = constrained;\n\t\tthis.applied = pose;\n\t}\n\n\tpublic setupPose (): void {\n\t\tthis.pose.set(this.data.setup);\n\t}\n\n\t/** The constraint's setup pose data. */\n\tpublic getData (): D {\n\t\treturn this.data;\n\t}\n\n\tpublic getPose (): P {\n\t\treturn this.pose;\n\t}\n\n\tpublic getAppliedPose (): A {\n\t\treturn this.applied;\n\t}\n\n\tusePose () { // Port: usePose - reference runtime: pose()\n\t\tthis.applied = this.pose;\n\t}\n\n\tuseConstrained () { // Port: useConstrained - reference runtime: constrained()\n\t\tthis.applied = this.constrained;\n\t}\n\n\tresetConstrained () { // Port: resetConstrained - reference runtime: reset()\n\t\tthis.constrained.set(this.pose);\n\t}\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose.js\";\nimport { Posed } from \"./Posed.js\";\nimport type { PosedData } from \"./PosedData.js\";\n\nimport type { Skeleton } from \"./Skeleton\";\n\nexport abstract class PosedActive<\n\tD extends PosedData

,\n\tP extends Pose

,\n\tA extends P>\n\textends Posed {\n\n\tactive = false;\n\n\tconstructor (data: D, pose: A, constrained: A) {\n\t\tsuper(data, pose, constrained);\n\t\tthis.setupPose();\n\t}\n\n\t/** Returns false when this constraint won't be updated by\n\t * {@link Skeleton.updateWorldTransform()} because a skin is required and the\n\t * {@link Skeleton.getSkin() active skin} does not contain this item.\n\t * @see Skin.getBones()\n\t * @see Skin.getConstraints()\n\t * @see PosedData.getSkinRequired()\n\t * @see Skeleton.updateCache() */\n\tpublic isActive (): boolean {\n\t\treturn this.active;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BoneData } from \"./BoneData.js\";\nimport type { BoneLocal } from \"./BoneLocal.js\";\nimport { BonePose } from \"./BonePose.js\";\nimport { PosedActive } from \"./PosedActive.js\";\n\n/** The current pose for a bone, before constraints are applied.\n *\n * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a\n * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a\n * constraint or application code modifies the world transform after it was computed from the local transform. */\nexport class Bone extends PosedActive {\n\t/** The parent bone, or null if this is the root bone. */\n\tparent: Bone | null = null;\n\n\t/** The immediate children of this bone. */\n\tchildren = [] as Bone[];\n\n\tsorted = false;\n\n\tconstructor (data: BoneData, parent: Bone | null) {\n\t\tsuper(data, new BonePose(), new BonePose());\n\t\tthis.parent = parent;\n\t\tthis.applied.bone = this;\n\t\tthis.constrained.bone = this;\n\t}\n\n\t/** Make a copy of the bone. Does not copy the {@link #getChildren()} bones. */\n\tcopy (parent: Bone | null): Bone {\n\t\tconst copy = new Bone(this.data, parent);\n\t\tcopy.pose.set(this.pose);\n\t\treturn copy;\n\t}\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { ConstraintData } from \"./ConstraintData.js\";\nimport type { Physics } from \"./Physics.js\";\nimport type { Pose } from \"./Pose.js\";\nimport { PosedActive } from \"./PosedActive.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { Update } from \"./Update.js\";\n\nexport abstract class Constraint<\n\tT extends Constraint,\n\tD extends ConstraintData,\n\tP extends Pose

>\n\textends PosedActive implements Update {\n\n\tconstructor (data: D, pose: P, constrained: P) {\n\t\tsuper(data, pose, constrained);\n\t}\n\n\tabstract copy (skeleton: Skeleton): T;\n\n\tabstract sort (skeleton: Skeleton): void;\n\n\tabstract update (skeleton: Skeleton, physics: Physics): void;\n\n\tisSourceActive (): boolean {\n\t\treturn true;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Constraint } from \"./Constraint.js\";\nimport type { Pose } from \"./Pose.js\";\nimport { PosedData } from \"./PosedData.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\n\n/** The base class for all constraint datas. */\nexport abstract class ConstraintData<\n\tT extends Constraint, P>,\n\tP extends Pose

>\n\textends PosedData

{\n\n\tconstructor (name: string, setup: P) {\n\t\tsuper(name, setup);\n\t}\n\n\tabstract create (skeleton: Skeleton): T;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { EventData } from \"./EventData.js\";\n\nimport type { Timeline } from \"./Animation.js\";\nimport type { AnimationStateListener } from \"./AnimationState.js\";\n\n/** Stores the current pose values for an {@link Event}.\n *\n * See Timeline {@link Timeline.apply()},\n * AnimationStateListener {@link AnimationStateListener.event()}, and\n * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class Event {\n\treadonly data: EventData;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\ttime: number = 0;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (time: number, data: EventData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.time = time;\n\t\tthis.data = data;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** Stores the setup pose values for an {@link Event}.\n *\n * See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class EventData {\n\tname: string;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\taudioPath: string | null = null;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose\";\n\n/** Stores the current pose for an IK constraint. */\nexport class IkConstraintPose implements Pose {\n\t/** For two bone IK, controls the bend direction of the IK bones, either 1 or -1. */\n\tbendDirection = 0;\n\n\t/** For one bone IK, when true and the target is too close, the bone is scaled to reach it. */\n\tcompress = false;\n\n\t/** When true and the target is out of range, the parent bone is scaled to reach it.\n\t *\n\t * For two bone IK: 1) the child bone's local Y translation is set to 0, 2) stretch is not applied if {@link softness} is\n\t * > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied. */\n\tstretch = false;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation.\n\t *\n\t * For two bone IK: if the parent bone has local nonuniform scale, the child bone's local Y translation is set to 0. */\n\tmix = 0;\n\n\t/** For two bone IK, the target bone's distance from the maximum reach of the bones where rotation begins to slow. The bones\n\t * will not straighten completely until the target is this far out of range. */\n\tsoftness = 0;\n\n\tpublic set (pose: IkConstraintPose) {\n\t\tthis.mix = pose.mix;\n\t\tthis.softness = pose.softness;\n\t\tthis.bendDirection = pose.bendDirection;\n\t\tthis.compress = pose.compress;\n\t\tthis.stretch = pose.stretch;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Bone } from \"./Bone.js\";\nimport { Inherit } from \"./BoneData.js\";\nimport type { BonePose } from \"./BonePose.js\";\nimport { Constraint } from \"./Constraint.js\";\nimport type { IkConstraintData } from \"./IkConstraintData.js\";\nimport { IkConstraintPose } from \"./IkConstraintPose.js\";\nimport type { Physics } from \"./Physics.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of\n * the last bone is as close to the target bone as possible.\n *\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraint extends Constraint {\n\t/** The 1 or 2 bones that will be modified by this IK constraint. */\n\treadonly bones: Array;\n\n\t/** The bone that is the IK target. */\n\ttarget: Bone;\n\n\tconstructor (data: IkConstraintData, skeleton: Skeleton) {\n\t\tsuper(data, new IkConstraintPose(), new IkConstraintPose());\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\n\t\tthis.bones = [] as BonePose[];\n\t\tfor (const boneData of data.bones)\n\t\t\tthis.bones.push(skeleton.bones[boneData.index].constrained);\n\n\t\tthis.target = skeleton.bones[data.target.index];\n\t}\n\n\tcopy (skeleton: Skeleton): IkConstraint {\n\t\tvar copy = new IkConstraint(this.data, skeleton);\n\t\tcopy.pose.set(this.pose);\n\t\treturn copy;\n\t}\n\n\tupdate (skeleton: Skeleton, physics: Physics) {\n\t\tconst p = this.applied;\n\t\tif (p.mix === 0) return;\n\t\tconst target = this.target.applied;\n\t\tconst bones = this.bones;\n\t\tswitch (bones.length) {\n\t\t\tcase 1:\n\t\t\t\tIkConstraint.apply(skeleton, bones[0], target.worldX, target.worldY, p.compress, p.stretch, this.data.uniform, p.mix);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tIkConstraint.apply(skeleton, bones[0], bones[1], target.worldX, target.worldY, p.bendDirection, p.stretch, this.data.uniform,\n\t\t\t\t\tp.softness, p.mix);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsort (skeleton: Skeleton) {\n\t\tskeleton.sortBone(this.target);\n\t\tconst parent = this.bones[0].bone;\n\t\tskeleton.sortBone(parent);\n\t\tskeleton._updateCache.push(this);\n\t\tparent.sorted = false;\n\t\tskeleton.sortReset(parent.children);\n\t\tskeleton.constrained(parent);\n\t\tif (this.bones.length > 1) skeleton.constrained(this.bones[1].bone);\n\t}\n\n\tisSourceActive () {\n\t\treturn this.target.active;\n\t}\n\n\t/** Applies 1 bone IK. The target is specified in the world coordinate system. */\n\tpublic static apply (skeleton: Skeleton, bone: BonePose, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, mix: number): void;\n\n\t/** Applies 2 bone IK. The target is specified in the world coordinate system.\n\t * @param child A direct descendant of the parent bone. */\n\tpublic static apply (skeleton: Skeleton, parent: BonePose, child: BonePose, targetX: number, targetY: number, bendDir: number, stretch: boolean, uniform: boolean, softness: number, mix: number): void;\n\n\tpublic static apply (skeleton: Skeleton, boneOrParent: BonePose, targetXorChild: number | BonePose, targetYOrTargetX: number, compressOrTargetY: boolean | number,\n\t\tstretchOrBendDir: boolean | number, uniformOrStretch: boolean, mixOrUniform: number | boolean, softness?: number, mix?: number) {\n\n\t\tif (typeof targetXorChild === \"number\")\n\t\t\tIkConstraint.apply1(skeleton, boneOrParent, targetXorChild, targetYOrTargetX, compressOrTargetY as boolean, stretchOrBendDir as boolean, uniformOrStretch, mixOrUniform as number);\n\t\telse\n\t\t\tIkConstraint.apply2(skeleton, boneOrParent, targetXorChild as BonePose, targetYOrTargetX, compressOrTargetY as number, stretchOrBendDir as number,\n\t\t\t\tuniformOrStretch, mixOrUniform as boolean, softness as number, mix as number);\n\t}\n\n\tprivate static apply1 (skeleton: Skeleton, bone: BonePose, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, mix: number) {\n\t\tbone.modifyLocal(skeleton);\n\n\t\t// biome-ignore lint/style/noNonNullAssertion: reference runtime\n\t\tconst p = bone.bone.parent!.applied;\n\n\t\tlet pa = p.a, pb = p.b, pc = p.c, pd = p.d;\n\t\tlet rotationIK = -bone.shearX - bone.rotation, tx = 0, ty = 0;\n\n\t\tswitch (bone.inherit) {\n\t\t\tcase Inherit.OnlyTranslation:\n\t\t\t\ttx = (targetX - bone.worldX) * MathUtils.signum(skeleton.scaleX);\n\t\t\t\tty = (targetY - bone.worldY) * MathUtils.signum(skeleton.scaleY);\n\t\t\t\tbreak;\n\t\t\t// biome-ignore lint/suspicious/noFallthroughSwitchClause: reference runtime\n\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\tconst s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc);\n\t\t\t\tconst sa = pa / skeleton.scaleX;\n\t\t\t\tconst sc = pc / skeleton.scaleY;\n\t\t\t\tpb = -sc * s * skeleton.scaleX;\n\t\t\t\tpd = sa * s * skeleton.scaleY;\n\t\t\t\trotationIK += MathUtils.atan2Deg(sc, sa);\n\t\t\t}\n\t\t\t// Fall through\n\t\t\tdefault: {\n\t\t\t\tconst x = targetX - p.worldX, y = targetY - p.worldY;\n\t\t\t\tconst d = pa * pd - pb * pc;\n\t\t\t\tif (Math.abs(d) <= 0.0001) {\n\t\t\t\t\ttx = 0;\n\t\t\t\t\tty = 0;\n\t\t\t\t} else {\n\t\t\t\t\ttx = (x * pd - y * pb) / d - bone.x;\n\t\t\t\t\tty = (y * pa - x * pc) / d - bone.y;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trotationIK += MathUtils.atan2Deg(ty, tx);\n\t\tif (bone.scaleX < 0) rotationIK += 180;\n\t\tif (rotationIK > 180)\n\t\t\trotationIK -= 360;\n\t\telse if (rotationIK < -180)\n\t\t\trotationIK += 360;\n\t\tbone.rotation += rotationIK * mix;\n\t\tif (compress || stretch) {\n\t\t\tswitch (bone.inherit) {\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection:\n\t\t\t\t\ttx = targetX - bone.worldX;\n\t\t\t\t\tty = targetY - bone.worldY;\n\t\t\t}\n\t\t\tconst b = bone.bone.data.length * bone.scaleX;\n\t\t\tif (b > 0.0001) {\n\t\t\t\tconst dd = tx * tx + ty * ty;\n\t\t\t\tif ((compress && dd < b * b) || (stretch && dd > b * b)) {\n\t\t\t\t\tconst s = (Math.sqrt(dd) / b - 1) * mix + 1;\n\t\t\t\t\tbone.scaleX *= s;\n\t\t\t\t\tif (uniform) bone.scaleY *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Applies 2 bone IK. The target is specified in the world coordinate system.\n\t * @param child A direct descendant of the parent bone. */\n\tprivate static apply2 (skeleton: Skeleton, parent: BonePose, child: BonePose, targetX: number, targetY: number, bendDir: number, stretch: boolean, uniform: boolean, softness: number, mix: number) {\n\t\tif (parent.inherit !== Inherit.Normal || child.inherit !== Inherit.Normal) return;\n\t\tparent.modifyLocal(skeleton);\n\t\tchild.modifyLocal(skeleton);\n\t\tlet px = parent.x, py = parent.y, psx = parent.scaleX, psy = parent.scaleY, csx = child.scaleX;\n\t\tlet os1 = 0, os2 = 0, s2 = 0;\n\t\tif (psx < 0) {\n\t\t\tpsx = -psx;\n\t\t\tos1 = 180;\n\t\t\ts2 = -1;\n\t\t} else {\n\t\t\tos1 = 0;\n\t\t\ts2 = 1;\n\t\t}\n\t\tif (psy < 0) {\n\t\t\tpsy = -psy;\n\t\t\ts2 = -s2;\n\t\t}\n\t\tif (csx < 0) {\n\t\t\tcsx = -csx;\n\t\t\tos2 = 180;\n\t\t} else\n\t\t\tos2 = 0;\n\t\tlet cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\n\t\tconst u = Math.abs(psx - psy) <= 0.0001;\n\t\tif (!u || stretch) {\n\t\t\tchild.y = 0;\n\t\t\tcwx = a * child.x + parent.worldX;\n\t\t\tcwy = c * child.x + parent.worldY;\n\t\t} else {\n\t\t\tcwx = a * child.x + b * child.y + parent.worldX;\n\t\t\tcwy = c * child.x + d * child.y + parent.worldY;\n\t\t}\n\t\t// biome-ignore lint/style/noNonNullAssertion: reference-runtime\n\t\tconst pp = parent.bone.parent!.applied;\n\t\ta = pp.a;\n\t\tb = pp.b;\n\t\tc = pp.c;\n\t\td = pp.d;\n\t\tlet id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY;\n\t\tid = Math.abs(id) <= 0.0001 ? 0 : 1 / id;\n\t\tconst dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\n\t\tlet l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.bone.data.length * csx, a1: number, a2: number;\n\t\tif (l1 < 0.0001) {\n\t\t\tIkConstraint.apply(skeleton, parent, targetX, targetY, false, stretch, false, mix);\n\t\t\tchild.rotation = 0;\n\t\t\treturn;\n\t\t}\n\t\tx = targetX - pp.worldX;\n\t\ty = targetY - pp.worldY;\n\t\tlet tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\n\t\tlet dd = tx * tx + ty * ty;\n\t\tif (softness !== 0) {\n\t\t\tsoftness *= psx * (csx + 1) * 0.5;\n\t\t\tconst td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\n\t\t\tif (sd > 0) {\n\t\t\t\tlet p = Math.min(1, sd / (softness * 2)) - 1;\n\t\t\t\tp = (sd - softness * (1 - p * p)) / td;\n\t\t\t\ttx -= p * tx;\n\t\t\t\tty -= p * ty;\n\t\t\t\tdd = tx * tx + ty * ty;\n\t\t\t}\n\t\t}\n\t\t// biome-ignore lint/suspicious/noConfusingLabels: reference runtime\n\t\touter:\n\t\tif (u) {\n\t\t\tl2 *= psx;\n\t\t\tlet cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\n\t\t\tif (cos < -1) {\n\t\t\t\tcos = -1;\n\t\t\t\ta2 = Math.PI * bendDir;\n\t\t\t} else if (cos > 1) {\n\t\t\t\tcos = 1;\n\t\t\t\ta2 = 0;\n\t\t\t\tif (stretch) {\n\t\t\t\t\ta = (Math.sqrt(dd) / (l1 + l2) - 1) * mix + 1;\n\t\t\t\t\tparent.scaleX *= a;\n\t\t\t\t\tif (uniform) parent.scaleY *= a;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\ta2 = Math.acos(cos) * bendDir;\n\t\t\ta = l1 + l2 * cos;\n\t\t\tb = l2 * Math.sin(a2);\n\t\t\ta1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\n\t\t} else {\n\t\t\ta = psx * l2;\n\t\t\tb = psy * l2;\n\t\t\tconst aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\n\t\t\tc = bb * l1 * l1 + aa * dd - aa * bb;\n\t\t\tconst c1 = -2 * bb * l1, c2 = bb - aa;\n\t\t\td = c1 * c1 - 4 * c2 * c;\n\t\t\tif (d >= 0) {\n\t\t\t\tlet q = Math.sqrt(d);\n\t\t\t\tif (c1 < 0) q = -q;\n\t\t\t\tq = -(c1 + q) * 0.5;\n\t\t\t\tlet r0 = q / c2, r1 = c / q;\n\t\t\t\tconst r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\n\t\t\t\tr0 = dd - r * r;\n\t\t\t\tif (r0 >= 0) {\n\t\t\t\t\ty = Math.sqrt(r0) * bendDir;\n\t\t\t\t\ta1 = ta - Math.atan2(y, r);\n\t\t\t\t\ta2 = Math.atan2(y / psy, (r - l1) / psx);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\n\t\t\tlet maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\n\t\t\tc = -a * l1 / (aa - bb);\n\t\t\tif (c >= -1 && c <= 1) {\n\t\t\t\tc = Math.acos(c);\n\t\t\t\tx = a * Math.cos(c) + l1;\n\t\t\t\ty = b * Math.sin(c);\n\t\t\t\td = x * x + y * y;\n\t\t\t\tif (d < minDist) {\n\t\t\t\t\tminAngle = c;\n\t\t\t\t\tminDist = d;\n\t\t\t\t\tminX = x;\n\t\t\t\t\tminY = y;\n\t\t\t\t}\n\t\t\t\tif (d > maxDist) {\n\t\t\t\t\tmaxAngle = c;\n\t\t\t\t\tmaxDist = d;\n\t\t\t\t\tmaxX = x;\n\t\t\t\t\tmaxY = y;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dd <= (minDist + maxDist) * 0.5) {\n\t\t\t\ta1 = ta - Math.atan2(minY * bendDir, minX);\n\t\t\t\ta2 = minAngle * bendDir;\n\t\t\t} else {\n\t\t\t\ta1 = ta - Math.atan2(maxY * bendDir, maxX);\n\t\t\t\ta2 = maxAngle * bendDir;\n\t\t\t}\n\t\t}\n\t\tconst os = Math.atan2(child.y, child.x) * s2;\n\t\ta1 = (a1 - os) * MathUtils.radDeg + os1 - parent.rotation;\n\t\tif (a1 > 180)\n\t\t\ta1 -= 360;\n\t\telse if (a1 < -180) //\n\t\t\ta1 += 360;\n\t\tparent.rotation += a1 * mix;\n\t\ta2 = ((a2 + os) * MathUtils.radDeg - child.shearX) * s2 + os2 - child.rotation;\n\t\tif (a2 > 180)\n\t\t\ta2 -= 360;\n\t\telse if (a2 < -180) //\n\t\t\ta2 += 360;\n\t\tchild.rotation += a2 * mix;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { IkConstraint } from \"./IkConstraint.js\";\nimport { IkConstraintPose } from \"./IkConstraintPose.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\n\n/** Stores the setup pose for an {@link IkConstraint}.\n *\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraintData extends ConstraintData {\n\t/** The bones that are constrained by this IK constraint. */\n\tbones = [] as BoneData[];\n\n\tprivate _target: BoneData | null = null;\n\t/** The bone that is the IK target. */\n\tpublic set target (boneData: BoneData) { this._target = boneData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"target cannot be null.\")\n\t\telse return this._target;\n\t}\n\n\t/** When true and {@link IkConstraintPose.compress} or {@link IkConstraintPose.stretch} is used, the bone is scaled\n\t * on both the X and Y axes. */\n\tuniform = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, new IkConstraintPose());\n\t}\n\n\tpublic create (skeleton: Skeleton) {\n\t\treturn new IkConstraint(this, skeleton);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose\"\n\n/** Stores a pose for a path constraint. */\nexport class PathConstraintPose implements Pose {\n\t/** The position along the path. */\n\tposition: number = 0;\n\n\t/** The spacing between bones. */\n\tspacing: number = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. */\n\tmixRotate = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. */\n\tmixX = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. */\n\tmixY = 0;\n\n\tpublic set (pose: PathConstraintPose) {\n\t\tthis.position = pose.position;\n\t\tthis.spacing = pose.spacing;\n\t\tthis.mixRotate = pose.mixRotate;\n\t\tthis.mixX = pose.mixX;\n\t\tthis.mixY = pose.mixY;\n\t}\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport { PathConstraintPose } from \"./PathConstraintPose.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { SlotData } from \"./SlotData.js\";\n\n\n/** Stores the setup pose for a {@link PathConstraint}.\n *\n * See [path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraintData extends ConstraintData {\n\t/** The bones that will be modified by this path constraint. */\n\tbones = [] as BoneData[];\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\tpublic set slot (slotData: SlotData) { this._slot = slotData; }\n\tpublic get slot () {\n\t\tif (!this._slot) throw new Error(\"SlotData not set.\")\n\t\telse return this._slot;\n\t}\n\tprivate _slot: SlotData | null = null;\n\n\t/** The mode for positioning the first bone on the path. */\n\tpositionMode: PositionMode = PositionMode.Fixed;\n\n\t/** The mode for positioning the bones after the first bone on the path. */\n\tspacingMode: SpacingMode = SpacingMode.Fixed;\n\n\t/** The mode for adjusting the rotation of the bones. */\n\trotateMode: RotateMode = RotateMode.Chain;\n\n\t/** An offset added to the constrained bone rotation. */\n\toffsetRotation: number = 0;\n\n\tconstructor (name: string) {\n\t\tsuper(name, new PathConstraintPose());\n\t}\n\n\tpublic create (skeleton: Skeleton) {\n\t\treturn new PathConstraint(this, skeleton);\n\t}\n}\n\n/** Controls how the first bone is positioned along the path.\n *\n * See [position](http://esotericsoftware.com/spine-path-constraints#Position) in the Spine User Guide. */\nexport enum PositionMode { Fixed, Percent }\n\n/** Controls how bones after the first bone are positioned along the path.\n *\n * See [spacing](http://esotericsoftware.com/spine-path-constraints#Spacing) in the Spine User Guide. */\nexport enum SpacingMode { Length, Fixed, Percent, Proportional }\n\n/** Controls how bones are rotated, translated, and scaled to match the path.\n *\n * See [rotate mix](http://esotericsoftware.com/spine-path-constraints#Rotate-Mix) in the Spine User Guide. */\nexport enum RotateMode { Tangent, Chain, ChainScale }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Attachment } from \"./attachments/Attachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport type { Bone } from \"./Bone.js\";\nimport type { BonePose } from \"./BonePose.js\";\nimport { Constraint } from \"./Constraint.js\";\nimport { type PathConstraintData, PositionMode, RotateMode, SpacingMode } from \"./PathConstraintData.js\";\nimport { PathConstraintPose } from \"./PathConstraintPose.js\";\nimport type { Physics } from \"./Physics.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { Skin } from \"./Skin.js\";\nimport type { Slot } from \"./Slot.js\";\nimport { MathUtils, Utils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the\n * constrained bones so they follow a {@link PathAttachment}.\n *\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraint extends Constraint {\n\tstatic NONE = -1; static BEFORE = -2; static AFTER = -3;\n\tstatic epsilon = 0.00001;\n\n\t/** The path constraint's setup pose data. */\n\tdata: PathConstraintData;\n\n\t/** The bones that will be modified by this path constraint. */\n\tbones: Array;\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\tslot: Slot;\n\n\tspaces = [] as number[]; positions = [] as number[];\n\tworld = [] as number[]; curves = [] as number[]; lengths = [] as number[];\n\tsegments = [] as number[];\n\n\tconstructor (data: PathConstraintData, skeleton: Skeleton) {\n\t\tsuper(data, new PathConstraintPose(), new PathConstraintPose());\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = [] as BonePose[];\n\t\tfor (const boneData of this.data.bones)\n\t\t\tthis.bones.push(skeleton.bones[boneData.index].constrained);\n\n\t\tthis.slot = skeleton.slots[data.slot.index];\n\t}\n\n\tpublic copy (skeleton: Skeleton) {\n\t\tvar copy = new PathConstraint(this.data, skeleton);\n\t\tcopy.pose.set(this.pose);\n\t\treturn copy;\n\t}\n\n\tupdate (skeleton: Skeleton, physics: Physics) {\n\t\tconst attachment = this.slot.applied.attachment;\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\n\t\tconst p = this.applied;\n\t\tconst mixRotate = p.mixRotate, mixX = p.mixX, mixY = p.mixY;\n\t\tif (mixRotate === 0 && mixX === 0 && mixY === 0) return;\n\n\t\tconst data = this.data;\n\t\tconst tangents = data.rotateMode === RotateMode.Tangent, scale = data.rotateMode === RotateMode.ChainScale;\n\n\t\tconst bones = this.bones;\n\t\tconst boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\n\t\tconst spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : [];\n\t\tconst spacing = p.spacing;\n\n\t\tswitch (data.spacingMode) {\n\t\t\tcase SpacingMode.Percent:\n\t\t\t\tif (scale) {\n\t\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n; i++) {\n\t\t\t\t\t\tconst bone = bones[i];\n\t\t\t\t\t\tconst setupLength = bone.bone.data.length;\n\t\t\t\t\t\tconst x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlengths[i] = Math.sqrt(x * x + y * y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tUtils.arrayFill(spaces, 1, spacesCount, spacing);\n\t\t\t\tbreak;\n\t\t\tcase SpacingMode.Proportional: {\n\t\t\t\tlet sum = 0;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tconst bone = bones[i];\n\t\t\t\t\tconst setupLength = bone.bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tconst length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = length;\n\t\t\t\t\t\tsum += length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (sum > 0) {\n\t\t\t\t\tsum = spacesCount / sum * spacing;\n\t\t\t\t\tfor (let i = 1; i < spacesCount; i++)\n\t\t\t\t\t\tspaces[i] *= sum;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconst lengthSpacing = data.spacingMode === SpacingMode.Length;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tconst bone = bones[i];\n\t\t\t\t\tconst setupLength = bone.bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tconst length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = (lengthSpacing ? Math.max(0, setupLength + spacing) : spacing) * length / setupLength;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst positions = this.computeWorldPositions(skeleton, attachment, spacesCount, tangents);\n\t\tlet boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\n\t\tlet tip = false;\n\t\tif (offsetRotation === 0)\n\t\t\ttip = data.rotateMode === RotateMode.Chain;\n\t\telse {\n\t\t\ttip = false;\n\t\t\tconst bone = this.slot.bone.applied;\n\t\t\toffsetRotation *= bone.a * bone.d - bone.b * bone.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\t}\n\t\tfor (let i = 0, ip = 3, u = skeleton._update; i < boneCount; i++, ip += 3) {\n\t\t\tconst bone = bones[i];\n\t\t\tbone.worldX += (boneX - bone.worldX) * mixX;\n\t\t\tbone.worldY += (boneY - bone.worldY) * mixY;\n\t\t\tconst x = positions[ip], y = positions[ip + 1], dx = x - boneX, dy = y - boneY;\n\t\t\tif (scale) {\n\t\t\t\tconst length = lengths[i];\n\t\t\t\tif (length !== 0) {\n\t\t\t\t\tconst s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1;\n\t\t\t\t\tbone.a *= s;\n\t\t\t\t\tbone.c *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboneX = x;\n\t\t\tboneY = y;\n\t\t\tif (mixRotate > 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\n\t\t\t\tif (tangents)\n\t\t\t\t\tr = positions[ip - 1];\n\t\t\t\telse if (spaces[i + 1] === 0)\n\t\t\t\t\tr = positions[ip + 2];\n\t\t\t\telse\n\t\t\t\t\tr = Math.atan2(dy, dx);\n\t\t\t\tr -= Math.atan2(c, a);\n\t\t\t\tif (tip) {\n\t\t\t\t\tcos = Math.cos(r);\n\t\t\t\t\tsin = Math.sin(r);\n\t\t\t\t\tconst length = bone.bone.data.length;\n\t\t\t\t\tboneX += (length * (cos * a - sin * c) - dx) * mixRotate;\n\t\t\t\t\tboneY += (length * (sin * a + cos * c) - dy) * mixRotate;\n\t\t\t\t} else {\n\t\t\t\t\tr += offsetRotation;\n\t\t\t\t}\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tcos = Math.cos(r);\n\t\t\t\tsin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\t\t\tbone.modifyWorld(u);\n\t\t}\n\t}\n\n\tcomputeWorldPositions (skeleton: Skeleton, path: PathAttachment, spacesCount: number, tangents: boolean) {\n\t\tconst slot = this.slot;\n\t\tlet position = this.applied.position;\n\t\tlet spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array = this.world;\n\t\tconst closed = path.closed;\n\t\tlet verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\n\n\t\tif (!path.constantSpeed) {\n\t\t\tconst lengths = path.lengths;\n\t\t\tcurveCount -= closed ? 1 : 2;\n\t\t\tconst pathLength = lengths[curveCount];\n\t\t\tif (this.data.positionMode === PositionMode.Percent) position *= pathLength;\n\n\t\t\tlet multiplier: number;\n\t\t\tswitch (this.data.spacingMode) {\n\t\t\t\tcase SpacingMode.Percent: multiplier = pathLength; break;\n\t\t\t\tcase SpacingMode.Proportional: multiplier = pathLength / spacesCount; break;\n\t\t\t\tdefault: multiplier = 1;\n\t\t\t}\n\n\t\t\tworld = Utils.setArraySize(this.world, 8);\n\t\t\tfor (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\n\t\t\t\tconst space = spaces[i] * multiplier;\n\t\t\t\tposition += space;\n\t\t\t\tlet p = position;\n\n\t\t\t\tif (closed) {\n\t\t\t\t\tp %= pathLength;\n\t\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\t\tcurve = 0;\n\t\t\t\t} else if (p < 0) {\n\t\t\t\t\tif (prevCurve !== PathConstraint.BEFORE) {\n\t\t\t\t\t\tprevCurve = PathConstraint.BEFORE;\n\t\t\t\t\t\tpath.computeWorldVertices(skeleton, slot, 2, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (p > pathLength) {\n\t\t\t\t\tif (prevCurve !== PathConstraint.AFTER) {\n\t\t\t\t\t\tprevCurve = PathConstraint.AFTER;\n\t\t\t\t\t\tpath.computeWorldVertices(skeleton, slot, verticesLength - 6, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addAfterPosition(p - pathLength, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Determine curve containing position.\n\t\t\t\tfor (; ; curve++) {\n\t\t\t\t\tconst length = lengths[curve];\n\t\t\t\t\tif (p > length) continue;\n\t\t\t\t\tif (curve === 0)\n\t\t\t\t\t\tp /= length;\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst prev = lengths[curve - 1];\n\t\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (curve !== prevCurve) {\n\t\t\t\t\tprevCurve = curve;\n\t\t\t\t\tif (closed && curve === curveCount) {\n\t\t\t\t\t\tpath.computeWorldVertices(skeleton, slot, verticesLength - 4, 4, world, 0, 2);\n\t\t\t\t\t\tpath.computeWorldVertices(skeleton, slot, 0, 4, world, 4, 2);\n\t\t\t\t\t} else\n\t\t\t\t\t\tpath.computeWorldVertices(skeleton, slot, curve * 6 + 2, 8, world, 0, 2);\n\t\t\t\t}\n\t\t\t\tthis.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\n\t\t\t\t\ttangents || (i > 0 && space === 0));\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// World vertices.\n\t\tif (closed) {\n\t\t\tverticesLength += 2;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(skeleton, slot, 2, verticesLength - 4, world, 0, 2);\n\t\t\tpath.computeWorldVertices(skeleton, slot, 0, 2, world, verticesLength - 4, 2);\n\t\t\tworld[verticesLength - 2] = world[0];\n\t\t\tworld[verticesLength - 1] = world[1];\n\t\t} else {\n\t\t\tcurveCount--;\n\t\t\tverticesLength -= 4;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(skeleton, slot, 2, verticesLength, world, 0, 2);\n\t\t}\n\n\t\t// Curve lengths.\n\t\tconst curves = Utils.setArraySize(this.curves, curveCount);\n\t\tlet pathLength = 0;\n\t\tlet x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\n\t\tlet tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\n\t\tfor (let i = 0, w = 2; i < curveCount; i++, w += 6) {\n\t\t\tcx1 = world[w];\n\t\t\tcy1 = world[w + 1];\n\t\t\tcx2 = world[w + 2];\n\t\t\tcy2 = world[w + 3];\n\t\t\tx2 = world[w + 4];\n\t\t\ty2 = world[w + 5];\n\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\n\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\n\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\n\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\n\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\tdfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\n\t\t\tdfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tddfx += dddfx;\n\t\t\tddfy += dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx + dddfx;\n\t\t\tdfy += ddfy + dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tcurves[i] = pathLength;\n\t\t\tx1 = x2;\n\t\t\ty1 = y2;\n\t\t}\n\n\t\tif (this.data.positionMode === PositionMode.Percent) position *= pathLength;\n\n\t\tlet multiplier: number;\n\t\tswitch (this.data.spacingMode) {\n\t\t\tcase SpacingMode.Percent: multiplier = pathLength; break;\n\t\t\tcase SpacingMode.Proportional: multiplier = pathLength / spacesCount; break;\n\t\t\tdefault: multiplier = 1;\n\t\t}\n\n\t\tconst segments = this.segments;\n\t\tlet curveLength = 0;\n\t\tfor (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\n\t\t\tconst space = spaces[i] * multiplier;\n\t\t\tposition += space;\n\t\t\tlet p = position;\n\n\t\t\tif (closed) {\n\t\t\t\tp %= pathLength;\n\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\tcurve = 0;\n\t\t\t\tsegment = 0;\n\t\t\t} else if (p < 0) {\n\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\tcontinue;\n\t\t\t} else if (p > pathLength) {\n\t\t\t\tthis.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Determine curve containing position.\n\t\t\tfor (; ; curve++) {\n\t\t\t\tconst length = curves[curve];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (curve === 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tconst prev = curves[curve - 1];\n\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Curve segment lengths.\n\t\t\tif (curve !== prevCurve) {\n\t\t\t\tprevCurve = curve;\n\t\t\t\tlet ii = curve * 6;\n\t\t\t\tx1 = world[ii];\n\t\t\t\ty1 = world[ii + 1];\n\t\t\t\tcx1 = world[ii + 2];\n\t\t\t\tcy1 = world[ii + 3];\n\t\t\t\tcx2 = world[ii + 4];\n\t\t\t\tcy2 = world[ii + 5];\n\t\t\t\tx2 = world[ii + 6];\n\t\t\t\ty2 = world[ii + 7];\n\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.03;\n\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.03;\n\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\n\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\n\t\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\t\tdfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\n\t\t\t\tdfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\n\t\t\t\tcurveLength = Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[0] = curveLength;\n\t\t\t\tfor (ii = 1; ii < 8; ii++) {\n\t\t\t\t\tdfx += ddfx;\n\t\t\t\t\tdfy += ddfy;\n\t\t\t\t\tddfx += dddfx;\n\t\t\t\t\tddfy += dddfy;\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\t\tsegments[ii] = curveLength;\n\t\t\t\t}\n\t\t\t\tdfx += ddfx;\n\t\t\t\tdfy += ddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[8] = curveLength;\n\t\t\t\tdfx += ddfx + dddfx;\n\t\t\t\tdfy += ddfy + dddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[9] = curveLength;\n\t\t\t\tsegment = 0;\n\t\t\t}\n\n\t\t\t// Weight by segment length.\n\t\t\tp *= curveLength;\n\t\t\tfor (; ; segment++) {\n\t\t\t\tconst length = segments[segment];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (segment === 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tconst prev = segments[segment - 1];\n\t\t\t\t\tp = segment + (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space === 0));\n\t\t}\n\t\treturn out;\n\t}\n\n\taddBeforePosition (p: number, temp: Array, i: number, out: Array, o: number) {\n\t\tconst x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddAfterPosition (p: number, temp: Array, i: number, out: Array, o: number) {\n\t\tconst x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\n\t\tout: Array, o: number, tangents: boolean) {\n\t\tif (p === 0 || Number.isNaN(p)) {\n\t\t\tout[o] = x1;\n\t\t\tout[o + 1] = y1;\n\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\treturn;\n\t\t}\n\t\tconst tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\n\t\tconst ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\n\t\tconst x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\n\t\tout[o] = x;\n\t\tout[o + 1] = y;\n\t\tif (tangents) {\n\t\t\tif (p < 0.001)\n\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\telse\n\t\t\t\tout[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\n\t\t}\n\t}\n\n\tsort (skeleton: Skeleton) {\n\t\tconst slotIndex = this.slot.data.index;\n\t\tconst slotBone = this.slot.bone;\n\t\tif (skeleton.skin != null) this.sortPathSlot(skeleton, skeleton.skin, slotIndex, slotBone);\n\t\tif (skeleton.data.defaultSkin != null && skeleton.data.defaultSkin !== skeleton.skin)\n\t\t\tthis.sortPathSlot(skeleton, skeleton.data.defaultSkin, slotIndex, slotBone);\n\t\tthis.sortPath(skeleton, this.slot.pose.attachment, slotBone);\n\t\tconst bones = this.bones;\n\t\tconst boneCount = this.bones.length;\n\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\tconst bone = bones[i].bone;\n\t\t\tskeleton.sortBone(bone);\n\t\t\tskeleton.constrained(bone);\n\t\t}\n\t\tskeleton._updateCache.push(this);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tskeleton.sortReset(bones[i].bone.children);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tbones[i].bone.sorted = true;\n\t}\n\n\tprivate sortPathSlot (skeleton: Skeleton, skin: Skin, slotIndex: number, slotBone: Bone) {\n\t\tconst entries = skin.getAttachments();\n\t\tfor (let i = 0, n = entries.length; i < n; i++) {\n\t\t\tconst entry = entries[i];\n\t\t\tif (entry.slotIndex === slotIndex) this.sortPath(skeleton, entry.attachment, slotBone);\n\t\t}\n\t}\n\n\tprivate sortPath (skeleton: Skeleton, attachment: Attachment | null, slotBone: Bone) {\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\t\tconst pathBones = attachment.bones;\n\t\tif (pathBones == null)\n\t\t\tskeleton.sortBone(slotBone);\n\t\telse {\n\t\t\tconst bones = skeleton.bones;\n\t\t\tfor (let i = 0, n = pathBones.length; i < n;) {\n\t\t\t\tlet nn = pathBones[i++];\n\t\t\t\tnn += i;\n\t\t\t\twhile (i < nn)\n\t\t\t\t\tskeleton.sortBone(bones[pathBones[i++]]);\n\t\t\t}\n\t\t}\n\t}\n\n\tisSourceActive () {\n\t\treturn this.slot.bone.active;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** Determines how physics and other non-deterministic updates are applied. */\nexport enum Physics {\n\t/** Physics are not updated or applied. */\n\tnone,\n\n\t/** Physics are reset to the current pose. */\n\treset,\n\n\t/** Physics are updated and the pose from physics is applied. */\n\tupdate,\n\n\t/** Physics are not updated but the pose from physics is applied. */\n\tpose\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose\"\n\n/** Stores a pose for a physics constraint. */\nexport class PhysicsConstraintPose implements Pose {\n\tinertia = 0;\n\tstrength = 0;\n\tdamping = 0;\n\tmassInverse = 0;\n\twind = 0;\n\tgravity = 0;\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */\n\tmix = 0;\n\n\tpublic set (pose: PhysicsConstraintPose) {\n\t\tthis.inertia = pose.inertia;\n\t\tthis.strength = pose.strength;\n\t\tthis.damping = pose.damping;\n\t\tthis.massInverse = pose.massInverse;\n\t\tthis.wind = pose.wind;\n\t\tthis.gravity = pose.gravity;\n\t\tthis.mix = pose.mix;\n\t}\n\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Attachment } from \"./attachments/Attachment.js\";\nimport { VertexAttachment } from \"./attachments/Attachment.js\";\nimport type { Sequence } from \"./attachments/Sequence.js\";\nimport type { Pose } from \"./Pose.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores a slot's pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store state\n * for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared across\n * multiple skeletons. */\nexport class SlotPose implements Pose {\n\t/** The color used to tint the slot's attachment. If {@link darkColor} is set, this is used as the light color for two\n\t * color tinting. */\n\treadonly color = new Color(1, 1, 1, 1);\n\n\t/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\n\t * color's alpha is not used. */\n\tdarkColor: Color | null = null;\n\n\t/** The current attachment for the slot, or null if the slot has no attachment. */\n\tattachment: Attachment | null = null; // Not used in setup pose.\n\n\t/** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the\n\t * {@link Sequence.getSetupIndex()}. */\n\tsequenceIndex = 0;\n\n\t/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a\n\t * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.\n\t *\n\t * See {@link VertexAttachment.computeWorldVertices()} and\n\t * {@link DeformTimeline}. */\n\treadonly deform = [] as number[];\n\n\tSlotPose () {\n\t}\n\n\tpublic set (pose: SlotPose): void {\n\t\tif (pose == null) throw new Error(\"pose cannot be null.\");\n\t\tthis.color.setFromColor(pose.color);\n\t\tif (this.darkColor != null && pose.darkColor != null) this.darkColor.setFromColor(pose.darkColor);\n\t\tthis.attachment = pose.attachment;\n\t\tthis.sequenceIndex = pose.sequenceIndex;\n\t\tthis.deform.length = 0;\n\t\tthis.deform.push(...pose.deform);\n\t}\n\n\t/** The current attachment for the slot, or null if the slot has no attachment. */\n\tgetAttachment (): Attachment | null {\n\t\treturn this.attachment;\n\t}\n\n\t/** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.\n\t * The deform is not cleared if the old attachment has the same {@link VertexAttachment.getTimelineAttachment()} as the\n\t * specified attachment. */\n\tsetAttachment (attachment: Attachment | null): void {\n\t\tif (this.attachment === attachment) return;\n\t\tif (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)\n\t\t\t|| attachment.timelineAttachment !== this.attachment.timelineAttachment) {\n\t\t\tthis.deform.length = 0;\n\t\t}\n\t\tthis.attachment = attachment;\n\t\tthis.sequenceIndex = -1;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Bone } from \"./Bone.js\";\nimport { Posed } from \"./Posed.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { SlotData } from \"./SlotData.js\";\nimport { SlotPose } from \"./SlotPose.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store\n * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared\n * across multiple skeletons. */\nexport class Slot extends Posed {\n\treadonly skeleton: Skeleton;\n\n\t/** The bone this slot belongs to. */\n\treadonly bone: Bone;\n\n\tattachmentState: number = 0;\n\n\tconstructor (data: SlotData, skeleton: Skeleton) {\n\t\tsuper(data, new SlotPose(), new SlotPose());\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.skeleton = skeleton;\n\t\tthis.bone = skeleton.bones[data.boneData.index];\n\t\tif (data.setup.darkColor != null) {\n\t\t\tthis.pose.darkColor = new Color();\n\t\t\tthis.constrained.darkColor = new Color();\n\t\t}\n\t\tthis.setupPose();\n\t}\n\n\tsetupPose () {\n\t\tthis.pose.color.setFromColor(this.data.setup.color);\n\t\t// biome-ignore lint/style/noNonNullAssertion: reference runtime\n\t\tif (this.pose.darkColor) this.pose.darkColor.setFromColor(this.data.setup.darkColor!);\n\t\tthis.pose.sequenceIndex = this.data.setup.sequenceIndex;\n\t\tif (!this.data.attachmentName)\n\t\t\tthis.pose.setAttachment(null);\n\t\telse {\n\t\t\tthis.pose.attachment = null;\n\t\t\tthis.pose.setAttachment(this.skeleton.getAttachment(this.data.index, this.data.attachmentName));\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Attachment } from \"./attachments/Attachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport type { Constraint } from \"./Constraint.js\";\nimport type { Physics } from \"./Physics.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport type { Posed } from \"./Posed.js\";\nimport type { SkeletonClipping } from \"./SkeletonClipping.js\";\nimport type { SkeletonData } from \"./SkeletonData.js\";\nimport type { Skin } from \"./Skin.js\";\nimport { Slot } from \"./Slot.js\";\nimport { Color, type NumberArrayLike, Utils, Vector2 } from \"./Utils.js\";\n\n/** Stores the current pose for a skeleton.\n *\n * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */\nexport class Skeleton {\n\tprivate static quadTriangles = [0, 1, 2, 2, 3, 0];\n\tstatic yDown = false;\n\tstatic get yDir (): number {\n\t\treturn Skeleton.yDown ? -1 : 1;\n\t}\n\n\t/** The skeleton's setup pose data. */\n\treadonly data: SkeletonData;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\treadonly bones: Array;\n\n\t/** The skeleton's slots. */\n\treadonly slots: Array;\n\n\t/** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */\n\tdrawOrder: Array;\n\n\t/** The skeleton's constraints. */\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\treadonly constraints: Array>;\n\n\t/** The skeleton's physics constraints. */\n\treadonly physics: Array;\n\n\t/** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link updateCache()}. */\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\treadonly _updateCache = [] as any[];\n\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\treadonly resetCache: Array> = [];\n\n\t/** The skeleton's current skin. May be null. */\n\tskin: Skin | null = null;\n\n\t/** The color to tint all the skeleton's attachments. */\n\treadonly color: Color;\n\n\t/** Scales the entire skeleton on the X axis.\n\t *\n\t * Bones that do not inherit scale are still affected by this property. */\n\tscaleX = 1;\n\n\tprivate _scaleY = 1;\n\n\t/** Scales the entire skeleton on the Y axis.\n\t *\n\t * Bones that do not inherit scale are still affected by this property. */\n\tpublic get scaleY () {\n\t\treturn this._scaleY * Skeleton.yDir;\n\t}\n\n\tpublic set scaleY (scaleY: number) {\n\t\tthis._scaleY = scaleY;\n\t}\n\n\t/** Sets the skeleton X position, which is added to the root bone worldX position.\n\t *\n\t * Bones that do not inherit translation are still affected by this property. */\n\tx = 0;\n\n\t/** Sets the skeleton Y position, which is added to the root bone worldY position.\n\t *\n\t * Bones that do not inherit translation are still affected by this property. */\n\ty = 0;\n\n\t/** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}.\n\t *\n\t * See {@link _update()}. */\n\ttime = 0;\n\n\twindX = 1;\n\twindY = 0;\n\tgravityX = 0;\n\tgravityY = 1;\n\n\t_update = 0;\n\n\tconstructor (data: SkeletonData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = [] as Bone[];\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tconst boneData = data.bones[i];\n\t\t\tlet bone: Bone;\n\t\t\tif (!boneData.parent)\n\t\t\t\tbone = new Bone(boneData, null);\n\t\t\telse {\n\t\t\t\tconst parent = this.bones[boneData.parent.index];\n\t\t\t\tbone = new Bone(boneData, parent);\n\t\t\t\tparent.children.push(bone);\n\t\t\t}\n\t\t\tthis.bones.push(bone);\n\t\t}\n\n\t\tthis.slots = [] as Slot[];\n\t\tthis.drawOrder = [] as Slot[];\n\t\tfor (const slotData of this.data.slots) {\n\t\t\tconst slot = new Slot(slotData, this);\n\t\t\tthis.slots.push(slot);\n\t\t\tthis.drawOrder.push(slot);\n\t\t}\n\n\t\tthis.physics = [] as PhysicsConstraint[];\n\t\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\t\tthis.constraints = [] as Constraint[];\n\t\tfor (const constraintData of this.data.constraints) {\n\t\t\tconst constraint = constraintData.create(this);\n\t\t\tif (constraint instanceof PhysicsConstraint) this.physics.push(constraint);\n\t\t\tthis.constraints.push(constraint);\n\t\t}\n\n\t\tthis.color = new Color(1, 1, 1, 1);\n\n\t\tthis.updateCache();\n\t}\n\n\t/** Caches information about bones and constraints. Must be called if the {@link getSkin()} is modified or if bones,\n\t * constraints, or weighted path attachments are added or removed. */\n\tupdateCache () {\n\t\tthis._updateCache.length = 0;\n\t\tthis.resetCache.length = 0;\n\n\t\tconst slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++)\n\t\t\tslots[i].usePose();\n\n\t\tconst bones = this.bones;\n\t\tconst boneCount = bones.length;\n\t\tfor (let i = 0, n = boneCount; i < n; i++) {\n\t\t\tconst bone = bones[i];\n\t\t\tbone.sorted = bone.data.skinRequired;\n\t\t\tbone.active = !bone.sorted;\n\t\t\tbone.usePose();\n\t\t}\n\t\tif (this.skin) {\n\t\t\tconst skinBones = this.skin.bones;\n\t\t\tfor (let i = 0, n = this.skin.bones.length; i < n; i++) {\n\t\t\t\tlet bone: Bone | null = this.bones[skinBones[i].index];\n\t\t\t\tdo {\n\t\t\t\t\tbone.sorted = false;\n\t\t\t\t\tbone.active = true;\n\t\t\t\t\tbone = bone.parent;\n\t\t\t\t} while (bone);\n\t\t\t}\n\t\t}\n\n\t\tconst constraints = this.constraints;\n\t\tlet n = this.constraints.length;\n\t\tfor (let i = 0; i < n; i++)\n\t\t\tconstraints[i].usePose();\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst constraint = constraints[i];\n\t\t\tconstraint.active = constraint.isSourceActive()\n\t\t\t\t// biome-ignore lint/complexity/useOptionalChain: changing to this might return undefined\n\t\t\t\t&& (!constraint.data.skinRequired || (this.skin != null && this.skin.constraints.includes(constraint.data)));\n\t\t\tif (constraint.active) constraint.sort(this);\n\t\t}\n\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortBone(bones[i]);\n\n\t\tn = this._updateCache.length;\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst updateable = this._updateCache[i];\n\t\t\tif (updateable instanceof Bone) this._updateCache[i] = updateable.applied;\n\t\t}\n\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\tconstrained (object: Posed) {\n\t\tif (object.pose === object.applied) {\n\t\t\tobject.useConstrained();\n\t\t\tthis.resetCache.push(object);\n\t\t}\n\t}\n\n\tsortBone (bone: Bone) {\n\t\tif (bone.sorted || !bone.active) return;\n\t\tconst parent = bone.parent;\n\t\tif (parent) this.sortBone(parent);\n\t\tbone.sorted = true;\n\t\tthis._updateCache.push(bone);\n\t}\n\n\tsortReset (bones: Array) {\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tconst bone = bones[i];\n\t\t\tif (bone.active) {\n\t\t\t\tif (bone.sorted) this.sortReset(bone.children);\n\t\t\t\tbone.sorted = false;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Updates the world transform for each bone and applies all constraints.\n\t *

\n\t * See World transforms in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransform (physics: Physics): void {\n\t\tthis._update++;\n\n\t\tconst resetCache = this.resetCache;\n\t\tfor (let i = 0, n = this.resetCache.length; i < n; i++)\n\t\t\tresetCache[i].resetConstrained();\n\n\t\tconst updateCache = this._updateCache;\n\t\tfor (let i = 0, n = this._updateCache.length; i < n; i++)\n\t\t\tupdateCache[i].update(this, physics);\n\t}\n\n\t/** Sets the bones, constraints, and slots to their setup pose values. */\n\tsetupPose () {\n\t\tthis.setupPoseBones();\n\t\tthis.setupPoseSlots();\n\t}\n\n\t/** Sets the bones and constraints to their setup pose values. */\n\tsetupPoseBones () {\n\t\tconst bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++)\n\t\t\tbones[i].setupPose();\n\n\t\tconst constraints = this.constraints;\n\t\tfor (let i = 0, n = constraints.length; i < n; i++)\n\t\t\tconstraints[i].setupPose();\n\t}\n\n\t/** Sets the slots and draw order to their setup pose values. */\n\tsetupPoseSlots () {\n\t\tconst slots = this.slots;\n\t\tUtils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\n\t\tfor (let i = 0, n = slots.length; i < n; i++)\n\t\t\tslots[i].setupPose();\n\t}\n\n\t/** Returns the root bone, or null if the skeleton has no bones. */\n\tgetRootBone () {\n\t\tif (this.bones.length === 0) return null;\n\t\treturn this.bones[0];\n\t}\n\n\t/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it\n\t * repeatedly. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tconst bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++)\n\t\t\tif (bones[i].data.name === boneName) return bones[i];\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * repeatedly. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tconst slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++)\n\t\t\tif (slots[i].data.name === slotName) return slots[i];\n\t\treturn null;\n\t}\n\n\t/** Sets a skin by name.\n\t *\n\t * See {@link setSkin()}. */\n\tsetSkin (skinName: string): void;\n\n\t/** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}. If the\n\t * skin is changed, {@link updateCache} is called.\n\t *

\n\t * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\n\t * old skin, each slot's setup mode attachment is attached from the new skin.\n\t *

\n\t * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling\n\t * {@link setupPoseSlots()}. Also, often {@link AnimationState.apply(Skeleton)} is called before the next time the skeleton is\n\t * rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin. */\n\tsetSkin (newSkin: Skin | null): void;\n\n\tsetSkin (newSkin: Skin | null | string): void {\n\t\tif (typeof newSkin === \"string\")\n\t\t\tthis.setSkinByName(newSkin);\n\t\telse\n\t\t\tthis.setSkinBySkin(newSkin);\n\t};\n\n\tprivate setSkinByName (skinName: string) {\n\t\tconst skin = this.data.findSkin(skinName);\n\t\tif (!skin) throw new Error(`Skin not found: ${skinName}`);\n\t\tthis.setSkin(skin);\n\t}\n\n\tprivate setSkinBySkin (newSkin: Skin | null) {\n\t\tif (newSkin === this.skin) return;\n\t\tif (newSkin) {\n\t\t\tif (this.skin)\n\t\t\t\tnewSkin.attachAll(this, this.skin);\n\t\t\telse {\n\t\t\t\tconst slots = this.slots;\n\t\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\t\tconst slot = slots[i];\n\t\t\t\t\tconst name = slot.data.attachmentName;\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tconst attachment = newSkin.getAttachment(i, name);\n\t\t\t\t\t\tif (attachment) slot.pose.setAttachment(attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.skin = newSkin;\n\t\tthis.updateCache();\n\t}\n\n\t/** Finds an attachment by looking in the {@link skin} and {@link SkeletonData.defaultSkin} using the slot name and attachment\n\t * name.\n\t *\n\t * See {@link getAttachment(number, string)}. */\n\tgetAttachment (slotName: string, attachmentName: string): Attachment | null;\n\n\t/** Finds an attachment by looking in the {@link skin} and {@link SkeletonData.defaultSkin} using the slot index and\n\t * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.\n\t *\n\t * See Runtime skins in the Spine Runtimes Guide. */\n\tgetAttachment (slotIndex: number, attachmentName: string): Attachment | null;\n\n\tgetAttachment (slotNameOrIndex: string | number, attachmentName: string): Attachment | null {\n\t\tif (typeof slotNameOrIndex === 'string')\n\t\t\treturn this.getAttachmentByName(slotNameOrIndex, attachmentName);\n\t\treturn this.getAttachmentByIndex(slotNameOrIndex, attachmentName);\n\t}\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment\n\t * name.\n\t *\n\t * See {@link #getAttachment()}.\n\t * @returns May be null. */\n\tprivate getAttachmentByName (slotName: string, attachmentName: string): Attachment | null {\n\t\tconst slot = this.data.findSlot(slotName);\n\t\tif (!slot) throw new Error(`Can't find slot with name ${slotName}`);\n\t\treturn this.getAttachment(slot.index, attachmentName);\n\t}\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and\n\t * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.\n\t *\n\t * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\n\t * @returns May be null. */\n\tprivate getAttachmentByIndex (slotIndex: number, attachmentName: string): Attachment | null {\n\t\tif (!attachmentName) throw new Error(\"attachmentName cannot be null.\");\n\t\tif (this.skin) {\n\t\t\tconst attachment = this.skin.getAttachment(slotIndex, attachmentName);\n\t\t\tif (attachment) return attachment;\n\t\t}\n\t\tif (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\n\t\treturn null;\n\t}\n\n\t/** A convenience method to set an attachment by finding the slot with {@link findSlot()}, finding the attachment with\n\t * {@link getAttachment()}, then setting the slot's {@link Slot.attachment}.\n\t * @param attachmentName May be null to clear the slot's attachment. */\n\tsetAttachment (slotName: string, attachmentName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tconst slot = this.findSlot(slotName);\n\t\tif (!slot) throw new Error(`Slot not found: ${slotName}`);\n\t\tlet attachment: Attachment | null = null;\n\t\tif (attachmentName) {\n\t\t\tattachment = this.getAttachment(slot.data.index, attachmentName);\n\t\t\tif (!attachment)\n\t\t\t\tthrow new Error(`Attachment not found: ${attachmentName}, for slot: ${slotName}`);\n\t\t}\n\t\tslot.pose.setAttachment(attachment);\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\tfindConstraint> (constraintName: string, type: new () => T): T | null {\n\t\tif (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n\t\tif (type == null) throw new Error(\"type cannot be null.\");\n\t\tconst constraints = this.constraints;\n\t\tfor (let i = 0, n = constraints.length; i < n; i++) {\n\t\t\tconst constraint = constraints[i];\n\t\t\tif (constraint instanceof type && constraint.data.name === constraintName) return constraint as T;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`.\n\t * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */\n\tgetBoundsRect (clipper?: SkeletonClipping) {\n\t\tconst offset = new Vector2();\n\t\tconst size = new Vector2();\n\t\tthis.getBounds(offset, size, undefined, clipper);\n\t\treturn { x: offset.x, y: offset.y, width: size.x, height: size.y };\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n\t * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.\n\t * @param size An output value, the width and height of the AABB.\n\t * @param temp Working memory to temporarily store attachments' computed world vertices.\n\t * @param clipper {@link SkeletonClipping} to use. If null, no clipping is applied. */\n\tgetBounds (offset: Vector2, size: Vector2, temp: Array = new Array(2), clipper: SkeletonClipping | null = null) {\n\t\tif (!offset) throw new Error(\"offset cannot be null.\");\n\t\tif (!size) throw new Error(\"size cannot be null.\");\n\t\tconst drawOrder = this.drawOrder;\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tconst slot = drawOrder[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tlet verticesLength = 0;\n\t\t\tlet vertices: NumberArrayLike | null = null;\n\t\t\tlet triangles: NumberArrayLike | null = null;\n\t\t\tconst attachment = slot.pose.attachment;\n\t\t\tif (attachment) {\n\t\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\t\tverticesLength = 8;\n\t\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\t\tattachment.computeWorldVertices(slot, vertices, 0, 2);\n\t\t\t\t\ttriangles = Skeleton.quadTriangles;\n\t\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\t\tverticesLength = attachment.worldVerticesLength;\n\t\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\t\tattachment.computeWorldVertices(this, slot, 0, verticesLength, vertices, 0, 2);\n\t\t\t\t\ttriangles = attachment.triangles;\n\t\t\t\t} else if (attachment instanceof ClippingAttachment && clipper) {\n\t\t\t\t\tclipper.clipEnd(slot);\n\t\t\t\t\tclipper.clipStart(this, slot, attachment);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (vertices && triangles) {\n\t\t\t\t\tif (clipper?.isClipping() && clipper.clipTriangles(vertices, triangles, triangles.length)) {\n\t\t\t\t\t\tvertices = clipper.clippedVertices;\n\t\t\t\t\t\tverticesLength = clipper.clippedVertices.length;\n\t\t\t\t\t}\n\t\t\t\t\tfor (let ii = 0, nn = vertices.length; ii < nn; ii += 2) {\n\t\t\t\t\t\tconst x = vertices[ii], y = vertices[ii + 1];\n\t\t\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (clipper) clipper.clipEnd(slot);\n\t\t}\n\t\tif (clipper) clipper.clipEnd();\n\t\toffset.set(minX, minY);\n\t\tsize.set(maxX - minX, maxY - minY);\n\t}\n\n\t/** Scales the entire skeleton on the X and Y axes.\n\t *\n\t * Bones that do not inherit scale are still affected by this property. */\n\tpublic setScale (scaleX: number, scaleY: number) {\n\t\tthis.scaleX = scaleX;\n\t\tthis.scaleY = scaleY;\n\t}\n\n\t/** Sets the skeleton X and Y position, which is added to the root bone worldX and worldY position.\n\t *\n\t * Bones that do not inherit translation are still affected by this property. */\n\tpublic setPosition (x: number, y: number) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\t/** Increments the skeleton's {@link #time}. */\n\tupdate (delta: number) {\n\t\tthis.time += delta;\n\t}\n\n\t/** Calls {@link PhysicsConstraint.translate} for each physics constraint. */\n\tphysicsTranslate (x: number, y: number) {\n\t\tconst constraints = this.physics;\n\t\tfor (let i = 0, n = constraints.length; i < n; i++)\n\t\t\tconstraints[i].translate(x, y);\n\t}\n\n\t/** Calls {@link PhysicsConstraint.rotate} for each physics constraint. */\n\tphysicsRotate (x: number, y: number, degrees: number) {\n\t\tconst constraints = this.physics;\n\t\tfor (let i = 0, n = constraints.length; i < n; i++)\n\t\t\tconstraints[i].rotate(x, y, degrees);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BonePose } from \"./BonePose.js\";\nimport { Constraint } from \"./Constraint.js\";\nimport { Physics } from \"./Physics.js\";\nimport type { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { PhysicsConstraintPose } from \"./PhysicsConstraintPose.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a physics constraint. A physics constraint applies physics to bones.\n *

\n * See Physics constraints in the Spine User Guide. */\nexport class PhysicsConstraint extends Constraint {\n\tbone: BonePose;\n\n\t_reset = true;\n\tux = 0;\n\tuy = 0;\n\tcx = 0;\n\tcy = 0;\n\ttx = 0;\n\tty = 0;\n\txOffset = 0;\n\txLag = 0;\n\txVelocity = 0;\n\tyOffset = 0;\n\tyLag = 0;\n\tyVelocity = 0;\n\trotateOffset = 0;\n\trotateLag = 0;\n\trotateVelocity = 0;\n\tscaleOffset = 0\n\tscaleLag = 0\n\tscaleVelocity = 0;\n\tremaining = 0;\n\tlastTime = 0;\n\n\tconstructor (data: PhysicsConstraintData, skeleton: Skeleton) {\n\t\tsuper(data, new PhysicsConstraintPose(), new PhysicsConstraintPose());\n\t\tif (skeleton == null) throw new Error(\"skeleton cannot be null.\");\n\n\t\tthis.bone = skeleton.bones[data.bone.index].constrained;\n\t}\n\n\tpublic copy (skeleton: Skeleton) {\n\t\tvar copy = new PhysicsConstraint(this.data, skeleton);\n\t\tcopy.pose.set(this.pose);\n\t\treturn copy;\n\t}\n\n\treset (skeleton: Skeleton) {\n\t\tthis.remaining = 0;\n\t\tthis.lastTime = skeleton.time;\n\t\tthis._reset = true;\n\t\tthis.xOffset = 0;\n\t\tthis.xLag = 0;\n\t\tthis.xVelocity = 0;\n\t\tthis.yOffset = 0;\n\t\tthis.yLag = 0;\n\t\tthis.yVelocity = 0;\n\t\tthis.rotateOffset = 0;\n\t\tthis.rotateLag = 0;\n\t\tthis.rotateVelocity = 0;\n\t\tthis.scaleOffset = 0;\n\t\tthis.scaleLag = 0;\n\t\tthis.scaleVelocity = 0;\n\t}\n\n\t/** Translates the physics constraint so next {@link update} forces are applied as if the bone moved an\n\t * additional amount in world space. */\n\ttranslate (x: number, y: number) {\n\t\tthis.ux -= x;\n\t\tthis.uy -= y;\n\t\tthis.cx -= x;\n\t\tthis.cy -= y;\n\t}\n\n\t/** Rotates the physics constraint so next {@link update} forces are applied as if the bone rotated around the\n\t * specified point in world space. */\n\trotate (x: number, y: number, degrees: number) {\n\t\tconst r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst dx = this.cx - x, dy = this.cy - y;\n\t\tthis.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);\n\t}\n\n\t/** Applies the constraint to the constrained bones. */\n\tupdate (skeleton: Skeleton, physics: Physics) {\n\t\tconst p = this.applied;\n\t\tconst mix = p.mix;\n\t\tif (mix === 0) return;\n\n\t\tconst x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0;\n\t\tconst bone = this.bone;\n\t\tlet l = bone.bone.data.length, t = this.data.step, z = 0;\n\n\t\tswitch (physics) {\n\t\t\tcase Physics.none:\n\t\t\t\treturn;\n\t\t\t// biome-ignore lint/suspicious/noFallthroughSwitchClause: fall through expected\n\t\t\tcase Physics.reset:\n\t\t\t\tthis.reset(skeleton); // Fall through.\n\t\t\tcase Physics.update: {\n\t\t\t\tconst delta = Math.max(skeleton.time - this.lastTime, 0), aa = this.remaining;\n\t\t\t\tthis.remaining += delta;\n\t\t\t\tthis.lastTime = skeleton.time;\n\n\t\t\t\tconst bx = bone.worldX, by = bone.worldY;\n\t\t\t\tif (this._reset) {\n\t\t\t\t\tthis._reset = false;\n\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\tthis.uy = by;\n\t\t\t\t} else {\n\t\t\t\t\tlet a = this.remaining, i = p.inertia, f = skeleton.data.referenceScale, d = -1, m = 0, e = 0, qx = this.data.limit * delta,\n\t\t\t\t\t\tqy = qx * Math.abs(skeleton.scaleY);\n\t\t\t\t\tqx *= Math.abs(skeleton.scaleX);\n\t\t\t\t\tif (x || y) {\n\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\tconst u = (this.ux - bx) * i;\n\t\t\t\t\t\t\tthis.xOffset += u > qx ? qx : u < -qx ? -qx : u;\n\t\t\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\tconst u = (this.uy - by) * i;\n\t\t\t\t\t\t\tthis.yOffset += u > qy ? qy : u < -qy ? -qy : u;\n\t\t\t\t\t\t\tthis.uy = by;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\tconst xs = this.xOffset, ys = this.yOffset;\n\t\t\t\t\t\t\td = p.damping ** (60 * t);\n\t\t\t\t\t\t\tm = t * p.massInverse;\n\t\t\t\t\t\t\te = p.strength;\n\t\t\t\t\t\t\tconst w = f * p.wind, g = f * p.gravity;\n\t\t\t\t\t\t\tconst ax = (w * skeleton.windX + g * skeleton.gravityX) * skeleton.scaleX;\n\t\t\t\t\t\t\tconst ay = (w * skeleton.windY + g * skeleton.gravityY) * skeleton.scaleY;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\t\t\tthis.xVelocity += (ax - this.xOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.xOffset += this.xVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.xVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\t\t\tthis.yVelocity -= (ay + this.yOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.yOffset += this.yVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.yVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t} while (a >= t);\n\t\t\t\t\t\t\tthis.xLag = this.xOffset - xs;\n\t\t\t\t\t\t\tthis.yLag = this.yOffset - ys;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tz = Math.max(0, 1 - a / t);\n\t\t\t\t\t\tif (x) bone.worldX += (this.xOffset - this.xLag * z) * mix * this.data.x;\n\t\t\t\t\t\tif (y) bone.worldY += (this.yOffset - this.yLag * z) * mix * this.data.y;\n\t\t\t\t\t}\n\t\t\t\t\tif (rotateOrShearX || scaleX) {\n\t\t\t\t\t\tlet ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0, dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;\n\t\t\t\t\t\tif (dx > qx)\n\t\t\t\t\t\t\tdx = qx;\n\t\t\t\t\t\telse if (dx < -qx) //\n\t\t\t\t\t\t\tdx = -qx;\n\t\t\t\t\t\tif (dy > qy)\n\t\t\t\t\t\t\tdy = qy;\n\t\t\t\t\t\telse if (dy < -qy) //\n\t\t\t\t\t\t\tdy = -qy;\n\t\t\t\t\t\ta = this.remaining;\n\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\tmr = (this.data.rotate + this.data.shearX) * mix;\n\t\t\t\t\t\t\tz = this.rotateLag * Math.max(0, 1 - aa / t);\n\t\t\t\t\t\t\tlet r = Math.atan2(dy + this.ty, dx + this.tx) - ca - (this.rotateOffset - z) * mr;\n\t\t\t\t\t\t\tthis.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i;\n\t\t\t\t\t\t\tr = (this.rotateOffset - z) * mr + ca;\n\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\tr = l * bone.getWorldScaleX();\n\t\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = Math.cos(ca);\n\t\t\t\t\t\t\ts = Math.sin(ca);\n\t\t\t\t\t\t\tconst r = l * bone.getWorldScaleX() - this.scaleLag * Math.max(0, 1 - aa / t);\n\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\tif (d === -1) {\n\t\t\t\t\t\t\t\td = p.damping ** (60 * t);\n\t\t\t\t\t\t\t\tm = t * p.massInverse;\n\t\t\t\t\t\t\t\te = p.strength;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst ax = p.wind * skeleton.windX + p.gravity * skeleton.gravityX;\n\t\t\t\t\t\t\tconst ay = (p.wind * skeleton.windY + p.gravity * skeleton.gravityY) * Skeleton.yDir;\n\t\t\t\t\t\t\tconst rs = this.rotateOffset, ss = this.scaleOffset, h = l / f;\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity += (ax * c - ay * s - this.scaleOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.scaleOffset += this.scaleVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity -= ((ax * s + ay * c) * h + this.rotateOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.rotateOffset += this.rotateVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity *= d;\n\t\t\t\t\t\t\t\t\tif (a < t) break;\n\t\t\t\t\t\t\t\t\tconst r = this.rotateOffset * mr + ca;\n\t\t\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\t\t} else if (a < t) //\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.rotateLag = this.rotateOffset - rs;\n\t\t\t\t\t\t\tthis.scaleLag = this.scaleOffset - ss;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tz = Math.max(0, 1 - a / t);\n\t\t\t\t\t}\n\t\t\t\t\tthis.remaining = a;\n\t\t\t\t}\n\t\t\t\tthis.cx = bone.worldX;\n\t\t\t\tthis.cy = bone.worldY;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Physics.pose:\n\t\t\t\tz = Math.max(0, 1 - this.remaining / t);\n\t\t\t\tif (x) bone.worldX += (this.xOffset - this.xLag * z) * mix * this.data.x;\n\t\t\t\tif (y) bone.worldY += (this.yOffset - this.yLag * z) * mix * this.data.y;\n\t\t}\n\n\t\tif (rotateOrShearX) {\n\t\t\tlet o = (this.rotateOffset - this.rotateLag * z) * mix, s = 0, c = 0, a = 0;\n\t\t\tif (this.data.shearX > 0) {\n\t\t\t\tlet r = 0;\n\t\t\t\tif (this.data.rotate > 0) {\n\t\t\t\t\tr = o * this.data.rotate;\n\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\ta = bone.b;\n\t\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t\t}\n\t\t\t\tr += o * this.data.shearX;\n\t\t\t\ts = Math.sin(r);\n\t\t\t\tc = Math.cos(r);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t} else {\n\t\t\t\to *= this.data.rotate;\n\t\t\t\ts = Math.sin(o);\n\t\t\t\tc = Math.cos(o);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t\ta = bone.b;\n\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t}\n\t\t}\n\t\tif (scaleX) {\n\t\t\tconst s = 1 + (this.scaleOffset - this.scaleLag * z) * mix * this.data.scaleX;\n\t\t\tbone.a *= s;\n\t\t\tbone.c *= s;\n\t\t}\n\t\tif (physics !== Physics.pose) {\n\t\t\tthis.tx = l * bone.a;\n\t\t\tthis.ty = l * bone.c;\n\t\t}\n\t\tbone.modifyWorld(skeleton._update);\n\t}\n\n\tsort (skeleton: Skeleton) {\n\t\tconst bone = this.bone.bone;\n\t\tskeleton.sortBone(bone);\n\t\tskeleton._updateCache.push(this);\n\t\tskeleton.sortReset(bone.children);\n\t\tskeleton.constrained(bone);\n\t}\n\n\tisSourceActive () {\n\t\treturn this.bone.bone.active;\n\t}\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport { PhysicsConstraintPose } from \"./PhysicsConstraintPose.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\n\n\n/** Stores the setup pose for a {@link PhysicsConstraint}.\n *

\n * See Physics constraints in the Spine User Guide. */\nexport class PhysicsConstraintData extends ConstraintData {\n\t/** The bone constrained by this physics constraint. */\n\tpublic set bone (boneData: BoneData) { this._bone = boneData; }\n\tpublic get bone () {\n\t\tif (!this._bone) throw new Error(\"BoneData not set.\")\n\t\telse return this._bone;\n\t}\n\tprivate _bone: BoneData | null = null;\n\n\tx = 0;\n\ty = 0;\n\trotate = 0;\n\tscaleX = 0;\n\tshearX = 0;\n\tlimit = 0;\n\tstep = 0;\n\tinertiaGlobal = false;\n\tstrengthGlobal = false;\n\tdampingGlobal = false;\n\tmassGlobal = false;\n\twindGlobal = false;\n\tgravityGlobal = false;\n\tmixGlobal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, new PhysicsConstraintPose());\n\t}\n\n\tpublic create (skeleton: Skeleton) {\n\t\treturn new PhysicsConstraint(this, skeleton);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n(() => {\n\tif (typeof Math.fround === \"undefined\") {\n\t\tMath.fround = ((array) => (x: number) => {\n\t\t\tarray[0] = x;\n\t\t\treturn array[0];\n\t\t})(new Float32Array(1));\n\t}\n})();\n\nexport { }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Animation } from \"./Animation\"\nimport type { BoneData } from \"./BoneData.js\";\nimport type { ConstraintData } from \"./ConstraintData\";\nimport type { EventData } from \"./EventData.js\";\nimport type { Skin } from \"./Skin.js\";\nimport type { SlotData } from \"./SlotData.js\";\n\n/** Stores the setup pose and all of the stateless data for a skeleton.\n *\n * See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes\n * Guide. */\nexport class SkeletonData {\n\n\t/** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */\n\tname: string | null = null;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\tbones = [] as BoneData[]; // Ordered parents first.\n\n\t/** The skeleton's slots in the setup pose draw order. */\n\tslots = [] as SlotData[]; // Setup pose draw order.\n\n\tskins = [] as Skin[];\n\n\t/** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.\n\t *\n\t * See {@link Skeleton#getAttachmentByName()}.\n\t * May be null. */\n\tdefaultSkin: Skin | null = null;\n\n\t/** The skeleton's events. */\n\tevents = [] as EventData[];\n\n\t/** The skeleton's animations. */\n\tanimations = [] as Animation[];\n\n\t/** The skeleton's IK constraints. */\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\tconstraints = [] as ConstraintData[];\n\n\t/** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\tx: number = 0;\n\n\t/** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\ty: number = 0;\n\n\t/** The width of the skeleton's axis aligned bounding box in the setup pose. */\n\twidth: number = 0;\n\n\t/** The height of the skeleton's axis aligned bounding box in the setup pose. */\n\theight: number = 0;\n\n\t/** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default\n\t * is 100. */\n\treferenceScale = 100;\n\n\t/** The Spine version used to export the skeleton data, or null. */\n\tversion: string | null = null;\n\n\t/** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */\n\thash: string | null = null;\n\n\t// Nonessential\n\t/** The dopesheet FPS in Spine. Available only when nonessential data was exported. */\n\tfps = 30;\n\n\t/** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\timagesPath: string | null = null;\n\n\t/** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\taudioPath: string | null = null;\n\n\t/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tconst bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++)\n\t\t\tif (bones[i].name === boneName) return bones[i];\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tconst slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++)\n\t\t\tif (slots[i].name === slotName) return slots[i];\n\t\treturn null;\n\t}\n\n\t/** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSkin (skinName: string) {\n\t\tif (!skinName) throw new Error(\"skinName cannot be null.\");\n\t\tconst skins = this.skins;\n\t\tfor (let i = 0, n = skins.length; i < n; i++)\n\t\t\tif (skins[i].name === skinName) return skins[i];\n\t\treturn null;\n\t}\n\n\t/** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindEvent (eventDataName: string) {\n\t\tif (!eventDataName) throw new Error(\"eventDataName cannot be null.\");\n\t\tconst events = this.events;\n\t\tfor (let i = 0, n = events.length; i < n; i++)\n\t\t\tif (events[i].name === eventDataName) return events[i];\n\t\treturn null;\n\t}\n\n\t/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to\n\t * call it multiple times.\n\t * @returns May be null. */\n\tfindAnimation (animationName: string) {\n\t\tif (!animationName) throw new Error(\"animationName cannot be null.\");\n\t\tconst animations = this.animations;\n\t\tfor (let i = 0, n = animations.length; i < n; i++)\n\t\t\tif (animations[i].name === animationName) return animations[i];\n\t\treturn null;\n\t}\n\n\t// --- Constraints.\n\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\tfindConstraint> (constraintName: string, type: new (name: string) => T): T | null {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tif (type == null) throw new Error(\"type cannot be null.\");\n\t\tconst constraints = this.constraints;\n\t\tfor (let i = 0, n = this.constraints.length; i < n; i++) {\n\t\t\tconst constraint = constraints[i];\n\t\t\tif (constraint instanceof type && constraint.name === constraintName) return constraint as T;\n\t\t}\n\t\treturn null;\n\t}\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Attachment } from \"./attachments/Attachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport type { BoneData } from \"./BoneData.js\";\nimport type { ConstraintData } from \"./ConstraintData.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport { Color, type StringMap } from \"./Utils.js\";\n\n/** Stores an entry in the skin consisting of the slot index, name, and attachment **/\nexport class SkinEntry {\n\tconstructor (public slotIndex: number = 0, public name: string, public attachment: Attachment) { }\n}\n\n/** Stores attachments by slot index and attachment name.\n *\n * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and\n * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. */\nexport class Skin {\n\t/** The skin's name, which is unique across all skins in the skeleton. */\n\tname: string;\n\n\tattachments = [] as StringMap[];\n\tbones = [] as BoneData[];\n\t// biome-ignore lint/suspicious/noExplicitAny: reference runtime does not restrict to specific types\n\tconstraints = [] as ConstraintData[];\n\n\t/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */\n\tcolor = new Color(0.99607843, 0.61960787, 0.30980393, 1); // fe9e4fff\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\t/** Adds an attachment to the skin for the specified slot index and name. */\n\tsetAttachment (slotIndex: number, name: string, attachment: Attachment) {\n\t\tif (!attachment) throw new Error(\"attachment cannot be null.\");\n\t\tconst attachments = this.attachments;\n\t\tif (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n\t\tif (!attachments[slotIndex]) attachments[slotIndex] = {};\n\t\tattachments[slotIndex][name] = attachment;\n\t}\n\n\t/** Adds all attachments, bones, and constraints from the specified skin to this skin. */\n\taddSkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tconst bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] === bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tconst constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] === constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tconst attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tconst attachment = attachments[i];\n\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t}\n\t}\n\n\t/** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not\n\t * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */\n\tcopySkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tconst bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] === bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tconst constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] === constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tconst attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tconst attachment = attachments[i];\n\t\t\tif (!attachment.attachment) continue;\n\t\t\tif (attachment.attachment instanceof MeshAttachment) {\n\t\t\t\tattachment.attachment = attachment.attachment.newLinkedMesh();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t} else {\n\t\t\t\tattachment.attachment = attachment.attachment.copy();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the attachment for the specified slot index and name, or null. */\n\tgetAttachment (slotIndex: number, name: string): Attachment | null {\n\t\tconst dictionary = this.attachments[slotIndex];\n\t\treturn dictionary ? dictionary[name] : null;\n\t}\n\n\t/** Removes the attachment in the skin for the specified slot index and name, if any. */\n\tremoveAttachment (slotIndex: number, name: string) {\n\t\tconst dictionary = this.attachments[slotIndex];\n\t\tif (dictionary) delete dictionary[name];\n\t}\n\n\t/** Returns all attachments in this skin. */\n\tgetAttachments (): Array {\n\t\tconst entries: SkinEntry[] = [];\n\t\tfor (let i = 0; i < this.attachments.length; i++) {\n\t\t\tconst slotAttachments = this.attachments[i];\n\t\t\tif (slotAttachments) {\n\t\t\t\tfor (const name in slotAttachments) {\n\t\t\t\t\tconst attachment = slotAttachments[name];\n\t\t\t\t\tif (attachment) entries.push(new SkinEntry(i, name, attachment));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn entries;\n\t}\n\n\t/** Returns all attachments in this skin for the specified slot index. */\n\tgetAttachmentsForSlot (slotIndex: number, attachments: Array) {\n\t\tconst slotAttachments = this.attachments[slotIndex];\n\t\tif (slotAttachments) {\n\t\t\tfor (const name in slotAttachments) {\n\t\t\t\tconst attachment = slotAttachments[name];\n\t\t\t\tif (attachment) attachments.push(new SkinEntry(slotIndex, name, attachment));\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Clears all attachments, bones, and constraints. */\n\tclear () {\n\t\tthis.attachments.length = 0;\n\t\tthis.bones.length = 0;\n\t\tthis.constraints.length = 0;\n\t}\n\n\t/** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n\tattachAll (skeleton: Skeleton, oldSkin: Skin) {\n\t\tlet slotIndex = 0;\n\t\tfor (let i = 0; i < skeleton.slots.length; i++) {\n\t\t\tconst slot = skeleton.slots[i];\n\t\t\tconst slotAttachment = slot.pose.getAttachment();\n\t\t\tif (slotAttachment && slotIndex < oldSkin.attachments.length) {\n\t\t\t\tconst dictionary = oldSkin.attachments[slotIndex];\n\t\t\t\tfor (const key in dictionary) {\n\t\t\t\t\tconst skinAttachment: Attachment = dictionary[key];\n\t\t\t\t\tif (slotAttachment === skinAttachment) {\n\t\t\t\t\t\tconst attachment = this.getAttachment(slotIndex, key);\n\t\t\t\t\t\tif (attachment) slot.pose.setAttachment(attachment);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tslotIndex++;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose.js\";\n\n/** Stores a pose for a slider. */\nexport class SliderPose implements Pose {\n\ttime = 0;\n\tmix = 0;\n\n\tset (pose: SliderPose) {\n\t\tthis.time = pose.time;\n\t\tthis.mix = pose.mix;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { isConstraintTimeline, isSlotTimeline, MixBlend, MixDirection, PhysicsConstraintTimeline } from \"./Animation.js\";\nimport type { Bone } from \"./Bone.js\";\nimport { Constraint } from \"./Constraint.js\";\nimport type { Physics } from \"./Physics.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { SliderData } from \"./SliderData.js\";\nimport { SliderPose } from \"./SliderPose.js\";\n\n/** Stores the setup pose for a {@link PhysicsConstraint}.\n *\n * See Physics constraints in the Spine User Guide. */\nexport class Slider extends Constraint {\n\tprivate static readonly offsets = [0, 0, 0, 0, 0, 0];\n\n\tbone: Bone | null = null;\n\n\tconstructor (data: SliderData, skeleton: Skeleton) {\n\t\tsuper(data, new SliderPose(), new SliderPose());\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\n\t\tif (data.bone != null) this.bone = skeleton.bones[data.bone.index];\n\t}\n\n\tpublic copy (skeleton: Skeleton) {\n\t\tvar copy = new Slider(this.data, skeleton);\n\t\tcopy.pose.set(this.pose);\n\t\treturn copy;\n\t}\n\n\tpublic update (skeleton: Skeleton, physics: Physics) {\n\t\tconst p = this.applied;\n\t\tif (p.mix === 0) return;\n\n\t\tconst data = this.data, animation = data.animation, bone = this.bone;\n\t\tif (bone !== null) {\n\t\t\tif (!bone.active) return;\n\t\t\tif (data.local) bone.applied.validateLocalTransform(skeleton);\n\t\t\tp.time = data.offset\n\t\t\t\t+ (data.property.value(skeleton, bone.applied, data.local, Slider.offsets) - data.property.offset) * data.scale;\n\t\t\tif (data.loop)\n\t\t\t\tp.time = animation.duration + (p.time % animation.duration);\n\t\t\telse\n\t\t\t\tp.time = Math.max(0, p.time);\n\t\t}\n\n\t\tconst bones = skeleton.bones;\n\t\tconst indices = animation.bones;\n\t\tfor (let i = 0, n = animation.bones.length; i < n; i++)\n\t\t\tbones[indices[i]].applied.modifyLocal(skeleton);\n\n\t\tanimation.apply(skeleton, p.time, p.time, data.loop, null, p.mix, data.additive ? MixBlend.add : MixBlend.replace,\n\t\t\tMixDirection.in, true);\n\t}\n\n\tsort (skeleton: Skeleton) {\n\t\tconst bone = this.bone;\n\t\tconst data = this.data;\n\t\tif (bone && data.local) skeleton.sortBone(bone);\n\t\tskeleton._updateCache.push(this);\n\n\t\tconst bones = skeleton.bones;\n\t\tconst indices = data.animation.bones;\n\t\tfor (let i = 0, n = data.animation.bones.length; i < n; i++) {\n\t\t\tconst bone = bones[indices[i]];\n\t\t\tbone.sorted = false;\n\t\t\tskeleton.sortReset(bone.children);\n\t\t\tskeleton.constrained(bone);\n\t\t}\n\n\t\tconst timelines = data.animation.timelines;\n\t\tconst slots = skeleton.slots;\n\t\tconst constraints = skeleton.constraints;\n\t\tconst physics = skeleton.physics;\n\t\tconst physicsCount = skeleton.physics.length;\n\t\tfor (let i = 0, n = data.animation.timelines.length; i < n; i++) {\n\t\t\tconst t = timelines[i];\n\t\t\tif (isSlotTimeline(t))\n\t\t\t\tskeleton.constrained(slots[t.slotIndex]);\n\t\t\telse if (t instanceof PhysicsConstraintTimeline) {\n\t\t\t\tif (t.constraintIndex === -1) {\n\t\t\t\t\tfor (let ii = 0; ii < physicsCount; ii++)\n\t\t\t\t\t\tskeleton.constrained(physics[ii]);\n\t\t\t\t} else\n\t\t\t\t\tskeleton.constrained(constraints[t.constraintIndex]);\n\t\t\t} else if (isConstraintTimeline(t)) {\n\t\t\t\tconst constraintIndex = t.constraintIndex;\n\t\t\t\tif (constraintIndex !== -1) skeleton.constrained(constraints[constraintIndex]);\n\t\t\t}\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Animation } from \"./Animation.js\";\nimport type { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport { Slider } from \"./Slider.js\";\nimport { SliderPose } from \"./SliderPose.js\";\nimport type { FromProperty } from \"./TransformConstraintData.js\";\n\n/** Stores the setup pose for a {@link SliderConstraint}.\n *\n * See Slider constraints in the Spine User Guide. */\nexport class SliderData extends ConstraintData {\n\tanimation!: Animation;\n\tadditive = false;\n\tloop = false;\n\tbone: BoneData | null = null;\n\tproperty!: FromProperty;\n\tscale = 0;\n\toffset = 0;\n\tlocal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, new SliderPose());\n\t}\n\n\tpublic create (skeleton: Skeleton) {\n\t\treturn new Slider(this, skeleton);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BoneData } from \"./BoneData.js\";\nimport { PosedData } from \"./PosedData.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport { SlotPose } from \"./SlotPose.js\";\n\n/** Stores the setup pose for a {@link Slot}. */\nexport class SlotData extends PosedData {\n\t/** The index of the slot in {@link Skeleton.getSlots()}. */\n\tindex: number = 0;\n\n\t/** The bone this slot belongs to. */\n\tboneData: BoneData;\n\n\t/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */\n\tattachmentName: string | null = null;\n\n\t/** The blend mode for drawing the slot's attachment. */\n\tblendMode: BlendMode = BlendMode.Normal;\n\n\t// Nonessential.\n\t/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = true;\n\n\tconstructor (index: number, name: string, boneData: BoneData) {\n\t\tsuper(name, new SlotPose());\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!boneData) throw new Error(\"boneData cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.boneData = boneData;\n\t}\n}\n\n/** Determines how images are blended with existing pixels when drawn. */\nexport enum BlendMode { Normal, Additive, Multiply, Screen }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Pose } from \"./Pose\"\n\n/** Stores a pose for a transform constraint. */\nexport class TransformConstraintPose implements Pose {\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. */\n\tmixRotate = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. */\n\tmixX = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. */\n\tmixY = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained scale X. */\n\tmixScaleX = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained scale Y. */\n\tmixScaleY = 0;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained shear Y. */\n\tmixShearY = 0;\n\n\tpublic set (pose: TransformConstraintPose) {\n\t\tthis.mixRotate = pose.mixRotate;\n\t\tthis.mixX = pose.mixX;\n\t\tthis.mixY = pose.mixY;\n\t\tthis.mixScaleX = pose.mixScaleX;\n\t\tthis.mixScaleY = pose.mixScaleY;\n\t\tthis.mixShearY = pose.mixShearY;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { Bone } from \"./Bone.js\";\nimport type { BonePose } from \"./BonePose.js\";\nimport { Constraint } from \"./Constraint.js\";\nimport type { Physics } from \"./Physics.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { TransformConstraintPose } from \"./TransformConstraintPose.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained\n * bones to match that of the source bone.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraint extends Constraint {\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones: Array;\n\n\t/** The bone whose world transform will be copied to the constrained bones. */\n\tsource: Bone;\n\n\tconstructor (data: TransformConstraintData, skeleton: Skeleton) {\n\t\tsuper(data, new TransformConstraintPose(), new TransformConstraintPose());\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\n\t\tthis.bones = [] as BonePose[];\n\t\tfor (const boneData of data.bones)\n\t\t\tthis.bones.push(skeleton.bones[boneData.index].constrained);\n\n\t\tconst source = skeleton.bones[data.source.index];\n\t\tif (source == null) throw new Error(\"source cannot be null.\");\n\t\tthis.source = source;\n\t}\n\n\tpublic copy (skeleton: Skeleton) {\n\t\tvar copy = new TransformConstraint(this.data, skeleton);\n\t\tcopy.pose.set(this.pose);\n\t\treturn copy;\n\t}\n\n\tupdate (skeleton: Skeleton, physics: Physics) {\n\t\tconst p = this.applied;\n\t\tif (p.mixRotate === 0 && p.mixX === 0 && p.mixY === 0 && p.mixScaleX === 0 && p.mixScaleY === 0 && p.mixShearY === 0) return;\n\n\t\tconst data = this.data;\n\t\tconst localSource = data.localSource, localTarget = data.localTarget, additive = data.additive, clamp = data.clamp;\n\t\tconst offsets = data.offsets;\n\t\tconst source = this.source.applied;\n\t\tif (localSource) source.validateLocalTransform(skeleton);\n\t\tconst fromItems = data.properties;\n\t\tconst fn = data.properties.length, update = skeleton._update;\n\t\tconst bones = this.bones;\n\t\tfor (let i = 0, n = this.bones.length; i < n; i++) {\n\t\t\tconst bone = bones[i];\n\t\t\tif (localTarget)\n\t\t\t\tbone.modifyLocal(skeleton);\n\t\t\telse\n\t\t\t\tbone.modifyWorld(update);\n\t\t\tfor (let f = 0; f < fn; f++) {\n\t\t\t\tconst from = fromItems[f];\n\t\t\t\tconst value = from.value(skeleton, source, localSource, offsets) - from.offset;\n\t\t\t\tconst toItems = from.to;\n\t\t\t\tfor (let t = 0, tn = from.to.length; t < tn; t++) {\n\t\t\t\t\tconst to = toItems[t];\n\t\t\t\t\tif (to.mix(p) !== 0) {\n\t\t\t\t\t\tlet clamped = to.offset + value * to.scale;\n\t\t\t\t\t\tif (clamp) {\n\t\t\t\t\t\t\tif (to.offset < to.max)\n\t\t\t\t\t\t\t\tclamped = MathUtils.clamp(clamped, to.offset, to.max);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tclamped = MathUtils.clamp(clamped, to.max, to.offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tto.apply(skeleton, p, bone, clamped, localTarget, additive);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsort (skeleton: Skeleton) {\n\t\tif (!this.data.localSource) skeleton.sortBone(this.source);\n\t\tconst bones = this.bones;\n\t\tconst boneCount = this.bones.length;\n\t\tconst worldTarget = !this.data.localTarget;\n\t\tif (worldTarget) {\n\t\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\t\tskeleton.sortBone(bones[i].bone);\n\t\t}\n\t\tskeleton._updateCache.push(this);\n\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\tconst bone = bones[i].bone;\n\t\t\tskeleton.sortReset(bone.children);\n\t\t\tskeleton.constrained(bone);\n\t\t}\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tbones[i].bone.sorted = worldTarget;\n\t}\n\n\tisSourceActive () {\n\t\treturn this.source.active;\n\t}\n\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { BoneData } from \"./BoneData.js\";\nimport type { BonePose } from \"./BonePose.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport { TransformConstraint } from \"./TransformConstraint.js\";\nimport { TransformConstraintPose } from \"./TransformConstraintPose.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n/** Stores the setup pose for a {@link TransformConstraint}.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraintData extends ConstraintData {\n\tpublic static readonly ROTATION = 0;\n\tpublic static readonly X = 1;\n\tpublic static readonly Y = 2;\n\tpublic static readonly SCALEX = 3;\n\tpublic static readonly SCALEY = 4;\n\tpublic static readonly SHEARY = 5;\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones = [] as BoneData[];\n\n\t/** The bone whose world transform will be copied to the constrained bones. */\n\tpublic set source (source: BoneData) { this._source = source; }\n\tpublic get source () {\n\t\tif (!this._source) throw new Error(\"BoneData not set.\")\n\t\telse return this._source;\n\t}\n\tprivate _source: BoneData | null = null;\n\n\toffsets = [0, 0, 0, 0, 0, 0];\n\n\t/** An offset added to the constrained bone X translation. */\n\toffsetX = 0;\n\n\t/** An offset added to the constrained bone Y translation. */\n\toffsetY = 0;\n\n\t/** Reads the source bone's local transform instead of its world transform. */\n\tlocalSource = false;\n\n\t/** Sets the constrained bones' local transforms instead of their world transforms. */\n\tlocalTarget = false;\n\n\t/** Adds the source bone transform to the constrained bones instead of setting it absolutely. */\n\tadditive = false;\n\n\t/** Prevents constrained bones from exceeding the ranged defined by {@link ToProperty.offset} and {@link ToProperty.max}. */\n\tclamp = false;\n\n\t/** The mapping of transform properties to other transform properties. */\n\treadonly properties: Array = [];\n\n\tconstructor (name: string) {\n\t\tsuper(name, new TransformConstraintPose());\n\t}\n\n\tpublic create (skeleton: Skeleton) {\n\t\treturn new TransformConstraint(this, skeleton);\n\t}\n\n\t/** An offset added to the constrained bone rotation. */\n\tgetOffsetRotation () {\n\t\treturn this.offsets[TransformConstraintData.ROTATION];\n\t}\n\n\tsetOffsetRotation (offsetRotation: number) {\n\t\tthis.offsets[TransformConstraintData.ROTATION] = offsetRotation;\n\t}\n\n\t/** An offset added to the constrained bone X translation. */\n\tgetOffsetX () {\n\t\treturn this.offsets[TransformConstraintData.X];\n\t}\n\n\tsetOffsetX (offsetX: number) {\n\t\tthis.offsets[TransformConstraintData.X] = offsetX;\n\t}\n\n\t/** An offset added to the constrained bone Y translation. */\n\tgetOffsetY () {\n\t\treturn this.offsets[TransformConstraintData.Y];\n\t}\n\n\tsetOffsetY (offsetY: number) {\n\t\tthis.offsets[TransformConstraintData.Y] = offsetY;\n\t}\n\n\t/** An offset added to the constrained bone scaleX. */\n\tgetOffsetScaleX () {\n\t\treturn this.offsets[TransformConstraintData.SCALEX];\n\t}\n\n\tsetOffsetScaleX (offsetScaleX: number) {\n\t\tthis.offsets[TransformConstraintData.SCALEX] = offsetScaleX;\n\t}\n\n\t/** An offset added to the constrained bone scaleY. */\n\tgetOffsetScaleY () {\n\t\treturn this.offsets[TransformConstraintData.SCALEY];\n\t}\n\n\tsetOffsetScaleY (offsetScaleY: number) {\n\t\tthis.offsets[TransformConstraintData.SCALEY] = offsetScaleY;\n\t}\n\n\t/** An offset added to the constrained bone shearY. */\n\tgetOffsetShearY () {\n\t\treturn this.offsets[TransformConstraintData.SHEARY];\n\t}\n\n\tsetOffsetShearY (offsetShearY: number) {\n\t\tthis.offsets[TransformConstraintData.SHEARY] = offsetShearY;\n\t}\n\n}\n\n/** Source property for a {@link TransformConstraint}. */\nexport abstract class FromProperty {\n\t/** The value of this property that corresponds to {@link ToProperty#offset}. */\n\toffset = 0;\n\n\t/** Constrained properties. */\n\treadonly to: Array = [];\n\n\t/** Reads this property from the specified bone. */\n\tabstract value (skeleton: Skeleton, source: BonePose, local: boolean, offsets: Array): number;\n}\n\n/** Constrained property for a {@link TransformConstraint}. */\nexport abstract class ToProperty {\n\t/** The value of this property that corresponds to {@link FromProperty#offset}. */\n\toffset = 0;\n\n\t/** The maximum value of this property when {@link TransformConstraintData#clamp clamped}. */\n\tmax = 0;\n\n\t/** The scale of the {@link FromProperty} value in relation to this property. */\n\tscale = 0;\n\n\t/** Reads the mix for this property from the specified constraint. */\n\tabstract mix (pose: TransformConstraintPose): number;\n\n\t/** Applies the value to this property. */\n\tabstract apply (skeleton: Skeleton, pose: TransformConstraintPose, bone: BonePose, value: number, local: boolean, additive: boolean): void;\n}\n\nexport class FromRotate extends FromProperty {\n\tvalue (skeleton: Skeleton, source: BonePose, local: boolean, offsets: Array): number {\n\t\tif (local) return source.rotation + offsets[TransformConstraintData.ROTATION];\n\t\tconst sx = skeleton.scaleX, sy = skeleton.scaleY;\n\t\tlet value = Math.atan2(source.c / sy, source.a / sx) * MathUtils.radDeg\n\t\t\t+ ((source.a * source.d - source.b * source.c) * sx * sy > 0 ? offsets[TransformConstraintData.ROTATION] : -offsets[TransformConstraintData.ROTATION]);\n\t\tif (value < 0) value += 360;\n\t\treturn value;\n\t}\n}\n\nexport class ToRotate extends ToProperty {\n\tmix (pose: TransformConstraintPose): number {\n\t\treturn pose.mixRotate;\n\t}\n\n\tapply (skeleton: Skeleton, pose: TransformConstraintPose, bone: BonePose, value: number, local: boolean, additive: boolean): void {\n\t\tif (local)\n\t\t\tbone.rotation += (additive ? value : value - bone.rotation) * pose.mixRotate;\n\t\telse {\n\t\t\tconst sx = skeleton.scaleX, sy = skeleton.scaleY, ix = 1 / sx, iy = 1 / sy;\n\t\t\tconst a = bone.a * ix, b = bone.b * ix, c = bone.c * iy, d = bone.d * iy;\n\t\t\tvalue *= MathUtils.degRad;\n\t\t\tif (!additive) value -= Math.atan2(c, a);\n\t\t\tif (value > MathUtils.PI)\n\t\t\t\tvalue -= MathUtils.PI2;\n\t\t\telse if (value < -MathUtils.PI) //\n\t\t\t\tvalue += MathUtils.PI2;\n\t\t\tvalue *= pose.mixRotate;\n\t\t\tconst cos = Math.cos(value), sin = Math.sin(value);\n\t\t\tbone.a = (cos * a - sin * c) * sx;\n\t\t\tbone.b = (cos * b - sin * d) * sx;\n\t\t\tbone.c = (sin * a + cos * c) * sy;\n\t\t\tbone.d = (sin * b + cos * d) * sy;\n\t\t}\n\t}\n}\n\nexport class FromX extends FromProperty {\n\tvalue (skeleton: Skeleton, source: BonePose, local: boolean, offsets: Array): number {\n\t\treturn local\n\t\t\t? source.x + offsets[TransformConstraintData.X]\n\t\t\t: (offsets[TransformConstraintData.X] * source.a + offsets[TransformConstraintData.Y] * source.b + source.worldX) / skeleton.scaleX;\n\t}\n}\n\nexport class ToX extends ToProperty {\n\tmix (pose: TransformConstraintPose): number {\n\t\treturn pose.mixX;\n\t}\n\n\tapply (skeleton: Skeleton, pose: TransformConstraintPose, bone: BonePose, value: number, local: boolean, additive: boolean): void {\n\t\tif (local)\n\t\t\tbone.x += (additive ? value : value - bone.x) * pose.mixX;\n\t\telse {\n\t\t\tif (!additive) value -= bone.worldX / skeleton.scaleX;\n\t\t\tbone.worldX += value * pose.mixX * skeleton.scaleX;\n\t\t}\n\t}\n}\n\nexport class FromY extends FromProperty {\n\tvalue (skeleton: Skeleton, source: BonePose, local: boolean, offsets: Array): number {\n\t\treturn local\n\t\t\t? source.y + offsets[TransformConstraintData.Y]\n\t\t\t: (offsets[TransformConstraintData.X] * source.c + offsets[TransformConstraintData.Y] * source.d + source.worldY) / skeleton.scaleY;\n\t}\n}\n\nexport class ToY extends ToProperty {\n\tmix (pose: TransformConstraintPose): number {\n\t\treturn pose.mixY;\n\t}\n\n\tapply (skeleton: Skeleton, pose: TransformConstraintPose, bone: BonePose, value: number, local: boolean, additive: boolean): void {\n\t\tif (local)\n\t\t\tbone.y += (additive ? value : value - bone.y) * pose.mixY;\n\t\telse {\n\t\t\tif (!additive) value -= bone.worldY / skeleton.scaleY;\n\t\t\tbone.worldY += value * pose.mixY * skeleton.scaleY;\n\t\t}\n\t}\n}\n\nexport class FromScaleX extends FromProperty {\n\tvalue (skeleton: Skeleton, source: BonePose, local: boolean, offsets: Array): number {\n\t\tif (local) return source.scaleX + offsets[TransformConstraintData.SCALEX];\n\t\tconst a = source.a / skeleton.scaleX, c = source.c / skeleton.scaleY;\n\t\treturn Math.sqrt(a * a + c * c) + offsets[TransformConstraintData.SCALEX];\n\t}\n}\n\nexport class ToScaleX extends ToProperty {\n\tmix (pose: TransformConstraintPose): number {\n\t\treturn pose.mixScaleX;\n\t}\n\n\tapply (skeleton: Skeleton, pose: TransformConstraintPose, bone: BonePose, value: number, local: boolean, additive: boolean): void {\n\t\tif (local) {\n\t\t\tif (additive)\n\t\t\t\tbone.scaleX *= 1 + (value - 1) * pose.mixScaleX;\n\t\t\telse if (bone.scaleX !== 0) //\n\t\t\t\tbone.scaleX += (value - bone.scaleX) * pose.mixScaleX;\n\t\t} else if (additive) {\n\t\t\tconst s = 1 + (value - 1) * pose.mixScaleX;\n\t\t\tbone.a *= s;\n\t\t\tbone.c *= s;\n\t\t} else {\n\t\t\tlet a = bone.a / skeleton.scaleX, c = bone.c / skeleton.scaleY, s = Math.sqrt(a * a + c * c);\n\t\t\tif (s !== 0) {\n\t\t\t\ts = 1 + (value - s) * pose.mixScaleX / s;\n\t\t\t\tbone.a *= s;\n\t\t\t\tbone.c *= s;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class FromScaleY extends FromProperty {\n\tvalue (skeleton: Skeleton, source: BonePose, local: boolean, offsets: Array): number {\n\t\tif (local) return source.scaleY + offsets[TransformConstraintData.SCALEY];\n\t\tconst b = source.b / skeleton.scaleX, d = source.d / skeleton.scaleY;\n\t\treturn Math.sqrt(b * b + d * d) + offsets[TransformConstraintData.SCALEY];\n\t}\n}\n\nexport class ToScaleY extends ToProperty {\n\tmix (pose: TransformConstraintPose): number {\n\t\treturn pose.mixScaleY;\n\t}\n\n\tapply (skeleton: Skeleton, pose: TransformConstraintPose, bone: BonePose, value: number, local: boolean, additive: boolean): void {\n\t\tif (local) {\n\t\t\tif (additive)\n\t\t\t\tbone.scaleY *= 1 + (value - 1) * pose.mixScaleY;\n\t\t\telse if (bone.scaleY !== 0) //\n\t\t\t\tbone.scaleY += (value - bone.scaleY) * pose.mixScaleY;\n\t\t} else if (additive) {\n\t\t\tconst s = 1 + (value - 1) * pose.mixScaleY;\n\t\t\tbone.b *= s;\n\t\t\tbone.d *= s;\n\t\t} else {\n\t\t\tlet b = bone.b / skeleton.scaleX, d = bone.d / skeleton.scaleY, s = Math.sqrt(b * b + d * d);\n\t\t\tif (s !== 0) {\n\t\t\t\ts = 1 + (value - s) * pose.mixScaleY / s;\n\t\t\t\tbone.b *= s;\n\t\t\t\tbone.d *= s;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class FromShearY extends FromProperty {\n\tvalue (skeleton: Skeleton, source: BonePose, local: boolean, offsets: Array): number {\n\t\tif (local) return source.shearY + offsets[TransformConstraintData.SHEARY];\n\t\tconst ix = 1 / skeleton.scaleX, iy = 1 / skeleton.scaleY;\n\t\treturn (Math.atan2(source.d * iy, source.b * ix) - Math.atan2(source.c * iy, source.a * ix)) * MathUtils.radDeg - 90 + offsets[TransformConstraintData.SHEARY];\n\t}\n}\n\nexport class ToShearY extends ToProperty {\n\tmix (pose: TransformConstraintPose): number {\n\t\treturn pose.mixShearY;\n\t}\n\n\tapply (skeleton: Skeleton, pose: TransformConstraintPose, bone: BonePose, value: number, local: boolean, additive: boolean): void {\n\t\tif (local) {\n\t\t\tif (!additive) value -= bone.shearY;\n\t\t\tbone.shearY += value * pose.mixShearY;\n\t\t} else {\n\t\t\tconst sx = skeleton.scaleX, sy = skeleton.scaleY, b = bone.b / sx, d = bone.d / sy, by = Math.atan2(d, b);\n\t\t\tvalue = (value + 90) * MathUtils.degRad;\n\t\t\tif (additive)\n\t\t\t\tvalue -= MathUtils.PI / 2;\n\t\t\telse {\n\t\t\t\tvalue -= by - Math.atan2(bone.c / sx, bone.a / sy);\n\t\t\t\tif (value > MathUtils.PI)\n\t\t\t\t\tvalue -= MathUtils.PI2;\n\t\t\t\telse if (value < -MathUtils.PI)\n\t\t\t\t\tvalue += MathUtils.PI2;\n\t\t\t}\n\t\t\tvalue = by + value * pose.mixShearY;\n\t\t\tconst s = Math.sqrt(b * b + d * d);\n\t\t\tbone.b = Math.cos(value) * s * sy;\n\t\t\tbone.d = Math.sin(value) * s * sx;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AlphaTimeline, Animation, AttachmentTimeline, type BoneTimeline2, type CurveTimeline, CurveTimeline1, DeformTimeline, DrawOrderTimeline, EventTimeline, IkConstraintTimeline, InheritTimeline, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintMixTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintWindTimeline, RGB2Timeline, RGBA2Timeline, RGBATimeline, RGBTimeline, RotateTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, SequenceTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, SliderMixTimeline, SliderTimeline, type Timeline, TransformConstraintTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline } from \"./Animation.js\";\nimport type { Attachment, VertexAttachment } from \"./attachments/Attachment.js\";\nimport type { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport type { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport type { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { Sequence, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport { BoneData } from \"./BoneData.js\";\nimport { Event } from \"./Event.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, SpacingMode } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SliderData } from \"./SliderData.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { type FromProperty, FromRotate, FromScaleX, FromScaleY, FromShearY, FromX, FromY, type ToProperty, ToRotate, ToScaleX, ToScaleY, ToShearY, ToX, ToY, TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Color, type NumberArrayLike, Utils } from \"./Utils.js\";\n\n/** Loads skeleton data in the Spine binary format.\n *\n * See [Spine binary format](http://esotericsoftware.com/spine-binary-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonBinary {\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\n\tattachmentLoader: AttachmentLoader;\n\tprivate linkedMeshes = [] as LinkedMesh[];\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\treadSkeletonData (binary: Uint8Array | ArrayBuffer): SkeletonData {\n\t\tconst scale = this.scale;\n\n\t\tconst skeletonData = new SkeletonData();\n\t\tskeletonData.name = \"\"; // BOZO\n\n\t\tconst input = new BinaryInput(binary);\n\n\t\tconst lowHash = input.readInt32();\n\t\tconst highHash = input.readInt32();\n\t\tskeletonData.hash = highHash === 0 && lowHash === 0 ? null : highHash.toString(16) + lowHash.toString(16);\n\t\tskeletonData.version = input.readString();\n\t\tskeletonData.x = input.readFloat();\n\t\tskeletonData.y = input.readFloat();\n\t\tskeletonData.width = input.readFloat();\n\t\tskeletonData.height = input.readFloat();\n\t\tskeletonData.referenceScale = input.readFloat() * scale;\n\n\t\tconst nonessential = input.readBoolean();\n\t\tif (nonessential) {\n\t\t\tskeletonData.fps = input.readFloat();\n\t\t\tskeletonData.imagesPath = input.readString();\n\t\t\tskeletonData.audioPath = input.readString();\n\t\t}\n\n\t\tlet n = 0;\n\t\t// Strings.\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst str = input.readString();\n\t\t\tif (!str) throw new Error(\"String in string table must not be null.\");\n\t\t\tinput.strings.push(str);\n\t\t}\n\n\t\t// Bones.\n\t\tconst bones = skeletonData.bones;\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst name = input.readString();\n\t\t\tif (!name) throw new Error(\"Bone name must not be null.\");\n\t\t\tconst parent = i === 0 ? null : bones[input.readInt(true)];\n\t\t\tconst data = new BoneData(i, name, parent);\n\t\t\tconst setup = data.setup;\n\t\t\tsetup.rotation = input.readFloat();\n\t\t\tsetup.x = input.readFloat() * scale;\n\t\t\tsetup.y = input.readFloat() * scale;\n\t\t\tsetup.scaleX = input.readFloat();\n\t\t\tsetup.scaleY = input.readFloat();\n\t\t\tsetup.shearX = input.readFloat();\n\t\t\tsetup.shearY = input.readFloat();\n\t\t\tsetup.inherit = input.readByte();\n\t\t\tdata.length = input.readFloat() * scale;\n\t\t\tdata.skinRequired = input.readBoolean();\n\t\t\tif (nonessential) {\n\t\t\t\tColor.rgba8888ToColor(data.color, input.readInt32());\n\t\t\t\tdata.icon = input.readString() ?? undefined;\n\t\t\t\tdata.visible = input.readBoolean();\n\t\t\t}\n\t\t\tbones.push(data);\n\t\t}\n\n\t\t// Slots.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst slotName = input.readString();\n\t\t\tif (!slotName) throw new Error(\"Slot name must not be null.\");\n\t\t\tconst boneData = bones[input.readInt(true)];\n\t\t\tconst data = new SlotData(i, slotName, boneData);\n\t\t\tColor.rgba8888ToColor(data.setup.color, input.readInt32());\n\n\t\t\tconst darkColor = input.readInt32();\n\t\t\tif (darkColor !== -1) Color.rgb888ToColor(data.setup.darkColor = new Color(), darkColor);\n\n\t\t\tdata.attachmentName = input.readStringRef();\n\t\t\tdata.blendMode = input.readInt(true);\n\t\t\tif (nonessential) data.visible = input.readBoolean();\n\t\t\tskeletonData.slots.push(data);\n\t\t}\n\n\t\t// Constraints.\n\t\tconst constraints = skeletonData.constraints;\n\t\tconst constraintCount = input.readInt(true);\n\t\tfor (let i = 0; i < constraintCount; i++) {\n\t\t\tconst name = input.readString();\n\t\t\tif (!name) throw new Error(\"Constraint data name must not be null.\");\n\t\t\tlet nn: number;\n\t\t\tswitch (input.readByte()) {\n\t\t\t\tcase CONSTRAINT_IK: {\n\t\t\t\t\tconst data = new IkConstraintData(name);\n\t\t\t\t\tnn = input.readInt(true);\n\t\t\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\t\t\tdata.bones.push(bones[input.readInt(true)]);\n\t\t\t\t\tdata.target = bones[input.readInt(true)];\n\t\t\t\t\tconst flags = input.readByte();\n\t\t\t\t\tdata.skinRequired = (flags & 1) !== 0;\n\t\t\t\t\tdata.uniform = (flags & 2) !== 0;\n\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\tsetup.bendDirection = (flags & 4) !== 0 ? -1 : 1;\n\t\t\t\t\tsetup.compress = (flags & 8) !== 0;\n\t\t\t\t\tsetup.stretch = (flags & 16) !== 0;\n\t\t\t\t\tif ((flags & 32) !== 0) setup.mix = (flags & 64) !== 0 ? input.readFloat() : 1;\n\t\t\t\t\tif ((flags & 128) !== 0) setup.softness = input.readFloat() * scale;\n\t\t\t\t\tconstraints.push(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CONSTRAINT_TRANSFORM: {\n\t\t\t\t\tconst data = new TransformConstraintData(name);\n\t\t\t\t\tnn = input.readInt(true);\n\t\t\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\t\t\tdata.bones.push(bones[input.readInt(true)]);\n\t\t\t\t\tdata.source = bones[input.readInt(true)];\n\t\t\t\t\tlet flags = input.readUnsignedByte();\n\t\t\t\t\tdata.skinRequired = (flags & 1) !== 0;\n\t\t\t\t\tdata.localSource = (flags & 2) !== 0;\n\t\t\t\t\tdata.localTarget = (flags & 4) !== 0;\n\t\t\t\t\tdata.additive = (flags & 8) !== 0;\n\t\t\t\t\tdata.clamp = (flags & 16) !== 0;\n\n\t\t\t\t\tnn = flags >> 5;\n\t\t\t\t\tfor (let ii = 0, tn: number; ii < nn; ii++) {\n\t\t\t\t\t\tlet fromScale = 1;\n\t\t\t\t\t\tlet from: FromProperty | null;\n\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\tcase 0: from = new FromRotate(); break;\n\t\t\t\t\t\t\tcase 1: {\n\t\t\t\t\t\t\t\tfromScale = scale;\n\t\t\t\t\t\t\t\tfrom = new FromX();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase 2: {\n\t\t\t\t\t\t\t\tfromScale = scale;\n\t\t\t\t\t\t\t\tfrom = new FromY();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase 3: from = new FromScaleX(); break;\n\t\t\t\t\t\t\tcase 4: from = new FromScaleY(); break;\n\t\t\t\t\t\t\tcase 5: from = new FromShearY(); break;\n\t\t\t\t\t\t\tdefault: from = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!from) continue;\n\t\t\t\t\t\tfrom.offset = input.readFloat() * fromScale;\n\t\t\t\t\t\ttn = input.readByte();\n\t\t\t\t\t\tfor (let t = 0; t < tn; t++) {\n\t\t\t\t\t\t\tlet toScale = 1;\n\t\t\t\t\t\t\tlet to: ToProperty | null;\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase 0: to = new ToRotate(); break;\n\t\t\t\t\t\t\t\tcase 1: {\n\t\t\t\t\t\t\t\t\ttoScale = scale;\n\t\t\t\t\t\t\t\t\tto = new ToX();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase 2: {\n\t\t\t\t\t\t\t\t\ttoScale = scale;\n\t\t\t\t\t\t\t\t\tto = new ToY();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase 3: to = new ToScaleX(); break;\n\t\t\t\t\t\t\t\tcase 4: to = new ToScaleY(); break;\n\t\t\t\t\t\t\t\tcase 5: to = new ToShearY(); break;\n\t\t\t\t\t\t\t\tdefault: to = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!to) continue;\n\t\t\t\t\t\t\tto.offset = input.readFloat() * toScale;\n\t\t\t\t\t\t\tto.max = input.readFloat() * toScale;\n\t\t\t\t\t\t\tto.scale = input.readFloat() * toScale / fromScale;\n\t\t\t\t\t\t\tfrom.to[t] = to;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdata.properties[ii] = from;\n\t\t\t\t\t}\n\t\t\t\t\tflags = input.readByte();\n\t\t\t\t\tif ((flags & 1) !== 0) data.offsets[TransformConstraintData.ROTATION] = input.readFloat();\n\t\t\t\t\tif ((flags & 2) !== 0) data.offsets[TransformConstraintData.X] = input.readFloat() * scale;\n\t\t\t\t\tif ((flags & 4) !== 0) data.offsets[TransformConstraintData.Y] = input.readFloat() * scale;\n\t\t\t\t\tif ((flags & 8) !== 0) data.offsets[TransformConstraintData.SCALEX] = input.readFloat();\n\t\t\t\t\tif ((flags & 16) !== 0) data.offsets[TransformConstraintData.SCALEY] = input.readFloat();\n\t\t\t\t\tif ((flags & 32) !== 0) data.offsets[TransformConstraintData.SHEARY] = input.readFloat();\n\t\t\t\t\tflags = input.readByte();\n\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\tif ((flags & 1) !== 0) setup.mixRotate = input.readFloat();\n\t\t\t\t\tif ((flags & 2) !== 0) setup.mixX = input.readFloat();\n\t\t\t\t\tif ((flags & 4) !== 0) setup.mixY = input.readFloat();\n\t\t\t\t\tif ((flags & 8) !== 0) setup.mixScaleX = input.readFloat();\n\t\t\t\t\tif ((flags & 16) !== 0) setup.mixScaleY = input.readFloat();\n\t\t\t\t\tif ((flags & 32) !== 0) setup.mixShearY = input.readFloat();\n\t\t\t\t\tconstraints.push(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CONSTRAINT_PATH: {\n\t\t\t\t\tconst data = new PathConstraintData(name);\n\t\t\t\t\tnn = input.readInt(true);\n\t\t\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\t\t\tdata.bones.push(bones[input.readInt(true)]);\n\t\t\t\t\tdata.slot = skeletonData.slots[input.readInt(true)];\n\t\t\t\t\tconst flags = input.readByte();\n\t\t\t\t\tdata.skinRequired = (flags & 1) !== 0;\n\t\t\t\t\tdata.positionMode = (flags >> 1) & 2;\n\t\t\t\t\tdata.spacingMode = (flags >> 2) & 3;\n\t\t\t\t\tdata.rotateMode = (flags >> 4) & 3;\n\t\t\t\t\tif ((flags & 128) !== 0) data.offsetRotation = input.readFloat();\n\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\tsetup.position = input.readFloat();\n\t\t\t\t\tif (data.positionMode === PositionMode.Fixed) setup.position *= scale;\n\t\t\t\t\tsetup.spacing = input.readFloat();\n\t\t\t\t\tif (data.spacingMode === SpacingMode.Length || data.spacingMode === SpacingMode.Fixed) setup.spacing *= scale;\n\t\t\t\t\tsetup.mixRotate = input.readFloat();\n\t\t\t\t\tsetup.mixX = input.readFloat();\n\t\t\t\t\tsetup.mixY = input.readFloat();\n\t\t\t\t\tconstraints.push(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CONSTRAINT_PHYSICS: {\n\t\t\t\t\tconst data = new PhysicsConstraintData(name);\n\t\t\t\t\tdata.bone = bones[input.readInt(true)];\n\t\t\t\t\tlet flags = input.readByte();\n\t\t\t\t\tdata.skinRequired = (flags & 1) !== 0;\n\t\t\t\t\tif ((flags & 2) !== 0) data.x = input.readFloat();\n\t\t\t\t\tif ((flags & 4) !== 0) data.y = input.readFloat();\n\t\t\t\t\tif ((flags & 8) !== 0) data.rotate = input.readFloat();\n\t\t\t\t\tif ((flags & 16) !== 0) data.scaleX = input.readFloat();\n\t\t\t\t\tif ((flags & 32) !== 0) data.shearX = input.readFloat();\n\t\t\t\t\tdata.limit = ((flags & 64) !== 0 ? input.readFloat() : 5000) * scale;\n\t\t\t\t\tdata.step = 1 / input.readUnsignedByte();\n\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\tsetup.inertia = input.readFloat();\n\t\t\t\t\tsetup.strength = input.readFloat();\n\t\t\t\t\tsetup.damping = input.readFloat();\n\t\t\t\t\tsetup.massInverse = (flags & 128) !== 0 ? input.readFloat() : 1;\n\t\t\t\t\tsetup.wind = input.readFloat();\n\t\t\t\t\tsetup.gravity = input.readFloat();\n\t\t\t\t\tflags = input.readByte();\n\t\t\t\t\tif ((flags & 1) !== 0) data.inertiaGlobal = true;\n\t\t\t\t\tif ((flags & 2) !== 0) data.strengthGlobal = true;\n\t\t\t\t\tif ((flags & 4) !== 0) data.dampingGlobal = true;\n\t\t\t\t\tif ((flags & 8) !== 0) data.massGlobal = true;\n\t\t\t\t\tif ((flags & 16) !== 0) data.windGlobal = true;\n\t\t\t\t\tif ((flags & 32) !== 0) data.gravityGlobal = true;\n\t\t\t\t\tif ((flags & 64) !== 0) data.mixGlobal = true;\n\t\t\t\t\tsetup.mix = (flags & 128) !== 0 ? input.readFloat() : 1;\n\t\t\t\t\tconstraints.push(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase CONSTRAINT_SLIDER: {\n\t\t\t\t\tconst data = new SliderData(name);\n\t\t\t\t\tconst flags = input.readByte();\n\t\t\t\t\tdata.skinRequired = (flags & 1) !== 0;\n\t\t\t\t\tdata.loop = (flags & 2) !== 0;\n\t\t\t\t\tdata.additive = (flags & 4) !== 0;\n\t\t\t\t\tif ((flags & 8) !== 0) data.setup.time = input.readFloat();\n\t\t\t\t\tif ((flags & 16) !== 0) data.setup.mix = (flags & 32) !== 0 ? input.readFloat() : 1;\n\t\t\t\t\tif ((flags & 64) !== 0) {\n\t\t\t\t\t\tdata.local = (flags & 128) !== 0;\n\t\t\t\t\t\tdata.bone = bones[input.readInt(true)];\n\t\t\t\t\t\tconst offset = input.readFloat();\n\t\t\t\t\t\tlet propertyScale = 1;\n\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\tcase 0: data.property = new FromRotate(); break;\n\t\t\t\t\t\t\tcase 1: {\n\t\t\t\t\t\t\t\tpropertyScale = scale;\n\t\t\t\t\t\t\t\tdata.property = new FromX();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase 2: {\n\t\t\t\t\t\t\t\tpropertyScale = scale;\n\t\t\t\t\t\t\t\tdata.property = new FromY();\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase 3: data.property = new FromScaleX(); break;\n\t\t\t\t\t\t\tcase 4: data.property = new FromScaleY(); break;\n\t\t\t\t\t\t\tcase 5: data.property = new FromShearY(); break;\n\t\t\t\t\t\t\tdefault: continue;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tdata.property.offset = offset * propertyScale;\n\t\t\t\t\t\tdata.offset = input.readFloat();\n\t\t\t\t\t\tdata.scale = input.readFloat() / propertyScale;\n\t\t\t\t\t}\n\t\t\t\t\tconstraints.push(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Default skin.\n\t\tconst defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\n\t\tif (defaultSkin) {\n\t\t\tskeletonData.defaultSkin = defaultSkin;\n\t\t\tskeletonData.skins.push(defaultSkin);\n\t\t}\n\n\t\t// Skins.\n\t\t{\n\t\t\tlet i = skeletonData.skins.length;\n\t\t\tUtils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\n\t\t\tfor (; i < n; i++) {\n\t\t\t\tconst skin = this.readSkin(input, skeletonData, false, nonessential);\n\t\t\t\tif (!skin) throw new Error(\"readSkin() should not have returned null.\");\n\t\t\t\tskeletonData.skins[i] = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tn = this.linkedMeshes.length;\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst linkedMesh = this.linkedMeshes[i];\n\t\t\tconst skin = skeletonData.skins[linkedMesh.skinIndex];\n\t\t\tif (!linkedMesh.parent) throw new Error(\"Linked mesh parent must not be null\");\n\t\t\tconst parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(parent as MeshAttachment);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst eventName = input.readString();\n\t\t\tif (!eventName) throw new Error(\"Event data name must not be null\");\n\t\t\tconst data = new EventData(eventName);\n\t\t\tdata.intValue = input.readInt(false);\n\t\t\tdata.floatValue = input.readFloat();\n\t\t\tdata.stringValue = input.readString();\n\t\t\tdata.audioPath = input.readString();\n\t\t\tif (data.audioPath) {\n\t\t\t\tdata.volume = input.readFloat();\n\t\t\t\tdata.balance = input.readFloat();\n\t\t\t}\n\t\t\tskeletonData.events.push(data);\n\t\t}\n\n\t\t// Animations.\n\t\tconst animations = skeletonData.animations;\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst animationName = input.readString();\n\t\t\tif (!animationName) throw new Error(\"Animation name must not be null.\");\n\t\t\tanimations.push(this.readAnimation(input, animationName, skeletonData));\n\t\t}\n\n\t\tfor (let i = 0; i < constraintCount; i++) {\n\t\t\tconst constraint = constraints[i];\n\t\t\tif (constraint instanceof SliderData) constraint.animation = animations[input.readInt(true)];\n\t\t}\n\n\t\treturn skeletonData;\n\t}\n\n\tprivate readSkin (input: BinaryInput, skeletonData: SkeletonData, defaultSkin: boolean, nonessential: boolean): Skin | null {\n\t\tlet skin = null;\n\t\tlet slotCount = 0;\n\n\t\tif (defaultSkin) {\n\t\t\tslotCount = input.readInt(true)\n\t\t\tif (slotCount === 0) return null;\n\t\t\tskin = new Skin(\"default\");\n\t\t} else {\n\t\t\tconst skinName = input.readString();\n\t\t\tif (!skinName) throw new Error(\"Skin name must not be null.\");\n\t\t\tskin = new Skin(skinName);\n\n\t\t\tif (nonessential) Color.rgba8888ToColor(skin.color, input.readInt32());\n\n\t\t\tlet n = input.readInt(true);\n\t\t\tlet from: object[] = skeletonData.bones, to: object[] = skin.bones;\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tto[i] = from[input.readInt(true)];\n\n\t\t\tn = input.readInt(true);\n\t\t\tfrom = skeletonData.constraints;\n\t\t\tto = skin.constraints;\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tto[i] = from[input.readInt(true)];\n\n\t\t\tslotCount = input.readInt(true);\n\t\t}\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tconst slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst name = input.readStringRef();\n\t\t\t\tif (!name)\n\t\t\t\t\tthrow new Error(\"Attachment name must not be null\");\n\t\t\t\tconst attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential);\n\t\t\t\tif (attachment) skin.setAttachment(slotIndex, name, attachment);\n\t\t\t}\n\t\t}\n\t\treturn skin;\n\t}\n\n\tprivate readAttachment (input: BinaryInput, skeletonData: SkeletonData, skin: Skin, slotIndex: number, attachmentName: string | null | undefined, nonessential: boolean): Attachment | null {\n\t\tconst scale = this.scale;\n\n\t\tconst flags = input.readByte();\n\t\tconst name = (flags & 8) !== 0 ? input.readStringRef() : attachmentName;\n\t\tif (!name) throw new Error(\"Attachment name must not be null\");\n\t\tswitch ((flags & 0b111) as AttachmentType) { // BUG?\n\t\t\tcase AttachmentType.Region: {\n\t\t\t\tlet path = (flags & 16) !== 0 ? input.readStringRef() : null;\n\t\t\t\tconst color = (flags & 32) !== 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) !== 0 ? this.readSequence(input) : null;\n\t\t\t\tconst rotation = (flags & 128) !== 0 ? input.readFloat() : 0;\n\t\t\t\tconst x = input.readFloat();\n\t\t\t\tconst y = input.readFloat();\n\t\t\t\tconst scaleX = input.readFloat();\n\t\t\t\tconst scaleY = input.readFloat();\n\t\t\t\tconst width = input.readFloat();\n\t\t\t\tconst height = input.readFloat();\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tconst region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = x * scale;\n\t\t\t\tregion.y = y * scale;\n\t\t\t\tregion.scaleX = scaleX;\n\t\t\t\tregion.scaleY = scaleY;\n\t\t\t\tregion.rotation = rotation;\n\t\t\t\tregion.width = width * scale;\n\t\t\t\tregion.height = height * scale;\n\t\t\t\tColor.rgba8888ToColor(region.color, color);\n\t\t\t\tregion.sequence = sequence;\n\t\t\t\tif (region.region != null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase AttachmentType.BoundingBox: {\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 16) !== 0);\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tbox.worldVerticesLength = vertices.length;\n\t\t\t\tbox.vertices = vertices.vertices;\n\t\t\t\tbox.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(box.color, color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase AttachmentType.Mesh: {\n\t\t\t\tlet path = (flags & 16) !== 0 ? input.readStringRef() : name;\n\t\t\t\tconst color = (flags & 32) !== 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) !== 0 ? this.readSequence(input) : null;\n\t\t\t\tconst hullLength = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 128) !== 0);\n\t\t\t\tconst uvs = this.readFloatArray(input, vertices.length, 1);\n\t\t\t\tconst triangles = this.readShortArray(input, (vertices.length - hullLength - 2) * 3);\n\t\t\t\tlet edges: number[] = [];\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tedges = this.readShortArray(input, input.readInt(true));\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tconst mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.bones = vertices.bones;\n\t\t\t\tmesh.vertices = vertices.vertices;\n\t\t\t\tmesh.worldVerticesLength = vertices.length;\n\t\t\t\tmesh.triangles = triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (mesh.region != null) mesh.updateRegion();\n\t\t\t\tmesh.hullLength = hullLength << 1;\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.edges = edges;\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.LinkedMesh: {\n\t\t\t\tconst path = (flags & 16) !== 0 ? input.readStringRef() : name;\n\t\t\t\tif (path == null) throw new Error(\"Path of linked mesh must not be null\");\n\t\t\t\tconst color = (flags & 32) !== 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) !== 0 ? this.readSequence(input) : null;\n\t\t\t\tconst inheritTimelines = (flags & 128) !== 0;\n\t\t\t\tconst skinIndex = input.readInt(true);\n\t\t\t\tconst parent = input.readStringRef();\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tconst mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, skinIndex, slotIndex, parent, inheritTimelines));\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.Path: {\n\t\t\t\tconst closed = (flags & 16) !== 0;\n\t\t\t\tconst constantSpeed = (flags & 32) !== 0;\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 64) !== 0);\n\n\t\t\t\tconst lengths = Utils.newArray(vertices.length / 6, 0);\n\t\t\t\tfor (let i = 0, n = lengths.length; i < n; i++)\n\t\t\t\t\tlengths[i] = input.readFloat() * scale;\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = closed;\n\t\t\t\tpath.constantSpeed = constantSpeed;\n\t\t\t\tpath.worldVerticesLength = vertices.length;\n\t\t\t\tpath.vertices = vertices.vertices;\n\t\t\t\tpath.bones = vertices.bones;\n\t\t\t\tpath.lengths = lengths;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(path.color, color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase AttachmentType.Point: {\n\t\t\t\tconst rotation = input.readFloat();\n\t\t\t\tconst x = input.readFloat();\n\t\t\t\tconst y = input.readFloat();\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = x * scale;\n\t\t\t\tpoint.y = y * scale;\n\t\t\t\tpoint.rotation = rotation;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(point.color, color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase AttachmentType.Clipping: {\n\t\t\t\tconst endSlotIndex = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 16) !== 0);\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\t\t\t\tclip.endSlot = skeletonData.slots[endSlotIndex];\n\t\t\t\tclip.worldVerticesLength = vertices.length;\n\t\t\t\tclip.vertices = vertices.vertices;\n\t\t\t\tclip.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(clip.color, color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readSequence (input: BinaryInput) {\n\t\tconst sequence = new Sequence(input.readInt(true));\n\t\tsequence.start = input.readInt(true);\n\t\tsequence.digits = input.readInt(true);\n\t\tsequence.setupIndex = input.readInt(true);\n\t\treturn sequence;\n\t}\n\n\tprivate readVertices (input: BinaryInput, weighted: boolean): Vertices {\n\t\tconst scale = this.scale;\n\t\tconst vertexCount = input.readInt(true);\n\t\tconst length = vertexCount << 1;\n\n\t\tif (!weighted)\n\t\t\treturn new Vertices(null, this.readFloatArray(input, length, scale), length);\n\n\t\tconst weights: number[] = [];\n\t\tconst bonesArray: number[] = [];\n\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\tconst boneCount = input.readInt(true);\n\t\t\tbonesArray.push(boneCount);\n\t\t\tfor (let ii = 0; ii < boneCount; ii++) {\n\t\t\t\tbonesArray.push(input.readInt(true));\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat());\n\t\t\t}\n\t\t}\n\t\treturn new Vertices(bonesArray, Utils.toFloatArray(weights), length);\n\t}\n\n\tprivate readFloatArray (input: BinaryInput, n: number, scale: number): number[] {\n\t\tconst array: number[] = [];\n\t\tif (scale === 1) {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat();\n\t\t} else {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat() * scale;\n\t\t}\n\t\treturn array;\n\t}\n\n\tprivate readShortArray (input: BinaryInput, n: number): number[] {\n\t\tconst array: number[] = [];\n\t\tfor (let i = 0; i < n; i++)\n\t\t\tarray[i] = input.readInt(true);\n\t\treturn array;\n\t}\n\n\tprivate readAnimation (input: BinaryInput, name: string, skeletonData: SkeletonData): Animation {\n\t\tinput.readInt(true); // Number of timelines.\n\t\tconst timelines: Timeline[] = [];\n\t\tconst scale = this.scale;\n\n\t\t// Slot timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst timelineType = input.readByte();\n\t\t\t\tconst frameCount = input.readInt(true);\n\t\t\t\tconst frameLast = frameCount - 1;\n\t\t\t\tswitch (timelineType) {\n\t\t\t\t\tcase SLOT_ATTACHMENT: {\n\t\t\t\t\t\tconst timeline = new AttachmentTimeline(frameCount, slotIndex);\n\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readStringRef());\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA: {\n\t\t\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\t\t\tconst timeline = new RGBATimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a);\n\t\t\t\t\t\t\tif (frame === frameLast) break;\n\n\t\t\t\t\t\t\tconst time2 = input.readFloat();\n\t\t\t\t\t\t\tconst r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst b2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst a2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB: {\n\t\t\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\t\t\tconst timeline = new RGBTimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b);\n\t\t\t\t\t\t\tif (frame === frameLast) break;\n\n\t\t\t\t\t\t\tconst time2 = input.readFloat();\n\t\t\t\t\t\t\tconst r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA2: {\n\t\t\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\t\t\tconst timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame === frameLast) break;\n\t\t\t\t\t\t\tconst time2 = input.readFloat();\n\t\t\t\t\t\t\tconst nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst na = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\ta = na;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB2: {\n\t\t\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\t\t\tconst timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame === frameLast) break;\n\t\t\t\t\t\t\tconst time2 = input.readFloat();\n\t\t\t\t\t\t\tconst nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tconst nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_ALPHA: {\n\t\t\t\t\t\tconst timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);\n\t\t\t\t\t\tlet time = input.readFloat(), a = input.readUnsignedByte() / 255;\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, a);\n\t\t\t\t\t\t\tif (frame === frameLast) break;\n\t\t\t\t\t\t\tconst time2 = input.readFloat();\n\t\t\t\t\t\t\tconst a2 = input.readUnsignedByte() / 255;\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst boneIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type === BONE_INHERIT) {\n\t\t\t\t\tconst timeline = new InheritTimeline(frameCount, boneIndex);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readByte());\n\t\t\t\t\t}\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase BONE_ROTATE: readTimeline(input, timelines, new RotateTimeline(frameCount, bezierCount, boneIndex), 1); break;\n\t\t\t\t\tcase BONE_TRANSLATE: readTimeline(input, timelines, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale); break;\n\t\t\t\t\tcase BONE_TRANSLATEX: readTimeline(input, timelines, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale); break;\n\t\t\t\t\tcase BONE_TRANSLATEY: readTimeline(input, timelines, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale); break;\n\t\t\t\t\tcase BONE_SCALE: readTimeline(input, timelines, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1); break;\n\t\t\t\t\tcase BONE_SCALEX: readTimeline(input, timelines, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1); break;\n\t\t\t\t\tcase BONE_SCALEY: readTimeline(input, timelines, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1); break;\n\t\t\t\t\tcase BONE_SHEAR: readTimeline(input, timelines, new ShearTimeline(frameCount, bezierCount, boneIndex), 1); break;\n\t\t\t\t\tcase BONE_SHEARX: readTimeline(input, timelines, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1); break;\n\t\t\t\t\tcase BONE_SHEARY: readTimeline(input, timelines, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1); break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tconst timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet flags = input.readByte();\n\t\t\tlet time = input.readFloat(), mix = (flags & 1) !== 0 ? ((flags & 2) !== 0 ? input.readFloat() : 1) : 0;\n\t\t\tlet softness = (flags & 4) !== 0 ? input.readFloat() * scale : 0;\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mix, softness, (flags & 8) !== 0 ? 1 : -1, (flags & 16) !== 0, (flags & 32) !== 0);\n\t\t\t\tif (frame === frameLast) break;\n\t\t\t\tflags = input.readByte();\n\t\t\t\tconst time2 = input.readFloat(), mix2 = (flags & 1) !== 0 ? ((flags & 2) !== 0 ? input.readFloat() : 1) : 0;\n\t\t\t\tconst softness2 = (flags & 4) !== 0 ? input.readFloat() * scale : 0;\n\t\t\t\tif ((flags & 64) !== 0) {\n\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t} else if ((flags & 128) !== 0) {\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmix = mix2;\n\t\t\t\tsoftness = softness2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tconst timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(),\n\t\t\t\tmixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat();\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\tif (frame === frameLast) break;\n\t\t\t\tconst time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(),\n\t\t\t\t\tmixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat();\n\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\tmixX = mixX2;\n\t\t\t\tmixY = mixY2;\n\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\tmixShearY = mixShearY2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true);\n\t\t\tconst data = skeletonData.constraints[index] as PathConstraintData;\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PATH_POSITION:\n\t\t\t\t\t\treadTimeline(input, timelines, new PathConstraintPositionTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\tdata.positionMode === PositionMode.Fixed ? scale : 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_SPACING:\n\t\t\t\t\t\treadTimeline(input, timelines, new PathConstraintSpacingTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\tdata.spacingMode === SpacingMode.Length || data.spacingMode === SpacingMode.Fixed ? scale : 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_MIX: {\n\t\t\t\t\t\tconst timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index);\n\t\t\t\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat();\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\tif (frame === frameLast) break;\n\t\t\t\t\t\t\tconst time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(),\n\t\t\t\t\t\t\t\tmixY2 = input.readFloat();\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true) - 1;\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type === PHYSICS_RESET) {\n\t\t\t\t\tconst timeline = new PhysicsConstraintResetTimeline(frameCount, index);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat());\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PHYSICS_INERTIA: readTimeline(input, timelines, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tcase PHYSICS_STRENGTH: readTimeline(input, timelines, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tcase PHYSICS_DAMPING: readTimeline(input, timelines, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tcase PHYSICS_MASS: readTimeline(input, timelines, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tcase PHYSICS_WIND: readTimeline(input, timelines, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tcase PHYSICS_GRAVITY: readTimeline(input, timelines, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tcase PHYSICS_MIX: readTimeline(input, timelines, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tdefault: throw new Error(\"Unknown physics timeline type.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Slider timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase SLIDER_TIME: readTimeline(input, timelines, new SliderTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tcase SLIDER_MIX: readTimeline(input, timelines, new SliderMixTimeline(frameCount, bezierCount, index), 1); break;\n\t\t\t\t\tdefault: throw new Error(`Uknown slider type: ${type}`);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// Attachment timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst skin = skeletonData.skins[input.readInt(true)];\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst slotIndex = input.readInt(true);\n\t\t\t\tfor (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\n\t\t\t\t\tconst attachmentName = input.readStringRef();\n\t\t\t\t\tif (!attachmentName) throw new Error(\"attachmentName must not be null.\");\n\t\t\t\t\tconst attachment = skin.getAttachment(slotIndex, attachmentName);\n\t\t\t\t\tconst timelineType = input.readByte();\n\t\t\t\t\tconst frameCount = input.readInt(true);\n\t\t\t\t\tconst frameLast = frameCount - 1;\n\n\t\t\t\t\tswitch (timelineType) {\n\t\t\t\t\t\tcase ATTACHMENT_DEFORM: {\n\t\t\t\t\t\t\tconst vertexAttachment = attachment as VertexAttachment;\n\t\t\t\t\t\t\tconst weighted = vertexAttachment.bones;\n\t\t\t\t\t\t\tconst vertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tconst deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\n\t\t\t\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\t\t\t\tconst timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment);\n\n\t\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\tlet deform: NumberArrayLike;\n\t\t\t\t\t\t\t\tlet end = input.readInt(true);\n\t\t\t\t\t\t\t\tif (end === 0)\n\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\tconst start = input.readInt(true);\n\t\t\t\t\t\t\t\t\tend += start;\n\t\t\t\t\t\t\t\t\tif (scale === 1) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat() * scale;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = 0, vn = deform.length; v < vn; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] += vertices[v];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\tif (frame === frameLast) break;\n\t\t\t\t\t\t\t\tconst time2 = input.readFloat();\n\t\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase ATTACHMENT_SEQUENCE: {\n\t\t\t\t\t\t\tconst timeline = new SequenceTimeline(frameCount, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\t\t\tconst time = input.readFloat();\n\t\t\t\t\t\t\t\tconst modeAndIndex = input.readInt32();\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, SequenceModeValues[modeAndIndex & 0xf], modeAndIndex >> 4,\n\t\t\t\t\t\t\t\t\tinput.readFloat());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timeline.\n\t\tconst drawOrderCount = input.readInt(true);\n\t\tif (drawOrderCount > 0) {\n\t\t\tconst timeline = new DrawOrderTimeline(drawOrderCount);\n\t\t\tconst slotCount = skeletonData.slots.length;\n\t\t\tfor (let i = 0; i < drawOrderCount; i++) {\n\t\t\t\tconst time = input.readFloat();\n\t\t\t\tconst offsetCount = input.readInt(true);\n\t\t\t\tconst drawOrder = Utils.newArray(slotCount, 0);\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tdrawOrder[ii] = -1;\n\t\t\t\tconst unchanged = Utils.newArray(slotCount - offsetCount, 0);\n\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\tfor (let ii = 0; ii < offsetCount; ii++) {\n\t\t\t\t\tconst slotIndex = input.readInt(true);\n\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\twhile (originalIndex !== slotIndex)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Set changed items.\n\t\t\t\t\tdrawOrder[originalIndex + input.readInt(true)] = originalIndex++;\n\t\t\t\t}\n\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t// Fill in unchanged items.\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tif (drawOrder[ii] === -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\ttimeline.setFrame(i, time, drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timeline.\n\t\tconst eventCount = input.readInt(true);\n\t\tif (eventCount > 0) {\n\t\t\tconst timeline = new EventTimeline(eventCount);\n\t\t\tfor (let i = 0; i < eventCount; i++) {\n\t\t\t\tconst time = input.readFloat();\n\t\t\t\tconst eventData = skeletonData.events[input.readInt(true)];\n\t\t\t\tconst event = new Event(time, eventData);\n\t\t\t\tevent.intValue = input.readInt(false);\n\t\t\t\tevent.floatValue = input.readFloat();\n\t\t\t\tevent.stringValue = input.readString();\n\t\t\t\tif (event.stringValue == null) event.stringValue = eventData.stringValue;\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = input.readFloat();\n\t\t\t\t\tevent.balance = input.readFloat();\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(i, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\treturn new Animation(name, timelines, duration);\n\t}\n}\n\nexport class BinaryInput {\n\tconstructor (data: Uint8Array | ArrayBuffer, public strings = [] as string[], private index: number = 0, private buffer = new DataView(data instanceof ArrayBuffer ? data : data.buffer)) {\n\t}\n\n\treadByte (): number {\n\t\treturn this.buffer.getInt8(this.index++);\n\t}\n\n\treadUnsignedByte (): number {\n\t\treturn this.buffer.getUint8(this.index++);\n\t}\n\n\treadShort (): number {\n\t\tconst value = this.buffer.getInt16(this.index);\n\t\tthis.index += 2;\n\t\treturn value;\n\t}\n\n\treadInt32 (): number {\n\t\tconst value = this.buffer.getInt32(this.index)\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadInt (optimizePositive: boolean) {\n\t\tlet b = this.readByte();\n\t\tlet result = b & 0x7F;\n\t\tif ((b & 0x80) !== 0) {\n\t\t\tb = this.readByte();\n\t\t\tresult |= (b & 0x7F) << 7;\n\t\t\tif ((b & 0x80) !== 0) {\n\t\t\t\tb = this.readByte();\n\t\t\t\tresult |= (b & 0x7F) << 14;\n\t\t\t\tif ((b & 0x80) !== 0) {\n\t\t\t\t\tb = this.readByte();\n\t\t\t\t\tresult |= (b & 0x7F) << 21;\n\t\t\t\t\tif ((b & 0x80) !== 0) {\n\t\t\t\t\t\tb = this.readByte();\n\t\t\t\t\t\tresult |= (b & 0x7F) << 28;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\n\t}\n\n\treadStringRef (): string | null {\n\t\tconst index = this.readInt(true);\n\t\treturn index === 0 ? null : this.strings[index - 1];\n\t}\n\n\treadString (): string | null {\n\t\tlet byteCount = this.readInt(true);\n\t\tswitch (byteCount) {\n\t\t\tcase 0:\n\t\t\t\treturn null;\n\t\t\tcase 1:\n\t\t\t\treturn \"\";\n\t\t}\n\t\tbyteCount--;\n\t\tlet chars = \"\";\n\t\tfor (let i = 0; i < byteCount;) {\n\t\t\tconst b = this.readUnsignedByte();\n\t\t\tswitch (b >> 4) {\n\t\t\t\tcase 12:\n\t\t\t\tcase 13:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 3;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tchars += String.fromCharCode(b);\n\t\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn chars;\n\t}\n\n\treadFloat (): number {\n\t\tconst value = this.buffer.getFloat32(this.index);\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadBoolean (): boolean {\n\t\treturn this.readByte() !== 0;\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string | null; skinIndex: number;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skinIndex: number, slotIndex: number, parent: string | null, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skinIndex = skinIndex;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\nclass Vertices {\n\tconstructor (public bones: Array | null = null, public vertices: Array | Float32Array, public length: number = 0) { }\n}\n\nenum AttachmentType { Region, BoundingBox, Mesh, LinkedMesh, Path, Point, Clipping }\n\nfunction readTimeline (input: BinaryInput, timelines: Array, timeline: CurveTimeline1, scale: number): void;\nfunction readTimeline (input: BinaryInput, timelines: Array, timeline: BoneTimeline2, scale: number): void;\nfunction readTimeline (input: BinaryInput, timelines: Array, timeline: CurveTimeline1 | BoneTimeline2, scale: number): void {\n\tif (timeline instanceof CurveTimeline1)\n\t\treadTimeline1(input, timelines, timeline, scale);\n\telse\n\t\treadTimeline2(input, timelines, timeline, scale);\n}\n\nfunction readTimeline1 (input: BinaryInput, timelines: Array, timeline: CurveTimeline1, scale: number): void {\n\tlet time = input.readFloat(), value = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tif (frame === frameLast) break;\n\t\tconst time2 = input.readFloat(), value2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue = value2;\n\t}\n\ttimelines.push(timeline);\n}\n\nfunction readTimeline2 (input: BinaryInput, timelines: Array, timeline: BoneTimeline2, scale: number): void {\n\tlet time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tif (frame === frameLast) break;\n\t\tconst time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t}\n\ttimelines.push(timeline);\n}\n\nfunction setBezier (input: BinaryInput, timeline: CurveTimeline, bezier: number, frame: number, value: number,\n\ttime1: number, time2: number, value1: number, value2: number, scale: number) {\n\ttimeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2);\n}\n\nconst BONE_ROTATE = 0;\nconst BONE_TRANSLATE = 1;\nconst BONE_TRANSLATEX = 2;\nconst BONE_TRANSLATEY = 3;\nconst BONE_SCALE = 4;\nconst BONE_SCALEX = 5;\nconst BONE_SCALEY = 6;\nconst BONE_SHEAR = 7;\nconst BONE_SHEARX = 8;\nconst BONE_SHEARY = 9;\nconst BONE_INHERIT = 10;\n\nconst SLOT_ATTACHMENT = 0;\nconst SLOT_RGBA = 1;\nconst SLOT_RGB = 2;\nconst SLOT_RGBA2 = 3;\nconst SLOT_RGB2 = 4;\nconst SLOT_ALPHA = 5;\n\nconst CONSTRAINT_IK = 0;\nconst CONSTRAINT_PATH = 1;\nconst CONSTRAINT_TRANSFORM = 2;\nconst CONSTRAINT_PHYSICS = 3;\nconst CONSTRAINT_SLIDER = 4;\n\nconst ATTACHMENT_DEFORM = 0;\nconst ATTACHMENT_SEQUENCE = 1;\n\nconst PATH_POSITION = 0;\nconst PATH_SPACING = 1;\nconst PATH_MIX = 2;\n\nconst PHYSICS_INERTIA = 0;\nconst PHYSICS_STRENGTH = 1;\nconst PHYSICS_DAMPING = 2;\nconst PHYSICS_MASS = 4;\nconst PHYSICS_WIND = 5;\nconst PHYSICS_GRAVITY = 6;\nconst PHYSICS_MIX = 7;\nconst PHYSICS_RESET = 8;\n\nconst SLIDER_TIME = 0;\nconst SLIDER_MIX = 1;\n\n// biome-ignore lint/correctness/noUnusedVariables: intentional\nconst CURVE_LINEAR = 0;\nconst CURVE_STEPPED = 1;\nconst CURVE_BEZIER = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport { type NumberArrayLike, Pool, Utils } from \"./Utils.js\";\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\n * provided along with convenience methods for doing hit detection. */\nexport class SkeletonBounds {\n\n\t/** The left edge of the axis aligned bounding box. */\n\tminX = 0;\n\n\t/** The bottom edge of the axis aligned bounding box. */\n\tminY = 0;\n\n\t/** The right edge of the axis aligned bounding box. */\n\tmaxX = 0;\n\n\t/** The top edge of the axis aligned bounding box. */\n\tmaxY = 0;\n\n\t/** The visible bounding boxes. */\n\tboundingBoxes = [] as BoundingBoxAttachment[];\n\n\t/** The world vertices for the bounding box polygons. */\n\tpolygons = [] as NumberArrayLike[];\n\n\tprivate polygonPool = new Pool(() => {\n\t\treturn Utils.newFloatArray(16);\n\t});\n\n\t/** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding\n\t * box's polygon.\n\t * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the\n\t * SkeletonBounds AABB methods will always return true. */\n\tupdate (skeleton: Skeleton, updateAabb: boolean) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tconst boundingBoxes = this.boundingBoxes;\n\t\tconst polygons = this.polygons;\n\t\tconst polygonPool = this.polygonPool;\n\t\tconst slots = skeleton.slots;\n\t\tconst slotCount = slots.length;\n\n\t\tboundingBoxes.length = 0;\n\t\tpolygonPool.freeAll(polygons);\n\t\tpolygons.length = 0;\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tconst slot = slots[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tconst attachment = slot.applied.attachment;\n\t\t\tif (attachment instanceof BoundingBoxAttachment) {\n\t\t\t\tboundingBoxes.push(attachment);\n\n\t\t\t\tlet polygon = polygonPool.obtain();\n\t\t\t\tif (polygon.length !== attachment.worldVerticesLength) {\n\t\t\t\t\tpolygon = Utils.newFloatArray(attachment.worldVerticesLength);\n\t\t\t\t}\n\t\t\t\tpolygons.push(polygon);\n\t\t\t\tattachment.computeWorldVertices(skeleton, slot, 0, attachment.worldVerticesLength, polygon, 0, 2);\n\t\t\t}\n\t\t}\n\n\t\tif (updateAabb) {\n\t\t\tthis.aabbCompute();\n\t\t} else {\n\t\t\tthis.minX = Number.POSITIVE_INFINITY;\n\t\t\tthis.minY = Number.POSITIVE_INFINITY;\n\t\t\tthis.maxX = Number.NEGATIVE_INFINITY;\n\t\t\tthis.maxY = Number.NEGATIVE_INFINITY;\n\t\t}\n\t}\n\n\taabbCompute () {\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tconst polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++) {\n\t\t\tconst polygon = polygons[i];\n\t\t\tconst vertices = polygon;\n\t\t\tfor (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\n\t\t\t\tconst x = vertices[ii];\n\t\t\t\tconst y = vertices[ii + 1];\n\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t}\n\t\t}\n\t\tthis.minX = minX;\n\t\tthis.minY = minY;\n\t\tthis.maxX = maxX;\n\t\tthis.maxY = maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box contains the point. */\n\taabbContainsPoint (x: number, y: number) {\n\t\treturn x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the line segment. */\n\taabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tconst minX = this.minX;\n\t\tconst minY = this.minY;\n\t\tconst maxX = this.maxX;\n\t\tconst maxY = this.maxY;\n\t\tif ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\n\t\t\treturn false;\n\t\tconst m = (y2 - y1) / (x2 - x1);\n\t\tlet y = m * (minX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\ty = m * (maxX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\tlet x = (minY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\tx = (maxY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\treturn false;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\n\taabbIntersectsSkeleton (bounds: SkeletonBounds) {\n\t\treturn this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\n\t}\n\n\t/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\n\t * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\n\tcontainsPoint (x: number, y: number): BoundingBoxAttachment | null {\n\t\tconst polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains the point. */\n\tcontainsPointPolygon (polygon: NumberArrayLike, x: number, y: number) {\n\t\tconst vertices = polygon;\n\t\tconst nn = polygon.length;\n\n\t\tlet prevIndex = nn - 2;\n\t\tlet inside = false;\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tconst vertexY = vertices[ii + 1];\n\t\t\tconst prevY = vertices[prevIndex + 1];\n\t\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\n\t\t\t\tconst vertexX = vertices[ii];\n\t\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\n\t\t\t}\n\t\t\tprevIndex = ii;\n\t\t}\n\t\treturn inside;\n\t}\n\n\t/** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\n\t * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns\n\t * true. */\n\tintersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tconst polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains any part of the line segment. */\n\tintersectsSegmentPolygon (polygon: NumberArrayLike, x1: number, y1: number, x2: number, y2: number) {\n\t\tconst vertices = polygon;\n\t\tconst nn = polygon.length;\n\n\t\tconst width12 = x1 - x2, height12 = y1 - y2;\n\t\tconst det1 = x1 * y2 - y1 * x2;\n\t\tlet x3 = vertices[nn - 2], y3 = vertices[nn - 1];\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tconst x4 = vertices[ii], y4 = vertices[ii + 1];\n\t\t\tconst det2 = x3 * y4 - y3 * x4;\n\t\t\tconst width34 = x3 - x4, height34 = y3 - y4;\n\t\t\tconst det3 = width12 * height34 - height12 * width34;\n\t\t\tconst x = (det1 * width34 - width12 * det2) / det3;\n\t\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\n\t\t\t\tconst y = (det1 * height34 - height12 * det2) / det3;\n\t\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\n\t\t\t}\n\t\t\tx3 = x4;\n\t\t\ty3 = y4;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Returns the polygon for the specified bounding box, or null. */\n\tgetPolygon (boundingBox: BoundingBoxAttachment) {\n\t\tif (!boundingBox) throw new Error(\"boundingBox cannot be null.\");\n\t\tconst index = this.boundingBoxes.indexOf(boundingBox);\n\t\treturn index === -1 ? null : this.polygons[index];\n\t}\n\n\t/** The width of the axis aligned bounding box. */\n\tgetWidth () {\n\t\treturn this.maxX - this.minX;\n\t}\n\n\t/** The height of the axis aligned bounding box. */\n\tgetHeight () {\n\t\treturn this.maxY - this.minY;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { type NumberArrayLike, Pool } from \"./Utils.js\";\n\nexport class Triangulator {\n\tprivate convexPolygons = [] as Array[];\n\tprivate convexPolygonsIndices = [] as Array[];\n\n\tprivate indicesArray = [] as number[];\n\tprivate isConcaveArray = [] as boolean[];\n\tprivate triangles = [] as number[];\n\n\tprivate polygonPool = new Pool>(() => {\n\t\treturn [] as number[];\n\t});\n\n\tprivate polygonIndicesPool = new Pool>(() => {\n\t\treturn [] as number[];\n\t});\n\n\tpublic triangulate (verticesArray: NumberArrayLike): Array {\n\t\tconst vertices = verticesArray;\n\t\tlet vertexCount = verticesArray.length >> 1;\n\n\t\tconst indices = this.indicesArray;\n\t\tindices.length = 0;\n\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\tindices[i] = i;\n\n\t\tconst isConcave = this.isConcaveArray;\n\t\tisConcave.length = 0;\n\t\tfor (let i = 0, n = vertexCount; i < n; ++i)\n\t\t\tisConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\n\n\t\tconst triangles = this.triangles;\n\t\ttriangles.length = 0;\n\n\t\twhile (vertexCount > 3) {\n\t\t\t// Find ear tip.\n\t\t\tlet previous = vertexCount - 1, i = 0, next = 1;\n\t\t\twhile (true) {\n\t\t\t\t// biome-ignore lint/suspicious/noConfusingLabels: reference runtime\n\t\t\t\touter:\n\t\t\t\tif (!isConcave[i]) {\n\t\t\t\t\tconst p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\n\t\t\t\t\tconst p1x = vertices[p1], p1y = vertices[p1 + 1];\n\t\t\t\t\tconst p2x = vertices[p2], p2y = vertices[p2 + 1];\n\t\t\t\t\tconst p3x = vertices[p3], p3y = vertices[p3 + 1];\n\t\t\t\t\tfor (let ii = (next + 1) % vertexCount; ii !== previous; ii = (ii + 1) % vertexCount) {\n\t\t\t\t\t\tif (!isConcave[ii]) continue;\n\t\t\t\t\t\tconst v = indices[ii] << 1;\n\t\t\t\t\t\tconst vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\t\t\tif (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\n\t\t\t\t\t\t\tif (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\n\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) break outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (next === 0) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (!isConcave[i]) break;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t} while (i > 0);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tprevious = i;\n\t\t\t\ti = next;\n\t\t\t\tnext = (next + 1) % vertexCount;\n\t\t\t}\n\n\t\t\t// Cut ear tip.\n\t\t\ttriangles.push(indices[(vertexCount + i - 1) % vertexCount]);\n\t\t\ttriangles.push(indices[i]);\n\t\t\ttriangles.push(indices[(i + 1) % vertexCount]);\n\t\t\tindices.splice(i, 1);\n\t\t\tisConcave.splice(i, 1);\n\t\t\tvertexCount--;\n\n\t\t\tconst previousIndex = (vertexCount + i - 1) % vertexCount;\n\t\t\tconst nextIndex = i === vertexCount ? 0 : i;\n\t\t\tisConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\n\t\t\tisConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\n\t\t}\n\n\t\tif (vertexCount === 3) {\n\t\t\ttriangles.push(indices[2]);\n\t\t\ttriangles.push(indices[0]);\n\t\t\ttriangles.push(indices[1]);\n\t\t}\n\n\t\treturn triangles;\n\t}\n\n\tdecompose (verticesArray: Array, triangles: Array): Array> {\n\t\tconst vertices = verticesArray;\n\t\tconst convexPolygons = this.convexPolygons;\n\t\tthis.polygonPool.freeAll(convexPolygons);\n\t\tconvexPolygons.length = 0;\n\n\t\tconst convexPolygonsIndices = this.convexPolygonsIndices;\n\t\tthis.polygonIndicesPool.freeAll(convexPolygonsIndices);\n\t\tconvexPolygonsIndices.length = 0;\n\n\t\tlet polygonIndices = this.polygonIndicesPool.obtain();\n\t\tpolygonIndices.length = 0;\n\n\t\tlet polygon = this.polygonPool.obtain();\n\t\tpolygon.length = 0;\n\n\t\t// Merge subsequent triangles if they form a triangle fan.\n\t\tlet fanBaseIndex = -1, lastWinding = 0;\n\t\tfor (let i = 0, n = triangles.length; i < n; i += 3) {\n\t\t\tconst t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\n\t\t\tconst x1 = vertices[t1], y1 = vertices[t1 + 1];\n\t\t\tconst x2 = vertices[t2], y2 = vertices[t2 + 1];\n\t\t\tconst x3 = vertices[t3], y3 = vertices[t3 + 1];\n\n\t\t\t// If the base of the last triangle is the same as this triangle, check if they form a convex polygon (triangle fan).\n\t\t\tlet merged = false;\n\t\t\tif (fanBaseIndex === t1) {\n\t\t\t\tconst o = polygon.length - 4;\n\t\t\t\tconst winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\n\t\t\t\tconst winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\n\t\t\t\tif (winding1 === lastWinding && winding2 === lastWinding) {\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\t\tmerged = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise make this triangle the new base.\n\t\t\tif (!merged) {\n\t\t\t\tif (polygon.length > 0) {\n\t\t\t\t\tconvexPolygons.push(polygon);\n\t\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t\t\t} else {\n\t\t\t\t\tthis.polygonPool.free(polygon)\n\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t\t}\n\t\t\t\tpolygon = this.polygonPool.obtain();\n\t\t\t\tpolygon.length = 0;\n\t\t\t\tpolygon.push(x1);\n\t\t\t\tpolygon.push(y1);\n\t\t\t\tpolygon.push(x2);\n\t\t\t\tpolygon.push(y2);\n\t\t\t\tpolygon.push(x3);\n\t\t\t\tpolygon.push(y3);\n\t\t\t\tpolygonIndices = this.polygonIndicesPool.obtain();\n\t\t\t\tpolygonIndices.length = 0;\n\t\t\t\tpolygonIndices.push(t1);\n\t\t\t\tpolygonIndices.push(t2);\n\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\tlastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\n\t\t\t\tfanBaseIndex = t1;\n\t\t\t}\n\t\t}\n\n\t\tif (polygon.length > 0) {\n\t\t\tconvexPolygons.push(polygon);\n\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t}\n\n\t\t// Go through the list of polygons and try to merge the remaining triangles with the found triangle fans.\n\t\tfor (let i = 0, n = convexPolygons.length; i < n; i++) {\n\t\t\tpolygonIndices = convexPolygonsIndices[i];\n\t\t\tif (polygonIndices.length === 0) continue;\n\t\t\tconst firstIndex = polygonIndices[0];\n\t\t\tconst lastIndex = polygonIndices[polygonIndices.length - 1];\n\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tconst o = polygon.length - 4;\n\t\t\tlet prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\n\t\t\tlet prevX = polygon[o + 2], prevY = polygon[o + 3];\n\t\t\tconst firstX = polygon[0], firstY = polygon[1];\n\t\t\tconst secondX = polygon[2], secondY = polygon[3];\n\t\t\tconst winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\n\n\t\t\tfor (let ii = 0; ii < n; ii++) {\n\t\t\t\tif (ii === i) continue;\n\t\t\t\tconst otherIndices = convexPolygonsIndices[ii];\n\t\t\t\tif (otherIndices.length !== 3) continue;\n\t\t\t\tconst otherFirstIndex = otherIndices[0];\n\t\t\t\tconst otherSecondIndex = otherIndices[1];\n\t\t\t\tconst otherLastIndex = otherIndices[2];\n\n\t\t\t\tconst otherPoly = convexPolygons[ii];\n\t\t\t\tconst x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\n\n\t\t\t\tif (otherFirstIndex !== firstIndex || otherSecondIndex !== lastIndex) continue;\n\t\t\t\tconst winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\n\t\t\t\tconst winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\n\t\t\t\tif (winding1 === winding && winding2 === winding) {\n\t\t\t\t\totherPoly.length = 0;\n\t\t\t\t\totherIndices.length = 0;\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(otherLastIndex);\n\t\t\t\t\tprevPrevX = prevX;\n\t\t\t\t\tprevPrevY = prevY;\n\t\t\t\t\tprevX = x3;\n\t\t\t\t\tprevY = y3;\n\t\t\t\t\tii = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove empty polygons that resulted from the merge step above.\n\t\tfor (let i = convexPolygons.length - 1; i >= 0; i--) {\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tif (polygon.length === 0) {\n\t\t\t\tconvexPolygons.splice(i, 1);\n\t\t\t\tthis.polygonPool.free(polygon);\n\t\t\t\tpolygonIndices = convexPolygonsIndices[i]\n\t\t\t\tconvexPolygonsIndices.splice(i, 1)\n\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t}\n\t\t}\n\n\t\treturn convexPolygons;\n\t}\n\n\tprivate static isConcave (index: number, vertexCount: number, vertices: NumberArrayLike, indices: NumberArrayLike): boolean {\n\t\tconst previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\n\t\tconst current = indices[index] << 1;\n\t\tconst next = indices[(index + 1) % vertexCount] << 1;\n\t\treturn !Triangulator.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next],\n\t\t\tvertices[next + 1]);\n\t}\n\n\tprivate static positiveArea (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): boolean {\n\t\treturn p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\n\t}\n\n\tprivate static winding (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): number {\n\t\tconst px = p2x - p1x, py = p2y - p1y;\n\t\treturn p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport type { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport type { Skeleton } from \"./Skeleton.js\";\nimport type { Slot } from \"./Slot.js\";\nimport { Triangulator } from \"./Triangulator.js\";\nimport { type Color, type NumberArrayLike, Utils } from \"./Utils.js\";\n\nexport class SkeletonClipping {\n\tprivate triangulator = new Triangulator();\n\tprivate clippingPolygon = [] as number[];\n\tprivate clipOutput = [] as number[];\n\tclippedVertices = [] as number[];\n\n\t/** An empty array unless {@link clipTrianglesUnpacked} was used. **/\n\tclippedUVs = [] as number[];\n\n\tclippedTriangles = [] as number[];\n\n\t_clippedVerticesTyped = new Float32Array(1024);\n\t_clippedUVsTyped = new Float32Array(1024);\n\t_clippedTrianglesTyped = new Uint32Array(1024);\n\tclippedVerticesTyped = new Float32Array(0);\n\tclippedUVsTyped = new Float32Array(0);\n\tclippedTrianglesTyped = new Uint32Array(0);\n\tclippedVerticesLength = 0;\n\tclippedUVsLength = 0;\n\tclippedTrianglesLength = 0;\n\n\tprivate scratch = [] as number[];\n\n\tprivate clipAttachment: ClippingAttachment | null = null;\n\tprivate clippingPolygons: Array> | null = null;\n\n\tclipStart (skeleton: Skeleton, slot: Slot, clip: ClippingAttachment): number {\n\t\tif (this.clipAttachment) return 0;\n\t\tthis.clipAttachment = clip;\n\n\t\tconst n = clip.worldVerticesLength;\n\t\tconst vertices = Utils.setArraySize(this.clippingPolygon, n);\n\t\tclip.computeWorldVertices(skeleton, slot, 0, n, vertices, 0, 2);\n\t\tconst clippingPolygon = this.clippingPolygon;\n\t\tSkeletonClipping.makeClockwise(clippingPolygon);\n\t\tconst clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\n\t\tfor (let i = 0, n = clippingPolygons.length; i < n; i++) {\n\t\t\tconst polygon = clippingPolygons[i];\n\t\t\tSkeletonClipping.makeClockwise(polygon);\n\t\t\tpolygon.push(polygon[0]);\n\t\t\tpolygon.push(polygon[1]);\n\t\t}\n\n\t\treturn clippingPolygons.length;\n\t}\n\n\tclipEnd (slot?: Slot) {\n\t\tif (!this.clipAttachment) return;\n\t\tif (slot && this.clipAttachment.endSlot !== slot.data) return;\n\t\tthis.clipAttachment = null;\n\t\tthis.clippingPolygons = null;\n\t\tthis.clippedVertices.length = 0;\n\t\tthis.clippedTriangles.length = 0;\n\t\tthis.clippingPolygon.length = 0;\n\t\tthis.clippedVerticesLength = 0;\n\t\tthis.clippedUVsLength = 0;\n\t\tthis.clippedTrianglesLength = 0;\n\t}\n\n\tisClipping (): boolean {\n\t\treturn this.clipAttachment != null;\n\t}\n\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number): boolean;\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number,\n\t\tuvs: NumberArrayLike, light: Color, dark: Color, twoColor: boolean, stride: number): boolean;\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number,\n\t\tuvs?: NumberArrayLike, light?: Color, dark?: Color, twoColor?: boolean, stride?: number): boolean {\n\n\t\treturn (uvs && light && dark && typeof twoColor === 'boolean' && typeof stride === 'number')\n\t\t\t? this.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor, stride)\n\t\t\t: this.clipTrianglesNoRender(vertices, triangles, trianglesLength);\n\t}\n\n\tprivate clipTrianglesNoRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number): boolean {\n\n\t\tconst clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tconst clippedTriangles = this.clippedTriangles;\n\t\t// biome-ignore lint/style/noNonNullAssertion: clipStart define it\n\t\tconst polygons = this.clippingPolygons!;\n\t\tconst polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tlet clipOutputItems = null;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet v = triangles[i] << 1;\n\t\t\tconst x1 = vertices[v], y1 = vertices[v + 1];\n\n\t\t\tv = triangles[i + 1] << 1;\n\t\t\tconst x2 = vertices[v], y2 = vertices[v + 1];\n\n\t\t\tv = triangles[i + 2] << 1;\n\t\t\tconst x3 = vertices[v], y3 = vertices[v + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tclipOutputItems = this.clipOutput;\n\t\t\t\t\tconst clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength === 0) continue;\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tconst clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tconst x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tconst clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tconst clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\n\t\t\t\t\tclippedVerticesItems[s + 2] = x2;\n\t\t\t\t\tclippedVerticesItems[s + 3] = y2;\n\n\t\t\t\t\tclippedVerticesItems[s + 4] = x3;\n\t\t\t\t\tclippedVerticesItems[s + 5] = y3;\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tconst clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clipOutputItems != null;\n\t}\n\n\tprivate clipTrianglesRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike,\n\t\tlight: Color, dark: Color, twoColor: boolean, stride: number): boolean {\n\n\t\tconst clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tconst clippedTriangles = this.clippedTriangles;\n\t\t// biome-ignore lint/style/noNonNullAssertion: clipStart define it\n\t\tconst polygons = this.clippingPolygons!;\n\t\tconst polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tlet clipOutputItems = null;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet t = triangles[i];\n\t\t\tconst u1 = uvs[t << 1], v1 = uvs[(t << 1) + 1];\n\t\t\tconst x1 = vertices[t * stride], y1 = vertices[t * stride + 1];\n\n\t\t\tt = triangles[i + 1];\n\t\t\tconst u2 = uvs[t << 1], v2 = uvs[(t << 1) + 1];\n\t\t\tconst x2 = vertices[t * stride], y2 = vertices[t * stride + 1];\n\n\t\t\tt = triangles[i + 2];\n\t\t\tconst u3 = uvs[t << 1], v3 = uvs[(t << 1) + 1];\n\t\t\tconst x3 = vertices[t * stride], y3 = vertices[t * stride + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tclipOutputItems = this.clipOutput;\n\t\t\t\t\tconst clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength === 0) continue;\n\t\t\t\t\tconst d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tconst d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tconst clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * stride);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += stride) {\n\t\t\t\t\t\tconst x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\t\tconst c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tconst a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tconst b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tconst c = 1 - a - b;\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t\tif (twoColor) {\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tconst clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tconst clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * stride);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\tif (!twoColor) {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = v2;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = v3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = v2;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 24] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 25] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 26] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 27] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 28] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 29] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 30] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 31] = v3;\n\t\t\t\t\t\tclippedVerticesItems[s + 32] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 33] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 34] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 35] = dark.a;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tconst clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn clipOutputItems != null;\n\t}\n\n\tpublic clipTrianglesUnpacked (vertices: NumberArrayLike, triangles: NumberArrayLike | Uint32Array, trianglesLength: number, uvs: NumberArrayLike) {\n\t\tconst clipOutput = this.clipOutput;\n\t\tlet clippedVertices = this._clippedVerticesTyped, clippedUVs = this._clippedUVsTyped, clippedTriangles = this._clippedTrianglesTyped;\n\t\t// biome-ignore lint/style/noNonNullAssertion: clipStart define it\n\t\tconst polygons = this.clippingPolygons!;\n\t\tconst polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tthis.clippedVerticesLength = 0;\n\t\tthis.clippedUVsLength = 0;\n\t\tthis.clippedTrianglesLength = 0;\n\n\t\tthis._clippedVerticesTyped;\n\t\tthis._clippedUVsTyped;\n\t\tthis._clippedTrianglesTyped;\n\n\t\tlet clipped = false;\n\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet v = triangles[i] << 1;\n\t\t\tconst x1 = vertices[v], y1 = vertices[v + 1];\n\t\t\tconst u1 = uvs[v], v1 = uvs[v + 1];\n\n\t\t\tv = triangles[i + 1] << 1;\n\t\t\tconst x2 = vertices[v], y2 = vertices[v + 1];\n\t\t\tconst u2 = uvs[v], v2 = uvs[v + 1];\n\n\t\t\tv = triangles[i + 2] << 1;\n\t\t\tconst x3 = vertices[v], y3 = vertices[v + 1];\n\t\t\tconst u3 = uvs[v], v3 = uvs[v + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = this.clippedVerticesLength;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tconst clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength === 0) continue;\n\t\t\t\t\tclipped = true;\n\t\t\t\t\tconst d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tconst d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tconst clipOutputItems = this.clipOutput;\n\n\t\t\t\t\tconst newLength = s + clipOutputCount * 2;\n\t\t\t\t\tif (clippedVertices.length < newLength) {\n\t\t\t\t\t\tthis._clippedVerticesTyped = new Float32Array(newLength * 2);\n\t\t\t\t\t\tthis._clippedVerticesTyped.set(clippedVertices.subarray(0, s));\n\t\t\t\t\t\tthis._clippedUVsTyped = new Float32Array(newLength * 2);\n\t\t\t\t\t\tthis._clippedUVsTyped.set(clippedUVs.subarray(0, s));\n\t\t\t\t\t\tclippedVertices = this._clippedVerticesTyped;\n\t\t\t\t\t\tclippedUVs = this._clippedUVsTyped;\n\t\t\t\t\t}\n\t\t\t\t\tconst clippedVerticesItems = clippedVertices;\n\t\t\t\t\tconst clippedUVsItems = clippedUVs;\n\t\t\t\t\tthis.clippedVerticesLength = newLength;\n\t\t\t\t\tthis.clippedUVsLength = newLength;\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tconst x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tconst c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tconst a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tconst b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tconst c = 1 - a - b;\n\t\t\t\t\t\tclippedUVsItems[s] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedUVsItems[s + 1] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = this.clippedTrianglesLength;\n\t\t\t\t\tconst newLengthTriangles = s + 3 * (clipOutputCount - 2)\n\t\t\t\t\tif (clippedTriangles.length < newLengthTriangles) {\n\t\t\t\t\t\tthis._clippedTrianglesTyped = new Uint32Array(newLengthTriangles * 2);\n\t\t\t\t\t\tthis._clippedTrianglesTyped.set(clippedTriangles.subarray(0, s));\n\t\t\t\t\t\tclippedTriangles = this._clippedTrianglesTyped;\n\t\t\t\t\t}\n\t\t\t\t\tthis.clippedTrianglesLength = newLengthTriangles;\n\t\t\t\t\tconst clippedTrianglesItems = clippedTriangles;\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlet newLength = s + 3 * 2;\n\t\t\t\t\tif (clippedVertices.length < newLength) {\n\t\t\t\t\t\tthis._clippedVerticesTyped = new Float32Array(newLength * 2);\n\t\t\t\t\t\tthis._clippedVerticesTyped.set(clippedVertices.subarray(0, s));\n\t\t\t\t\t\tclippedVertices = this._clippedVerticesTyped;\n\t\t\t\t\t}\n\t\t\t\t\tclippedVertices[s] = x1;\n\t\t\t\t\tclippedVertices[s + 1] = y1;\n\t\t\t\t\tclippedVertices[s + 2] = x2;\n\t\t\t\t\tclippedVertices[s + 3] = y2;\n\t\t\t\t\tclippedVertices[s + 4] = x3;\n\t\t\t\t\tclippedVertices[s + 5] = y3;\n\n\t\t\t\t\tif (clippedUVs.length < newLength) {\n\t\t\t\t\t\tthis._clippedUVsTyped = new Float32Array(newLength * 2);\n\t\t\t\t\t\tthis._clippedUVsTyped.set(clippedUVs.subarray(0, s));\n\t\t\t\t\t\tclippedUVs = this._clippedUVsTyped;\n\t\t\t\t\t}\n\t\t\t\t\tclippedUVs[s] = u1;\n\t\t\t\t\tclippedUVs[s + 1] = v1;\n\t\t\t\t\tclippedUVs[s + 2] = u2;\n\t\t\t\t\tclippedUVs[s + 3] = v2;\n\t\t\t\t\tclippedUVs[s + 4] = u3;\n\t\t\t\t\tclippedUVs[s + 5] = v3;\n\n\t\t\t\t\tthis.clippedVerticesLength = newLength;\n\t\t\t\t\tthis.clippedUVsLength = newLength;\n\n\t\t\t\t\ts = this.clippedTrianglesLength;\n\t\t\t\t\tnewLength = s + 3;\n\t\t\t\t\tif (clippedTriangles.length < newLength) {\n\t\t\t\t\t\tthis._clippedTrianglesTyped = new Uint32Array(newLength * 2);\n\t\t\t\t\t\tthis._clippedTrianglesTyped.set(clippedTriangles.subarray(0, s));\n\t\t\t\t\t\tclippedTriangles = this._clippedTrianglesTyped;\n\t\t\t\t\t}\n\n\t\t\t\t\tclippedTriangles[s] = index;\n\t\t\t\t\tclippedTriangles[s + 1] = (index + 1);\n\t\t\t\t\tclippedTriangles[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\n\t\t\t\t\tthis.clippedTrianglesLength = newLength;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.clippedVerticesTyped = this._clippedVerticesTyped.subarray(0, this.clippedVerticesLength)\n\t\tthis.clippedUVsTyped = this._clippedUVsTyped.subarray(0, this.clippedUVsLength)\n\t\tthis.clippedTrianglesTyped = this._clippedTrianglesTyped.subarray(0, this.clippedTrianglesLength)\n\t\treturn clipped;\n\t}\n\n\t/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping\n\t * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */\n\tprivate clip (x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array, output: Array) {\n\t\tconst originalOutput = output;\n\t\tlet clipped = false;\n\n\t\t// Avoid copy at the end.\n\t\tlet input: Array;\n\t\tif (clippingArea.length % 4 >= 2) {\n\t\t\tinput = output;\n\t\t\toutput = this.scratch;\n\t\t} else\n\t\t\tinput = this.scratch;\n\n\t\tinput.length = 0;\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\tinput.push(x2);\n\t\tinput.push(y2);\n\t\tinput.push(x3);\n\t\tinput.push(y3);\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\toutput.length = 0;\n\n\t\tconst clippingVerticesLast = clippingArea.length - 4;\n\t\tconst clippingVertices = clippingArea;\n\t\tfor (let i = 0; ; i += 2) {\n\t\t\tconst edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\n\t\t\tconst ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3];\n\n\t\t\tconst outputStart = output.length;\n\t\t\tconst inputVertices = input;\n\t\t\tfor (let ii = 0, nn = input.length - 2; ii < nn;) {\n\t\t\t\tconst inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\n\t\t\t\tii += 2;\n\t\t\t\tconst inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1];\n\t\t\t\tconst s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2);\n\t\t\t\tconst s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY);\n\t\t\t\tif (s1 > 0) {\n\t\t\t\t\tif (s2) { // v1 inside, v2 inside\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// v1 inside, v2 outside\n\t\t\t\t\tconst ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (s2) { // v1 outside, v2 inside\n\t\t\t\t\tconst ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclipped = true;\n\t\t\t}\n\n\t\t\tif (outputStart === output.length) { // All edges outside.\n\t\t\t\toriginalOutput.length = 0;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\toutput.push(output[0]);\n\t\t\toutput.push(output[1]);\n\n\t\t\tif (i === clippingVerticesLast) break;\n\t\t\tconst temp = output;\n\t\t\toutput = input;\n\t\t\toutput.length = 0;\n\t\t\tinput = temp;\n\t\t}\n\n\t\tif (originalOutput !== output) {\n\t\t\toriginalOutput.length = 0;\n\t\t\tfor (let i = 0, n = output.length - 2; i < n; i++)\n\t\t\t\toriginalOutput[i] = output[i];\n\t\t} else\n\t\t\toriginalOutput.length = originalOutput.length - 2;\n\n\t\treturn clipped;\n\t}\n\n\tpublic static makeClockwise (polygon: NumberArrayLike) {\n\t\tconst vertices = polygon;\n\t\tconst verticeslength = polygon.length;\n\n\t\tlet area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\n\t\tfor (let i = 0, n = verticeslength - 3; i < n; i += 2) {\n\t\t\tp1x = vertices[i];\n\t\t\tp1y = vertices[i + 1];\n\t\t\tp2x = vertices[i + 2];\n\t\t\tp2y = vertices[i + 3];\n\t\t\tarea += p1x * p2y - p2x * p1y;\n\t\t}\n\t\tif (area < 0) return;\n\n\t\tfor (let i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\n\t\t\tconst x = vertices[i], y = vertices[i + 1];\n\t\t\tconst other = lastX - i;\n\t\t\tvertices[i] = vertices[other];\n\t\t\tvertices[i + 1] = vertices[other + 1];\n\t\t\tvertices[other] = x;\n\t\t\tvertices[other + 1] = y;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AlphaTimeline, Animation, AttachmentTimeline, type BoneTimeline2, type CurveTimeline, type CurveTimeline1, DeformTimeline, DrawOrderTimeline, EventTimeline, IkConstraintTimeline, InheritTimeline, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintMixTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintWindTimeline, RGB2Timeline, RGBA2Timeline, RGBATimeline, RGBTimeline, RotateTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, SequenceTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, SliderMixTimeline, SliderTimeline, type Timeline, TransformConstraintTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline } from \"./Animation.js\";\nimport type { Attachment, VertexAttachment } from \"./attachments/Attachment.js\";\nimport type { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport type { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport type { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { Sequence, SequenceMode } from \"./attachments/Sequence.js\";\nimport { BoneData, Inherit } from \"./BoneData.js\";\nimport { Event } from \"./Event.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, RotateMode, SpacingMode } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SliderData } from \"./SliderData.js\";\nimport { BlendMode, SlotData } from \"./SlotData.js\";\nimport { type FromProperty, FromRotate, FromScaleX, FromScaleY, FromShearY, FromX, FromY, type ToProperty, ToRotate, ToScaleX, ToScaleY, ToShearY, ToX, ToY, TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Color, type NumberArrayLike, Utils } from \"./Utils.js\";\n\n/** Loads skeleton data in the Spine JSON format.\n *\n * See [Spine JSON format](http://esotericsoftware.com/spine-json-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonJson {\n\tattachmentLoader: AttachmentLoader;\n\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\tprivate readonly linkedMeshes = [] as LinkedMesh[];\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: it is any until we define a schema\n\treadSkeletonData (json: string | any): SkeletonData {\n\t\tconst scale = this.scale;\n\t\tconst skeletonData = new SkeletonData();\n\t\tconst root = typeof (json) === \"string\" ? JSON.parse(json) : json;\n\n\t\t// Skeleton\n\t\tconst skeletonMap = root.skeleton;\n\t\tif (skeletonMap) {\n\t\t\tskeletonData.hash = skeletonMap.hash;\n\t\t\tskeletonData.version = skeletonMap.spine;\n\t\t\tskeletonData.x = skeletonMap.x;\n\t\t\tskeletonData.y = skeletonMap.y;\n\t\t\tskeletonData.width = skeletonMap.width;\n\t\t\tskeletonData.height = skeletonMap.height;\n\t\t\tskeletonData.referenceScale = getValue(skeletonMap, \"referenceScale\", 100) * scale;\n\t\t\tskeletonData.fps = skeletonMap.fps;\n\t\t\tskeletonData.imagesPath = skeletonMap.images ?? null;\n\t\t\tskeletonData.audioPath = skeletonMap.audio ?? null;\n\t\t}\n\n\t\t// Bones\n\t\tif (root.bones) {\n\t\t\tfor (let i = 0; i < root.bones.length; i++) {\n\t\t\t\tconst boneMap = root.bones[i];\n\n\t\t\t\tlet parent: BoneData | null = null;\n\t\t\t\tconst parentName: string = getValue(boneMap, \"parent\", null);\n\t\t\t\tif (parentName) parent = skeletonData.findBone(parentName);\n\t\t\t\tconst data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\n\t\t\t\tdata.length = getValue(boneMap, \"length\", 0) * scale;\n\t\t\t\tconst setup = data.setup;\n\t\t\t\tsetup.x = getValue(boneMap, \"x\", 0) * scale;\n\t\t\t\tsetup.y = getValue(boneMap, \"y\", 0) * scale;\n\t\t\t\tsetup.rotation = getValue(boneMap, \"rotation\", 0);\n\t\t\t\tsetup.scaleX = getValue(boneMap, \"scaleX\", 1);\n\t\t\t\tsetup.scaleY = getValue(boneMap, \"scaleY\", 1);\n\t\t\t\tsetup.shearX = getValue(boneMap, \"shearX\", 0);\n\t\t\t\tsetup.shearY = getValue(boneMap, \"shearY\", 0);\n\t\t\t\tsetup.inherit = Utils.enumValue(Inherit, getValue(boneMap, \"inherit\", \"Normal\"));\n\t\t\t\tdata.skinRequired = getValue(boneMap, \"skin\", false);\n\n\t\t\t\tconst color = getValue(boneMap, \"color\", null);\n\t\t\t\tif (color) data.color.setFromString(color);\n\n\t\t\t\tskeletonData.bones.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Slots.\n\t\tif (root.slots) {\n\t\t\tfor (let i = 0; i < root.slots.length; i++) {\n\t\t\t\tconst slotMap = root.slots[i];\n\t\t\t\tconst slotName = slotMap.name;\n\n\t\t\t\tconst boneData = skeletonData.findBone(slotMap.bone);\n\t\t\t\tif (!boneData) throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`);\n\t\t\t\tconst data = new SlotData(skeletonData.slots.length, slotName, boneData);\n\n\t\t\t\tconst color: string = getValue(slotMap, \"color\", null);\n\t\t\t\tif (color) data.setup.color.setFromString(color);\n\n\t\t\t\tconst dark: string = getValue(slotMap, \"dark\", null);\n\t\t\t\tif (dark) data.setup.darkColor = Color.fromString(dark);\n\n\t\t\t\tdata.attachmentName = getValue(slotMap, \"attachment\", null);\n\t\t\t\tdata.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, \"blend\", \"normal\"));\n\t\t\t\tdata.visible = getValue(slotMap, \"visible\", true);\n\t\t\t\tskeletonData.slots.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Constraints.\n\t\tif (root.constraints) {\n\t\t\tfor (const constraintMap of root.constraints) {\n\t\t\t\tconst name = constraintMap.name;\n\t\t\t\tconst skinRequired = getValue(constraintMap, \"skin\", false);\n\t\t\t\tswitch (getValue(constraintMap, \"type\", false)) {\n\t\t\t\t\tcase \"ik\": {\n\t\t\t\t\t\tconst data = new IkConstraintData(name);\n\t\t\t\t\t\tdata.skinRequired = skinRequired;\n\n\t\t\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\t\t\tconst bone = skeletonData.findBone(constraintMap.bones[ii]);\n\t\t\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${constraintMap.bones[ii]} for IK constraint ${name}.`);\n\t\t\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst targetName = constraintMap.target;\n\t\t\t\t\t\tconst target = skeletonData.findBone(targetName);\n\t\t\t\t\t\tif (!target) throw new Error(`Couldn't find target bone ${targetName} for IK constraint ${name}.`);\n\t\t\t\t\t\tdata.target = target;\n\n\t\t\t\t\t\tdata.uniform = getValue(constraintMap, \"uniform\", false);\n\t\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\t\tsetup.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\t\t\tsetup.softness = getValue(constraintMap, \"softness\", 0) * scale;\n\t\t\t\t\t\tsetup.bendDirection = getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\n\t\t\t\t\t\tsetup.compress = getValue(constraintMap, \"compress\", false);\n\t\t\t\t\t\tsetup.stretch = getValue(constraintMap, \"stretch\", false);\n\n\t\t\t\t\t\tskeletonData.constraints.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"transform\": {\n\t\t\t\t\t\tconst data = new TransformConstraintData(name);\n\t\t\t\t\t\tdata.skinRequired = skinRequired;\n\n\t\t\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\t\t\tconst boneName = constraintMap.bones[ii];\n\t\t\t\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst sourceName: string = constraintMap.source;\n\t\t\t\t\t\tconst source = skeletonData.findBone(sourceName);\n\t\t\t\t\t\tif (!source) throw new Error(`Couldn't find source bone ${sourceName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\t\t\tdata.source = source;\n\n\t\t\t\t\t\tdata.localSource = getValue(constraintMap, \"localSource\", false);\n\t\t\t\t\t\tdata.localTarget = getValue(constraintMap, \"localTarget\", false);\n\t\t\t\t\t\tdata.additive = getValue(constraintMap, \"additive\", false);\n\t\t\t\t\t\tdata.clamp = getValue(constraintMap, \"clamp\", false);\n\n\t\t\t\t\t\tlet rotate = false, x = false, y = false, scaleX = false, scaleY = false, shearY = false;\n\t\t\t\t\t\tconst fromEntries = Object.entries(getValue(constraintMap, \"properties\", {})) as [string, object][];\n\t\t\t\t\t\tfor (const [name, fromEntry] of fromEntries) {\n\t\t\t\t\t\t\tconst from = this.fromProperty(name);\n\t\t\t\t\t\t\tconst fromScale = this.propertyScale(name, scale);\n\t\t\t\t\t\t\tfrom.offset = getValue(fromEntry, \"offset\", 0) * fromScale;\n\t\t\t\t\t\t\tconst toEntries = Object.entries(getValue(fromEntry, \"to\", {})) as [string, object][];\n\t\t\t\t\t\t\tfor (const [name, toEntry] of toEntries) {\n\t\t\t\t\t\t\t\tlet toScale = 1;\n\t\t\t\t\t\t\t\tlet to: ToProperty;\n\t\t\t\t\t\t\t\tswitch (name) {\n\t\t\t\t\t\t\t\t\tcase \"rotate\": {\n\t\t\t\t\t\t\t\t\t\trotate = true;\n\t\t\t\t\t\t\t\t\t\tto = new ToRotate();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase \"x\": {\n\t\t\t\t\t\t\t\t\t\tx = true;\n\t\t\t\t\t\t\t\t\t\tto = new ToX();\n\t\t\t\t\t\t\t\t\t\ttoScale = scale;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase \"y\": {\n\t\t\t\t\t\t\t\t\t\ty = true;\n\t\t\t\t\t\t\t\t\t\tto = new ToY();\n\t\t\t\t\t\t\t\t\t\ttoScale = scale;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase \"scaleX\": {\n\t\t\t\t\t\t\t\t\t\tscaleX = true;\n\t\t\t\t\t\t\t\t\t\tto = new ToScaleX();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase \"scaleY\": {\n\t\t\t\t\t\t\t\t\t\tscaleY = true;\n\t\t\t\t\t\t\t\t\t\tto = new ToScaleY();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcase \"shearY\": {\n\t\t\t\t\t\t\t\t\t\tshearY = true;\n\t\t\t\t\t\t\t\t\t\tto = new ToShearY();\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tdefault: throw new Error(`Invalid transform constraint to property: ${name}`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tto.offset = getValue(toEntry, \"offset\", 0) * toScale;\n\t\t\t\t\t\t\t\tto.max = getValue(toEntry, \"max\", 1) * toScale;\n\t\t\t\t\t\t\t\tto.scale = getValue(toEntry, \"scale\", 1) * toScale / fromScale;\n\t\t\t\t\t\t\t\tfrom.to.push(to);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (from.to.length > 0) data.properties.push(from);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata.offsets[TransformConstraintData.ROTATION] = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\t\t\tdata.offsets[TransformConstraintData.X] = getValue(constraintMap, \"x\", 0) * scale;\n\t\t\t\t\t\tdata.offsets[TransformConstraintData.Y] = getValue(constraintMap, \"y\", 0) * scale;\n\t\t\t\t\t\tdata.offsets[TransformConstraintData.SCALEX] = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\t\t\tdata.offsets[TransformConstraintData.SCALEY] = getValue(constraintMap, \"scaleY\", 0);\n\t\t\t\t\t\tdata.offsets[TransformConstraintData.SHEARY] = getValue(constraintMap, \"shearY\", 0);\n\n\t\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\t\tif (rotate) setup.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\t\t\tif (x) setup.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\t\t\tif (y) setup.mixY = getValue(constraintMap, \"mixY\", setup.mixX);\n\t\t\t\t\t\tif (scaleX) setup.mixScaleX = getValue(constraintMap, \"mixScaleX\", 1);\n\t\t\t\t\t\tif (scaleY) setup.mixScaleY = getValue(constraintMap, \"mixScaleY\", setup.mixScaleX);\n\t\t\t\t\t\tif (shearY) setup.mixShearY = getValue(constraintMap, \"mixShearY\", 1);\n\n\t\t\t\t\t\tskeletonData.constraints.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"path\": {\n\t\t\t\t\t\tconst data = new PathConstraintData(name);\n\t\t\t\t\t\tdata.skinRequired = skinRequired;\n\n\t\t\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\t\t\tconst boneName = constraintMap.bones[ii];\n\t\t\t\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for path constraint ${constraintMap.name}.`);\n\t\t\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst slotName: string = constraintMap.slot;\n\t\t\t\t\t\tconst slot = skeletonData.findSlot(slotName);\n\t\t\t\t\t\tif (!slot) throw new Error(`Couldn't find slot ${slotName} for path constraint ${constraintMap.name}.`);\n\t\t\t\t\t\tdata.slot = slot;\n\n\t\t\t\t\t\tdata.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, \"positionMode\", \"Percent\"));\n\t\t\t\t\t\tdata.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, \"spacingMode\", \"Length\"));\n\t\t\t\t\t\tdata.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, \"rotateMode\", \"Tangent\"));\n\t\t\t\t\t\tdata.offsetRotation = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\t\tsetup.position = getValue(constraintMap, \"position\", 0);\n\t\t\t\t\t\tif (data.positionMode === PositionMode.Fixed) setup.position *= scale;\n\t\t\t\t\t\tsetup.spacing = getValue(constraintMap, \"spacing\", 0);\n\t\t\t\t\t\tif (data.spacingMode === SpacingMode.Length || data.spacingMode === SpacingMode.Fixed) setup.spacing *= scale;\n\t\t\t\t\t\tsetup.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\t\t\tsetup.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\t\t\tsetup.mixY = getValue(constraintMap, \"mixY\", setup.mixX);\n\n\t\t\t\t\t\tskeletonData.constraints.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"physics\": {\n\t\t\t\t\t\tconst data = new PhysicsConstraintData(name);\n\t\t\t\t\t\tdata.skinRequired = skinRequired;\n\n\t\t\t\t\t\tconst boneName: string = constraintMap.bone;\n\t\t\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\tif (bone == null) throw new Error(`Physics bone not found: ${boneName}`);\n\t\t\t\t\t\tdata.bone = bone;\n\n\t\t\t\t\t\tdata.x = getValue(constraintMap, \"x\", 0);\n\t\t\t\t\t\tdata.y = getValue(constraintMap, \"y\", 0);\n\t\t\t\t\t\tdata.rotate = getValue(constraintMap, \"rotate\", 0);\n\t\t\t\t\t\tdata.scaleX = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\t\t\tdata.shearX = getValue(constraintMap, \"shearX\", 0);\n\t\t\t\t\t\tdata.limit = getValue(constraintMap, \"limit\", 5000) * scale;\n\t\t\t\t\t\tdata.step = 1 / getValue(constraintMap, \"fps\", 60);\n\t\t\t\t\t\tconst setup = data.setup;\n\t\t\t\t\t\tsetup.inertia = getValue(constraintMap, \"inertia\", 0.5);\n\t\t\t\t\t\tsetup.strength = getValue(constraintMap, \"strength\", 100);\n\t\t\t\t\t\tsetup.damping = getValue(constraintMap, \"damping\", 0.85);\n\t\t\t\t\t\tsetup.massInverse = 1 / getValue(constraintMap, \"mass\", 1);\n\t\t\t\t\t\tsetup.wind = getValue(constraintMap, \"wind\", 0);\n\t\t\t\t\t\tsetup.gravity = getValue(constraintMap, \"gravity\", 0);\n\t\t\t\t\t\tsetup.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\t\t\tdata.inertiaGlobal = getValue(constraintMap, \"inertiaGlobal\", false);\n\t\t\t\t\t\tdata.strengthGlobal = getValue(constraintMap, \"strengthGlobal\", false);\n\t\t\t\t\t\tdata.dampingGlobal = getValue(constraintMap, \"dampingGlobal\", false);\n\t\t\t\t\t\tdata.massGlobal = getValue(constraintMap, \"massGlobal\", false);\n\t\t\t\t\t\tdata.windGlobal = getValue(constraintMap, \"windGlobal\", false);\n\t\t\t\t\t\tdata.gravityGlobal = getValue(constraintMap, \"gravityGlobal\", false);\n\t\t\t\t\t\tdata.mixGlobal = getValue(constraintMap, \"mixGlobal\", false);\n\n\t\t\t\t\t\tskeletonData.constraints.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"slider\": {\n\t\t\t\t\t\tconst data = new SliderData(name);\n\t\t\t\t\t\tdata.skinRequired = skinRequired;\n\n\t\t\t\t\t\tdata.additive = getValue(constraintMap, \"additive\", false);\n\t\t\t\t\t\tdata.loop = getValue(constraintMap, \"loop\", false);\n\t\t\t\t\t\tdata.setup.time = getValue(constraintMap, \"time\", 0);\n\t\t\t\t\t\tdata.setup.mix = getValue(constraintMap, \"mix\", 1);\n\n\t\t\t\t\t\tconst boneName: string = constraintMap.bone;\n\t\t\t\t\t\tif (boneName) {\n\t\t\t\t\t\t\tdata.bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\t\tif (!data.bone) throw new Error(`Slider bone not found: ${boneName}`);\n\t\t\t\t\t\t\tconst property = constraintMap.property;\n\t\t\t\t\t\t\tdata.property = this.fromProperty(property);\n\t\t\t\t\t\t\tconst propertyScale = this.propertyScale(property, scale);\n\t\t\t\t\t\t\tdata.property.offset = getValue(constraintMap, \"from\", 0) * propertyScale;\n\t\t\t\t\t\t\tdata.offset = getValue(constraintMap, \"to\", 0);\n\t\t\t\t\t\t\tdata.scale = getValue(constraintMap, \"scale\", 1) / propertyScale;\n\t\t\t\t\t\t\tdata.local = getValue(constraintMap, \"local\", false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tskeletonData.constraints.push(data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Skins.\n\t\tif (root.skins) {\n\t\t\tfor (let i = 0; i < root.skins.length; i++) {\n\t\t\t\tconst skinMap = root.skins[i]\n\t\t\t\tconst skin = new Skin(skinMap.name);\n\n\t\t\t\tif (skinMap.bones) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.bones.length; ii++) {\n\t\t\t\t\t\tconst boneName = skinMap.bones[ii];\n\t\t\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.bones.push(bone);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.ik) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.ik.length; ii++) {\n\t\t\t\t\t\tconst constraintName = skinMap.ik[ii];\n\t\t\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, IkConstraintData);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find IK constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.transform) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.transform.length; ii++) {\n\t\t\t\t\t\tconst constraintName = skinMap.transform[ii];\n\t\t\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, TransformConstraintData);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find transform constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.path) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.path.length; ii++) {\n\t\t\t\t\t\tconst constraintName = skinMap.path[ii];\n\t\t\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, PathConstraintData);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find path constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.physics) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.physics.length; ii++) {\n\t\t\t\t\t\tconst constraintName = skinMap.physics[ii];\n\t\t\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, PhysicsConstraintData);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find physics constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.slider) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.slider.length; ii++) {\n\t\t\t\t\t\tconst constraintName = skinMap.slider[ii];\n\t\t\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, SliderData);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find slider constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const slotName in skinMap.attachments) {\n\t\t\t\t\tconst slot = skeletonData.findSlot(slotName);\n\t\t\t\t\tif (!slot) throw new Error(`Couldn't find slot ${slotName} for skin ${skinMap.name}.`);\n\t\t\t\t\tconst slotMap = skinMap.attachments[slotName];\n\t\t\t\t\tfor (const entryName in slotMap) {\n\t\t\t\t\t\tconst attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\n\t\t\t\t\t\tif (attachment) skin.setAttachment(slot.index, entryName, attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tskeletonData.skins.push(skin);\n\t\t\t\tif (skin.name === \"default\") skeletonData.defaultSkin = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tfor (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\n\t\t\tconst linkedMesh = this.linkedMeshes[i];\n\t\t\tconst skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n\t\t\tif (!skin) throw new Error(`Skin not found: ${linkedMesh.skin}`);\n\t\t\tconst parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(parent);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tif (root.events) {\n\t\t\tfor (const eventName in root.events) {\n\t\t\t\tconst eventMap = root.events[eventName];\n\t\t\t\tconst data = new EventData(eventName);\n\t\t\t\tdata.intValue = getValue(eventMap, \"int\", 0);\n\t\t\t\tdata.floatValue = getValue(eventMap, \"float\", 0);\n\t\t\t\tdata.stringValue = getValue(eventMap, \"string\", \"\");\n\t\t\t\tdata.audioPath = getValue(eventMap, \"audio\", null);\n\t\t\t\tif (data.audioPath) {\n\t\t\t\t\tdata.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tdata.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\tskeletonData.events.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Animations.\n\t\tif (root.animations) {\n\t\t\tfor (const animationName in root.animations) {\n\t\t\t\tconst animationMap = root.animations[animationName];\n\t\t\t\tthis.readAnimation(animationMap, animationName, skeletonData);\n\t\t\t}\n\t\t}\n\n\t\t// Slider animations.\n\t\tif (root.constraints) {\n\t\t\tfor (const animationName in root.constraints) {\n\t\t\t\tconst animationMap = root.constraints[animationName];\n\t\t\t\tif (animationMap.type === \"slider\") {\n\t\t\t\t\tconst data = skeletonData.findConstraint(animationMap.name, SliderData)\n\t\t\t\t\tconst animationName = animationMap.animation;\n\t\t\t\t\tconst animation = skeletonData.findAnimation(animationName);\n\t\t\t\t\tif (!animation) throw new Error(`Slider animation not found: ${animationName}`);\n\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: reference runtime\n\t\t\t\t\tdata!.animation = animation;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn skeletonData;\n\t}\n\n\tprivate fromProperty (type: string): FromProperty {\n\t\tlet from: FromProperty;\n\t\tswitch (type) {\n\t\t\tcase \"rotate\": from = new FromRotate(); break;\n\t\t\tcase \"x\": from = new FromX(); break;\n\t\t\tcase \"y\": from = new FromY(); break;\n\t\t\tcase \"scaleX\": from = new FromScaleX(); break;\n\t\t\tcase \"scaleY\": from = new FromScaleY(); break;\n\t\t\tcase \"shearY\": from = new FromShearY(); break;\n\t\t\tdefault: throw new Error(`Invalid transform constraint from property: ${type}`);\n\t\t}\n\t\treturn from;\n\t}\n\n\tprivate propertyScale (type: string, scale: number) {\n\t\tswitch (type) {\n\t\t\tcase \"x\":\n\t\t\tcase \"y\": return scale;\n\t\t\tdefault: return 1;\n\t\t}\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: it is any until we define a schema\n\treadAttachment (map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment | null {\n\t\tconst scale = this.scale;\n\t\tname = getValue(map, \"name\", name);\n\n\t\tswitch (getValue(map, \"type\", \"region\")) {\n\t\t\tcase \"region\": {\n\t\t\t\tconst path = getValue(map, \"path\", name);\n\t\t\t\tconst sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tconst region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tregion.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tregion.scaleX = getValue(map, \"scaleX\", 1);\n\t\t\t\tregion.scaleY = getValue(map, \"scaleY\", 1);\n\t\t\t\tregion.rotation = getValue(map, \"rotation\", 0);\n\t\t\t\tregion.width = map.width * scale;\n\t\t\t\tregion.height = map.height * scale;\n\t\t\t\tregion.sequence = sequence;\n\n\t\t\t\tconst color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) region.color.setFromString(color);\n\n\t\t\t\tif (region.region != null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase \"boundingbox\": {\n\t\t\t\tconst box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tthis.readVertices(map, box, map.vertexCount << 1);\n\t\t\t\tconst color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) box.color.setFromString(color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase \"mesh\":\n\t\t\tcase \"linkedmesh\": {\n\t\t\t\tconst path = getValue(map, \"path\", name);\n\t\t\t\tconst sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tconst mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\n\t\t\t\tconst color = getValue(map, \"color\", null);\n\t\t\t\tif (color) mesh.color.setFromString(color);\n\n\t\t\t\tmesh.width = getValue(map, \"width\", 0) * scale;\n\t\t\t\tmesh.height = getValue(map, \"height\", 0) * scale;\n\t\t\t\tmesh.sequence = sequence;\n\n\t\t\t\tconst parent: string = getValue(map, \"parent\", null);\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, getValue(map, \"skin\", null), slotIndex, parent, getValue(map, \"timelines\", true)));\n\t\t\t\t\treturn mesh;\n\t\t\t\t}\n\n\t\t\t\tconst uvs: Array = map.uvs;\n\t\t\t\tthis.readVertices(map, mesh, uvs.length);\n\t\t\t\tmesh.triangles = map.triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (mesh.region != null) mesh.updateRegion();\n\n\t\t\t\tmesh.edges = getValue(map, \"edges\", null);\n\t\t\t\tmesh.hullLength = getValue(map, \"hull\", 0) * 2;\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase \"path\": {\n\t\t\t\tconst path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = getValue(map, \"closed\", false);\n\t\t\t\tpath.constantSpeed = getValue(map, \"constantSpeed\", true);\n\n\t\t\t\tconst vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, path, vertexCount << 1);\n\n\t\t\t\tconst lengths: Array = Utils.newArray(vertexCount / 3, 0);\n\t\t\t\tfor (let i = 0; i < map.lengths.length; i++)\n\t\t\t\t\tlengths[i] = map.lengths[i] * scale;\n\t\t\t\tpath.lengths = lengths;\n\n\t\t\t\tconst color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) path.color.setFromString(color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase \"point\": {\n\t\t\t\tconst point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tpoint.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tpoint.rotation = getValue(map, \"rotation\", 0);\n\n\t\t\t\tconst color = getValue(map, \"color\", null);\n\t\t\t\tif (color) point.color.setFromString(color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase \"clipping\": {\n\t\t\t\tconst clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\n\t\t\t\tconst end = getValue(map, \"end\", null);\n\t\t\t\tif (end) clip.endSlot = skeletonData.findSlot(end);\n\n\t\t\t\tconst vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, clip, vertexCount << 1);\n\n\t\t\t\tconst color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) clip.color.setFromString(color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\treadSequence (map: object) {\n\t\tif (map == null) return null;\n\t\tconst sequence = new Sequence(getValue(map, \"count\", 0));\n\t\tsequence.start = getValue(map, \"start\", 1);\n\t\tsequence.digits = getValue(map, \"digits\", 0);\n\t\tsequence.setupIndex = getValue(map, \"setup\", 0);\n\t\treturn sequence;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: it is any until we define a schema\n\treadVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\n\t\tconst scale = this.scale;\n\t\tattachment.worldVerticesLength = verticesLength;\n\t\tconst vertices: Array = map.vertices;\n\t\tif (verticesLength === vertices.length) {\n\t\t\tconst scaledVertices = Utils.toFloatArray(vertices);\n\t\t\tif (scale !== 1) {\n\t\t\t\tfor (let i = 0, n = vertices.length; i < n; i++)\n\t\t\t\t\tscaledVertices[i] *= scale;\n\t\t\t}\n\t\t\tattachment.vertices = scaledVertices;\n\t\t\treturn;\n\t\t}\n\t\tconst weights: number[] = [];\n\t\tconst bones: number[] = [];\n\t\tfor (let i = 0, n = vertices.length; i < n;) {\n\t\t\tconst boneCount = vertices[i++];\n\t\t\tbones.push(boneCount);\n\t\t\tfor (let nn = i + boneCount * 4; i < nn; i += 4) {\n\t\t\t\tbones.push(vertices[i]);\n\t\t\t\tweights.push(vertices[i + 1] * scale);\n\t\t\t\tweights.push(vertices[i + 2] * scale);\n\t\t\t\tweights.push(vertices[i + 3]);\n\t\t\t}\n\t\t}\n\t\tattachment.bones = bones;\n\t\tattachment.vertices = Utils.toFloatArray(weights);\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: it is any untile we define a schema\n\treadAnimation (map: any, name: string, skeletonData: SkeletonData) {\n\t\tconst scale = this.scale;\n\t\tconst timelines: Timeline[] = [];\n\n\t\t// Slot timelines.\n\t\tif (map.slots) {\n\t\t\tfor (const slotName in map.slots) {\n\t\t\t\tconst slotMap = map.slots[slotName];\n\t\t\t\tconst slot = skeletonData.findSlot(slotName);\n\t\t\t\tif (!slot) throw new Error(`Slot not found: ${slotName}`);\n\t\t\t\tconst slotIndex = slot.index;\n\t\t\t\tfor (const timelineName in slotMap) {\n\t\t\t\t\tconst timelineMap = slotMap[timelineName];\n\t\t\t\t\tif (!timelineMap) continue;\n\t\t\t\t\tconst frames = timelineMap.length;\n\n\t\t\t\t\tswitch (timelineName) {\n\t\t\t\t\t\tcase \"attachment\": {\n\t\t\t\t\t\t\tconst timeline = new AttachmentTimeline(frames, slotIndex);\n\t\t\t\t\t\t\tfor (let frame = 0; frame < frames; frame++) {\n\t\t\t\t\t\t\t\tconst keyMap = timelineMap[frame];\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(keyMap, \"time\", 0), getValue(keyMap, \"name\", null));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"rgba\": {\n\t\t\t\t\t\t\tconst timeline = new RGBATimeline(frames, frames << 2, slotIndex);\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a);\n\t\t\t\t\t\t\t\tconst nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\tconst newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"rgb\": {\n\t\t\t\t\t\t\tconst timeline = new RGBTimeline(frames, frames * 3, slotIndex);\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b);\n\t\t\t\t\t\t\t\tconst nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\tconst newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"alpha\": {\n\t\t\t\t\t\t\treadTimeline1(timelines, timelineMap, new AlphaTimeline(frames, frames, slotIndex), 0, 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"rgba2\": {\n\t\t\t\t\t\t\tconst timeline = new RGBA2Timeline(frames, frames * 7, slotIndex);\n\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\t\tconst nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\tconst newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\t\tconst newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"rgb2\": {\n\t\t\t\t\t\t\tconst timeline = new RGB2Timeline(frames, frames * 6, slotIndex);\n\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\t\tconst nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\tconst newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\t\tconst newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new Error(`Invalid timeline type for a slot: ${timelineMap.name} (${slotMap.name})`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tif (map.bones) {\n\t\t\tfor (const boneName in map.bones) {\n\t\t\t\tconst boneMap = map.bones[boneName];\n\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\tif (!bone) throw new Error(`Bone not found: ${boneName}`);\n\t\t\t\tconst boneIndex = bone.index;\n\t\t\t\tfor (const timelineName in boneMap) {\n\t\t\t\t\tconst timelineMap = boneMap[timelineName];\n\t\t\t\t\tconst frames = timelineMap.length;\n\t\t\t\t\tif (frames === 0) continue;\n\n\t\t\t\t\tswitch (timelineName) {\n\t\t\t\t\t\tcase \"rotate\": readTimeline1(timelines, timelineMap, new RotateTimeline(frames, frames, boneIndex), 0, 1); break;\n\t\t\t\t\t\tcase \"translate\": readTimeline2(timelines, timelineMap, new TranslateTimeline(frames, frames << 1, boneIndex), \"x\", \"y\", 0, scale); break;\n\t\t\t\t\t\tcase \"translatex\": readTimeline1(timelines, timelineMap, new TranslateXTimeline(frames, frames, boneIndex), 0, scale); break;\n\t\t\t\t\t\tcase \"translatey\": readTimeline1(timelines, timelineMap, new TranslateYTimeline(frames, frames, boneIndex), 0, scale); break;\n\t\t\t\t\t\tcase \"scale\": readTimeline2(timelines, timelineMap, new ScaleTimeline(frames, frames << 1, boneIndex), \"x\", \"y\", 1, 1); break;\n\t\t\t\t\t\tcase \"scalex\": readTimeline1(timelines, timelineMap, new ScaleXTimeline(frames, frames, boneIndex), 1, 1); break;\n\t\t\t\t\t\tcase \"scaley\": readTimeline1(timelines, timelineMap, new ScaleYTimeline(frames, frames, boneIndex), 1, 1); break;\n\t\t\t\t\t\tcase \"shear\": readTimeline2(timelines, timelineMap, new ShearTimeline(frames, frames << 1, boneIndex), \"x\", \"y\", 0, 1); break;\n\t\t\t\t\t\tcase \"shearx\": readTimeline1(timelines, timelineMap, new ShearXTimeline(frames, frames, boneIndex), 0, 1); break;\n\t\t\t\t\t\tcase \"sheary\": readTimeline1(timelines, timelineMap, new ShearYTimeline(frames, frames, boneIndex), 0, 1); break;\n\t\t\t\t\t\tcase \"inherit\": {\n\t\t\t\t\t\t\tconst timeline = new InheritTimeline(frames, bone.index);\n\t\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\t\tconst aFrame = timelineMap[frame];\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(aFrame, \"time\", 0), Utils.enumValue(Inherit, getValue(aFrame, \"inherit\", \"Normal\")));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new Error(`Invalid timeline type for a bone: ${timelineMap.name} (${boneMap.name})`);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tif (map.ik) {\n\t\t\tfor (const constraintName in map.ik) {\n\t\t\t\tconst constraintMap = map.ik[constraintName];\n\t\t\t\tlet keyMap = constraintMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, IkConstraintData);\n\t\t\t\tif (!constraint) throw new Error(`IK Constraint not found: ${constraintName}`);\n\t\t\t\tconst timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1,\n\t\t\t\t\tskeletonData.constraints.indexOf(constraint));\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mix = getValue(keyMap, \"mix\", 1);\n\t\t\t\tlet softness = getValue(keyMap, \"softness\", 0) * scale;\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mix, softness, getValue(keyMap, \"bendPositive\", true) ? 1 : -1, getValue(keyMap, \"compress\", false), getValue(keyMap, \"stretch\", false));\n\t\t\t\t\tconst nextMap = constraintMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tconst mix2 = getValue(nextMap, \"mix\", 1);\n\t\t\t\t\tconst softness2 = getValue(nextMap, \"softness\", 0) * scale;\n\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmix = mix2;\n\t\t\t\t\tsoftness = softness2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tif (map.transform) {\n\t\t\tfor (const constraintName in map.transform) {\n\t\t\t\tconst timelineMap = map.transform[constraintName];\n\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, TransformConstraintData);\n\t\t\t\tif (!constraint) throw new Error(`Transform constraint not found: ${constraintName}`);\n\t\t\t\tconst timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6,\n\t\t\t\t\tskeletonData.constraints.indexOf(constraint));\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1), mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\tlet mixScaleX = getValue(keyMap, \"mixScaleX\", 1), mixScaleY = getValue(keyMap, \"mixScaleY\", 1);\n\t\t\t\tconst mixShearY = getValue(keyMap, \"mixShearY\", 1);\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\t\tconst nextMap = timelineMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tconst mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\tconst mixX2 = getValue(nextMap, \"mixX\", 1), mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\tconst mixScaleX2 = getValue(nextMap, \"mixScaleX\", 1), mixScaleY2 = getValue(nextMap, \"mixScaleY\", 1);\n\t\t\t\t\tconst mixShearY2 = getValue(nextMap, \"mixShearY\", 1);\n\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tif (map.path) {\n\t\t\tfor (const constraintName in map.path) {\n\t\t\t\tconst constraintMap = map.path[constraintName];\n\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, PathConstraintData);\n\t\t\t\tif (!constraint) throw new Error(`Path constraint not found: ${constraintName}`);\n\t\t\t\tconst index = skeletonData.constraints.indexOf(constraint);\n\t\t\t\tfor (const timelineName in constraintMap) {\n\t\t\t\t\tconst timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tconst frames = timelineMap.length;\n\t\t\t\t\tswitch (timelineName) {\n\t\t\t\t\t\tcase \"position\": {\n\t\t\t\t\t\t\tconst timeline = new PathConstraintPositionTimeline(frames, frames, index);\n\t\t\t\t\t\t\treadTimeline1(timelines, timelineMap, timeline, 0, constraint.positionMode === PositionMode.Fixed ? scale : 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"spacing\": {\n\t\t\t\t\t\t\tconst timeline = new PathConstraintSpacingTimeline(frames, frames, index);\n\t\t\t\t\t\t\treadTimeline1(timelines, timelineMap, timeline, 0, constraint.spacingMode === SpacingMode.Length || constraint.spacingMode === SpacingMode.Fixed ? scale : 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"mix\": {\n\t\t\t\t\t\t\tconst timeline = new PathConstraintMixTimeline(frames, frames * 3, index);\n\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1);\n\t\t\t\t\t\t\tlet mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\t\tconst nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\tconst mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\t\t\t\tconst mixX2 = getValue(nextMap, \"mixX\", 1);\n\t\t\t\t\t\t\t\tconst mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics constraint timelines.\n\t\tif (map.physics) {\n\t\t\tfor (const constraintName in map.physics) {\n\t\t\t\tconst constraintMap = map.physics[constraintName];\n\t\t\t\tlet index = -1;\n\t\t\t\tif (constraintName.length > 0) {\n\t\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, PhysicsConstraintData);\n\t\t\t\t\tif (!constraint) throw new Error(`Physics constraint not found: ${constraintName}`);\n\t\t\t\t\tindex = skeletonData.constraints.indexOf(constraint);\n\t\t\t\t}\n\t\t\t\tfor (const timelineName in constraintMap) {\n\t\t\t\t\tconst timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tconst frames = timelineMap.length;\n\t\t\t\t\tlet timeline: CurveTimeline1;\n\t\t\t\t\tlet defaultValue = 0;\n\t\t\t\t\tif (timelineName === \"reset\") {\n\t\t\t\t\t\tconst resetTimeline = new PhysicsConstraintResetTimeline(frames, index);\n\t\t\t\t\t\tfor (let frame = 0; keyMap != null; keyMap = timelineMap[frame + 1], frame++)\n\t\t\t\t\t\t\tresetTimeline.setFrame(frame, getValue(keyMap, \"time\", 0));\n\t\t\t\t\t\ttimelines.push(resetTimeline);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (timelineName) {\n\t\t\t\t\t\tcase \"inertia\": timeline = new PhysicsConstraintInertiaTimeline(frames, frames, index); break;\n\t\t\t\t\t\tcase \"strength\": timeline = new PhysicsConstraintStrengthTimeline(frames, frames, index); break;\n\t\t\t\t\t\tcase \"damping\": timeline = new PhysicsConstraintDampingTimeline(frames, frames, index); break;\n\t\t\t\t\t\tcase \"mass\": timeline = new PhysicsConstraintMassTimeline(frames, frames, index); break;\n\t\t\t\t\t\tcase \"wind\": timeline = new PhysicsConstraintWindTimeline(frames, frames, index); break;\n\t\t\t\t\t\tcase \"gravity\": timeline = new PhysicsConstraintGravityTimeline(frames, frames, index); break;\n\t\t\t\t\t\tcase \"mix\": {\n\t\t\t\t\t\t\tdefaultValue = 1;\n\t\t\t\t\t\t\ttimeline = new PhysicsConstraintMixTimeline(frames, frames, index);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: continue;\n\t\t\t\t\t}\n\t\t\t\t\treadTimeline1(timelines, timelineMap, timeline, defaultValue, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Slider timelines.\n\t\tif (map.slider) {\n\t\t\tfor (const constraintName in map.slider) {\n\t\t\t\tconst constraintMap = map.slider[constraintName];\n\t\t\t\tconst constraint = skeletonData.findConstraint(constraintName, SliderData);\n\t\t\t\tif (!constraint) throw new Error(`Slider not found: ${constraintName}`);\n\t\t\t\tconst index = skeletonData.constraints.indexOf(constraint);\n\n\t\t\t\tfor (const timelineName in constraintMap) {\n\t\t\t\t\tconst timelineMap = constraintMap[timelineName];\n\t\t\t\t\tconst keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tconst frames = timelineMap.length;\n\t\t\t\t\tswitch (timelineName) {\n\t\t\t\t\t\tcase \"time\": readTimeline1(timelines, timelineMap, new SliderTimeline(frames, frames, index), 1, 1); break;\n\t\t\t\t\t\tcase \"mix\": readTimeline1(timelines, timelineMap, new SliderMixTimeline(frames, frames, index), 1, 1); break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Attachment timelines.\n\t\tif (map.attachments) {\n\t\t\tfor (const attachmentsName in map.attachments) {\n\t\t\t\tconst attachmentsMap = map.attachments[attachmentsName];\n\t\t\t\tconst skin = skeletonData.findSkin(attachmentsName);\n\t\t\t\tif (!skin) throw new Error(`Skin not found: ${attachmentsName}`);\n\t\t\t\tfor (const slotMapName in attachmentsMap) {\n\t\t\t\t\tconst slotMap = attachmentsMap[slotMapName];\n\t\t\t\t\tconst slot = skeletonData.findSlot(slotMapName);\n\t\t\t\t\tif (!slot) throw new Error(`Slot not found: ${slotMapName}`);\n\t\t\t\t\tconst slotIndex = slot.index;\n\t\t\t\t\tfor (const attachmentMapName in slotMap) {\n\t\t\t\t\t\tconst attachmentMap = slotMap[attachmentMapName];\n\t\t\t\t\t\tconst attachment = skin.getAttachment(slotIndex, attachmentMapName);\n\t\t\t\t\t\tif (!attachment) throw new Error(`Timeline attachment not found: ${attachmentMapName}`);\n\n\t\t\t\t\t\tfor (const timelineMapName in attachmentMap) {\n\t\t\t\t\t\t\tconst timelineMap = attachmentMap[timelineMapName];\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\t\t\tif (timelineMapName === \"deform\") {\n\t\t\t\t\t\t\t\tconst weighted = attachment.bones;\n\t\t\t\t\t\t\t\tconst vertices = attachment.vertices;\n\t\t\t\t\t\t\t\tconst deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\t\t\t\t\t\t\t\tconst timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment);\n\t\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\t\tlet deform: NumberArrayLike;\n\t\t\t\t\t\t\t\t\tconst verticesValue: Array = getValue(keyMap, \"vertices\", null);\n\t\t\t\t\t\t\t\t\tif (!verticesValue)\n\t\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\t\tconst start = getValue(keyMap, \"offset\", 0);\n\t\t\t\t\t\t\t\t\t\tUtils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\n\t\t\t\t\t\t\t\t\t\tif (scale !== 1) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = start, n = i + verticesValue.length; i < n; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] *= scale;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < deformLength; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] += vertices[i];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\t\tconst nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tconst time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tconst curve = keyMap.curve;\n\t\t\t\t\t\t\t\t\tif (curve) bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t} else if (timelineMapName === \"sequence\") {\n\t\t\t\t\t\t\t\tconst timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\t\tlet lastDelay = 0;\n\t\t\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\t\t\tconst delay = getValue(keyMap, \"delay\", lastDelay);\n\t\t\t\t\t\t\t\t\tconst time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tconst mode = SequenceMode[getValue(keyMap, \"mode\", \"hold\")] as unknown as number;\n\t\t\t\t\t\t\t\t\tconst index = getValue(keyMap, \"index\", 0);\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mode, index, delay);\n\t\t\t\t\t\t\t\t\tlastDelay = delay;\n\t\t\t\t\t\t\t\t\tkeyMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timelines.\n\t\tif (map.drawOrder) {\n\t\t\tconst timeline = new DrawOrderTimeline(map.drawOrder.length);\n\t\t\tconst slotCount = skeletonData.slots.length;\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.drawOrder.length; i++, frame++) {\n\t\t\t\tconst drawOrderMap = map.drawOrder[i];\n\t\t\t\tlet drawOrder: Array | null = null;\n\t\t\t\tconst offsets = getValue(drawOrderMap, \"offsets\", null);\n\t\t\t\tif (offsets) {\n\t\t\t\t\tdrawOrder = Utils.newArray(slotCount, -1);\n\t\t\t\t\tconst unchanged = Utils.newArray(slotCount - offsets.length, 0);\n\t\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\t\tfor (let ii = 0; ii < offsets.length; ii++) {\n\t\t\t\t\t\tconst offsetMap = offsets[ii];\n\t\t\t\t\t\tconst slot = skeletonData.findSlot(offsetMap.slot);\n\t\t\t\t\t\tif (!slot) throw new Error(`Slot not found: ${slot}`);\n\t\t\t\t\t\tconst slotIndex = slot.index;\n\t\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\t\twhile (originalIndex !== slotIndex)\n\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t\t// Set changed items.\n\t\t\t\t\t\tdrawOrder[originalIndex + offsetMap.offset] = originalIndex++;\n\t\t\t\t\t}\n\t\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Fill in unchanged items.\n\t\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\t\tif (drawOrder[ii] === -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, getValue(drawOrderMap, \"time\", 0), drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timelines.\n\t\tif (map.events) {\n\t\t\tconst timeline = new EventTimeline(map.events.length);\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.events.length; i++, frame++) {\n\t\t\t\tconst eventMap = map.events[i];\n\t\t\t\tconst eventData = skeletonData.findEvent(eventMap.name);\n\t\t\t\tif (!eventData) throw new Error(`Event not found: ${eventMap.name}`);\n\t\t\t\tconst event = new Event(Utils.toSinglePrecision(getValue(eventMap, \"time\", 0)), eventData);\n\t\t\t\tevent.intValue = getValue(eventMap, \"int\", eventData.intValue);\n\t\t\t\tevent.floatValue = getValue(eventMap, \"float\", eventData.floatValue);\n\t\t\t\tevent.stringValue = getValue(eventMap, \"string\", eventData.stringValue);\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tevent.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\tskeletonData.animations.push(new Animation(name, timelines, duration));\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string; skin: string;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skin = skin;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\ntype CurveType = [number, number, number, number] | \"stepped\";\ntype Timeline1KeysType = { value: number, time?: number, curve?: CurveType };\ntype Timeline2KeysType = Timeline1KeysType & { x?: number, y?: number };\n\nfunction readTimeline1 (timelines: Array, keys: Timeline1KeysType[], timeline: CurveTimeline1, defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = keyMap.time ?? 0;\n\tlet value = (keyMap.value ?? defaultValue) * scale;\n\tlet bezier = 0;\n\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tconst nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\ttimelines.push(timeline);\n\t\t\treturn;\n\t\t}\n\t\tconst time2 = nextMap.time ?? 0;\n\t\tconst value2 = (nextMap.value ?? defaultValue) * scale;\n\t\tif (keyMap.curve) bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale);\n\t\ttime = time2;\n\t\tvalue = value2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readTimeline2 (timelines: Array, keys: Timeline2KeysType[], timeline: BoneTimeline2, name1: \"x\", name2: \"y\", defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = keyMap.time ?? 0;\n\tlet value1 = (keyMap[name1] ?? defaultValue) * scale;\n\tlet value2 = (keyMap[name2] ?? defaultValue) * scale;\n\tlet bezier = 0;\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tconst nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\ttimelines.push(timeline);\n\t\t\treturn;\n\t\t}\n\t\tconst time2 = nextMap.time ?? 0;\n\t\tconst nvalue1 = (nextMap[name1] ?? defaultValue) * scale;\n\t\tconst nvalue2 = (nextMap[name2] ?? defaultValue) * scale;\n\t\tconst curve = keyMap.curve;\n\t\tif (curve) {\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readCurve (curve: [number, number, number, number] | \"stepped\", timeline: CurveTimeline, bezier: number, frame: number, value: number, time1: number, time2: number,\n\tvalue1: number, value2: number, scale: number) {\n\tif (curve === \"stepped\") {\n\t\ttimeline.setStepped(frame);\n\t\treturn bezier;\n\t}\n\tconst i = value << 2;\n\tconst cx1 = curve[i];\n\tconst cy1 = curve[i + 1] * scale;\n\tconst cx2 = curve[i + 2];\n\tconst cy2 = curve[i + 3] * scale;\n\ttimeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);\n\treturn bezier + 1;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: it is any until we define a schema\nfunction getValue (map: any, property: string, defaultValue: any) {\n\treturn map[property] !== undefined ? map[property] : defaultValue;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { ClippingAttachment, MeshAttachment, RegionAttachment } from \"./attachments\";\nimport type { Skeleton } from \"./Skeleton\";\nimport { SkeletonClipping } from \"./SkeletonClipping\";\nimport { BlendMode } from \"./SlotData\";\nimport type { Color, NumberArrayLike } from \"./Utils\";\n\nexport class SkeletonRendererCore {\n\tprivate commandPool = new CommandPool();\n\tprivate worldVertices = new Float32Array(12 * 1024);\n\tprivate quadIndices = new Uint32Array([0, 1, 2, 2, 3, 0]);\n\tprivate clipping = new SkeletonClipping();\n\tprivate renderCommands: RenderCommand[] = [];\n\n\trender (skeleton: Skeleton): RenderCommand | undefined {\n\t\tthis.commandPool.reset();\n\t\tthis.renderCommands.length = 0;\n\n\t\tconst clipper = this.clipping;\n\n\t\tfor (let i = 0; i < skeleton.slots.length; i++) {\n\t\t\tconst slot = skeleton.drawOrder[i];\n\t\t\tconst attachment = slot.applied.attachment;\n\n\t\t\tif (!attachment) {\n\t\t\t\tclipper.clipEnd(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst slotApplied = slot.applied;\n\t\t\tconst color = slotApplied.color;\n\t\t\tconst alpha = color.a;\n\t\t\tif ((alpha === 0 || !slot.bone.active) && !(attachment instanceof ClippingAttachment)) {\n\t\t\t\tclipper.clipEnd(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet vertices: NumberArrayLike;\n\t\t\tlet verticesCount: number;\n\t\t\tlet uvs: NumberArrayLike;\n\t\t\tlet indices: number[] | Uint32Array;\n\t\t\tlet indicesCount: number;\n\t\t\tlet attachmentColor: Color;\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: texture depends on the runtime\n\t\t\tlet texture: any;\n\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tattachmentColor = attachment.color;\n\n\t\t\t\tif (attachmentColor.a === 0) {\n\t\t\t\t\tclipper.clipEnd(slot);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tattachment.computeWorldVertices(slot, this.worldVertices, 0, 2);\n\t\t\t\tvertices = this.worldVertices;\n\t\t\t\tverticesCount = 4;\n\t\t\t\tuvs = attachment.uvs as Float32Array;\n\t\t\t\tindices = this.quadIndices;\n\t\t\t\tindicesCount = 6;\n\t\t\t\ttexture = attachment.region?.texture;\n\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tattachmentColor = attachment.color;\n\n\t\t\t\tif (attachmentColor.a === 0) {\n\t\t\t\t\tclipper.clipEnd(slot);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (this.worldVertices.length < attachment.worldVerticesLength)\n\t\t\t\t\tthis.worldVertices = new Float32Array(attachment.worldVerticesLength);\n\n\t\t\t\tattachment.computeWorldVertices(skeleton, slot, 0, attachment.worldVerticesLength, this.worldVertices, 0, 2);\n\t\t\t\tvertices = this.worldVertices;\n\t\t\t\tverticesCount = attachment.worldVerticesLength >> 1;\n\t\t\t\tuvs = attachment.uvs as Float32Array;\n\t\t\t\tindices = attachment.triangles;\n\t\t\t\tindicesCount = indices.length;\n\t\t\t\ttexture = attachment.region?.texture;\n\n\t\t\t} else if (attachment instanceof ClippingAttachment) {\n\t\t\t\tclipper.clipStart(skeleton, slot, attachment);\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst skelColor = skeleton.color;\n\t\t\tconst r = Math.floor(skelColor.r * slotApplied.color.r * attachmentColor.r * 255);\n\t\t\tconst g = Math.floor(skelColor.g * slotApplied.color.g * attachmentColor.g * 255);\n\t\t\tconst b = Math.floor(skelColor.b * slotApplied.color.b * attachmentColor.b * 255);\n\t\t\tconst a = Math.floor(skelColor.a * slotApplied.color.a * attachmentColor.a * 255);\n\n\t\t\tlet darkColor = 0xff000000;\n\t\t\tif (slotApplied.darkColor) {\n\t\t\t\tconst { r, g, b } = slotApplied.darkColor;\n\t\t\t\tdarkColor = 0xff000000 |\n\t\t\t\t\t(Math.floor(r * 255) << 16) |\n\t\t\t\t\t(Math.floor(g * 255) << 8) |\n\t\t\t\t\tMath.floor(b * 255);\n\t\t\t}\n\n\t\t\tif (clipper.isClipping()) {\n\t\t\t\tclipper.clipTrianglesUnpacked(vertices, indices, indicesCount, uvs);\n\t\t\t\tvertices = clipper.clippedVerticesTyped;\n\t\t\t\tverticesCount = clipper.clippedVerticesLength >> 1;\n\t\t\t\tuvs = clipper.clippedUVsTyped;\n\t\t\t\tindices = clipper.clippedTrianglesTyped;\n\t\t\t\tindicesCount = clipper.clippedTrianglesLength;\n\t\t\t}\n\n\t\t\tconst cmd = this.commandPool.getCommand(verticesCount, indicesCount);\n\t\t\tcmd.blendMode = slot.data.blendMode;\n\t\t\tcmd.texture = texture;\n\n\t\t\tcmd.positions.set(vertices.subarray(0, verticesCount << 1));\n\t\t\tcmd.uvs.set(uvs.subarray(0, verticesCount << 1));\n\n\t\t\tfor (let j = 0; j < verticesCount; j++) {\n\t\t\t\tcmd.colors[j] = (a << 24) | (r << 16) | (g << 8) | b;\n\t\t\t\tcmd.darkColors[j] = darkColor;\n\t\t\t}\n\n\t\t\tif (indices instanceof Uint16Array) {\n\t\t\t\tcmd.indices.set(indices.subarray(0, indicesCount));\n\t\t\t} else {\n\t\t\t\tcmd.indices.set(indices.slice(0, indicesCount));\n\t\t\t}\n\n\t\t\tthis.renderCommands.push(cmd);\n\t\t\tclipper.clipEnd(slot);\n\t\t}\n\n\t\tclipper.clipEnd();\n\t\treturn this.batchCommands();\n\t}\n\n\tprivate batchSubCommands (commands: RenderCommand[], first: number, last: number,\n\t\tnumVertices: number, numIndices: number): RenderCommand {\n\n\t\tconst firstCmd = commands[first];\n\t\tconst batched = this.commandPool.getCommand(numVertices, numIndices);\n\n\t\tbatched.blendMode = firstCmd.blendMode;\n\t\tbatched.texture = firstCmd.texture;\n\n\t\tlet positionsOffset = 0;\n\t\tlet uvsOffset = 0;\n\t\tlet colorsOffset = 0;\n\t\tlet indicesOffset = 0;\n\t\tlet vertexOffset = 0;\n\n\t\tfor (let i = first; i <= last; i++) {\n\t\t\tconst cmd = commands[i];\n\n\t\t\tbatched.positions.set(cmd.positions, positionsOffset);\n\t\t\tpositionsOffset += cmd.numVertices << 1;\n\n\t\t\tbatched.uvs.set(cmd.uvs, uvsOffset);\n\t\t\tuvsOffset += cmd.numVertices << 1;\n\n\t\t\tbatched.colors.set(cmd.colors, colorsOffset);\n\t\t\tbatched.darkColors.set(cmd.darkColors, colorsOffset);\n\t\t\tcolorsOffset += cmd.numVertices;\n\n\t\t\t// cannot fast copy - indices need vertex offset adjustment\n\t\t\tfor (let j = 0; j < cmd.numIndices; j++)\n\t\t\t\tbatched.indices[indicesOffset + j] = cmd.indices[j] + vertexOffset;\n\n\t\t\tindicesOffset += cmd.numIndices;\n\t\t\tvertexOffset += cmd.numVertices;\n\t\t}\n\n\t\treturn batched;\n\t}\n\n\tprivate batchCommands (): RenderCommand | undefined {\n\t\tif (this.renderCommands.length === 0) return undefined;\n\n\t\tlet root: RenderCommand | undefined;\n\t\tlet last: RenderCommand | undefined;\n\n\t\tlet first = this.renderCommands[0];\n\t\tlet startIndex = 0;\n\t\tlet i = 1;\n\t\tlet numVertices = first.numVertices;\n\t\tlet numIndices = first.numIndices;\n\n\t\twhile (i <= this.renderCommands.length) {\n\t\t\tconst cmd = i < this.renderCommands.length ? this.renderCommands[i] : null;\n\n\t\t\tif (cmd && cmd.numVertices === 0 && cmd.numIndices === 0) {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst canBatch = cmd !== null &&\n\t\t\t\tcmd.texture === first.texture &&\n\t\t\t\tcmd.blendMode === first.blendMode &&\n\t\t\t\tcmd.colors[0] === first.colors[0] &&\n\t\t\t\tcmd.darkColors[0] === first.darkColors[0] &&\n\t\t\t\tnumIndices + cmd.numIndices < 0xffff;\n\t\t\tif (canBatch) {\n\t\t\t\tnumVertices += cmd.numVertices;\n\t\t\t\tnumIndices += cmd.numIndices;\n\t\t\t} else {\n\t\t\t\tconst batched = this.batchSubCommands(this.renderCommands, startIndex, i - 1,\n\t\t\t\t\tnumVertices, numIndices);\n\n\t\t\t\tif (!last) {\n\t\t\t\t\troot = last = batched;\n\t\t\t\t} else {\n\t\t\t\t\tlast.next = batched;\n\t\t\t\t\tlast = batched;\n\t\t\t\t}\n\n\t\t\t\tif (i === this.renderCommands.length) break;\n\n\t\t\t\tfirst = this.renderCommands[i];\n\t\t\t\tstartIndex = i;\n\t\t\t\tnumVertices = first.numVertices;\n\t\t\t\tnumIndices = first.numIndices;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\n\t\treturn root;\n\t}\n}\n\ninterface RenderCommand {\n\tpositions: Float32Array;\n\tuvs: Float32Array;\n\tcolors: Uint32Array;\n\tdarkColors: Uint32Array;\n\tindices: Uint16Array;\n\t_positions: Float32Array;\n\t_uvs: Float32Array;\n\t_colors: Uint32Array;\n\t_darkColors: Uint32Array;\n\t_indices: Uint16Array;\n\tnumVertices: number;\n\tnumIndices: number;\n\tblendMode: BlendMode;\n\t// biome-ignore lint/suspicious/noExplicitAny: texture depends on the runtime\n\ttexture: any;\n\tnext?: RenderCommand;\n}\n\nclass CommandPool {\n\tprivate pool: RenderCommand[] = [];\n\tprivate inUse: RenderCommand[] = [];\n\n\tgetCommand (numVertices: number, numIndices: number): RenderCommand {\n\t\tlet cmd: RenderCommand | undefined;\n\t\tfor (const c of this.pool) {\n\t\t\tif (c._positions.length >= numVertices << 1 && c._indices.length >= numIndices) {\n\t\t\t\tcmd = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!cmd) {\n\t\t\tconst _positions = new Float32Array(numVertices << 1);\n\t\t\tconst _uvs = new Float32Array(numVertices << 1);\n\t\t\tconst _colors = new Uint32Array(numVertices);\n\t\t\tconst _darkColors = new Uint32Array(numVertices);\n\t\t\tconst _indices = new Uint16Array(numIndices);\n\t\t\tcmd = {\n\t\t\t\tpositions: _positions,\n\t\t\t\tuvs: _uvs,\n\t\t\t\tcolors: _colors,\n\t\t\t\tdarkColors: _darkColors,\n\t\t\t\tindices: _indices,\n\t\t\t\t_positions,\n\t\t\t\t_uvs,\n\t\t\t\t_colors,\n\t\t\t\t_darkColors,\n\t\t\t\t_indices,\n\t\t\t\tnumVertices,\n\t\t\t\tnumIndices,\n\t\t\t\tblendMode: BlendMode.Normal,\n\t\t\t\ttexture: null\n\t\t\t};\n\t\t} else {\n\t\t\tthis.pool.splice(this.pool.indexOf(cmd), 1);\n\t\t\tcmd.next = undefined;\n\t\t\tcmd.numVertices = numVertices;\n\t\t\tcmd.numIndices = numIndices;\n\n\t\t\tcmd.positions = cmd._positions.subarray(0, numVertices << 1);\n\t\t\tcmd.uvs = cmd._uvs.subarray(0, numVertices * 2);\n\t\t\tcmd.colors = cmd._colors.subarray(0, numVertices);\n\t\t\tcmd.darkColors = cmd._darkColors.subarray(0, numVertices);\n\t\t\tcmd.indices = cmd._indices.subarray(0, numIndices);\n\t\t}\n\n\t\tthis.inUse.push(cmd);\n\t\treturn cmd;\n\t}\n\n\treset (): void {\n\t\tthis.pool.push(...this.inUse);\n\t\tthis.inUse.length = 0;\n\t}\n}", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BlendMode, Texture, type TextureAtlasPage, TextureFilter, TextureWrap } from \"@esotericsoftware/spine-core\";\n\nexport class C3TextureEditor extends Texture {\n\ttexture: SDK.Gfx.IWebGLTexture;\n\trenderer: SDK.Gfx.IWebGLRenderer;\n\n\tconstructor (image: HTMLImageElement | ImageBitmap, renderer: SDK.Gfx.IWebGLRenderer, page: TextureAtlasPage) {\n\t\tsuper(image);\n\t\tthis.renderer = renderer;\n\t\tconst options: TextureCreateOptions = {\n\t\t\twrapX: toC3TextureWrap(page.uWrap),\n\t\t\twrapY: toC3TextureWrap(page.vWrap),\n\t\t\tsampling: toC3Filter(page.minFilter),\n\t\t\tmipMap: toC3MipMap(page.minFilter),\n\t\t}\n\t\tthis.texture = renderer.CreateDynamicTexture(image.width, image.height, options);\n\t\tthis.renderer.UpdateTexture(image, this.texture, { premultiplyAlpha: !page.pma });\n\t}\n\n\tsetFilters () {\n\t\t// cannot change filter after texture creation\n\t}\n\n\tsetWraps () {\n\t\t// cannot change wraps after texture creation\n\t}\n\n\n\tdispose () {\n\t\tthis.renderer.DeleteTexture(this.texture);\n\t}\n}\n\nexport class C3Texture extends Texture {\n\ttexture: ITexture;\n\trenderer: IRenderer;\n\n\tconstructor (image: HTMLImageElement | ImageBitmap, renderer: IRenderer, page: TextureAtlasPage) {\n\t\tsuper(image);\n\t\tthis.renderer = renderer;\n\t\tconst options: TextureCreateOptions = {\n\t\t\twrapX: toC3TextureWrap(page.uWrap),\n\t\t\twrapY: toC3TextureWrap(page.vWrap),\n\t\t\tsampling: toC3Filter(page.minFilter),\n\t\t\tmipMap: toC3MipMap(page.minFilter),\n\t\t}\n\t\tthis.texture = renderer.createDynamicTexture(image.width, image.height, options);\n\t\tthis.renderer.updateTexture(image, this.texture, { premultiplyAlpha: !page.pma });\n\t}\n\n\n\tsetFilters () {\n\t\t// cannot change filter after texture creation\n\t}\n\n\tsetWraps () {\n\t\t// cannot change wraps after texture creation\n\t}\n\n\tdispose () {\n\t\tthis.renderer.deleteTexture(this.texture);\n\t}\n}\n\nfunction toC3TextureWrap (wrap: TextureWrap): TextureWrapMode {\n\tif (wrap === TextureWrap.ClampToEdge) return \"clamp-to-edge\";\n\telse if (wrap === TextureWrap.MirroredRepeat) return \"mirror-repeat\";\n\telse if (wrap === TextureWrap.Repeat) return \"repeat\";\n\telse throw new Error(`Unknown texture wrap: ${wrap}`);\n}\n\nfunction toC3MipMap (filter: TextureFilter): boolean {\n\tswitch (filter) {\n\t\tcase TextureFilter.MipMap:\n\t\tcase TextureFilter.MipMapLinearNearest:\n\t\tcase TextureFilter.MipMapNearestLinear:\n\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\treturn true;\n\n\t\tcase TextureFilter.Linear:\n\t\tcase TextureFilter.Nearest:\n\t\t\treturn false;\n\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown texture filter: ${filter}`);\n\t}\n}\n\nfunction toC3Filter (filter: TextureFilter): TextureSamplingMode {\n\tswitch (filter) {\n\t\tcase TextureFilter.Nearest:\n\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\treturn \"nearest\";\n\n\t\tcase TextureFilter.Linear:\n\t\tcase TextureFilter.MipMapLinearNearest:\n\t\tcase TextureFilter.MipMapNearestLinear:\n\t\t\treturn \"bilinear\";\n\n\t\tcase TextureFilter.MipMap:\n\t\tcase TextureFilter.MipMapLinearLinear:\n\t\t\treturn \"trilinear\";\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown texture filter: ${filter}`);\n\t}\n}\n\nexport const BlendingModeSpineToC3: Record = {\n\t[BlendMode.Normal]: \"normal\",\n\t[BlendMode.Additive]: \"additive\",\n\t[BlendMode.Multiply]: \"multiply\",\n\t[BlendMode.Screen]: \"screen\",\n}\n\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated April 5, 2025. Replaces all prior versions.\n *\n * Copyright (c) 2013-2025, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software\n * or otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AtlasAttachmentLoader, SkeletonBinary, SkeletonJson, TextureAtlas } from \"@esotericsoftware/spine-core\";\nimport { C3Texture, C3TextureEditor } from \"./C3Texture\";\n\n\nexport class AssetLoader {\n\n\tpublic async loadSkeletonEditor (sid: number, textureAtlas: TextureAtlas, scale = 1, instance: SDK.IWorldInstance) {\n\t\tconst projectFile = instance.GetProject().GetProjectFileBySID(sid);\n\t\tif (!projectFile) return null;\n\n\t\tconst blob = projectFile.GetBlob();\n\t\tconst atlasLoader = new AtlasAttachmentLoader(textureAtlas);\n\n\t\tconst isBinary = projectFile.GetName().endsWith(\".skel\");\n\t\tif (isBinary) {\n\t\t\tconst skeletonFile = await blob.arrayBuffer();\n\t\t\tconst skeletonLoader = new SkeletonBinary(atlasLoader);\n\t\t\tskeletonLoader.scale = scale;\n\t\t\treturn skeletonLoader.readSkeletonData(skeletonFile);\n\t\t}\n\n\t\tconst skeletonFile = await blob.text();\n\t\tconst skeletonLoader = new SkeletonJson(atlasLoader);\n\t\tskeletonLoader.scale = scale;\n\t\treturn skeletonLoader.readSkeletonData(skeletonFile);\n\t}\n\n\tpublic async loadAtlasEditor (sid: number, instance: SDK.IWorldInstance, renderer: SDK.Gfx.IWebGLRenderer) {\n\t\tconst projectFile = instance.GetProject().GetProjectFileBySID(sid);\n\t\tif (!projectFile) return null;\n\n\t\tconst blob = projectFile.GetBlob();\n\t\tconst content = await blob.text();\n\n\t\tconst path = projectFile.GetPath();\n\t\tconst basePath = path.substring(0, path.lastIndexOf(\"/\") + 1);\n\t\tconst textureAtlas = new TextureAtlas(content);\n\t\tawait Promise.all(textureAtlas.pages.map(async page => {\n\t\t\tconst texture = await this.loadSpineTextureEditor(basePath + page.name, page.pma, instance);\n\t\t\tif (texture) {\n\t\t\t\tconst spineTexture = new C3TextureEditor(texture, renderer, page);\n\t\t\t\tpage.setTexture(spineTexture);\n\t\t\t}\n\t\t\treturn texture;\n\t\t}));\n\n\t\treturn textureAtlas;\n\t}\n\n\tpublic async loadSpineTextureEditor (pageName: string, pma = false, instance: SDK.IWorldInstance) {\n\t\tconst projectFile = instance.GetProject().GetProjectFileByExportPath(pageName);\n\t\tif (!projectFile) {\n\t\t\tthrow new Error(`An error occured while loading the texture: ${pageName}`);\n\t\t}\n\n\t\tconst content = projectFile.GetBlob();\n\t\treturn AssetLoader.createImageBitmapFromBlob(content, pma);\n\t}\n\n\tpublic async loadSkeletonRuntime (path: string, textureAtlas: TextureAtlas, scale = 1, instance: IRuntime) {\n\t\tconst fullPath = await instance.assets.getProjectFileUrl(path);\n\t\tif (!fullPath) return null;\n\n\t\tconst atlasLoader = new AtlasAttachmentLoader(textureAtlas);\n\n\t\tconst isBinary = path.endsWith(\".skel\");\n\t\tif (isBinary) {\n\t\t\tconst content = await instance.assets.fetchArrayBuffer(fullPath);\n\t\t\tif (!content) return null;\n\t\t\tconst skeletonLoader = new SkeletonBinary(atlasLoader);\n\t\t\tskeletonLoader.scale = scale;\n\t\t\treturn skeletonLoader.readSkeletonData(content);\n\t\t}\n\t\tconst content = await instance.assets.fetchJson(fullPath);\n\t\tif (!content) return null;\n\t\tconst skeletonLoader = new SkeletonJson(atlasLoader);\n\t\tskeletonLoader.scale = scale;\n\t\treturn skeletonLoader.readSkeletonData(content);\n\t}\n\n\tpublic async loadAtlasRuntime (path: string, instance: IRuntime, renderer: IRenderer) {\n\t\tconst fullPath = await instance.assets.getProjectFileUrl(path);\n\t\tif (!fullPath) return null;\n\n\t\tconst content = await instance.assets.fetchText(fullPath);\n\t\tif (!content) return null;\n\n\t\tconst basePath = path.substring(0, path.lastIndexOf(\"/\") + 1);\n\t\tconst textureAtlas = new TextureAtlas(content);\n\t\tawait Promise.all(textureAtlas.pages.map(async page => {\n\t\t\tconst texture = await this.loadSpineTextureRuntime(basePath + page.name, page.pma, instance);\n\t\t\tif (texture) {\n\t\t\t\tconst spineTexture = new C3Texture(texture, renderer, page);\n\t\t\t\tpage.setTexture(spineTexture);\n\t\t\t}\n\t\t\treturn texture;\n\t\t}));\n\t\treturn textureAtlas;\n\t}\n\n\tpublic async loadSpineTextureRuntime (pageName: string, pma = false, instance: IRuntime) {\n\t\tconst fullPath = await instance.assets.getProjectFileUrl(pageName);\n\t\tif (!fullPath) return null;\n\n\t\tconst content = await instance.assets.fetchBlob(fullPath);\n\t\tif (!content) return null;\n\n\t\treturn AssetLoader.createImageBitmapFromBlob(content, pma);\n\t}\n\n\tstatic async createImageBitmapFromBlob (blob: Blob, pma: boolean): Promise {\n\t\ttry {\n\t\t\t// pma parameters seems to do not matter here. It matters in C3 Texture creation\n\t\t\treturn createImageBitmap(blob, { premultiplyAlpha: pma ? \"none\" : \"premultiply\" });\n\t\t} catch (e) {\n\t\t\tconsole.error(\"Failed to create ImageBitmap from blob:\", e);\n\t\t\treturn null;\n\t\t}\n\t}\n\n}\n\n\n", "import { AnimationState, Physics, Skeleton, SkeletonClipping, Skin } from \"@esotericsoftware/spine-core\";\n\ninterface Rectangle {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\ninterface GameObject {\n\tskeleton?: Skeleton,\n\tstate?: AnimationState,\n}\n\nexport interface SpineBoundsProvider {\n\t/** Returns the bounding box for the skeleton, in skeleton space. */\n\tcalculateBounds (gameObject: GameObject): Rectangle;\n}\n\nexport class AABBRectangleBoundsProvider implements SpineBoundsProvider {\n\tconstructor (\n\t\tprivate x: number,\n\t\tprivate y: number,\n\t\tprivate width: number,\n\t\tprivate height: number,\n\t) { }\n\tcalculateBounds () {\n\t\treturn { x: this.x, y: this.y, width: this.width, height: this.height };\n\t}\n}\n\nexport class SetupPoseBoundsProvider implements SpineBoundsProvider {\n\t/**\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (private clipping = false) { }\n\n\tcalculateBounds (gameObject: GameObject) {\n\t\tif (!gameObject.skeleton) return { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tskeleton.setupPose();\n\t\tskeleton.updateWorldTransform(Physics.update);\n\t\tconst bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : undefined);\n\t\treturn bounds.width === Number.NEGATIVE_INFINITY\n\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t: bounds;\n\t}\n}\n\nexport class SkinsAndAnimationBoundsProvider implements SpineBoundsProvider {\n\t/**\n\t * @param animation The animation to use for calculating the bounds. If null, the setup pose is used.\n\t * @param skins The skins to use for calculating the bounds. If empty, the default skin is used.\n\t * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation.\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (\n\t\tprivate animation?: string,\n\t\tprivate skins: string[] = [],\n\t\tprivate timeStep: number = 0.05,\n\t\tprivate clipping = false,\n\t) { }\n\n\tcalculateBounds (gameObject: GameObject): {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t} {\n\t\tif (!gameObject.skeleton || !gameObject.state)\n\t\t\treturn { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst animationState = new AnimationState(gameObject.state.data);\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tconst clipper = this.clipping ? new SkeletonClipping() : undefined;\n\t\tconst data = skeleton.data;\n\t\tif (this.skins.length > 0) {\n\t\t\tconst customSkin = new Skin(\"custom-skin\");\n\t\t\tfor (const skinName of this.skins) {\n\t\t\t\tconst skin = data.findSkin(skinName);\n\t\t\t\tif (skin == null) continue;\n\t\t\t\tcustomSkin.addSkin(skin);\n\t\t\t}\n\t\t\tskeleton.setSkin(customSkin);\n\t\t}\n\t\tskeleton.setupPose();\n\n\t\tconst animation = this.animation != null ? data.findAnimation(this.animation!) : null;\n\n\t\tif (animation == null) {\n\t\t\tskeleton.updateWorldTransform(Physics.update);\n\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\treturn bounds.width === Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t} else {\n\t\t\tlet minX = Number.POSITIVE_INFINITY,\n\t\t\t\tminY = Number.POSITIVE_INFINITY,\n\t\t\t\tmaxX = Number.NEGATIVE_INFINITY,\n\t\t\t\tmaxY = Number.NEGATIVE_INFINITY;\n\t\t\tanimationState.clearTracks();\n\t\t\tanimationState.setAnimation(0, animation, false);\n\t\t\tconst steps = Math.max(animation.duration / this.timeStep, 1.0);\n\t\t\tfor (let i = 0; i < steps; i++) {\n\t\t\t\tconst delta = i > 0 ? this.timeStep : 0;\n\t\t\t\tanimationState.update(delta);\n\t\t\t\tanimationState.apply(skeleton);\n\t\t\t\tskeleton.update(delta);\n\t\t\t\tskeleton.updateWorldTransform(Physics.update);\n\n\t\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\t\tminX = Math.min(minX, bounds.x);\n\t\t\t\tminY = Math.min(minY, bounds.y);\n\t\t\t\tmaxX = Math.max(maxX, bounds.x + bounds.width);\n\t\t\t\tmaxY = Math.max(maxY, bounds.y + bounds.height);\n\t\t\t}\n\t\t\tconst bounds = {\n\t\t\t\tx: minX,\n\t\t\t\ty: minY,\n\t\t\t\twidth: maxX - minX,\n\t\t\t\theight: maxY - minY,\n\t\t\t};\n\t\t\treturn bounds.width === Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t}\n\t}\n}"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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ACjB,OAAO,OAAO,mBACd,OAAO,OAAO,mBACd,OAAO,OAAO;AACf,uBAAe,YAAY;AAC3B,uBAAe,aAAa,GAAG,WAAW,KAAK;AAC/C,cAAM,QAAQ,KAAK,IAAI,UAAU,WAAW,KAAK,UAAU,CAAG;AAC9D,iBAAS,IAAI,GAAG,IAAI,OAAO,KAAK;AAC/B,gBAAM,QAAQ,IAAI,IAAI,KAAK,WAAW;AACtC,yBAAe,OAAO,KAAK;AAC3B,yBAAe,MAAM,QAAQ;AAC7B,mBAAS,OAAO,KAAK;AACrB,mBAAS,mCAAmC;AAE5C,gBAAMC,UAAS,SAAS,cAAc,OAAO;AAC7C,iBAAO,KAAK,IAAI,MAAMA,QAAO,CAAC;AAC9B,iBAAO,KAAK,IAAI,MAAMA,QAAO,CAAC;AAC9B,iBAAO,KAAK,IAAI,MAAMA,QAAO,IAAIA,QAAO,KAAK;AAC7C,iBAAO,KAAK,IAAI,MAAMA,QAAO,IAAIA,QAAO,MAAM;AAAA,QAC/C;AACA,cAAM,SAAS;AAAA,UACd,GAAG;AAAA,UACH,GAAG;AAAA,UACH,OAAO,OAAO;AAAA,UACd,QAAQ,OAAO;AAAA,QAChB;AACA,eAAO,OAAO,UAAU,OAAO,oBAC5B,EAAE,GAAG,GAAG,GAAG,GAAG,OAAO,GAAG,QAAQ,EAAE,IAClC;AAAA,MACJ;AAAA,IACD;AAAA,EACD;", - "names": ["v", "SequenceMode", "MixBlend", "MixDirection", "Property", "x", "y", "constraint", "EventType", "TextureFilter", "TextureWrap", "page", "Inherit", "PositionMode", "SpacingMode", "RotateMode", "pathLength", "multiplier", "Physics", "n", "bone", "BlendMode", "n", "name", "animationName", "LinkedMesh", "readTimeline1", "readTimeline2", "r", "g", "b", "skeletonFile", "skeletonLoader", "content", "bounds"] -} diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/index.d.ts b/spine-ts/spine-construct3/spine-construct3-lib/dist/index.d.ts deleted file mode 100644 index a351846fc..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "@esotericsoftware/spine-core"; -export * from './AssetLoader.js'; -export * from './C3Texture.js'; -export * from './SpineBoundsProvider.js'; diff --git a/spine-ts/spine-construct3/spine-construct3-lib/dist/index.js b/spine-ts/spine-construct3/spine-construct3-lib/dist/index.js deleted file mode 100644 index 61ea4bf2c..000000000 --- a/spine-ts/spine-construct3/spine-construct3-lib/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "@esotericsoftware/spine-core"; -export * from './AssetLoader.js'; -export * from './C3Texture.js'; -export * from './SpineBoundsProvider.js'; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYywwQkFBMEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCJAZXNvdGVyaWNzb2Z0d2FyZS9zcGluZS1jb3JlXCI7XG5leHBvcnQgKiBmcm9tICcuL0Fzc2V0TG9hZGVyLmpzJztcbmV4cG9ydCAqIGZyb20gJy4vQzNUZXh0dXJlLmpzJztcbmV4cG9ydCAqIGZyb20gJy4vU3BpbmVCb3VuZHNQcm92aWRlci5qcyc7XG4iXX0= \ No newline at end of file