"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addGlobalBlurListener = addGlobalBlurListener;
function addGlobalBlurListener($element, listener) {
    const _listener = (event) => {
        const { relatedTarget } = event;
        if (relatedTarget === null) {
            listener(event);
        }
    };
    $element.addEventListener('blur', _listener, true);
    return () => {
        $element.removeEventListener('blur', _listener, true);
    };
}
//# sourceMappingURL=addGlobalBlurListener.js.map