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