/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-7eefd09
 * Released under the MIT license.
 */

export var Bucket;
(function (Bucket) {
    Bucket[Bucket["Color"] = 0] = "Color";
    Bucket[Bucket["Value"] = 1] = "Value";
    Bucket[Bucket["Mod"] = 2] = "Mod";
})(Bucket || (Bucket = {}));
export const makeEmptyPart = () => ({
    mods: [],
    values: [],
    colors: [],
    all: [],
    output: '',
});
export const makeEmptyDetails = () => ({
    input: '',
    output: '',
    mods: [],
    values: [],
    colors: [],
    all: [],
    parts: [],
});
export const finalizePart = (p) => {
    p.output = p.all.join(' ');
    return p;
};
/**
 * Aggregate parts into a StyleDetails group.
 * Combines all parts' arrays into group-level arrays for backward compatibility.
 */
export const finalizeGroup = (d, parts) => {
    // Store parts
    d.parts = parts;
    // Aggregate all parts into group-level arrays
    for (const part of parts) {
        d.mods.push(...part.mods);
        d.values.push(...part.values);
        d.colors.push(...part.colors);
        d.all.push(...part.all);
    }
    // Join parts' outputs with ' / ' for the group output
    d.output = parts.map((p) => p.output).join(' / ');
    return d;
};

        