'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var jsxRuntime = require('react/jsx-runtime');
var characterTypes = require('./characterTypes.js');
var heads = require('./shapes/heads.js');
var hair = require('./shapes/hair.js');
var eyes = require('./shapes/eyes.js');
var noses = require('./shapes/noses.js');
var mouths = require('./shapes/mouths.js');
var outfits = require('./shapes/outfits.js');
var torsos = require('./shapes/torsos.js');
var arms = require('./shapes/arms.js');
var legs = require('./shapes/legs.js');
var headwear = require('./shapes/headwear.js');

/** Static character body composed from modular SVG shapes. */
const NiceBodyRenderer = ({ character, size }) => {
    var _a;
    const S = Math.max(120, Math.floor((_a = size !== null && size !== void 0 ? size : character.size) !== null && _a !== void 0 ? _a : 180));
    const k = S / 180;
    const skin = characterTypes.pick(character.face.colors, 0, characterTypes.DEFAULT_COLORS.skin);
    const stroke = characterTypes.pick(character.face.colors, 2, characterTypes.DEFAULT_COLORS.stroke);
    const outfitBase = characterTypes.pick(character.outfit.colors, 0, characterTypes.DEFAULT_COLORS.shirt);
    const armColors = [skin, outfitBase, stroke];
    const legColors = [outfitBase, characterTypes.pick(character.outfit.colors, 1, outfitBase), stroke];
    return (jsxRuntime.jsx("svg", { width: S, height: S, viewBox: `0 0 ${S} ${S}`, role: "img", children: jsxRuntime.jsxs("g", { transform: `translate(${S / 2} ${S * 0.86})`, children: [jsxRuntime.jsx(legs.Leg, { colors: legColors, side: -1, variant: "pants", scale: k, transform: "translate(-16 0)" }), jsxRuntime.jsx(legs.Leg, { colors: legColors, side: 1, variant: "pants", scale: k, transform: "translate(16 0)" }), jsxRuntime.jsx(torsos.Torso, { variant: "vShape", colors: [skin, "var(--anim-transparent, #00000000)", stroke], scale: k }), jsxRuntime.jsx(outfits.Outfit, { variant: character.outfit.variant, colors: character.outfit.colors, scale: k }), jsxRuntime.jsx(arms.Arm, { colors: armColors, side: -1, variant: "sleeveShort", scale: k, transform: "translate(-40 -8)" }), jsxRuntime.jsx(arms.Arm, { colors: armColors, side: 1, variant: "sleeveShort", scale: k, transform: "translate(40 -8)" }), jsxRuntime.jsxs("g", { transform: "translate(0 -84)", children: [jsxRuntime.jsx(heads.Head, { variant: character.face.variant, colors: character.face.colors, scale: k }), jsxRuntime.jsx(hair.Hair, { variant: character.hair.variant, colors: character.hair.colors, scale: k }), jsxRuntime.jsx(eyes.Eyes, { variant: character.eyes.variant, colors: character.eyes.colors, scale: k }), jsxRuntime.jsx(noses.Nose, { variant: character.nose.variant, colors: character.nose.colors, scale: k }), jsxRuntime.jsx(mouths.Mouth, { variant: character.mouth.variant, colors: character.mouth.colors, scale: k }), jsxRuntime.jsx(headwear.Headwear, { variant: character.headwear.variant, colors: character.headwear.colors, scale: k })] })] }) }));
};
/** @deprecated Use NiceBodyRenderer */
const BodyRenderer = NiceBodyRenderer;

exports.BodyRenderer = BodyRenderer;
exports.NiceBodyRenderer = NiceBodyRenderer;
exports.default = NiceBodyRenderer;
//# sourceMappingURL=BodyRenderer.js.map
