'use strict';

var spriteGeneratorCore = require('./spriteGeneratorCore.js');

/**
 * animalGeneratorPresets.ts — Modular animal sprite generator.
 *
 * Parts: heads (cat, dog, wolf, bird, dragon, rabbit, bear, horse),
 * bodies, legs, tails, wings, manes.
 * Integrates with quadruped skeleton template.
 */
/* ════════════════════════════════════════════════════════════════
   COLOUR PALETTES
   ════════════════════════════════════════════════════════════════ */
const FUR_PALETTES = {
    white: ['#f0f0f0', '#d0d0d0', '#b0b0b0', '#909090'],
    black: ['#404040', '#303030', '#202020', '#101010'],
    brown: ['#c08848', '#a06830', '#805020', '#603818'],
    gray: ['#a0a0a0', '#808080', '#606060', '#404040'],
    orange: ['#e09040', '#c07828', '#a06020', '#804818'],
    golden: ['#f0d068', '#d0b048', '#b09030', '#907020'],
    cream: ['#f0e8d0', '#d8d0b8', '#c0b8a0', '#a8a088'],
};
const SCALE_PALETTES = {
    green: ['#40a040', '#308030', '#206020', '#104010'],
    red: ['#c04040', '#a03030', '#802020', '#601010'],
    blue: ['#4060c0', '#3048a0', '#203880', '#182060'],
    gold: ['#f0d060', '#d0b040', '#a08020', '#806010'],
    purple: ['#8040c0', '#6030a0', '#402080', '#301060'],
};
const FEATHER_PALETTES = {
    brown: ['#a08040', '#806030', '#604020', '#402810'],
    white: ['#f0f0f0', '#d8d8d8', '#c0c0c0', '#a0a0a0'],
    blue: ['#4080d0', '#3060b0', '#204890', '#183070'],
    red: ['#d04040', '#b03030', '#902020', '#701010'],
    tropical: ['#40c040', '#f0d040', '#d06020', '#c03030'],
};
/* ════════════════════════════════════════════════════════════════
   ANIMAL PARTS
   ════════════════════════════════════════════════════════════════ */
const _ = -1;
/* ── Cat head ── */
const CAT_HEAD_S = spriteGeneratorCore.createPartData(8, 7, [
    [_, 0, _, _, _, _, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 2, 0, 0, 2, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 3, 3, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, _],
], ['#e09040', '#c07828', '#40a040', '#f0a0a0']);
const CAT_HEAD_E = spriteGeneratorCore.createPartData(6, 7, [
    [_, _, _, _, 0, _],
    [_, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0],
    [0, 0, 0, 2, 0, 0],
    [0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 3, 0],
    [_, 0, 0, 0, 0, _],
], ['#e09040', '#c07828', '#40a040', '#f0a0a0']);
/* ── Dog head ── */
const DOG_HEAD_S = spriteGeneratorCore.createPartData(8, 8, [
    [_, _, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 2, 0, 0, 2, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 3, 3, 0, 0, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, _, _, 0, 0, _, _, _],
], ['#c08848', '#a06830', '#301818', '#301818']);
const DOG_HEAD_E = spriteGeneratorCore.createPartData(7, 8, [
    [_, _, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 2, 0, _],
    [0, 0, 0, 0, 0, 0, _],
    [_, 0, 0, 0, 0, 3, 0],
    [_, _, 0, 0, 0, 3, 0],
    [_, _, _, 0, 0, 0, _],
], ['#c08848', '#a06830', '#301818', '#301818']);
/* ── Wolf head ── */
const WOLF_HEAD_S = spriteGeneratorCore.createPartData(10, 8, [
    [_, 0, _, _, _, _, _, _, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 2, 0, 0, 2, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 3, 3, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, 0, 0, _, _],
    [_, _, _, 0, 0, 0, 0, _, _, _],
], ['#808080', '#606060', '#f0d060', '#301818']);
/* ── Bird head ── */
const BIRD_HEAD_S = spriteGeneratorCore.createPartData(6, 6, [
    [_, _, 0, 0, _, _],
    [_, 0, 0, 0, 0, _],
    [0, 0, 2, 2, 0, 0],
    [0, 0, 0, 0, 0, 0],
    [_, 0, 3, 3, 0, _],
    [_, _, _, 3, _, _],
], ['#a08040', '#806030', '#301818', '#f0a020']);
/* ── Dragon head ── */
const DRAGON_HEAD_S = spriteGeneratorCore.createPartData(10, 9, [
    [_, _, _, 0, _, _, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 2, 0, 0, 2, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 3, 3, 0, 0, _, _],
    [_, _, _, 0, 0, 0, 0, _, _, _],
], ['#40a040', '#308030', '#f0d060', '#301818']);
/* ── Rabbit head ── */
const RABBIT_HEAD_S = spriteGeneratorCore.createPartData(8, 10, [
    [_, _, 0, _, _, 0, _, _],
    [_, _, 0, _, _, 0, _, _],
    [_, _, 0, _, _, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 2, 0, 0, 2, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 3, 3, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, _, _],
], ['#f0e8d0', '#d8d0b8', '#d04040', '#f0a0a0']);
/* ── Bear head ── */
const BEAR_HEAD_S = spriteGeneratorCore.createPartData(10, 9, [
    [_, 0, 0, _, _, _, _, 0, 0, _],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 2, 0, 0, 2, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 3, 3, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, 0, 0, _, _],
], ['#805020', '#603818', '#201010', '#402818']);
/* ── Horse head ── */
const HORSE_HEAD_S = spriteGeneratorCore.createPartData(8, 10, [
    [_, _, _, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 2, 0, 0, 2, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, _, _, 0, 0, _, _, _],
], ['#c08848', '#a06830', '#301818']);
/* ── Bodies ── */
const BODY_SMALL = spriteGeneratorCore.createPartData(8, 6, [
    [_, _, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, _, _],
], ['#e09040', '#c07828']);
const BODY_MEDIUM = spriteGeneratorCore.createPartData(12, 8, [
    [_, _, _, 0, 0, 0, 0, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, 0, 0, 0, 0, _, _],
    [_, _, _, 0, 0, 0, 0, 0, 0, _, _, _],
], ['#c08848', '#a06830']);
const BODY_LARGE = spriteGeneratorCore.createPartData(14, 10, [
    [_, _, _, _, 0, 0, 0, 0, 0, 0, _, _, _, _],
    [_, _, _, 0, 0, 0, 0, 0, 0, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _, _],
    [_, _, _, 0, 0, 0, 0, 0, 0, 0, 0, _, _, _],
    [_, _, _, _, 0, 0, 0, 0, 0, 0, _, _, _, _],
], ['#805020', '#603818']);
const BODY_BIRD = spriteGeneratorCore.createPartData(8, 7, [
    [_, _, _, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, _, _],
    [_, _, _, 0, 0, _, _, _],
], ['#a08040', '#806030']);
const BODY_DRAGON = spriteGeneratorCore.createPartData(14, 10, [
    [_, _, _, _, _, 0, 0, 0, 0, _, _, _, _, _],
    [_, _, _, _, 0, 0, 0, 0, 0, 0, _, _, _, _],
    [_, _, _, 0, 0, 0, 0, 0, 0, 0, 0, _, _, _],
    [_, _, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, _],
    [_, _, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, _, _],
    [_, _, _, 0, 0, 0, 0, 0, 0, 0, 0, _, _, _],
    [_, _, _, _, 0, 0, 0, 0, 0, 0, _, _, _, _],
], ['#40a040', '#f0d060']);
/* ── Legs ── */
const LEG_THIN = spriteGeneratorCore.createPartData(2, 5, [
    [0, 0],
    [0, 0],
    [0, 0],
    [0, 0],
    [0, 1],
], ['#c08848', '#a06830']);
const LEG_THICK = spriteGeneratorCore.createPartData(3, 5, [
    [0, 0, 0],
    [0, 0, 0],
    [0, 0, 0],
    [0, 0, 0],
    [0, 0, 1],
], ['#805020', '#603818']);
const LEG_BIRD = spriteGeneratorCore.createPartData(2, 5, [
    [_, 0],
    [_, 0],
    [_, 0],
    [0, 0],
    [0, 0],
], ['#f0a020', '#c08010']);
const LEG_DRAGON = spriteGeneratorCore.createPartData(3, 6, [
    [_, 0, 0],
    [0, 0, 0],
    [0, 0, 0],
    [0, 0, 0],
    [0, 0, 0],
    [0, 1, 0],
], ['#40a040', '#206020']);
/* ── Tails ── */
const TAIL_SHORT = spriteGeneratorCore.createPartData(4, 3, [
    [0, 0, _, _],
    [_, 0, 0, _],
    [_, _, 0, 0],
], ['#e09040', '#c07828']);
const TAIL_LONG = spriteGeneratorCore.createPartData(6, 4, [
    [0, 0, _, _, _, _],
    [_, 0, 0, _, _, _],
    [_, _, 0, 0, _, _],
    [_, _, _, 0, 0, 0],
], ['#c08848', '#a06830']);
const TAIL_FLUFFY = spriteGeneratorCore.createPartData(6, 5, [
    [_, 0, 0, _, _, _],
    [0, 0, 0, 0, _, _],
    [_, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0],
    [_, _, _, 0, 0, _],
], ['#808080', '#606060']);
const TAIL_DRAGON = spriteGeneratorCore.createPartData(8, 4, [
    [0, 0, _, _, _, _, _, _],
    [_, 0, 0, 0, _, _, _, _],
    [_, _, _, 0, 0, 0, _, _],
    [_, _, _, _, _, 0, 1, 0],
], ['#40a040', '#308030']);
const TAIL_BIRD = spriteGeneratorCore.createPartData(5, 5, [
    [_, _, 0, _, _],
    [_, 0, 0, 0, _],
    [0, 0, 0, 0, 0],
    [_, 0, 0, 0, _],
    [_, _, 0, _, _],
], ['#a08040', '#806030']);
/* ── Wings ── */
const WING_SMALL = spriteGeneratorCore.createPartData(6, 5, [
    [_, _, _, _, 0, _],
    [_, _, _, 0, 0, 0],
    [_, _, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, _],
], ['#a08040', '#806030']);
const WING_LARGE = spriteGeneratorCore.createPartData(10, 8, [
    [_, _, _, _, _, _, _, _, 0, _],
    [_, _, _, _, _, _, _, 0, 0, 0],
    [_, _, _, _, _, _, 0, 0, 0, 0],
    [_, _, _, _, _, 0, 0, 0, 0, 0],
    [_, _, _, _, 0, 0, 0, 0, 0, 0],
    [_, _, _, 0, 0, 0, 0, 0, 0, 0],
    [_, _, 0, 0, 0, 0, 0, 0, 0, _],
    [_, 0, 0, 0, 0, 0, 0, 0, _, _],
], ['#40a040', '#308030']);
const WING_BAT = spriteGeneratorCore.createPartData(10, 7, [
    [_, _, 0, _, _, 0, _, _, 0, _],
    [_, 0, 0, _, 0, 0, _, 0, 0, _],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, 0, 0, 0, 0, _],
    [_, _, 0, 0, 0, 0, 0, 0, _, _],
    [_, _, _, 0, 0, 0, 0, _, _, _],
], ['#404040', '#303030']);
/* ── Manes ── */
const MANE_SHORT = spriteGeneratorCore.createPartData(6, 4, [
    [_, _, 0, 0, _, _],
    [_, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0],
    [_, _, 0, 0, _, _],
], ['#c08848', '#a06830']);
const MANE_LONG = spriteGeneratorCore.createPartData(6, 8, [
    [_, _, 0, 0, _, _],
    [_, 0, 0, 0, 0, _],
    [0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0],
    [_, 0, 0, 0, 0, _],
    [_, 0, 0, 0, 0, _],
    [_, _, 0, 0, _, _],
], ['#c08848', '#a06830']);
/* ── Horns ── */
const HORNS_SMALL = spriteGeneratorCore.createPartData(8, 3, [
    [0, _, _, _, _, _, _, 0],
    [0, 0, _, _, _, _, 0, 0],
    [_, 0, _, _, _, _, 0, _],
], ['#f0e8d0', '#d8d0b8']);
const HORNS_DRAGON = spriteGeneratorCore.createPartData(10, 4, [
    [0, _, _, _, _, _, _, _, _, 0],
    [0, 0, _, _, _, _, _, _, 0, 0],
    [_, 0, 0, _, _, _, _, 0, 0, _],
    [_, _, 0, _, _, _, _, 0, _, _],
], ['#805020', '#603818']);
/* ════════════════════════════════════════════════════════════════
   REGISTER ALL ANIMAL PARTS
   ════════════════════════════════════════════════════════════════ */
const ANIMAL_PARTS = [
    // ── Heads ──
    {
        id: 'animal-head-cat', name: 'Cat Head', category: 'animalHead', slot: 'head',
        anchorX: 4, anchorY: 6, zOrder: 10, tags: ['cat', 'small', 'pet'],
        pixels: spriteGeneratorCore.generateMirroredDirections({ S: CAT_HEAD_S, E: CAT_HEAD_E }),
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-head-dog', name: 'Dog Head', category: 'animalHead', slot: 'head',
        anchorX: 4, anchorY: 7, zOrder: 10, tags: ['dog', 'medium', 'pet'],
        pixels: spriteGeneratorCore.generateMirroredDirections({ S: DOG_HEAD_S, E: DOG_HEAD_E }),
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-head-wolf', name: 'Wolf Head', category: 'animalHead', slot: 'head',
        anchorX: 5, anchorY: 7, zOrder: 10, tags: ['wolf', 'wild', 'predator'],
        pixels: { S: WOLF_HEAD_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-head-bird', name: 'Bird Head', category: 'animalHead', slot: 'head',
        anchorX: 3, anchorY: 5, zOrder: 10, tags: ['bird', 'small', 'flying'],
        pixels: { S: BIRD_HEAD_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-head-dragon', name: 'Dragon Head', category: 'animalHead', slot: 'head',
        anchorX: 5, anchorY: 8, zOrder: 10, tags: ['dragon', 'fantasy', 'large'],
        pixels: { S: DRAGON_HEAD_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-head-rabbit', name: 'Rabbit Head', category: 'animalHead', slot: 'head',
        anchorX: 4, anchorY: 9, zOrder: 10, tags: ['rabbit', 'small', 'pet'],
        pixels: { S: RABBIT_HEAD_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-head-bear', name: 'Bear Head', category: 'animalHead', slot: 'head',
        anchorX: 5, anchorY: 8, zOrder: 10, tags: ['bear', 'large', 'wild'],
        pixels: { S: BEAR_HEAD_S },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-head-horse', name: 'Horse Head', category: 'animalHead', slot: 'head',
        anchorX: 4, anchorY: 9, zOrder: 10, tags: ['horse', 'large', 'rideable'],
        pixels: { S: HORSE_HEAD_S },
        recolorableIndices: [0, 1],
    },
    // ── Bodies ──
    {
        id: 'animal-body-small', name: 'Small Body', category: 'animalBody', slot: 'body',
        anchorX: 4, anchorY: 0, zOrder: 5, tags: ['small', 'cat', 'rabbit'],
        pixels: { S: BODY_SMALL },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-body-medium', name: 'Medium Body', category: 'animalBody', slot: 'body',
        anchorX: 6, anchorY: 0, zOrder: 5, tags: ['medium', 'dog', 'wolf'],
        pixels: { S: BODY_MEDIUM },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-body-large', name: 'Large Body', category: 'animalBody', slot: 'body',
        anchorX: 7, anchorY: 0, zOrder: 5, tags: ['large', 'bear', 'horse'],
        pixels: { S: BODY_LARGE },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-body-bird', name: 'Bird Body', category: 'animalBody', slot: 'body',
        anchorX: 4, anchorY: 0, zOrder: 5, tags: ['bird', 'small', 'flying'],
        pixels: { S: BODY_BIRD },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-body-dragon', name: 'Dragon Body', category: 'animalBody', slot: 'body',
        anchorX: 7, anchorY: 0, zOrder: 5, tags: ['dragon', 'fantasy', 'large'],
        pixels: { S: BODY_DRAGON },
        recolorableIndices: [0, 1],
    },
    // ── Legs ──
    {
        id: 'animal-leg-thin', name: 'Thin Leg', category: 'animalLeg', slot: 'leftLeg',
        anchorX: 1, anchorY: 0, zOrder: 3, tags: ['thin', 'small', 'cat', 'dog'],
        pixels: { S: LEG_THIN },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-leg-thick', name: 'Thick Leg', category: 'animalLeg', slot: 'leftLeg',
        anchorX: 1, anchorY: 0, zOrder: 3, tags: ['thick', 'large', 'bear', 'horse'],
        pixels: { S: LEG_THICK },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-leg-bird', name: 'Bird Leg', category: 'animalLeg', slot: 'leftLeg',
        anchorX: 1, anchorY: 0, zOrder: 3, tags: ['bird', 'claw'],
        pixels: { S: LEG_BIRD },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-leg-dragon', name: 'Dragon Leg', category: 'animalLeg', slot: 'leftLeg',
        anchorX: 1, anchorY: 0, zOrder: 3, tags: ['dragon', 'claw', 'large'],
        pixels: { S: LEG_DRAGON },
        recolorableIndices: [0, 1],
    },
    // ── Tails ──
    {
        id: 'animal-tail-short', name: 'Short Tail', category: 'animalTail', slot: 'tail',
        anchorX: 0, anchorY: 1, zOrder: 2, tags: ['short', 'cat', 'dog'],
        pixels: { S: TAIL_SHORT },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-tail-long', name: 'Long Tail', category: 'animalTail', slot: 'tail',
        anchorX: 0, anchorY: 1, zOrder: 2, tags: ['long', 'dog', 'wolf'],
        pixels: { S: TAIL_LONG },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-tail-fluffy', name: 'Fluffy Tail', category: 'animalTail', slot: 'tail',
        anchorX: 0, anchorY: 2, zOrder: 2, tags: ['fluffy', 'fox', 'wolf'],
        pixels: { S: TAIL_FLUFFY },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-tail-dragon', name: 'Dragon Tail', category: 'animalTail', slot: 'tail',
        anchorX: 0, anchorY: 1, zOrder: 2, tags: ['dragon', 'spiked'],
        pixels: { S: TAIL_DRAGON },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-tail-bird', name: 'Bird Tail', category: 'animalTail', slot: 'tail',
        anchorX: 2, anchorY: 0, zOrder: 2, tags: ['bird', 'feather'],
        pixels: { S: TAIL_BIRD },
        recolorableIndices: [0, 1],
    },
    // ── Wings ──
    {
        id: 'animal-wing-small', name: 'Small Wing', category: 'animalWing', slot: 'wing',
        anchorX: 0, anchorY: 4, zOrder: 8, tags: ['small', 'bird'],
        pixels: { S: WING_SMALL },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-wing-large', name: 'Large Wing', category: 'animalWing', slot: 'wing',
        anchorX: 0, anchorY: 7, zOrder: 8, tags: ['large', 'dragon'],
        pixels: { S: WING_LARGE },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-wing-bat', name: 'Bat Wing', category: 'animalWing', slot: 'wing',
        anchorX: 0, anchorY: 6, zOrder: 8, tags: ['bat', 'dragon', 'dark'],
        pixels: { S: WING_BAT },
        recolorableIndices: [0, 1],
    },
    // ── Manes ──
    {
        id: 'animal-mane-short', name: 'Short Mane', category: 'animalMane', slot: 'mane',
        anchorX: 3, anchorY: 0, zOrder: 9, tags: ['short', 'horse'],
        pixels: { S: MANE_SHORT },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-mane-long', name: 'Long Mane', category: 'animalMane', slot: 'mane',
        anchorX: 3, anchorY: 0, zOrder: 9, tags: ['long', 'lion', 'horse'],
        pixels: { S: MANE_LONG },
        recolorableIndices: [0, 1],
    },
    // ── Horns ──
    {
        id: 'animal-horns-small', name: 'Small Horns', category: 'animalHead', slot: 'head',
        anchorX: 4, anchorY: 2, zOrder: 12, tags: ['horns', 'small', 'goat'],
        pixels: { S: HORNS_SMALL },
        recolorableIndices: [0, 1],
    },
    {
        id: 'animal-horns-dragon', name: 'Dragon Horns', category: 'animalHead', slot: 'head',
        anchorX: 5, anchorY: 3, zOrder: 12, tags: ['horns', 'dragon', 'large'],
        pixels: { S: HORNS_DRAGON },
        recolorableIndices: [0, 1],
    },
];
function animalAssembly(name, parts, w = 32, h = 32) {
    return {
        id: `animal-${name.toLowerCase().replace(/\s+/g, '-')}`,
        name,
        parts,
        skeletonId: 'quadruped',
        canvasWidth: w,
        canvasHeight: h,
        projection: 'sideView',
    };
}
const ANIMAL_PRESETS = [
    {
        id: 'preset-cat', name: 'Cat', description: 'Small domestic cat',
        tags: ['cat', 'pet', 'small'],
        assembly: animalAssembly('Cat', [
            { partId: 'animal-leg-thin', offsetX: 8, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 12, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 18, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 22, offsetY: 22 },
            { partId: 'animal-body-small', offsetX: 10, offsetY: 16 },
            { partId: 'animal-head-cat', offsetX: 6, offsetY: 9 },
            { partId: 'animal-tail-short', offsetX: 22, offsetY: 15 },
        ]),
    },
    {
        id: 'preset-dog', name: 'Dog', description: 'Medium-sized dog',
        tags: ['dog', 'pet', 'medium'],
        assembly: animalAssembly('Dog', [
            { partId: 'animal-leg-thin', offsetX: 6, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 10, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 18, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 22, offsetY: 22 },
            { partId: 'animal-body-medium', offsetX: 6, offsetY: 14 },
            { partId: 'animal-head-dog', offsetX: 2, offsetY: 6 },
            { partId: 'animal-tail-long', offsetX: 22, offsetY: 13 },
        ]),
    },
    {
        id: 'preset-wolf', name: 'Wolf', description: 'Wild wolf with fluffy tail',
        tags: ['wolf', 'wild', 'predator'],
        assembly: animalAssembly('Wolf', [
            { partId: 'animal-leg-thin', offsetX: 5, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 9, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 18, offsetY: 22 },
            { partId: 'animal-leg-thin', offsetX: 22, offsetY: 22 },
            { partId: 'animal-body-medium', offsetX: 5, offsetY: 14 },
            { partId: 'animal-head-wolf', offsetX: 1, offsetY: 6 },
            { partId: 'animal-tail-fluffy', offsetX: 22, offsetY: 12 },
        ]),
    },
    {
        id: 'preset-bird', name: 'Bird', description: 'Small bird with wings',
        tags: ['bird', 'flying', 'small'],
        assembly: animalAssembly('Bird', [
            { partId: 'animal-leg-bird', offsetX: 12, offsetY: 24 },
            { partId: 'animal-leg-bird', offsetX: 16, offsetY: 24 },
            { partId: 'animal-body-bird', offsetX: 10, offsetY: 17 },
            { partId: 'animal-head-bird', offsetX: 9, offsetY: 11 },
            { partId: 'animal-wing-small', offsetX: 18, offsetY: 14 },
            { partId: 'animal-tail-bird', offsetX: 6, offsetY: 19 },
        ]),
    },
    {
        id: 'preset-dragon', name: 'Dragon', description: 'Fire-breathing dragon with wings',
        tags: ['dragon', 'fantasy', 'large'],
        assembly: animalAssembly('Dragon', [
            { partId: 'animal-leg-dragon', offsetX: 4, offsetY: 24 },
            { partId: 'animal-leg-dragon', offsetX: 9, offsetY: 24 },
            { partId: 'animal-leg-dragon', offsetX: 18, offsetY: 24 },
            { partId: 'animal-leg-dragon', offsetX: 23, offsetY: 24 },
            { partId: 'animal-body-dragon', offsetX: 4, offsetY: 14 },
            { partId: 'animal-head-dragon', offsetX: 0, offsetY: 4 },
            { partId: 'animal-horns-dragon', offsetX: 0, offsetY: 1 },
            { partId: 'animal-wing-large', offsetX: 18, offsetY: 4 },
            { partId: 'animal-tail-dragon', offsetX: 22, offsetY: 18 },
        ], 32, 32),
    },
    {
        id: 'preset-rabbit', name: 'Rabbit', description: 'Small fluffy rabbit',
        tags: ['rabbit', 'pet', 'small'],
        assembly: animalAssembly('Rabbit', [
            { partId: 'animal-leg-thin', offsetX: 10, offsetY: 24 },
            { partId: 'animal-leg-thin', offsetX: 14, offsetY: 24 },
            { partId: 'animal-leg-thin', offsetX: 18, offsetY: 24 },
            { partId: 'animal-leg-thin', offsetX: 22, offsetY: 24 },
            { partId: 'animal-body-small', offsetX: 10, offsetY: 18 },
            { partId: 'animal-head-rabbit', offsetX: 6, offsetY: 8 },
            { partId: 'animal-tail-short', offsetX: 22, offsetY: 18 },
        ]),
    },
    {
        id: 'preset-bear', name: 'Bear', description: 'Large bear',
        tags: ['bear', 'wild', 'large'],
        assembly: animalAssembly('Bear', [
            { partId: 'animal-leg-thick', offsetX: 4, offsetY: 22 },
            { partId: 'animal-leg-thick', offsetX: 9, offsetY: 22 },
            { partId: 'animal-leg-thick', offsetX: 18, offsetY: 22 },
            { partId: 'animal-leg-thick', offsetX: 23, offsetY: 22 },
            { partId: 'animal-body-large', offsetX: 3, offsetY: 12 },
            { partId: 'animal-head-bear', offsetX: 0, offsetY: 3 },
            { partId: 'animal-tail-short', offsetX: 22, offsetY: 14 },
        ]),
    },
    {
        id: 'preset-horse', name: 'Horse', description: 'Horse with mane',
        tags: ['horse', 'rideable', 'large'],
        assembly: animalAssembly('Horse', [
            { partId: 'animal-leg-thick', offsetX: 4, offsetY: 22 },
            { partId: 'animal-leg-thick', offsetX: 9, offsetY: 22 },
            { partId: 'animal-leg-thick', offsetX: 18, offsetY: 22 },
            { partId: 'animal-leg-thick', offsetX: 23, offsetY: 22 },
            { partId: 'animal-body-large', offsetX: 3, offsetY: 12 },
            { partId: 'animal-head-horse', offsetX: 0, offsetY: 2 },
            { partId: 'animal-mane-long', offsetX: 4, offsetY: 4 },
            { partId: 'animal-tail-long', offsetX: 22, offsetY: 14 },
        ]),
    },
    {
        id: 'preset-phoenix', name: 'Phoenix', description: 'Mythical fire bird',
        tags: ['phoenix', 'fantasy', 'bird', 'fire'],
        assembly: animalAssembly('Phoenix', [
            { partId: 'animal-leg-bird', offsetX: 12, offsetY: 24 },
            { partId: 'animal-leg-bird', offsetX: 16, offsetY: 24 },
            { partId: 'animal-body-bird', offsetX: 10, offsetY: 17,
                colorOverrides: { 0: '#f06020', 1: '#c04010' } },
            { partId: 'animal-head-bird', offsetX: 9, offsetY: 11,
                colorOverrides: { 0: '#f06020', 1: '#c04010', 3: '#f0d060' } },
            { partId: 'animal-wing-large', offsetX: 18, offsetY: 10,
                colorOverrides: { 0: '#f0a020', 1: '#d06010' } },
            { partId: 'animal-tail-bird', offsetX: 4, offsetY: 19,
                colorOverrides: { 0: '#f07030', 1: '#d05020' } },
        ]),
    },
];
/** Initialize: register all animal parts */
function initAnimalParts() {
    spriteGeneratorCore.registerParts(ANIMAL_PARTS);
}

exports.ANIMAL_PARTS = ANIMAL_PARTS;
exports.ANIMAL_PRESETS = ANIMAL_PRESETS;
exports.FEATHER_PALETTES = FEATHER_PALETTES;
exports.FUR_PALETTES = FUR_PALETTES;
exports.SCALE_PALETTES = SCALE_PALETTES;
exports.initAnimalParts = initAnimalParts;
//# sourceMappingURL=animalGeneratorPresets.js.map
