"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listenFocus = exports.makeFocusListener = void 0;
function makeFocusListener(listener) {
    return (component) => {
        return listenFocus(component, listener);
    };
}
exports.makeFocusListener = makeFocusListener;
function listenFocus(component, listener) {
    const { $element } = component;
    const focusListener = (_event) => {
        const { relatedTarget } = _event;
        listener({ relatedTarget }, _event);
    };
    $element.addEventListener('focus', focusListener);
    return () => {
        $element.removeEventListener('focus', focusListener);
    };
}
exports.listenFocus = listenFocus;
//# sourceMappingURL=focus.js.map