"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeFocusOutListener = makeFocusOutListener;
exports.listenFocusOut = listenFocusOut;
function makeFocusOutListener(listener) {
    return (component) => {
        return listenFocusOut(component, listener);
    };
}
function listenFocusOut(component, listener) {
    const { $element } = component;
    const focusInListener = (_event) => {
        const { relatedTarget } = _event;
        listener({ relatedTarget }, _event);
    };
    $element.addEventListener('focusout', focusInListener);
    return () => {
        $element.removeEventListener('focusout', focusInListener);
    };
}
//# sourceMappingURL=focusout.js.map