"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const Feature = require("./dist-es-motion-features-Feature.cjs");
require("../motion-utils/dist-es-errors.cjs");
const noop = require("../motion-utils/dist-es-noop.cjs");
const VisualElementDragControls = require("./dist-es-gestures-drag-VisualElementDragControls.cjs");
class DragGesture extends Feature.Feature {
  constructor(node) {
    super(node);
    this.removeGroupControls = noop.noop;
    this.removeListeners = noop.noop;
    this.controls = new VisualElementDragControls.VisualElementDragControls(node);
  }
  mount() {
    const { dragControls } = this.node.getProps();
    if (dragControls) {
      this.removeGroupControls = dragControls.subscribe(this.controls);
    }
    this.removeListeners = this.controls.addListeners() || noop.noop;
  }
  unmount() {
    this.removeGroupControls();
    this.removeListeners();
  }
}
exports.DragGesture = DragGesture;
//# sourceMappingURL=dist-es-gestures-drag-index.cjs.map
