import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__useGetAriaLabelOfDrawer_mjs__ from "./useGetAriaLabelOfDrawer.mjs";
function useSetAriaLabelForDrawer(visible) {
    const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__useGetAriaLabelOfDrawer_mjs__.useGetAriaLabelOfDrawer)();
    (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
        if (visible) {
            const wrappers = [
                ...document.querySelectorAll('.ant-drawer-wrapper-body')
            ];
            const masks = [
                ...document.querySelectorAll('.ant-drawer-mask')
            ];
            const currentMask = masks[masks.length - 1];
            const currentWrapper = wrappers[wrappers.length - 1];
            if (currentMask) {
                currentMask.setAttribute('role', 'button');
                currentMask.setAttribute('aria-label', getAriaLabel('mask'));
            }
            if (currentWrapper) {
                currentWrapper.setAttribute('role', 'button');
                currentWrapper.setAttribute('data-testid', getAriaLabel());
                currentWrapper.setAttribute('aria-label', getAriaLabel());
            }
        }
    }, [
        getAriaLabel,
        visible
    ]);
}
export { useSetAriaLabelForDrawer };
