"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeDragLeaveListener = makeDragLeaveListener;
exports.listenDragLeave = listenDragLeave;
const pointer_1 = require("../pointer");
function makeDragLeaveListener(listener, _global = false) {
    return (component) => {
        return listenDragLeave(component, listener);
    };
}
function listenDragLeave(component, listener, _global = false) {
    const { $element } = component;
    const dragLeaveListener = (_event) => {
        const { $context } = component;
        const event = {
            ...(0, pointer_1.applyContextTransformToPointerEvent)($context, _event),
            dataTransfer: null,
        };
        listener(event, _event);
    };
    $element.addEventListener('dragleave', dragLeaveListener);
    return () => {
        $element.removeEventListener('dragleave', dragLeaveListener);
    };
}
//# sourceMappingURL=dragleave.js.map