export function resolvePosition(position) {
    if (position instanceof MouseEvent) {
        return { x: position.clientX, y: position.clientY };
    }
    if (position instanceof Element) {
        const rect = position.getBoundingClientRect();
        return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
    }
    return position;
}
//# sourceMappingURL=position.js.map