"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.rowMoveModifier = exports.columnMoveModifier = void 0;
var utilities_1 = require("@dnd-kit/utilities");
var columnMoveModifier = function (_a) {
    var activatorEvent = _a.activatorEvent, draggingNodeRect = _a.draggingNodeRect, transform = _a.transform;
    if (draggingNodeRect && activatorEvent) {
        var activatorCoordinates = (0, utilities_1.getEventCoordinates)(activatorEvent);
        if (!activatorCoordinates) {
            return transform;
        }
        var offsetX = activatorCoordinates.x - draggingNodeRect.left;
        return __assign(__assign({}, transform), { x: transform.x + offsetX - draggingNodeRect.width / 2, y: 0 });
    }
    return transform;
};
exports.columnMoveModifier = columnMoveModifier;
var rowMoveModifier = function (_a) {
    var activatorEvent = _a.activatorEvent, draggingNodeRect = _a.draggingNodeRect, transform = _a.transform;
    if (draggingNodeRect && activatorEvent) {
        var activatorCoordinates = (0, utilities_1.getEventCoordinates)(activatorEvent);
        if (!activatorCoordinates) {
            return transform;
        }
        return __assign(__assign({}, transform), { x: 0, y: transform.y });
    }
    return transform;
};
exports.rowMoveModifier = rowMoveModifier;
