{"version":3,"file":"PathConstraintData.mjs","sources":["../../src/core/PathConstraintData.ts"],"sourcesContent":["import { ConstraintData } from './ConstraintData';\nimport type { SlotData } from './SlotData';\nimport type { BoneData } from './BoneData';\nimport { PositionMode, RotateMode } from '@pixi-spine/base';\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.\n * @public\n * */\nexport class PathConstraintData extends ConstraintData {\n    /** The bones that will be modified by this path constraint. */\n    bones = new Array<BoneData>();\n\n    /** The slot whose path attachment will be used to constrained the bones. */\n    private _target: SlotData | null = null;\n    public set target(slotData: SlotData) {\n        this._target = slotData;\n    }\n    public get target() {\n        if (!this._target) throw new Error('SlotData not set.');\n        else return this._target;\n    }\n\n    /** The mode for positioning the first bone on the path. */\n    positionMode: PositionMode = PositionMode.Fixed;\n\n    /** The mode for positioning the bones after the first bone on the path. */\n    spacingMode: SpacingMode = SpacingMode.Fixed;\n\n    /** The mode for adjusting the rotation of the bones. */\n    rotateMode: RotateMode = RotateMode.Chain;\n\n    /** An offset added to the constrained bone rotation. */\n    offsetRotation = 0;\n\n    /** The position along the path. */\n    position = 0;\n\n    /** The spacing between bones. */\n    spacing = 0;\n\n    mixRotate = 0;\n    mixX = 0;\n    mixY = 0;\n\n    constructor(name: string) {\n        super(name, 0, false);\n    }\n}\n\n/** Controls how bones after the first bone are positioned along the path.\n *\n * [Spacing mode](http://esotericsoftware.com/spine-path-constraints#Spacing-mode) in the Spine User Guide.\n * @public\n * */\nexport enum SpacingMode {\n    Length,\n    Fixed,\n    Percent,\n    Proportional,\n}\n"],"names":["SpacingMode"],"mappings":";;;AAUO,MAAM,2BAA2B,cAAe,CAAA;AAAA,EAoCnD,YAAY,IAAc,EAAA;AACtB,IAAM,KAAA,CAAA,IAAA,EAAM,GAAG,KAAK,CAAA,CAAA;AAnCxB;AAAA,IAAA,IAAA,CAAA,KAAA,GAAQ,IAAI,KAAgB,EAAA,CAAA;AAG5B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