"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get getChildren () {
        return getChildren;
    },
    get updatePropsRecursively () {
        return updatePropsRecursively;
    }
});
const _react = require("react");
const updatePropsRecursively = (children, activeIndex, view, disabled, updateValue)=>_react.Children.map(children || [], (child, index)=>{
        if (!(0, _react.isValidElement)(child)) {
            return child;
        }
        const props = {
            index,
            value: !!(activeIndex?.findIndex((i)=>i === (child.props.eventKey ?? index)) !== -1),
            view,
            disabled,
            onChange: updateValue
        };
        return (0, _react.cloneElement)(child, props);
    });
const getChildren = (children, activeIndex, view, disabled, updateValue)=>{
    return updatePropsRecursively(children, activeIndex, view, disabled, updateValue);
};
