import { clone } from "remeda";
const defaultDimensions = (advancedVSeed, context)=>{
    const result = {
        ...advancedVSeed
    };
    const { vseed } = context;
    const { dimensions, dataset } = vseed;
    if (dimensions && dimensions.length > 0) return {
        ...result,
        dimensions: clone(dimensions.map((dim)=>({
                ...dim,
                alias: dim.alias || dim.id
            })))
    };
    const measures = advancedVSeed.measures;
    const top100dataset = dataset.slice(0, 100);
    const sample = top100dataset.reduce((prev, cur)=>({
            ...prev,
            ...cur
        }), {});
    const newDimensions = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'string' == typeof item[key]) && ![
            '',
            null,
            void 0
        ].includes(key) && !measures.some((measure)=>measure.id === key)).map((dim)=>({
            id: dim,
            alias: dim
        }));
    return {
        ...result,
        dimensions: newDimensions
    };
};
export { defaultDimensions };

//# sourceMappingURL=defaultDimensions.js.map