import { isValidElement } from 'react';
function isTabTotalElement(node) {
    return (isValidElement(node) &&
        typeof node.type?.initTabTotal ===
            'function');
}
function isTabsFilterElement(node) {
    return (isValidElement(node) &&
        Array.isArray(node.props.data) &&
        typeof node.props.counterBadge === 'function');
}
export function getToolbarCollectionFeaturesInitializers(props) {
    const { tabs } = props;
    const tabTotalFeatureInitializer = (() => {
        if (isTabsFilterElement(tabs)) {
            const tabsProps = tabs.props;
            const el = tabsProps?.data
                .map((value) => tabs.props.counterBadge?.(value))
                .find(isTabTotalElement);
            return el?.type?.initTabTotal?.(tabs.props, el.props);
        }
        return undefined;
    })();
    return [tabTotalFeatureInitializer];
}
//# sourceMappingURL=getToolbarCollectionFeaturesInitializers.js.map