"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listenDragOver = exports.makeDragOverListener = void 0;
const pointer_1 = require("../pointer");
function makeDragOverListener(listener, _global = false) {
    return (component) => {
        return listenDragOver(component, listener, _global);
    };
}
exports.makeDragOverListener = makeDragOverListener;
function listenDragOver(component, listener, _global = false) {
    const { $element } = component;
    const dragOverListener = (_event) => {
        const { $context } = component;
        // AD HOC
        _event.preventDefault();
        const event = Object.assign(Object.assign({}, (0, pointer_1.applyContextTransformToPointerEvent)($context, _event)), { dataTransfer: null });
        listener(event, _event);
    };
    $element.addEventListener('dragover', dragOverListener, _global);
    return () => {
        $element.removeEventListener('dragover', dragOverListener, _global);
    };
}
exports.listenDragOver = listenDragOver;
//# sourceMappingURL=dragover.js.map