'use strict';

const swipe_subject = require('./swipe.subject-67b38daa.js');

function ListenToSwipe(options = { mobileOnly: false }) {
  return function (target, _propertyKey, _descriptor) {
    const { connectedCallback, disconnectedCallback } = target;
    target.connectedCallback = function () {
      this._balSwipeSubject = new swipe_subject.BalSwipeSubject(options);
      this._balSwipeSubject.attach(this);
      return connectedCallback && connectedCallback.call(this);
    };
    target.disconnectedCallback = function () {
      this._balSwipeSubject.detach();
      return disconnectedCallback && disconnectedCallback.call(this);
    };
  };
}

exports.ListenToSwipe = ListenToSwipe;
