import $ from "jquery";

import { CrossSellingPointer } from "../../others/crossSellingPointer.js";
import { RPM } from "../names.js";

const crossRpmMove = () =>
    CrossSellingPointer.isActionAvailable(RPM, "move") &&
    (window as any).rml?.hooks.register("attachment/move/finished", (ids: number[], to: number[]) => {
        new CrossSellingPointer($(`.rml-container:visible li[data-li-id="${to}"]`), RPM, "move");
    });

export { crossRpmMove };
