import { jsxs, jsx } from 'react/jsx-runtime';
import { pick } from '../characterTypes.js';

function pal(c) {
    return {
        skin: pick(c, 0, "var(--anim-skin, #FFD2B3)"),
        shade: pick(c, 1, "var(--anim-skin-shade, #F2C4A9)"),
        stroke: pick(c, 2, "var(--anim-stroke, #111)"),
    };
}
const HeadRound = ({ colors, scale = 1, transform, strokeWidth = 1.6 }) => {
    const { skin, shade, stroke } = pal(colors);
    return (jsxs("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, stroke: stroke, strokeWidth: strokeWidth, children: [jsx("circle", { cx: 0, cy: -8, r: 34, fill: skin }), jsx("ellipse", { cx: 10, cy: -20, rx: 10, ry: 6, fill: shade, opacity: 0.15 })] }));
};
const HeadOval = ({ colors, scale = 1, transform, strokeWidth = 1.6 }) => {
    const { skin, shade, stroke } = pal(colors);
    return (jsxs("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, stroke: stroke, strokeWidth: strokeWidth, children: [jsx("ellipse", { cx: 0, cy: -6, rx: 30, ry: 36, fill: skin }), jsx("ellipse", { cx: -12, cy: -18, rx: 8, ry: 5, fill: shade, opacity: 0.12 })] }));
};
const HeadSquare = ({ colors, scale = 1, transform, strokeWidth = 1.6 }) => {
    const { skin, shade, stroke } = pal(colors);
    return (jsxs("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, stroke: stroke, strokeWidth: strokeWidth, strokeLinejoin: "round", children: [jsx("path", { d: "M-26 -32 h52 v40 l-14 10 h-24 l-14 -10 z", fill: skin }), jsx("rect", { x: -10, y: -20, width: 12, height: 6, fill: shade, opacity: 0.12 })] }));
};
const HeadHeart = ({ colors, scale = 1, transform, strokeWidth = 1.6 }) => {
    const { skin, stroke } = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, stroke: stroke, strokeWidth: strokeWidth, strokeLinejoin: "round", children: jsx("path", { d: "M0 -6 c14 -22,38 -10,30 14 c-6 18,-20 30,-30 34 c-10 -4,-24 -16,-30 -34 c-8 -24,16 -36,30 -14 z", fill: skin }) }));
};
const HeadDiamond = ({ colors, scale = 1, transform, strokeWidth = 1.6 }) => {
    const { skin, stroke } = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, stroke: stroke, strokeWidth: strokeWidth, strokeLinejoin: "round", children: jsx("path", { d: "M0 -44 L28 -8 L0 28 L-28 -8 Z", fill: skin }) }));
};
const HeadLong = ({ colors, scale = 1, transform, strokeWidth = 1.6 }) => {
    const { skin, stroke } = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, stroke: stroke, strokeWidth: strokeWidth, children: jsx("ellipse", { cx: 0, cy: -6, rx: 26, ry: 40, fill: skin }) }));
};
const HeadChubby = ({ colors, scale = 1, transform, strokeWidth = 1.6 }) => {
    const { skin, stroke } = pal(colors);
    return (jsx("g", { transform: `${transform !== null && transform !== void 0 ? transform : ""} scale(${scale})`, stroke: stroke, strokeWidth: strokeWidth, children: jsx("circle", { cx: 0, cy: -6, r: 38, fill: skin }) }));
};
const HEAD_RENDERERS = {
    round: HeadRound, oval: HeadOval, square: HeadSquare,
    heart: HeadHeart, diamond: HeadDiamond, long: HeadLong, chubby: HeadChubby,
    flatTop: HeadSquare, egg: HeadOval, triangle: HeadDiamond,
    hex: HeadDiamond, pear: HeadOval, bean: HeadRound, heroJaw: HeadSquare,
};
const NiceHead = ({ variant, ...rest }) => {
    var _a;
    const Comp = (_a = HEAD_RENDERERS[variant]) !== null && _a !== void 0 ? _a : HeadRound;
    return jsx(Comp, { ...rest });
};
/** @deprecated Use NiceHead */
const Head = NiceHead;

export { HEAD_RENDERERS, Head, HeadChubby, HeadDiamond, HeadHeart, HeadLong, HeadOval, HeadRound, HeadSquare, NiceHead };
//# sourceMappingURL=heads.js.map
