import { Feature } from "../../motion/features/Feature.js";
import { VisualElementDragControls } from "./VisualElementDragControls.js";
import { noop } from "../../../../../motion-utils/dist/es/noop.js";
class DragGesture extends Feature {
  constructor(node) {
    super(node);
    this.removeGroupControls = noop;
    this.removeListeners = noop;
    this.controls = new VisualElementDragControls(node);
  }
  mount() {
    const { dragControls } = this.node.getProps();
    if (dragControls) {
      this.removeGroupControls = dragControls.subscribe(this.controls);
    }
    this.removeListeners = this.controls.addListeners() || noop;
  }
  unmount() {
    this.removeGroupControls();
    this.removeListeners();
  }
}
export {
  DragGesture
};
//# sourceMappingURL=index.js.map
