import { isControllingVariants } from '../../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.mjs';
import { isVariantLabel } from '../../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/utils/is-variant-label.mjs';

function getCurrentTreeVariants(props, context) {
    if (isControllingVariants(props)) {
        const { initial, animate } = props;
        return {
            initial: initial === false || isVariantLabel(initial)
                ? initial
                : undefined,
            animate: isVariantLabel(animate) ? animate : undefined,
        };
    }
    return props.inherit !== false ? context : {};
}

export { getCurrentTreeVariants };
