import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__useGetAriaLabelOfPopover_mjs__ from "./useGetAriaLabelOfPopover.mjs";
function useSetAriaLabelForPopover(visible) {
    const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__useGetAriaLabelOfPopover_mjs__.useGetAriaLabelOfPopover)();
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        if (visible) {
            const wrappers = [
                ...document.querySelectorAll('.ant-popover-content')
            ];
            const currentWrapper = wrappers[wrappers.length - 1];
            if (currentWrapper) {
                currentWrapper.setAttribute('role', 'button');
                currentWrapper.setAttribute('data-testid', getAriaLabel());
                currentWrapper.setAttribute('aria-label', getAriaLabel());
            }
        }
    }, [
        getAriaLabel,
        visible
    ]);
}
export { useSetAriaLabelForPopover };
