/**
 * interact.js 1.5.3
 *
 * Copyright (c) 2012-2019 Taye Adeyemi <dev@taye.me>
 * Released under the MIT License.
 * https://raw.github.com/taye/interact.js/master/LICENSE
 */
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.interact = f()}})(function(){var define,module,exports;
    var createModuleFactory = function createModuleFactory(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}};
    var _$scope_24 = createModuleFactory(function (module, exports) {
    "use strict";
    
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    /* common-shake removed: exports.createScope = */ void createScope;
    /* common-shake removed: exports.initScope = */ void initScope;
    exports.Scope = exports.ActionName = void 0;
    
    var utils = _interopRequireWildcard(_$utils_56);
    
    var _domObjects = _interopRequireDefault(_$domObjects_50);
    
    var _defaultOptions = _interopRequireDefault(_$defaultOptions_20);
    
    var _Eventable = _interopRequireDefault(_$Eventable_14);
    
    var _Interactable = _interopRequireDefault(_$Interactable_16);
    
    var _InteractableSet = _interopRequireDefault(_$InteractableSet_17);
    
    var _InteractEvent = _interopRequireDefault(_$InteractEvent_15);
    
    var _interactions = _interopRequireDefault(_$interactions_23({}));
    
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
    
    function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
    
    function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    
    function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
    
    function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
    
    function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
    
    function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
    
    function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
    
    function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    
    var win = utils.win,
        browser = utils.browser,
        raf = utils.raf,
        Signals = utils.Signals,
        events = utils.events;
    var ActionName;
    exports.ActionName = ActionName;
    
    (function (ActionName) {})(ActionName || (exports.ActionName = ActionName = {}));
    
    function createScope() {
      return new Scope();
    }
    
    var Scope =
    /*#__PURE__*/
    function () {
      function Scope() {
        var _this = this;
    
        _classCallCheck(this, Scope);
    
        this.id = "__interact_scope_".concat(Math.floor(Math.random() * 100));
        this.signals = new Signals();
        this.browser = browser;
        this.events = events;
        this.utils = utils;
        this.defaults = utils.clone(_defaultOptions["default"]);
        this.Eventable = _Eventable["default"];
        this.actions = {
          names: [],
          methodDict: {},
          eventTypes: []
        };
        this.InteractEvent = _InteractEvent["default"];
        this.interactables = new _InteractableSet["default"](this); // all documents being listened to
    
        this.documents = [];
        this._plugins = [];
        this._pluginMap = {};
    
        this.onWindowUnload = function (event) {
          return _this.removeDocument(event.target);
        };
    
        var scope = this;
    
        this.Interactable =
        /*#__PURE__*/
        function (_InteractableBase) {
          _inherits(Interactable, _InteractableBase);
    
          function Interactable() {
            _classCallCheck(this, Interactable);
    
            return _possibleConstructorReturn(this, _getPrototypeOf(Interactable).apply(this, arguments));
          }
    
          _createClass(Interactable, [{
            key: "set",
            value: function set(options) {
              _get(_getPrototypeOf(Interactable.prototype), "set", this).call(this, options);
    
              scope.interactables.signals.fire('set', {
                options: options,
                interactable: this
              });
              return this;
            }
          }, {
            key: "unset",
            value: function unset() {
              _get(_getPrototypeOf(Interactable.prototype), "unset", this).call(this);
    
              for (var i = scope.interactions.list.length - 1; i >= 0; i--) {
                var interaction = scope.interactions.list[i];
    
                if (interaction.interactable === this) {
                  interaction.stop();
                  scope.interactions.signals.fire('destroy', {
                    interaction: interaction
                  });
                  interaction.destroy();
    
                  if (scope.interactions.list.length > 2) {
                    scope.interactions.list.splice(i, 1);
                  }
                }
              }
    
              scope.interactables.signals.fire('unset', {
                interactable: this
              });
            }
          }, {
            key: "_defaults",
            get: function get() {
              return scope.defaults;
            }
          }]);
    
          return Interactable;
        }(_Interactable["default"]);
      }
    
      _createClass(Scope, [{
        key: "init",
        value: function init(window) {
          return initScope(this, window);
        }
      }, {
        key: "pluginIsInstalled",
        value: function pluginIsInstalled(plugin) {
          return this._pluginMap[plugin.id] || this._plugins.indexOf(plugin) !== -1;
        }
      }, {
        key: "usePlugin",
        value: function usePlugin(plugin, options) {
          if (this.pluginIsInstalled(plugin)) {
            return this;
          }
    
          if (plugin.id) {
            this._pluginMap[plugin.id] = plugin;
          }
    
          plugin.install(this, options);
    
          this._plugins.push(plugin);
    
          return this;
        }
      }, {
        key: "addDocument",
        value: function addDocument(doc, options) {
          // do nothing if document is already known
          if (this.getDocIndex(doc) !== -1) {
            return false;
          }
    
          var window = win.getWindow(doc);
          options = options ? utils.extend({}, options) : {};
          this.documents.push({
            doc: doc,
            options: options
          });
          events.documents.push(doc); // don't add an unload event for the main document
          // so that the page may be cached in browser history
    
          if (doc !== this.document) {
            events.add(window, 'unload', this.onWindowUnload);
          }
    
          this.signals.fire('add-document', {
            doc: doc,
            window: window,
            scope: this,
            options: options
          });
        }
      }, {
        key: "removeDocument",
        value: function removeDocument(doc) {
          var index = this.getDocIndex(doc);
          var window = win.getWindow(doc);
          var options = this.documents[index].options;
          events.remove(window, 'unload', this.onWindowUnload);
          this.documents.splice(index, 1);
          events.documents.splice(index, 1);
          this.signals.fire('remove-document', {
            doc: doc,
            window: window,
            scope: this,
            options: options
          });
        }
      }, {
        key: "getDocIndex",
        value: function getDocIndex(doc) {
          for (var i = 0; i < this.documents.length; i++) {
            if (this.documents[i].doc === doc) {
              return i;
            }
          }
    
          return -1;
        }
      }, {
        key: "getDocOptions",
        value: function getDocOptions(doc) {
          var docIndex = this.getDocIndex(doc);
          return docIndex === -1 ? null : this.documents[docIndex].options;
        }
      }, {
        key: "now",
        value: function now() {
          return (this.window.Date || Date).now();
        }
      }]);
    
      return Scope;
    }();
    
    exports.Scope = Scope;
    
    function initScope(scope, window) {
      win.init(window);
    
      _domObjects["default"].init(window);
    
      browser.init(window);
      raf.init(window);
      events.init(window);
      scope.usePlugin(_interactions["default"]);
      scope.document = window.document;
      scope.window = window;
      return scope;
    }
    
    });
    var _$interactions_23 = createModuleFactory(function (module, exports) {
    "use strict";
    
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports["default"] = void 0;
    
    var _browser = _interopRequireDefault(_$browser_48);
    
    var _domObjects = _interopRequireDefault(_$domObjects_50);
    
    /* removed: var _$domUtils_51 = require("@interactjs/utils/domUtils"); */;
    
    var _events = _interopRequireDefault(_$events_52);
    
    var _pointerUtils = _interopRequireDefault(_$pointerUtils_61);
    
    var _Signals = _interopRequireDefault(_$Signals_46);
    
    var _Interaction = _interopRequireDefault(_$Interaction_18({}));
    
    var _interactionFinder = _interopRequireDefault(_$interactionFinder_22);
    
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
    
    function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
    
    function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
    
    function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
    
    function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
    
    function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    
    function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
    
    function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    
    function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
    
    function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
    
    function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
    
    var methodNames = ['pointerDown', 'pointerMove', 'pointerUp', 'updatePointer', 'removePointer', 'windowBlur'];
    
    function install(scope) {
      var signals = new _Signals["default"]();
      var listeners = {};
    
      for (var _i = 0; _i < methodNames.length; _i++) {
        var method = methodNames[_i];
        listeners[method] = doOnInteractions(method, scope);
      }
    
      var pEventTypes = _browser["default"].pEventTypes;
      var docEvents;
    
      if (_domObjects["default"].PointerEvent) {
        docEvents = [{
          type: pEventTypes.down,
          listener: releasePointersOnRemovedEls
        }, {
          type: pEventTypes.down,
          listener: listeners.pointerDown
        }, {
          type: pEventTypes.move,
          listener: listeners.pointerMove
        }, {
          type: pEventTypes.up,
          listener: listeners.pointerUp
        }, {
          type: pEventTypes.cancel,
          listener: listeners.pointerUp
        }];
      } else {
        docEvents = [{
          type: 'mousedown',
          listener: listeners.pointerDown
        }, {
          type: 'mousemove',
          listener: listeners.pointerMove
        }, {
          type: 'mouseup',
          listener: listeners.pointerUp
        }, {
          type: 'touchstart',
          listener: releasePointersOnRemovedEls
        }, {
          type: 'touchstart',
          listener: listeners.pointerDown
        }, {
          type: 'touchmove',
          listener: listeners.pointerMove
        }, {
          type: 'touchend',
          listener: listeners.pointerUp
        }, {
          type: 'touchcancel',
          listener: listeners.pointerUp
        }];
      }
    
      docEvents.push({
        type: 'blur',
        listener: function listener(event) {
          for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
            var _ref;
    
            _ref = scope.interactions.list[_i2];
            var interaction = _ref;
            interaction.documentBlur(event);
          }
        }
      });
      scope.signals.on('add-document', onDocSignal);
      scope.signals.on('remove-document', onDocSignal); // for ignoring browser's simulated mouse events
    
      scope.prevTouchTime = 0;
    
      scope.Interaction =
      /*#__PURE__*/
      function (_InteractionBase) {
        _inherits(Interaction, _InteractionBase);
    
        function Interaction() {
          _classCallCheck(this, Interaction);
    
          return _possibleConstructorReturn(this, _getPrototypeOf(Interaction).apply(this, arguments));
        }
    
        _createClass(Interaction, [{
          key: "_now",
          value: function _now() {
            return scope.now();
          }
        }, {
          key: "pointerMoveTolerance",
          get: function get() {
            return scope.interactions.pointerMoveTolerance;
          },
          set: function set(value) {
            scope.interactions.pointerMoveTolerance = value;
          }
        }]);
    
        return Interaction;
      }(_Interaction["default"]);
    
      scope.interactions = {
        signals: signals,
        // all active and idle interactions
        list: [],
        "new": function _new(options) {
          options.signals = signals;
          var interaction = new scope.Interaction(options);
          scope.interactions.list.push(interaction);
          return interaction;
        },
        listeners: listeners,
        docEvents: docEvents,
        pointerMoveTolerance: 1
      };
    
      function releasePointersOnRemovedEls() {
        // for all inactive touch interactions with pointers down
        for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
          var _ref2;
    
          _ref2 = scope.interactions.list[_i3];
          var interaction = _ref2;
    
          if (!interaction.pointerIsDown || interaction.pointerType !== 'touch' || interaction._interacting) {
            continue;
          } // if a pointer is down on an element that is no longer in the DOM tree
    
    
          var _loop = function _loop() {
            _ref3 = interaction.pointers[_i4];
            var pointer = _ref3;
    
            if (!scope.documents.some(function (_ref4) {
              var doc = _ref4.doc;
              return (0, _$domUtils_51.nodeContains)(doc, pointer.downTarget);
            })) {
              // remove the pointer from the interaction
              interaction.removePointer(pointer.pointer, pointer.event);
            }
          };
    
          for (var _i4 = 0; _i4 < interaction.pointers.length; _i4++) {
            var _ref3;
    
            _loop();
          }
        }
      }
    }
    
    function doOnInteractions(method, scope) {
      return function (event) {
        var interactions = scope.interactions.list;
    
        var pointerType = _pointerUtils["default"].getPointerType(event);
    
        var _pointerUtils$getEven = _pointerUtils["default"].getEventTargets(event),
            _pointerUtils$getEven2 = _slicedToArray(_pointerUtils$getEven, 2),
            eventTarget = _pointerUtils$getEven2[0],
            curEventTarget = _pointerUtils$getEven2[1];
    
        var matches = []; // [ [pointer, interaction], ...]
    
        if (/^touch/.test(event.type)) {
          scope.prevTouchTime = scope.now();
    
          for (var _i5 = 0; _i5 < event.changedTouches.length; _i5++) {
            var _ref5;
    
            _ref5 = event.changedTouches[_i5];
            var changedTouch = _ref5;
            var pointer = changedTouch;
    
            var pointerId = _pointerUtils["default"].getPointerId(pointer);
    
            var searchDetails = {
              pointer: pointer,
              pointerId: pointerId,
              pointerType: pointerType,
              eventType: event.type,
              eventTarget: eventTarget,
              curEventTarget: curEventTarget,
              scope: scope
            };
            var interaction = getInteraction(searchDetails);
            matches.push([searchDetails.pointer, searchDetails.eventTarget, searchDetails.curEventTarget, interaction]);
          }
        } else {
          var invalidPointer = false;
    
          if (!_browser["default"].supportsPointerEvent && /mouse/.test(event.type)) {
            // ignore mouse events while touch interactions are active
            for (var i = 0; i < interactions.length && !invalidPointer; i++) {
              invalidPointer = interactions[i].pointerType !== 'mouse' && interactions[i].pointerIsDown;
            } // try to ignore mouse events that are simulated by the browser
            // after a touch event
    
    
            invalidPointer = invalidPointer || scope.now() - scope.prevTouchTime < 500 || // on iOS and Firefox Mobile, MouseEvent.timeStamp is zero if simulated
            event.timeStamp === 0;
          }
    
          if (!invalidPointer) {
            var _searchDetails = {
              pointer: event,
              pointerId: _pointerUtils["default"].getPointerId(event),
              pointerType: pointerType,
              eventType: event.type,
              curEventTarget: curEventTarget,
              eventTarget: eventTarget,
              scope: scope
            };
    
            var _interaction = getInteraction(_searchDetails);
    
            matches.push([_searchDetails.pointer, _searchDetails.eventTarget, _searchDetails.curEventTarget, _interaction]);
          }
        } // eslint-disable-next-line no-shadow
    
    
        for (var _i6 = 0; _i6 < matches.length; _i6++) {
          var _matches$_i = _slicedToArray(matches[_i6], 4),
              _pointer = _matches$_i[0],
              _eventTarget = _matches$_i[1],
              _curEventTarget = _matches$_i[2],
              _interaction2 = _matches$_i[3];
    
          _interaction2[method](_pointer, event, _eventTarget, _curEventTarget);
        }
      };
    }
    
    function getInteraction(searchDetails) {
      var pointerType = searchDetails.pointerType,
          scope = searchDetails.scope;
    
      var foundInteraction = _interactionFinder["default"].search(searchDetails);
    
      var signalArg = {
        interaction: foundInteraction,
        searchDetails: searchDetails
      };
      scope.interactions.signals.fire('find', signalArg);
      return signalArg.interaction || scope.interactions["new"]({
        pointerType: pointerType
      });
    }
    
    function onDocSignal(_ref6, signalName) {
      var doc = _ref6.doc,
          scope = _ref6.scope,
          options = _ref6.options;
      var docEvents = scope.interactions.docEvents;
      var eventMethod = signalName.indexOf('add') === 0 ? _events["default"].add : _events["default"].remove;
    
      if (scope.browser.isIOS && !options.events) {
        options.events = {
          passive: false
        };
      } // delegate event listener
    
    
      for (var eventType in _events["default"].delegatedEvents) {
        eventMethod(doc, eventType, _events["default"].delegateListener);
        eventMethod(doc, eventType, _events["default"].delegateUseCapture, true);
      }
    
      var eventOptions = options && options.events;
    
      for (var _i7 = 0; _i7 < docEvents.length; _i7++) {
        var _ref7;
    
        _ref7 = docEvents[_i7];
        var _ref8 = _ref7,
            type = _ref8.type,
            listener = _ref8.listener;
        eventMethod(doc, type, listener, eventOptions);
      }
    }
    
    var _default = {
      id: 'core/interactions',
      install: install,
      onDocSignal: onDocSignal,
      doOnInteractions: doOnInteractions,
      methodNames: methodNames
    };
    exports["default"] = _default;
    
    });
    var _$Interaction_18 = createModuleFactory(function (module, exports) {
    "use strict";
    
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    Object.defineProperty(exports, "PointerInfo", {
      enumerable: true,
      get: function get() {
        return _PointerInfo["default"];
      }
    });
    exports["default"] = exports.Interaction = exports._ProxyMethods = exports._ProxyValues = void 0;
    
    var utils = _interopRequireWildcard(_$utils_56);
    
    var _InteractEvent = _interopRequireWildcard(_$InteractEvent_15);
    
    var _PointerInfo = _interopRequireDefault(_$PointerInfo_19);
    
    var _scope = _$scope_24({});
    
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    
    var _ProxyValues;
    
    exports._ProxyValues = _ProxyValues;
    
    (function (_ProxyValues) {
      _ProxyValues["interactable"] = "";
      _ProxyValues["element"] = "";
      _ProxyValues["prepared"] = "";
      _ProxyValues["pointerIsDown"] = "";
      _ProxyValues["pointerWasMoved"] = "";
      _ProxyValues["_proxy"] = "";
    })(_ProxyValues || (exports._ProxyValues = _ProxyValues = {}));
    
    var _ProxyMethods;
    
    exports._ProxyMethods = _ProxyMethods;
    
    (function (_ProxyMethods) {
      _ProxyMethods["start"] = "";
      _ProxyMethods["move"] = "";
      _ProxyMethods["end"] = "";
      _ProxyMethods["stop"] = "";
      _ProxyMethods["interacting"] = "";
    })(_ProxyMethods || (exports._ProxyMethods = _ProxyMethods = {}));
    
    var Interaction =
    /*#__PURE__*/
    function () {
      /** */
      function Interaction(_ref) {
        var _this = this;
    
        var pointerType = _ref.pointerType,
            signals = _ref.signals;
    
        _classCallCheck(this, Interaction);
    
        // current interactable being interacted with
        this.interactable = null; // the target element of the interactable
    
        this.element = null; // action that's ready to be fired on next move event
    
        this.prepared = {
          name: null,
          axis: null,
          edges: null
        }; // keep track of added pointers
    
        this.pointers = []; // pointerdown/mousedown/touchstart event
    
        this.downEvent = null;
        this.downPointer = {};
        this._latestPointer = {
          pointer: null,
          event: null,
          eventTarget: null
        }; // previous action event
    
        this.prevEvent = null;
        this.pointerIsDown = false;
        this.pointerWasMoved = false;
        this._interacting = false;
        this._ending = false;
        this._stopped = true;
        this._proxy = null;
        this.simulation = null;
        /**
         * @alias Interaction.prototype.move
         */
    
        this.doMove = utils.warnOnce(function (signalArg) {
          this.move(signalArg);
        }, 'The interaction.doMove() method has been renamed to interaction.move()');
        this.coords = {
          // Starting InteractEvent pointer coordinates
          start: utils.pointer.newCoords(),
          // Previous native pointer move event coordinates
          prev: utils.pointer.newCoords(),
          // current native pointer move event coordinates
          cur: utils.pointer.newCoords(),
          // Change in coordinates and time of the pointer
          delta: utils.pointer.newCoords(),
          // pointer velocity
          velocity: utils.pointer.newCoords()
        };
        this._signals = signals;
        this.pointerType = pointerType;
        var that = this;
        this._proxy = {};
    
        var _loop = function _loop(key) {
          Object.defineProperty(_this._proxy, key, {
            get: function get() {
              return that[key];
            }
          });
        };
    
        for (var key in _ProxyValues) {
          _loop(key);
        }
    
        var _loop2 = function _loop2(key) {
          Object.defineProperty(_this._proxy, key, {
            value: function value() {
              return that[key].apply(that, arguments);
            }
          });
        };
    
        for (var key in _ProxyMethods) {
          _loop2(key);
        }
    
        this._signals.fire('new', {
          interaction: this
        });
      }
    
      _createClass(Interaction, [{
        key: "pointerDown",
        value: function pointerDown(pointer, event, eventTarget) {
          var pointerIndex = this.updatePointer(pointer, event, eventTarget, true);
    
          this._signals.fire('down', {
            pointer: pointer,
            event: event,
            eventTarget: eventTarget,
            pointerIndex: pointerIndex,
            interaction: this
          });
        }
        /**
         * ```js
         * interact(target)
         *   .draggable({
         *     // disable the default drag start by down->move
         *     manualStart: true
         *   })
         *   // start dragging after the user holds the pointer down
         *   .on('hold', function (event) {
         *     var interaction = event.interaction
         *
         *     if (!interaction.interacting()) {
         *       interaction.start({ name: 'drag' },
         *                         event.interactable,
         *                         event.currentTarget)
         *     }
         * })
         * ```
         *
         * Start an action with the given Interactable and Element as tartgets. The
         * action must be enabled for the target Interactable and an appropriate
         * number of pointers must be held down - 1 for drag/resize, 2 for gesture.
         *
         * Use it with `interactable.<action>able({ manualStart: false })` to always
         * [start actions manually](https://github.com/taye/interact.js/issues/114)
         *
         * @param {object} action   The action to be performed - drag, resize, etc.
         * @param {Interactable} target  The Interactable to target
         * @param {Element} element The DOM Element to target
         * @return {object} interact
         */
    
      }, {
        key: "start",
        value: function start(action, interactable, element) {
          if (this.interacting() || !this.pointerIsDown || this.pointers.length < (action.name === _scope.ActionName.Gesture ? 2 : 1) || !interactable.options[action.name].enabled) {
            return false;
          }
    
          utils.copyAction(this.prepared, action);
          this.interactable = interactable;
          this.element = element;
          this.rect = interactable.getRect(element);
          this.edges = this.prepared.edges;
          this._stopped = false;
          this._interacting = this._doPhase({
            interaction: this,
            event: this.downEvent,
            phase: _InteractEvent.EventPhase.Start
          }) && !this._stopped;
          return this._interacting;
        }
      }, {
        key: "pointerMove",
        value: function pointerMove(pointer, event, eventTarget) {
          if (!this.simulation && !(this.modifiers && this.modifiers.endPrevented)) {
            this.updatePointer(pointer, event, eventTarget, false);
            utils.pointer.setCoords(this.coords.cur, this.pointers.map(function (p) {
              return p.pointer;
            }), this._now());
          }
    
          var duplicateMove = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
          var dx;
          var dy; // register movement greater than pointerMoveTolerance
    
          if (this.pointerIsDown && !this.pointerWasMoved) {
            dx = this.coords.cur.client.x - this.coords.start.client.x;
            dy = this.coords.cur.client.y - this.coords.start.client.y;
            this.pointerWasMoved = utils.hypot(dx, dy) > this.pointerMoveTolerance;
          }
    
          var signalArg = {
            pointer: pointer,
            pointerIndex: this.getPointerIndex(pointer),
            event: event,
            eventTarget: eventTarget,
            dx: dx,
            dy: dy,
            duplicate: duplicateMove,
            interaction: this
          };
    
          if (!duplicateMove) {
            // set pointer coordinate, time changes and velocity
            utils.pointer.setCoordDeltas(this.coords.delta, this.coords.prev, this.coords.cur);
            utils.pointer.setCoordVelocity(this.coords.velocity, this.coords.delta);
          }
    
          this._signals.fire('move', signalArg);
    
          if (!duplicateMove) {
            // if interacting, fire an 'action-move' signal etc
            if (this.interacting()) {
              this.move(signalArg);
            }
    
            if (this.pointerWasMoved) {
              utils.pointer.copyCoords(this.coords.prev, this.coords.cur);
            }
          }
        }
        /**
         * ```js
         * interact(target)
         *   .draggable(true)
         *   .on('dragmove', function (event) {
         *     if (someCondition) {
         *       // change the snap settings
         *       event.interactable.draggable({ snap: { targets: [] }})
         *       // fire another move event with re-calculated snap
         *       event.interaction.move()
         *     }
         *   })
         * ```
         *
         * Force a move of the current action at the same coordinates. Useful if
         * snap/restrict has been changed and you want a movement with the new
         * settings.
         */
    
      }, {
        key: "move",
        value: function move(signalArg) {
          signalArg = utils.extend({
            pointer: this._latestPointer.pointer,
            event: this._latestPointer.event,
            eventTarget: this._latestPointer.eventTarget,
            interaction: this
          }, signalArg || {});
          signalArg.phase = _InteractEvent.EventPhase.Move;
    
          this._doPhase(signalArg);
        } // End interact move events and stop auto-scroll unless simulation is running
    
      }, {
        key: "pointerUp",
        value: function pointerUp(pointer, event, eventTarget, curEventTarget) {
          var pointerIndex = this.getPointerIndex(pointer);
    
          if (pointerIndex === -1) {
            pointerIndex = this.updatePointer(pointer, event, eventTarget, false);
          }
    
          this._signals.fire(/cancel$/i.test(event.type) ? 'cancel' : 'up', {
            pointer: pointer,
            pointerIndex: pointerIndex,
            event: event,
            eventTarget: eventTarget,
            curEventTarget: curEventTarget,
            interaction: this
          });
    
          if (!this.simulation) {
            this.end(event);
          }
    
          this.pointerIsDown = false;
          this.removePointer(pointer, event);
        }
      }, {
        key: "documentBlur",
        value: function documentBlur(event) {
          this.end(event);
    
          this._signals.fire('blur', {
            event: event,
            interaction: this
          });
        }
        /**
         * ```js
         * interact(target)
         *   .draggable(true)
         *   .on('move', function (event) {
         *     if (event.pageX > 1000) {
         *       // end the current action
         *       event.interaction.end()
         *       // stop all further listeners from being called
         *       event.stopImmediatePropagation()
         *     }
         *   })
         * ```
         *
         * @param {PointerEvent} [event]
         */
    
      }, {
        key: "end",
        value: function end(event) {
          this._ending = true;
          event = event || this._latestPointer.event;
          var endPhaseResult;
    
          if (this.interacting()) {
            endPhaseResult = this._doPhase({
              event: event,
              interaction: this,
              phase: _InteractEvent.EventPhase.End
            });
          }
    
          this._ending = false;
    
          if (endPhaseResult === true) {
            this.stop();
          }
        }
      }, {
        key: "currentAction",
        value: function currentAction() {
          return this._interacting ? this.prepared.name : null;
        }
      }, {
        key: "interacting",
        value: function interacting() {
          return this._interacting;
        }
        /** */
    
      }, {
        key: "stop",
        value: function stop() {
          this._signals.fire('stop', {
            interaction: this
          });
    
          this.interactable = this.element = null;
          this._interacting = false;
          this._stopped = true;
          this.prepared.name = this.prevEvent = null;
        }
      }, {
        key: "getPointerIndex",
        value: function getPointerIndex(pointer) {
          var pointerId = utils.pointer.getPointerId(pointer); // mouse and pen interactions may have only one pointer
    
          return this.pointerType === 'mouse' || this.pointerType === 'pen' ? this.pointers.length - 1 : utils.arr.findIndex(this.pointers, function (curPointer) {
            return curPointer.id === pointerId;
          });
        }
      }, {
        key: "getPointerInfo",
        value: function getPointerInfo(pointer) {
          return this.pointers[this.getPointerIndex(pointer)];
        }
      }, {
        key: "updatePointer",
        value: function updatePointer(pointer, event, eventTarget, down) {
          var id = utils.pointer.getPointerId(pointer);
          var pointerIndex = this.getPointerIndex(pointer);
          var pointerInfo = this.pointers[pointerIndex];
          down = down === false ? false : down || /(down|start)$/i.test(event.type);
    
          if (!pointerInfo) {
            pointerInfo = new _PointerInfo["default"](id, pointer, event, null, null);
            pointerIndex = this.pointers.length;
            this.pointers.push(pointerInfo);
          } else {
            pointerInfo.pointer = pointer;
          }
    
          if (down) {
            this.pointerIsDown = true;
    
            if (!this.interacting()) {
              utils.pointer.setCoords(this.coords.start, this.pointers.map(function (p) {
                return p.pointer;
              }), this._now());
              utils.pointer.copyCoords(this.coords.cur, this.coords.start);
              utils.pointer.copyCoords(this.coords.prev, this.coords.start);
              utils.pointer.pointerExtend(this.downPointer, pointer);
              this.downEvent = event;
              pointerInfo.downTime = this.coords.cur.timeStamp;
              pointerInfo.downTarget = eventTarget;
              this.pointerWasMoved = false;
            }
          }
    
          this._updateLatestPointer(pointer, event, eventTarget);
    
          this._signals.fire('update-pointer', {
            pointer: pointer,
            event: event,
            eventTarget: eventTarget,
            down: down,
            pointerInfo: pointerInfo,
            pointerIndex: pointerIndex,
            interaction: this
          });
    
          return pointerIndex;
        }
      }, {
        key: "removePointer",
        value: function removePointer(pointer, event) {
          var pointerIndex = this.getPointerIndex(pointer);
    
          if (pointerIndex === -1) {
            return;
          }
    
          var pointerInfo = this.pointers[pointerIndex];
    
          this._signals.fire('remove-pointer', {
            pointer: pointer,
            event: event,
            pointerIndex: pointerIndex,
            pointerInfo: pointerInfo,
            interaction: this
          });
    
          this.pointers.splice(pointerIndex, 1);
        }
      }, {
        key: "_updateLatestPointer",
        value: function _updateLatestPointer(pointer, event, eventTarget) {
          this._latestPointer.pointer = pointer;
          this._latestPointer.event = event;
          this._latestPointer.eventTarget = eventTarget;
        }
      }, {
        key: "destroy",
        value: function destroy() {
          this._latestPointer.pointer = null;
          this._latestPointer.event = null;
          this._latestPointer.eventTarget = null;
        }
      }, {
        key: "_createPreparedEvent",
        value: function _createPreparedEvent(event, phase, preEnd, type) {
          var actionName = this.prepared.name;
          return new _InteractEvent["default"](this, event, actionName, phase, this.element, null, preEnd, type);
        }
      }, {
        key: "_fireEvent",
        value: function _fireEvent(iEvent) {
          this.interactable.fire(iEvent);
    
          if (!this.prevEvent || iEvent.timeStamp >= this.prevEvent.timeStamp) {
            this.prevEvent = iEvent;
          }
        }
      }, {
        key: "_doPhase",
        value: function _doPhase(signalArg) {
          var event = signalArg.event,
              phase = signalArg.phase,
              preEnd = signalArg.preEnd,
              type = signalArg.type;
    
          var beforeResult = this._signals.fire("before-action-".concat(phase), signalArg);
    
          if (beforeResult === false) {
            return false;
          }
    
          var iEvent = signalArg.iEvent = this._createPreparedEvent(event, phase, preEnd, type);
    
          var rect = this.rect;
    
          if (rect) {
            // update the rect modifications
            var edges = this.edges || this.prepared.edges || {
              left: true,
              right: true,
              top: true,
              bottom: true
            };
    
            if (edges.top) {
              rect.top += iEvent.delta.y;
            }
    
            if (edges.bottom) {
              rect.bottom += iEvent.delta.y;
            }
    
            if (edges.left) {
              rect.left += iEvent.delta.x;
            }
    
            if (edges.right) {
              rect.right += iEvent.delta.x;
            }
    
            rect.width = rect.right - rect.left;
            rect.height = rect.bottom - rect.top;
          }
    
          this._signals.fire("action-".concat(phase), signalArg);
    
          this._fireEvent(iEvent);
    
          this._signals.fire("after-action-".concat(phase), signalArg);
    
          return true;
        }
      }, {
        key: "_now",
        value: function _now() {
          return Date.now();
        }
      }, {
        key: "pointerMoveTolerance",
        get: function get() {
          return 1;
        }
      }]);
    
      return Interaction;
    }();
    
    exports.Interaction = Interaction;
    var _default = Interaction;
    exports["default"] = _default;
    
    });
    var _$arr_47 = {};
    "use strict";
    
    Object.defineProperty(_$arr_47, "__esModule", {
      value: true
    });
    _$arr_47.contains = contains;
    _$arr_47.remove = remove;
    _$arr_47.merge = merge;
    _$arr_47.from = from;
    _$arr_47.findIndex = findIndex;
    _$arr_47.find = find;
    
    function contains(array, target) {
      return array.indexOf(target) !== -1;
    }
    
    function remove(array, target) {
      return array.splice(array.indexOf(target), 1);
    }
    
    function merge(target, source) {
      for (var _i = 0; _i < source.length; _i++) {
        var _ref;
    
        _ref = source[_i];
        var item = _ref;
        target.push(item);
      }
    
      return target;
    }
    
    function from(source) {
      return merge([], source);
    }
    
    function findIndex(array, func) {
      for (var i = 0; i < array.length; i++) {
        if (func(array[i], i, array)) {
          return i;
        }
      }
    
      return -1;
    }
    
    function find(array, func) {
      return array[findIndex(array, func)];
    }
    
    var _$domObjects_50 = {};
    "use strict";
    
    Object.defineProperty(_$domObjects_50, "__esModule", {
      value: true
    });
    _$domObjects_50["default"] = void 0;
    var domObjects = {
      init: init,
      document: null,
      DocumentFragment: null,
      SVGElement: null,
      SVGSVGElement: null,
      // eslint-disable-next-line no-undef
      SVGElementInstance: null,
      Element: null,
      HTMLElement: null,
      Event: null,
      Touch: null,
      PointerEvent: null
    };
    
    function blank() {}
    
    var _default = domObjects;
    _$domObjects_50["default"] = _default;
    
    function init(window) {
      var win = window;
      domObjects.document = win.document;
      domObjects.DocumentFragment = win.DocumentFragment || blank;
      domObjects.SVGElement = win.SVGElement || blank;
      domObjects.SVGSVGElement = win.SVGSVGElement || blank;
      domObjects.SVGElementInstance = win.SVGElementInstance || blank;
      domObjects.Element = win.Element || blank;
      domObjects.HTMLElement = win.HTMLElement || domObjects.Element;
      domObjects.Event = win.Event;
      domObjects.Touch = win.Touch || blank;
      domObjects.PointerEvent = win.PointerEvent || win.MSPointerEvent;
    }
    
    var _$isWindow_58 = {};
    "use strict";
    
    Object.defineProperty(_$isWindow_58, "__esModule", {
      value: true
    });
    _$isWindow_58["default"] = void 0;
    
    var ___default_58 = function _default(thing) {
      return !!(thing && thing.Window) && thing instanceof thing.Window;
    };
    
    _$isWindow_58["default"] = ___default_58;
    
    var _$window_66 = {};
    "use strict";
    
    Object.defineProperty(_$window_66, "__esModule", {
      value: true
    });
    _$window_66.init = __init_66;
    _$window_66.getWindow = getWindow;
    _$window_66["default"] = void 0;
    
    var _isWindow = _interopRequireDefault(_$isWindow_58);
    
    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    var win = {
      realWindow: undefined,
      window: undefined,
      getWindow: getWindow,
      init: __init_66
    };
    
    function __init_66(window) {
      // get wrapped window if using Shadow DOM polyfill
      win.realWindow = window; // create a TextNode
    
      var el = window.document.createTextNode(''); // check if it's wrapped by a polyfill
    
      if (el.ownerDocument !== window.document && typeof window.wrap === 'function' && window.wrap(el) === el) {
        // use wrapped window
        window = window.wrap(window);
      }
    
      win.window = window;
    }
    
    if (typeof window === 'undefined') {
      win.window = undefined;
      win.realWindow = undefined;
    } else {
      __init_66(window);
    }
    
    function getWindow(node) {
      if ((0, _isWindow["default"])(node)) {
        return node;
      }
    
      var rootNode = node.ownerDocument || node;
      return rootNode.defaultView || win.window;
    }
    
    win.init = __init_66;
    var ___default_66 = win;
    _$window_66["default"] = ___default_66;
    
    var _$is_57 = {};
    "use strict";
    
    Object.defineProperty(_$is_57, "__esModule", {
      value: true
    });
    _$is_57.array = _$is_57.plainObject = _$is_57.element = _$is_57.string = _$is_57.bool = _$is_57.number = _$is_57.func = _$is_57.object = _$is_57.docFrag = _$is_57.window = void 0;
    
    var ___isWindow_57 = ___interopRequireDefault_57(_$isWindow_58);
    
    var _window2 = ___interopRequireDefault_57(_$window_66);
    
    function ___interopRequireDefault_57(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
    
    var __window_57 = function window(thing) {
      return thing === _window2["default"].window || (0, ___isWindow_57["default"])(thing);
    };
    
    _$is_57.window = __window_57;
    
    var docFrag = function docFrag(thing) {
      return object(thing) && thing.nodeType === 11;
    };
    
    _$is_57.docFrag = docFrag;
    
    var object = function object(thing) {
      return !!thing && _typeof(thing) === 'object';
    };
    
    _$is_57.object = object;
    
    var func = function func(thing) {
      return typeof thing === 'function';
    };
    
    _$is_57.func = func;
    
    var number = function number(thing) {
      return typeof thing === 'number';
    };
    
    _$is_57.number = number;
    
    var bool = function bool(thing) {
      return typeof thing === 'boolean';
    };
    
    _$is_57.bool = bool;
    
    var string = function string(thing) {
      return typeof thing === 'string';
    };
    
    _$is_57.string = string;
    
    var element = function element(thing) {
      if (!thing || _typeof(thing) !== 'object') {
        return false;
      }
    
      var _window = _window2["default"].getWindow(thing) || _window2["default"].window;
    
      return /object|function/.test(_typeof(_window.Element)) ? thing instanceof _window.Element // DOM2
      : thing.nodeType === 1 && typeof thing.nodeName === 'string';
    };
    
    _$is_57.element = element;
    
    var plainObject = function plainObject(thing) {
      return object(thing) && !!thing.constructor && /function Object\b/.test(thing.constructor.toString());
    };
    
    _$is_57.plainObject = plainObject;
    
    var array = function array(thing) {
      return object(thing) && typeof thing.length !== 'undefined' && func(thing.splice);
    };
    
    _$is_57.array = array;
    
    var _$browser_48 = {};
    "use strict";
    
    Object.defineProperty(_$browser_48, "__esModule", {
      value: true
    });
    _$browser_48["default"] = void 0;
    
    var _domObjects = ___interopRequireDefault_48(_$domObjects_50);
    
    var is = _interopRequireWildcard(_$is_57);
    
    var _window = ___interopRequireDefault_48(_$window_66);
    
    function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_48(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    var browser = {
      init: __init_48,
      supportsTouch: null,
      supportsPointerEvent: null,
      isIOS7: null,
      isIOS: null,
      isIe9: null,
      isOperaMobile: null,
      prefixedMatchesSelector: null,
      pEventTypes: null,
      wheelEvent: null
    };
    
    function __init_48(window) {
      var Element = _domObjects["default"].Element;
      var navigator = _window["default"].window.navigator; // Does the browser support touch input?
    
      browser.supportsTouch = 'ontouchstart' in window || is.func(window.DocumentTouch) && _domObjects["default"].document instanceof window.DocumentTouch; // Does the browser support PointerEvents
    
      browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!_domObjects["default"].PointerEvent;
      browser.isIOS = /iP(hone|od|ad)/.test(navigator.platform); // scrolling doesn't change the result of getClientRects on iOS 7
    
      browser.isIOS7 = /iP(hone|od|ad)/.test(navigator.platform) && /OS 7[^\d]/.test(navigator.appVersion);
      browser.isIe9 = /MSIE 9/.test(navigator.userAgent); // Opera Mobile must be handled differently
    
      browser.isOperaMobile = navigator.appName === 'Opera' && browser.supportsTouch && /Presto/.test(navigator.userAgent); // prefix matchesSelector
    
      browser.prefixedMatchesSelector = 'matches' in Element.prototype ? 'matches' : 'webkitMatchesSelector' in Element.prototype ? 'webkitMatchesSelector' : 'mozMatchesSelector' in Element.prototype ? 'mozMatchesSelector' : 'oMatchesSelector' in Element.prototype ? 'oMatchesSelector' : 'msMatchesSelector';
      browser.pEventTypes = browser.supportsPointerEvent ? _domObjects["default"].PointerEvent === window.MSPointerEvent ? {
        up: 'MSPointerUp',
        down: 'MSPointerDown',
        over: 'mouseover',
        out: 'mouseout',
        move: 'MSPointerMove',
        cancel: 'MSPointerCancel'
      } : {
        up: 'pointerup',
        down: 'pointerdown',
        over: 'pointerover',
        out: 'pointerout',
        move: 'pointermove',
        cancel: 'pointercancel'
      } : null; // because Webkit and Opera still use 'mousewheel' event type
    
      browser.wheelEvent = 'onmousewheel' in _domObjects["default"].document ? 'mousewheel' : 'wheel';
    }
    
    var ___default_48 = browser;
    _$browser_48["default"] = ___default_48;
    
    var _$domUtils_51 = {};
    "use strict";
    
    Object.defineProperty(_$domUtils_51, "__esModule", {
      value: true
    });
    _$domUtils_51.nodeContains = nodeContains;
    _$domUtils_51.closest = closest;
    _$domUtils_51.parentNode = parentNode;
    _$domUtils_51.matchesSelector = matchesSelector;
    _$domUtils_51.indexOfDeepestElement = indexOfDeepestElement;
    _$domUtils_51.matchesUpTo = matchesUpTo;
    _$domUtils_51.getActualElement = getActualElement;
    _$domUtils_51.getScrollXY = getScrollXY;
    _$domUtils_51.getElementClientRect = getElementClientRect;
    _$domUtils_51.getElementRect = getElementRect;
    _$domUtils_51.getPath = getPath;
    _$domUtils_51.trySelector = trySelector;
    
    var _browser = ___interopRequireDefault_51(_$browser_48);
    
    var ___domObjects_51 = ___interopRequireDefault_51(_$domObjects_50);
    
    var __is_51 = ___interopRequireWildcard_51(_$is_57);
    
    var ___window_51 = ___interopRequireDefault_51(_$window_66);
    
    function ___interopRequireWildcard_51(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_51(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function nodeContains(parent, child) {
      while (child) {
        if (child === parent) {
          return true;
        }
    
        child = child.parentNode;
      }
    
      return false;
    }
    
    function closest(element, selector) {
      while (__is_51.element(element)) {
        if (matchesSelector(element, selector)) {
          return element;
        }
    
        element = parentNode(element);
      }
    
      return null;
    }
    
    function parentNode(node) {
      var parent = node.parentNode;
    
      if (__is_51.docFrag(parent)) {
        // skip past #shado-root fragments
        // tslint:disable-next-line
        while ((parent = parent.host) && __is_51.docFrag(parent)) {
          continue;
        }
    
        return parent;
      }
    
      return parent;
    }
    
    function matchesSelector(element, selector) {
      // remove /deep/ from selectors if shadowDOM polyfill is used
      if (___window_51["default"].window !== ___window_51["default"].realWindow) {
        selector = selector.replace(/\/deep\//g, ' ');
      }
    
      return element[_browser["default"].prefixedMatchesSelector](selector);
    }
    
    var getParent = function getParent(el) {
      return el.parentNode ? el.parentNode : el.host;
    }; // Test for the element that's "above" all other qualifiers
    
    
    function indexOfDeepestElement(elements) {
      var deepestZoneParents = [];
      var dropzoneParents = [];
      var dropzone;
      var deepestZone = elements[0];
      var index = deepestZone ? 0 : -1;
      var parent;
      var child;
      var i;
      var n;
    
      for (i = 1; i < elements.length; i++) {
        dropzone = elements[i]; // an element might belong to multiple selector dropzones
    
        if (!dropzone || dropzone === deepestZone) {
          continue;
        }
    
        if (!deepestZone) {
          deepestZone = dropzone;
          index = i;
          continue;
        } // check if the deepest or current are document.documentElement or document.rootElement
        // - if the current dropzone is, do nothing and continue
    
    
        if (dropzone.parentNode === dropzone.ownerDocument) {
          continue;
        } // - if deepest is, update with the current dropzone and continue to next
        else if (deepestZone.parentNode === dropzone.ownerDocument) {
            deepestZone = dropzone;
            index = i;
            continue;
          }
    
        if (!deepestZoneParents.length) {
          parent = deepestZone;
    
          while (getParent(parent) && getParent(parent) !== parent.ownerDocument) {
            deepestZoneParents.unshift(parent);
            parent = getParent(parent);
          }
        } // if this element is an svg element and the current deepest is
        // an HTMLElement
    
    
        if (deepestZone instanceof ___domObjects_51["default"].HTMLElement && dropzone instanceof ___domObjects_51["default"].SVGElement && !(dropzone instanceof ___domObjects_51["default"].SVGSVGElement)) {
          if (dropzone === deepestZone.parentNode) {
            continue;
          }
    
          parent = dropzone.ownerSVGElement;
        } else {
          parent = dropzone;
        }
    
        dropzoneParents = [];
    
        while (parent.parentNode !== parent.ownerDocument) {
          dropzoneParents.unshift(parent);
          parent = getParent(parent);
        }
    
        n = 0; // get (position of last common ancestor) + 1
    
        while (dropzoneParents[n] && dropzoneParents[n] === deepestZoneParents[n]) {
          n++;
        }
    
        var parents = [dropzoneParents[n - 1], dropzoneParents[n], deepestZoneParents[n]];
        child = parents[0].lastChild;
    
        while (child) {
          if (child === parents[1]) {
            deepestZone = dropzone;
            index = i;
            deepestZoneParents = [];
            break;
          } else if (child === parents[2]) {
            break;
          }
    
          child = child.previousSibling;
        }
      }
    
      return index;
    }
    
    function matchesUpTo(element, selector, limit) {
      while (__is_51.element(element)) {
        if (matchesSelector(element, selector)) {
          return true;
        }
    
        element = parentNode(element);
    
        if (element === limit) {
          return matchesSelector(element, selector);
        }
      }
    
      return false;
    }
    
    function getActualElement(element) {
      return element instanceof ___domObjects_51["default"].SVGElementInstance ? element.correspondingUseElement : element;
    }
    
    function getScrollXY(relevantWindow) {
      relevantWindow = relevantWindow || ___window_51["default"].window;
      return {
        x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft,
        y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop
      };
    }
    
    function getElementClientRect(element) {
      var clientRect = element instanceof ___domObjects_51["default"].SVGElement ? element.getBoundingClientRect() : element.getClientRects()[0];
      return clientRect && {
        left: clientRect.left,
        right: clientRect.right,
        top: clientRect.top,
        bottom: clientRect.bottom,
        width: clientRect.width || clientRect.right - clientRect.left,
        height: clientRect.height || clientRect.bottom - clientRect.top
      };
    }
    
    function getElementRect(element) {
      var clientRect = getElementClientRect(element);
    
      if (!_browser["default"].isIOS7 && clientRect) {
        var scroll = getScrollXY(___window_51["default"].getWindow(element));
        clientRect.left += scroll.x;
        clientRect.right += scroll.x;
        clientRect.top += scroll.y;
        clientRect.bottom += scroll.y;
      }
    
      return clientRect;
    }
    
    function getPath(node) {
      var path = [];
    
      while (node) {
        path.push(node);
        node = parentNode(node);
      }
    
      return path;
    }
    
    function trySelector(value) {
      if (!__is_51.string(value)) {
        return false;
      } // an exception will be raised if it is invalid
    
    
      ___domObjects_51["default"].document.querySelector(value);
    
      return true;
    }
    
    var _$clone_49 = {};
    "use strict";
    
    Object.defineProperty(_$clone_49, "__esModule", {
      value: true
    });
    _$clone_49["default"] = clone;
    
    var arr = ___interopRequireWildcard_49(_$arr_47);
    
    var __is_49 = ___interopRequireWildcard_49(_$is_57);
    
    function ___interopRequireWildcard_49(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function clone(source) {
      var dest = {};
    
      for (var prop in source) {
        var value = source[prop];
    
        if (__is_49.plainObject(value)) {
          dest[prop] = clone(value);
        } else if (__is_49.array(value)) {
          dest[prop] = arr.from(value);
        } else {
          dest[prop] = value;
        }
      }
    
      return dest;
    }
    
    var _$pointerExtend_60 = {};
    "use strict";
    
    Object.defineProperty(_$pointerExtend_60, "__esModule", {
      value: true
    });
    _$pointerExtend_60["default"] = void 0;
    
    function pointerExtend(dest, source) {
      for (var prop in source) {
        var prefixedPropREs = pointerExtend.prefixedPropREs;
        var deprecated = false; // skip deprecated prefixed properties
    
        for (var vendor in prefixedPropREs) {
          if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {
            deprecated = true;
            break;
          }
        }
    
        if (!deprecated && typeof source[prop] !== 'function') {
          dest[prop] = source[prop];
        }
      }
    
      return dest;
    }
    
    pointerExtend.prefixedPropREs = {
      webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/
    };
    var ___default_60 = pointerExtend;
    _$pointerExtend_60["default"] = ___default_60;
    
    var _$hypot_55 = {};
    "use strict";
    
    Object.defineProperty(_$hypot_55, "__esModule", {
      value: true
    });
    _$hypot_55["default"] = void 0;
    
    var ___default_55 = function _default(x, y) {
      return Math.sqrt(x * x + y * y);
    };
    
    _$hypot_55["default"] = ___default_55;
    
    var _$pointerUtils_61 = {};
    "use strict";
    
    Object.defineProperty(_$pointerUtils_61, "__esModule", {
      value: true
    });
    _$pointerUtils_61["default"] = void 0;
    
    var ___browser_61 = ___interopRequireDefault_61(_$browser_48);
    
    var ___domObjects_61 = ___interopRequireDefault_61(_$domObjects_50);
    
    var domUtils = ___interopRequireWildcard_61(_$domUtils_51);
    
    var _hypot = ___interopRequireDefault_61(_$hypot_55);
    
    var __is_61 = ___interopRequireWildcard_61(_$is_57);
    
    var _pointerExtend = ___interopRequireDefault_61(_$pointerExtend_60);
    
    function ___interopRequireWildcard_61(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_61(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    var pointerUtils = {
      copyCoords: function copyCoords(dest, src) {
        dest.page = dest.page || {};
        dest.page.x = src.page.x;
        dest.page.y = src.page.y;
        dest.client = dest.client || {};
        dest.client.x = src.client.x;
        dest.client.y = src.client.y;
        dest.timeStamp = src.timeStamp;
      },
      setCoordDeltas: function setCoordDeltas(targetObj, prev, cur) {
        targetObj.page.x = cur.page.x - prev.page.x;
        targetObj.page.y = cur.page.y - prev.page.y;
        targetObj.client.x = cur.client.x - prev.client.x;
        targetObj.client.y = cur.client.y - prev.client.y;
        targetObj.timeStamp = cur.timeStamp - prev.timeStamp;
      },
      setCoordVelocity: function setCoordVelocity(targetObj, delta) {
        var dt = Math.max(delta.timeStamp / 1000, 0.001);
        targetObj.page.x = delta.page.x / dt;
        targetObj.page.y = delta.page.y / dt;
        targetObj.client.x = delta.client.x / dt;
        targetObj.client.y = delta.client.y / dt;
        targetObj.timeStamp = dt;
      },
      isNativePointer: function isNativePointer(pointer) {
        return pointer instanceof ___domObjects_61["default"].Event || pointer instanceof ___domObjects_61["default"].Touch;
      },
      // Get specified X/Y coords for mouse or event.touches[0]
      getXY: function getXY(type, pointer, xy) {
        xy = xy || {};
        type = type || 'page';
        xy.x = pointer[type + 'X'];
        xy.y = pointer[type + 'Y'];
        return xy;
      },
      getPageXY: function getPageXY(pointer, page) {
        page = page || {
          x: 0,
          y: 0
        }; // Opera Mobile handles the viewport and scrolling oddly
    
        if (___browser_61["default"].isOperaMobile && pointerUtils.isNativePointer(pointer)) {
          pointerUtils.getXY('screen', pointer, page);
          page.x += window.scrollX;
          page.y += window.scrollY;
        } else {
          pointerUtils.getXY('page', pointer, page);
        }
    
        return page;
      },
      getClientXY: function getClientXY(pointer, client) {
        client = client || {};
    
        if (___browser_61["default"].isOperaMobile && pointerUtils.isNativePointer(pointer)) {
          // Opera Mobile handles the viewport and scrolling oddly
          pointerUtils.getXY('screen', pointer, client);
        } else {
          pointerUtils.getXY('client', pointer, client);
        }
    
        return client;
      },
      getPointerId: function getPointerId(pointer) {
        return __is_61.number(pointer.pointerId) ? pointer.pointerId : pointer.identifier;
      },
      setCoords: function setCoords(targetObj, pointers, timeStamp) {
        var pointer = pointers.length > 1 ? pointerUtils.pointerAverage(pointers) : pointers[0];
        var tmpXY = {};
        pointerUtils.getPageXY(pointer, tmpXY);
        targetObj.page.x = tmpXY.x;
        targetObj.page.y = tmpXY.y;
        pointerUtils.getClientXY(pointer, tmpXY);
        targetObj.client.x = tmpXY.x;
        targetObj.client.y = tmpXY.y;
        targetObj.timeStamp = timeStamp;
      },
      pointerExtend: _pointerExtend["default"],
      getTouchPair: function getTouchPair(event) {
        var touches = []; // array of touches is supplied
    
        if (__is_61.array(event)) {
          touches[0] = event[0];
          touches[1] = event[1];
        } // an event
        else {
            if (event.type === 'touchend') {
              if (event.touches.length === 1) {
                touches[0] = event.touches[0];
                touches[1] = event.changedTouches[0];
              } else if (event.touches.length === 0) {
                touches[0] = event.changedTouches[0];
                touches[1] = event.changedTouches[1];
              }
            } else {
              touches[0] = event.touches[0];
              touches[1] = event.touches[1];
            }
          }
    
        return touches;
      },
      pointerAverage: function pointerAverage(pointers) {
        var average = {
          pageX: 0,
          pageY: 0,
          clientX: 0,
          clientY: 0,
          screenX: 0,
          screenY: 0
        };
    
        for (var _i = 0; _i < pointers.length; _i++) {
          var _ref;
    
          _ref = pointers[_i];
          var pointer = _ref;
    
          for (var _prop in average) {
            average[_prop] += pointer[_prop];
          }
        }
    
        for (var prop in average) {
          average[prop] /= pointers.length;
        }
    
        return average;
      },
      touchBBox: function touchBBox(event) {
        if (!event.length && !(event.touches && event.touches.length > 1)) {
          return null;
        }
    
        var touches = pointerUtils.getTouchPair(event);
        var minX = Math.min(touches[0].pageX, touches[1].pageX);
        var minY = Math.min(touches[0].pageY, touches[1].pageY);
        var maxX = Math.max(touches[0].pageX, touches[1].pageX);
        var maxY = Math.max(touches[0].pageY, touches[1].pageY);
        return {
          x: minX,
          y: minY,
          left: minX,
          top: minY,
          right: maxX,
          bottom: maxY,
          width: maxX - minX,
          height: maxY - minY
        };
      },
      touchDistance: function touchDistance(event, deltaSource) {
        var sourceX = deltaSource + 'X';
        var sourceY = deltaSource + 'Y';
        var touches = pointerUtils.getTouchPair(event);
        var dx = touches[0][sourceX] - touches[1][sourceX];
        var dy = touches[0][sourceY] - touches[1][sourceY];
        return (0, _hypot["default"])(dx, dy);
      },
      touchAngle: function touchAngle(event, deltaSource) {
        var sourceX = deltaSource + 'X';
        var sourceY = deltaSource + 'Y';
        var touches = pointerUtils.getTouchPair(event);
        var dx = touches[1][sourceX] - touches[0][sourceX];
        var dy = touches[1][sourceY] - touches[0][sourceY];
        var angle = 180 * Math.atan2(dy, dx) / Math.PI;
        return angle;
      },
      getPointerType: function getPointerType(pointer) {
        return __is_61.string(pointer.pointerType) ? pointer.pointerType : __is_61.number(pointer.pointerType) ? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType] // if the PointerEvent API isn't available, then the "pointer" must
        // be either a MouseEvent, TouchEvent, or Touch object
        : /touch/.test(pointer.type) || pointer instanceof ___domObjects_61["default"].Touch ? 'touch' : 'mouse';
      },
      // [ event.target, event.currentTarget ]
      getEventTargets: function getEventTargets(event) {
        var path = __is_61.func(event.composedPath) ? event.composedPath() : event.path;
        return [domUtils.getActualElement(path ? path[0] : event.target), domUtils.getActualElement(event.currentTarget)];
      },
      newCoords: function newCoords() {
        return {
          page: {
            x: 0,
            y: 0
          },
          client: {
            x: 0,
            y: 0
          },
          timeStamp: 0
        };
      },
      coordsToEvent: function coordsToEvent(coords) {
        var event = {
          coords: coords,
    
          get page() {
            return this.coords.page;
          },
    
          get client() {
            return this.coords.client;
          },
    
          get timeStamp() {
            return this.coords.timeStamp;
          },
    
          get pageX() {
            return this.coords.page.x;
          },
    
          get pageY() {
            return this.coords.page.y;
          },
    
          get clientX() {
            return this.coords.client.x;
          },
    
          get clientY() {
            return this.coords.client.y;
          },
    
          get pointerId() {
            return this.coords.pointerId;
          },
    
          get target() {
            return this.coords.target;
          },
    
          get type() {
            return this.coords.type;
          },
    
          get pointerType() {
            return this.coords.pointerType;
          },
    
          get buttons() {
            return this.coords.buttons;
          }
    
        };
        return event;
      }
    };
    var ___default_61 = pointerUtils;
    _$pointerUtils_61["default"] = ___default_61;
    
    var _$events_52 = {};
    "use strict";
    
    Object.defineProperty(_$events_52, "__esModule", {
      value: true
    });
    _$events_52["default"] = _$events_52.FakeEvent = void 0;
    
    /* removed: var _$arr_47 = require("./arr"); */;
    
    var __domUtils_52 = ___interopRequireWildcard_52(_$domUtils_51);
    
    var __is_52 = ___interopRequireWildcard_52(_$is_57);
    
    var ___pointerExtend_52 = ___interopRequireDefault_52(_$pointerExtend_60);
    
    var _pointerUtils = ___interopRequireDefault_52(_$pointerUtils_61);
    
    function ___interopRequireDefault_52(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_52(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    
    function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
    
    function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
    
    function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
    
    function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
    
    var elements = [];
    var targets = [];
    var delegatedEvents = {};
    var documents = [];
    
    function add(element, type, listener, optionalArg) {
      var options = getOptions(optionalArg);
      var elementIndex = elements.indexOf(element);
      var target = targets[elementIndex];
    
      if (!target) {
        target = {
          events: {},
          typeCount: 0
        };
        elementIndex = elements.push(element) - 1;
        targets.push(target);
      }
    
      if (!target.events[type]) {
        target.events[type] = [];
        target.typeCount++;
      }
    
      if (!(0, _$arr_47.contains)(target.events[type], listener)) {
        element.addEventListener(type, listener, events.supportsOptions ? options : !!options.capture);
        target.events[type].push(listener);
      }
    }
    
    function __remove_52(element, type, listener, optionalArg) {
      var options = getOptions(optionalArg);
      var elementIndex = elements.indexOf(element);
      var target = targets[elementIndex];
    
      if (!target || !target.events) {
        return;
      }
    
      if (type === 'all') {
        for (type in target.events) {
          if (target.events.hasOwnProperty(type)) {
            __remove_52(element, type, 'all');
          }
        }
    
        return;
      }
    
      if (target.events[type]) {
        var len = target.events[type].length;
    
        if (listener === 'all') {
          for (var i = 0; i < len; i++) {
            __remove_52(element, type, target.events[type][i], options);
          }
    
          return;
        } else {
          for (var _i = 0; _i < len; _i++) {
            if (target.events[type][_i] === listener) {
              element.removeEventListener(type, listener, events.supportsOptions ? options : !!options.capture);
              target.events[type].splice(_i, 1);
              break;
            }
          }
        }
    
        if (target.events[type] && target.events[type].length === 0) {
          target.events[type] = null;
          target.typeCount--;
        }
      }
    
      if (!target.typeCount) {
        targets.splice(elementIndex, 1);
        elements.splice(elementIndex, 1);
      }
    }
    
    function addDelegate(selector, context, type, listener, optionalArg) {
      var options = getOptions(optionalArg);
    
      if (!delegatedEvents[type]) {
        delegatedEvents[type] = {
          contexts: [],
          listeners: [],
          selectors: []
        }; // add delegate listener functions
    
        for (var _i2 = 0; _i2 < documents.length; _i2++) {
          var doc = documents[_i2];
          add(doc, type, delegateListener);
          add(doc, type, delegateUseCapture, true);
        }
      }
    
      var delegated = delegatedEvents[type];
      var index;
    
      for (index = delegated.selectors.length - 1; index >= 0; index--) {
        if (delegated.selectors[index] === selector && delegated.contexts[index] === context) {
          break;
        }
      }
    
      if (index === -1) {
        index = delegated.selectors.length;
        delegated.selectors.push(selector);
        delegated.contexts.push(context);
        delegated.listeners.push([]);
      } // keep listener and capture and passive flags
    
    
      delegated.listeners[index].push([listener, !!options.capture, options.passive]);
    }
    
    function removeDelegate(selector, context, type, listener, optionalArg) {
      var options = getOptions(optionalArg);
      var delegated = delegatedEvents[type];
      var matchFound = false;
      var index;
    
      if (!delegated) {
        return;
      } // count from last index of delegated to 0
    
    
      for (index = delegated.selectors.length - 1; index >= 0; index--) {
        // look for matching selector and context Node
        if (delegated.selectors[index] === selector && delegated.contexts[index] === context) {
          var listeners = delegated.listeners[index]; // each item of the listeners array is an array: [function, capture, passive]
    
          for (var i = listeners.length - 1; i >= 0; i--) {
            var _listeners$i = _slicedToArray(listeners[i], 3),
                fn = _listeners$i[0],
                capture = _listeners$i[1],
                passive = _listeners$i[2]; // check if the listener functions and capture and passive flags match
    
    
            if (fn === listener && capture === !!options.capture && passive === options.passive) {
              // remove the listener from the array of listeners
              listeners.splice(i, 1); // if all listeners for this interactable have been removed
              // remove the interactable from the delegated arrays
    
              if (!listeners.length) {
                delegated.selectors.splice(index, 1);
                delegated.contexts.splice(index, 1);
                delegated.listeners.splice(index, 1); // remove delegate function from context
    
                __remove_52(context, type, delegateListener);
                __remove_52(context, type, delegateUseCapture, true); // remove the arrays if they are empty
    
                if (!delegated.selectors.length) {
                  delegatedEvents[type] = null;
                }
              } // only remove one listener
    
    
              matchFound = true;
              break;
            }
          }
    
          if (matchFound) {
            break;
          }
        }
      }
    } // bound to the interactable context when a DOM event
    // listener is added to a selector interactable
    
    
    function delegateListener(event, optionalArg) {
      var options = getOptions(optionalArg);
      var fakeEvent = new FakeEvent(event);
      var delegated = delegatedEvents[event.type];
    
      var _pointerUtils$getEven = _pointerUtils["default"].getEventTargets(event),
          _pointerUtils$getEven2 = _slicedToArray(_pointerUtils$getEven, 1),
          eventTarget = _pointerUtils$getEven2[0];
    
      var element = eventTarget; // climb up document tree looking for selector matches
    
      while (__is_52.element(element)) {
        for (var i = 0; i < delegated.selectors.length; i++) {
          var selector = delegated.selectors[i];
          var context = delegated.contexts[i];
    
          if (__domUtils_52.matchesSelector(element, selector) && __domUtils_52.nodeContains(context, eventTarget) && __domUtils_52.nodeContains(context, element)) {
            var listeners = delegated.listeners[i];
            fakeEvent.currentTarget = element;
    
            for (var _i3 = 0; _i3 < listeners.length; _i3++) {
              var _ref;
    
              _ref = listeners[_i3];
    
              var _ref2 = _ref,
                  _ref3 = _slicedToArray(_ref2, 3),
                  fn = _ref3[0],
                  capture = _ref3[1],
                  passive = _ref3[2];
    
              if (capture === !!options.capture && passive === options.passive) {
                fn(fakeEvent);
              }
            }
          }
        }
    
        element = __domUtils_52.parentNode(element);
      }
    }
    
    function delegateUseCapture(event) {
      return delegateListener.call(this, event, true);
    }
    
    function getOptions(param) {
      return __is_52.object(param) ? param : {
        capture: param
      };
    }
    
    var FakeEvent =
    /*#__PURE__*/
    function () {
      function FakeEvent(originalEvent) {
        _classCallCheck(this, FakeEvent);
    
        this.originalEvent = originalEvent; // duplicate the event so that currentTarget can be changed
    
        (0, ___pointerExtend_52["default"])(this, originalEvent);
      }
    
      _createClass(FakeEvent, [{
        key: "preventOriginalDefault",
        value: function preventOriginalDefault() {
          this.originalEvent.preventDefault();
        }
      }, {
        key: "stopPropagation",
        value: function stopPropagation() {
          this.originalEvent.stopPropagation();
        }
      }, {
        key: "stopImmediatePropagation",
        value: function stopImmediatePropagation() {
          this.originalEvent.stopImmediatePropagation();
        }
      }]);
    
      return FakeEvent;
    }();
    
    _$events_52.FakeEvent = FakeEvent;
    var events = {
      add: add,
      remove: __remove_52,
      addDelegate: addDelegate,
      removeDelegate: removeDelegate,
      delegateListener: delegateListener,
      delegateUseCapture: delegateUseCapture,
      delegatedEvents: delegatedEvents,
      documents: documents,
      supportsOptions: false,
      supportsPassive: false,
      _elements: elements,
      _targets: targets,
      init: function init(window) {
        window.document.createElement('div').addEventListener('test', null, {
          get capture() {
            return events.supportsOptions = true;
          },
    
          get passive() {
            return events.supportsPassive = true;
          }
    
        });
      }
    };
    var ___default_52 = events;
    _$events_52["default"] = ___default_52;
    
    var _$extend_53 = {};
    "use strict";
    
    Object.defineProperty(_$extend_53, "__esModule", {
      value: true
    });
    _$extend_53["default"] = extend;
    
    function extend(dest, source) {
      for (var prop in source) {
        dest[prop] = source[prop];
      }
    
      return dest;
    }
    
    var _$rect_63 = {};
    "use strict";
    
    Object.defineProperty(_$rect_63, "__esModule", {
      value: true
    });
    _$rect_63.getStringOptionResult = getStringOptionResult;
    _$rect_63.resolveRectLike = resolveRectLike;
    _$rect_63.rectToXY = rectToXY;
    _$rect_63.xywhToTlbr = xywhToTlbr;
    _$rect_63.tlbrToXywh = tlbrToXywh;
    _$rect_63["default"] = void 0;
    
    /* removed: var _$domUtils_51 = require("./domUtils"); */;
    
    var _extend = ___interopRequireDefault_63(_$extend_53);
    
    var __is_63 = ___interopRequireWildcard_63(_$is_57);
    
    function ___interopRequireWildcard_63(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_63(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
    
    function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
    
    function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
    
    function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
    
    function getStringOptionResult(value, interactable, element) {
      if (value === 'parent') {
        return (0, _$domUtils_51.parentNode)(element);
      }
    
      if (value === 'self') {
        return interactable.getRect(element);
      }
    
      return (0, _$domUtils_51.closest)(element, value);
    }
    
    function resolveRectLike(value, interactable, element, functionArgs) {
      if (__is_63.string(value)) {
        value = getStringOptionResult(value, interactable, element);
      } else if (__is_63.func(value)) {
        value = value.apply(void 0, _toConsumableArray(functionArgs));
      }
    
      if (__is_63.element(value)) {
        value = (0, _$domUtils_51.getElementRect)(value);
      }
    
      return value;
    }
    
    function rectToXY(rect) {
      return rect && {
        x: 'x' in rect ? rect.x : rect.left,
        y: 'y' in rect ? rect.y : rect.top
      };
    }
    
    function xywhToTlbr(rect) {
      if (rect && !('left' in rect && 'top' in rect)) {
        rect = (0, _extend["default"])({}, rect);
        rect.left = rect.x || 0;
        rect.top = rect.y || 0;
        rect.right = rect.right || rect.left + rect.width;
        rect.bottom = rect.bottom || rect.top + rect.height;
      }
    
      return rect;
    }
    
    function tlbrToXywh(rect) {
      if (rect && !('x' in rect && 'y' in rect)) {
        rect = (0, _extend["default"])({}, rect);
        rect.x = rect.left || 0;
        rect.y = rect.top || 0;
        rect.width = rect.width || rect.right - rect.x;
        rect.height = rect.height || rect.bottom - rect.y;
      }
    
      return rect;
    }
    
    var ___default_63 = {
      getStringOptionResult: getStringOptionResult,
      resolveRectLike: resolveRectLike,
      rectToXY: rectToXY,
      xywhToTlbr: xywhToTlbr,
      tlbrToXywh: tlbrToXywh
    };
    _$rect_63["default"] = ___default_63;
    
    var _$getOriginXY_54 = {};
    "use strict";
    
    Object.defineProperty(_$getOriginXY_54, "__esModule", {
      value: true
    });
    _$getOriginXY_54["default"] = ___default_54;
    
    /* removed: var _$rect_63 = require("./rect"); */;
    
    function ___default_54(target, element, action) {
      var actionOptions = target.options[action];
      var actionOrigin = actionOptions && actionOptions.origin;
      var origin = actionOrigin || target.options.origin;
      var originRect = (0, _$rect_63.resolveRectLike)(origin, target, element, [target && element]);
      return (0, _$rect_63.rectToXY)(originRect) || {
        x: 0,
        y: 0
      };
    }
    
    var _$normalizeListeners_59 = {};
    "use strict";
    
    Object.defineProperty(_$normalizeListeners_59, "__esModule", {
      value: true
    });
    _$normalizeListeners_59["default"] = normalize;
    
    var ___extend_59 = ___interopRequireDefault_59(_$extend_53);
    
    var __is_59 = ___interopRequireWildcard_59(_$is_57);
    
    function ___interopRequireWildcard_59(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_59(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function normalize(type, listeners, result) {
      result = result || {};
    
      if (__is_59.string(type) && type.search(' ') !== -1) {
        type = split(type);
      }
    
      if (__is_59.array(type)) {
        return type.reduce(function (acc, t) {
          return (0, ___extend_59["default"])(acc, normalize(t, listeners, result));
        }, result);
      } // ({ type: fn }) -> ('', { type: fn })
    
    
      if (__is_59.object(type)) {
        listeners = type;
        type = '';
      }
    
      if (__is_59.func(listeners)) {
        result[type] = result[type] || [];
        result[type].push(listeners);
      } else if (__is_59.array(listeners)) {
        for (var _i = 0; _i < listeners.length; _i++) {
          var _ref;
    
          _ref = listeners[_i];
          var l = _ref;
          normalize(type, l, result);
        }
      } else if (__is_59.object(listeners)) {
        for (var prefix in listeners) {
          var combinedTypes = split(prefix).map(function (p) {
            return "".concat(type).concat(p);
          });
          normalize(combinedTypes, listeners[prefix], result);
        }
      }
    
      return result;
    }
    
    function split(type) {
      return type.trim().split(/ +/);
    }
    
    var _$raf_62 = {};
    "use strict";
    
    Object.defineProperty(_$raf_62, "__esModule", {
      value: true
    });
    _$raf_62["default"] = void 0;
    var lastTime = 0;
    
    var _request;
    
    var _cancel;
    
    function __init_62(window) {
      _request = window.requestAnimationFrame;
      _cancel = window.cancelAnimationFrame;
    
      if (!_request) {
        var vendors = ['ms', 'moz', 'webkit', 'o'];
    
        for (var _i = 0; _i < vendors.length; _i++) {
          var vendor = vendors[_i];
          _request = window["".concat(vendor, "RequestAnimationFrame")];
          _cancel = window["".concat(vendor, "CancelAnimationFrame")] || window["".concat(vendor, "CancelRequestAnimationFrame")];
        }
      }
    
      if (!_request) {
        _request = function request(callback) {
          var currTime = Date.now();
          var timeToCall = Math.max(0, 16 - (currTime - lastTime)); // eslint-disable-next-line standard/no-callback-literal
    
          var token = setTimeout(function () {
            callback(currTime + timeToCall);
          }, timeToCall);
          lastTime = currTime + timeToCall;
          return token;
        };
    
        _cancel = function cancel(token) {
          return clearTimeout(token);
        };
      }
    }
    
    var ___default_62 = {
      request: function request(callback) {
        return _request(callback);
      },
      cancel: function cancel(token) {
        return _cancel(token);
      },
      init: __init_62
    };
    _$raf_62["default"] = ___default_62;
    
    var _$Signals_46 = {};
    "use strict";
    
    Object.defineProperty(_$Signals_46, "__esModule", {
      value: true
    });
    _$Signals_46["default"] = void 0;
    
    function ___classCallCheck_46(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_46(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_46(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_46(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_46(Constructor, staticProps); return Constructor; }
    
    var Signals =
    /*#__PURE__*/
    function () {
      function Signals() {
        ___classCallCheck_46(this, Signals);
    
        this.listeners = {};
      }
    
      ___createClass_46(Signals, [{
        key: "on",
        value: function on(name, listener) {
          if (!this.listeners[name]) {
            this.listeners[name] = [listener];
            return;
          }
    
          this.listeners[name].push(listener);
        }
      }, {
        key: "off",
        value: function off(name, listener) {
          if (!this.listeners[name]) {
            return;
          }
    
          var index = this.listeners[name].indexOf(listener);
    
          if (index !== -1) {
            this.listeners[name].splice(index, 1);
          }
        }
      }, {
        key: "fire",
        value: function fire(name, arg) {
          var targetListeners = this.listeners[name];
    
          if (!targetListeners) {
            return;
          }
    
          for (var _i = 0; _i < targetListeners.length; _i++) {
            var _ref;
    
            _ref = targetListeners[_i];
            var listener = _ref;
    
            if (listener(arg, name) === false) {
              return false;
            }
          }
        }
      }]);
    
      return Signals;
    }();
    
    var ___default_46 = Signals;
    _$Signals_46["default"] = ___default_46;
    
    var _$utils_56 = {};
    "use strict";
    
    Object.defineProperty(_$utils_56, "__esModule", {
      value: true
    });
    _$utils_56.warnOnce = warnOnce;
    _$utils_56._getQBezierValue = _getQBezierValue;
    _$utils_56.getQuadraticCurvePoint = getQuadraticCurvePoint;
    _$utils_56.easeOutQuad = easeOutQuad;
    _$utils_56.copyAction = copyAction;
    Object.defineProperty(_$utils_56, "win", {
      enumerable: true,
      get: function get() {
        return ___window_56["default"];
      }
    });
    Object.defineProperty(_$utils_56, "browser", {
      enumerable: true,
      get: function get() {
        return ___browser_56["default"];
      }
    });
    Object.defineProperty(_$utils_56, "clone", {
      enumerable: true,
      get: function get() {
        return _clone["default"];
      }
    });
    Object.defineProperty(_$utils_56, "events", {
      enumerable: true,
      get: function get() {
        return _events["default"];
      }
    });
    Object.defineProperty(_$utils_56, "extend", {
      enumerable: true,
      get: function get() {
        return ___extend_56["default"];
      }
    });
    Object.defineProperty(_$utils_56, "getOriginXY", {
      enumerable: true,
      get: function get() {
        return _getOriginXY["default"];
      }
    });
    Object.defineProperty(_$utils_56, "hypot", {
      enumerable: true,
      get: function get() {
        return ___hypot_56["default"];
      }
    });
    Object.defineProperty(_$utils_56, "normalizeListeners", {
      enumerable: true,
      get: function get() {
        return _normalizeListeners["default"];
      }
    });
    Object.defineProperty(_$utils_56, "pointer", {
      enumerable: true,
      get: function get() {
        return ___pointerUtils_56["default"];
      }
    });
    Object.defineProperty(_$utils_56, "raf", {
      enumerable: true,
      get: function get() {
        return _raf["default"];
      }
    });
    Object.defineProperty(_$utils_56, "rect", {
      enumerable: true,
      get: function get() {
        return ___rect_56["default"];
      }
    });
    Object.defineProperty(_$utils_56, "Signals", {
      enumerable: true,
      get: function get() {
        return _Signals["default"];
      }
    });
    _$utils_56.is = _$utils_56.dom = _$utils_56.arr = void 0;
    
    var __arr_56 = ___interopRequireWildcard_56(_$arr_47);
    
    _$utils_56.arr = __arr_56;
    
    var dom = ___interopRequireWildcard_56(_$domUtils_51);
    
    _$utils_56.dom = dom;
    
    var __is_56 = ___interopRequireWildcard_56(_$is_57);
    
    _$utils_56.is = __is_56;
    
    var ___window_56 = ___interopRequireDefault_56(_$window_66);
    
    var ___browser_56 = ___interopRequireDefault_56(_$browser_48);
    
    var _clone = ___interopRequireDefault_56(_$clone_49);
    
    var _events = ___interopRequireDefault_56(_$events_52);
    
    var ___extend_56 = ___interopRequireDefault_56(_$extend_53);
    
    var _getOriginXY = ___interopRequireDefault_56(_$getOriginXY_54);
    
    var ___hypot_56 = ___interopRequireDefault_56(_$hypot_55);
    
    var _normalizeListeners = ___interopRequireDefault_56(_$normalizeListeners_59);
    
    var ___pointerUtils_56 = ___interopRequireDefault_56(_$pointerUtils_61);
    
    var _raf = ___interopRequireDefault_56(_$raf_62);
    
    var ___rect_56 = ___interopRequireDefault_56(_$rect_63);
    
    var _Signals = ___interopRequireDefault_56(_$Signals_46);
    
    function ___interopRequireDefault_56(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_56(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function warnOnce(method, message) {
      var warned = false; // eslint-disable-next-line no-shadow
    
      return function () {
        if (!warned) {
          ___window_56["default"].window.console.warn(message);
    
          warned = true;
        }
    
        return method.apply(this, arguments);
      };
    } // http://stackoverflow.com/a/5634528/2280888
    
    
    function _getQBezierValue(t, p1, p2, p3) {
      var iT = 1 - t;
      return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
    }
    
    function getQuadraticCurvePoint(startX, startY, cpX, cpY, endX, endY, position) {
      return {
        x: _getQBezierValue(position, startX, cpX, endX),
        y: _getQBezierValue(position, startY, cpY, endY)
      };
    } // http://gizma.com/easing/
    
    
    function easeOutQuad(t, b, c, d) {
      t /= d;
      return -c * t * (t - 2) + b;
    }
    
    function copyAction(dest, src) {
      dest.name = src.name;
      dest.axis = src.axis;
      dest.edges = src.edges;
      return dest;
    }
    
    var _$defaultOptions_20 = {};
    "use strict";
    
    Object.defineProperty(_$defaultOptions_20, "__esModule", {
      value: true
    });
    _$defaultOptions_20["default"] = _$defaultOptions_20.defaults = void 0;
    // tslint:disable no-empty-interface
    var defaults = {
      base: {
        preventDefault: 'auto',
        deltaSource: 'page'
      },
      perAction: {
        enabled: false,
        origin: {
          x: 0,
          y: 0
        }
      },
      actions: {}
    };
    _$defaultOptions_20.defaults = defaults;
    var ___default_20 = defaults;
    _$defaultOptions_20["default"] = ___default_20;
    
    var _$Eventable_14 = {};
    "use strict";
    
    Object.defineProperty(_$Eventable_14, "__esModule", {
      value: true
    });
    _$Eventable_14["default"] = void 0;
    
    var __arr_14 = ___interopRequireWildcard_14(_$arr_47);
    
    var ___extend_14 = ___interopRequireDefault_14(_$extend_53);
    
    var ___normalizeListeners_14 = ___interopRequireDefault_14(_$normalizeListeners_59);
    
    function ___interopRequireDefault_14(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_14(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___classCallCheck_14(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_14(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_14(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_14(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_14(Constructor, staticProps); return Constructor; }
    
    function fireUntilImmediateStopped(event, listeners) {
      for (var _i = 0; _i < listeners.length; _i++) {
        var _ref;
    
        _ref = listeners[_i];
        var listener = _ref;
    
        if (event.immediatePropagationStopped) {
          break;
        }
    
        listener(event);
      }
    }
    
    var Eventable =
    /*#__PURE__*/
    function () {
      function Eventable(options) {
        ___classCallCheck_14(this, Eventable);
    
        this.types = {};
        this.propagationStopped = false;
        this.immediatePropagationStopped = false;
        this.options = (0, ___extend_14["default"])({}, options || {});
      }
    
      ___createClass_14(Eventable, [{
        key: "fire",
        value: function fire(event) {
          var listeners;
          var global = this.global; // Interactable#on() listeners
          // tslint:disable no-conditional-assignment
    
          if (listeners = this.types[event.type]) {
            fireUntilImmediateStopped(event, listeners);
          } // interact.on() listeners
    
    
          if (!event.propagationStopped && global && (listeners = global[event.type])) {
            fireUntilImmediateStopped(event, listeners);
          }
        }
      }, {
        key: "on",
        value: function on(type, listener) {
          var listeners = (0, ___normalizeListeners_14["default"])(type, listener);
    
          for (type in listeners) {
            this.types[type] = __arr_14.merge(this.types[type] || [], listeners[type]);
          }
        }
      }, {
        key: "off",
        value: function off(type, listener) {
          var listeners = (0, ___normalizeListeners_14["default"])(type, listener);
    
          for (type in listeners) {
            var eventList = this.types[type];
    
            if (!eventList || !eventList.length) {
              continue;
            }
    
            for (var _i2 = 0; _i2 < listeners[type].length; _i2++) {
              var _ref2;
    
              _ref2 = listeners[type][_i2];
              var subListener = _ref2;
              var index = eventList.indexOf(subListener);
    
              if (index !== -1) {
                eventList.splice(index, 1);
              }
            }
          }
        }
      }]);
    
      return Eventable;
    }();
    
    var ___default_14 = Eventable;
    _$Eventable_14["default"] = ___default_14;
    
    var _$Interactable_16 = {};
    "use strict";
    
    Object.defineProperty(_$Interactable_16, "__esModule", {
      value: true
    });
    _$Interactable_16["default"] = _$Interactable_16.Interactable = void 0;
    
    var __arr_16 = ___interopRequireWildcard_16(_$arr_47);
    
    var ___browser_16 = ___interopRequireDefault_16(_$browser_48);
    
    var ___clone_16 = ___interopRequireDefault_16(_$clone_49);
    
    /* removed: var _$domUtils_51 = require("@interactjs/utils/domUtils"); */;
    
    var ___events_16 = ___interopRequireDefault_16(_$events_52);
    
    var ___extend_16 = ___interopRequireDefault_16(_$extend_53);
    
    var __is_16 = ___interopRequireWildcard_16(_$is_57);
    
    var ___normalizeListeners_16 = ___interopRequireDefault_16(_$normalizeListeners_59);
    
    /* removed: var _$window_66 = require("@interactjs/utils/window"); */;
    
    var _Eventable = ___interopRequireDefault_16(_$Eventable_14);
    
    function ___interopRequireDefault_16(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_16(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___classCallCheck_16(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_16(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_16(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_16(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_16(Constructor, staticProps); return Constructor; }
    
    /** */
    var Interactable =
    /*#__PURE__*/
    function () {
      /** */
      function Interactable(target, options, defaultContext) {
        ___classCallCheck_16(this, Interactable);
    
        this.events = new _Eventable["default"]();
        this._actions = options.actions;
        this.target = target;
        this._context = options.context || defaultContext;
        this._win = (0, _$window_66.getWindow)((0, _$domUtils_51.trySelector)(target) ? this._context : target);
        this._doc = this._win.document;
        this.set(options);
      }
    
      ___createClass_16(Interactable, [{
        key: "setOnEvents",
        value: function setOnEvents(actionName, phases) {
          if (__is_16.func(phases.onstart)) {
            this.on("".concat(actionName, "start"), phases.onstart);
          }
    
          if (__is_16.func(phases.onmove)) {
            this.on("".concat(actionName, "move"), phases.onmove);
          }
    
          if (__is_16.func(phases.onend)) {
            this.on("".concat(actionName, "end"), phases.onend);
          }
    
          if (__is_16.func(phases.oninertiastart)) {
            this.on("".concat(actionName, "inertiastart"), phases.oninertiastart);
          }
    
          return this;
        }
      }, {
        key: "updatePerActionListeners",
        value: function updatePerActionListeners(actionName, prev, cur) {
          if (__is_16.array(prev) || __is_16.object(prev)) {
            this.off(actionName, prev);
          }
    
          if (__is_16.array(cur) || __is_16.object(cur)) {
            this.on(actionName, cur);
          }
        }
      }, {
        key: "setPerAction",
        value: function setPerAction(actionName, options) {
          var defaults = this._defaults; // for all the default per-action options
    
          for (var optionName in options) {
            var actionOptions = this.options[actionName];
            var optionValue = options[optionName];
            var isArray = __is_16.array(optionValue); // remove old event listeners and add new ones
    
            if (optionName === 'listeners') {
              this.updatePerActionListeners(actionName, actionOptions.listeners, optionValue);
            } // if the option value is an array
    
    
            if (isArray) {
              actionOptions[optionName] = __arr_16.from(optionValue);
            } // if the option value is an object
            else if (!isArray && __is_16.plainObject(optionValue)) {
                // copy the object
                actionOptions[optionName] = (0, ___extend_16["default"])(actionOptions[optionName] || {}, (0, ___clone_16["default"])(optionValue)); // set anabled field to true if it exists in the defaults
    
                if (__is_16.object(defaults.perAction[optionName]) && 'enabled' in defaults.perAction[optionName]) {
                  actionOptions[optionName].enabled = optionValue.enabled !== false;
                }
              } // if the option value is a boolean and the default is an object
              else if (__is_16.bool(optionValue) && __is_16.object(defaults.perAction[optionName])) {
                  actionOptions[optionName].enabled = optionValue;
                } // if it's anything else, do a plain assignment
                else {
                    actionOptions[optionName] = optionValue;
                  }
          }
        }
        /**
         * The default function to get an Interactables bounding rect. Can be
         * overridden using {@link Interactable.rectChecker}.
         *
         * @param {Element} [element] The element to measure.
         * @return {object} The object's bounding rectangle.
         */
    
      }, {
        key: "getRect",
        value: function getRect(element) {
          element = element || (__is_16.element(this.target) ? this.target : null);
    
          if (__is_16.string(this.target)) {
            element = element || this._context.querySelector(this.target);
          }
    
          return (0, _$domUtils_51.getElementRect)(element);
        }
        /**
         * Returns or sets the function used to calculate the interactable's
         * element's rectangle
         *
         * @param {function} [checker] A function which returns this Interactable's
         * bounding rectangle. See {@link Interactable.getRect}
         * @return {function | object} The checker function or this Interactable
         */
    
      }, {
        key: "rectChecker",
        value: function rectChecker(checker) {
          if (__is_16.func(checker)) {
            this.getRect = checker;
            return this;
          }
    
          if (checker === null) {
            delete this.getRect;
            return this;
          }
    
          return this.getRect;
        }
      }, {
        key: "_backCompatOption",
        value: function _backCompatOption(optionName, newValue) {
          if ((0, _$domUtils_51.trySelector)(newValue) || __is_16.object(newValue)) {
            this.options[optionName] = newValue;
    
            for (var _i = 0; _i < this._actions.names.length; _i++) {
              var _ref;
    
              _ref = this._actions.names[_i];
              var action = _ref;
              this.options[action][optionName] = newValue;
            }
    
            return this;
          }
    
          return this.options[optionName];
        }
        /**
         * Gets or sets the origin of the Interactable's element.  The x and y
         * of the origin will be subtracted from action event coordinates.
         *
         * @param {Element | object | string} [origin] An HTML or SVG Element whose
         * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'
         * or any CSS selector
         *
         * @return {object} The current origin or this Interactable
         */
    
      }, {
        key: "origin",
        value: function origin(newValue) {
          return this._backCompatOption('origin', newValue);
        }
        /**
         * Returns or sets the mouse coordinate types used to calculate the
         * movement of the pointer.
         *
         * @param {string} [newValue] Use 'client' if you will be scrolling while
         * interacting; Use 'page' if you want autoScroll to work
         * @return {string | object} The current deltaSource or this Interactable
         */
    
      }, {
        key: "deltaSource",
        value: function deltaSource(newValue) {
          if (newValue === 'page' || newValue === 'client') {
            this.options.deltaSource = newValue;
            return this;
          }
    
          return this.options.deltaSource;
        }
        /**
         * Gets the selector context Node of the Interactable. The default is
         * `window.document`.
         *
         * @return {Node} The context Node of this Interactable
         */
    
      }, {
        key: "context",
        value: function context() {
          return this._context;
        }
      }, {
        key: "inContext",
        value: function inContext(element) {
          return this._context === element.ownerDocument || (0, _$domUtils_51.nodeContains)(this._context, element);
        }
      }, {
        key: "testIgnoreAllow",
        value: function testIgnoreAllow(options, targetNode, eventTarget) {
          return !this.testIgnore(options.ignoreFrom, targetNode, eventTarget) && this.testAllow(options.allowFrom, targetNode, eventTarget);
        }
      }, {
        key: "testAllow",
        value: function testAllow(allowFrom, targetNode, element) {
          if (!allowFrom) {
            return true;
          }
    
          if (!__is_16.element(element)) {
            return false;
          }
    
          if (__is_16.string(allowFrom)) {
            return (0, _$domUtils_51.matchesUpTo)(element, allowFrom, targetNode);
          } else if (__is_16.element(allowFrom)) {
            return (0, _$domUtils_51.nodeContains)(allowFrom, element);
          }
    
          return false;
        }
      }, {
        key: "testIgnore",
        value: function testIgnore(ignoreFrom, targetNode, element) {
          if (!ignoreFrom || !__is_16.element(element)) {
            return false;
          }
    
          if (__is_16.string(ignoreFrom)) {
            return (0, _$domUtils_51.matchesUpTo)(element, ignoreFrom, targetNode);
          } else if (__is_16.element(ignoreFrom)) {
            return (0, _$domUtils_51.nodeContains)(ignoreFrom, element);
          }
    
          return false;
        }
        /**
         * Calls listeners for the given InteractEvent type bound globally
         * and directly to this Interactable
         *
         * @param {InteractEvent} iEvent The InteractEvent object to be fired on this
         * Interactable
         * @return {Interactable} this Interactable
         */
    
      }, {
        key: "fire",
        value: function fire(iEvent) {
          this.events.fire(iEvent);
          return this;
        }
      }, {
        key: "_onOff",
        value: function _onOff(method, typeArg, listenerArg, options) {
          if (__is_16.object(typeArg) && !__is_16.array(typeArg)) {
            options = listenerArg;
            listenerArg = null;
          }
    
          var addRemove = method === 'on' ? 'add' : 'remove';
          var listeners = (0, ___normalizeListeners_16["default"])(typeArg, listenerArg);
    
          for (var type in listeners) {
            if (type === 'wheel') {
              type = ___browser_16["default"].wheelEvent;
            }
    
            for (var _i2 = 0; _i2 < listeners[type].length; _i2++) {
              var _ref2;
    
              _ref2 = listeners[type][_i2];
              var listener = _ref2;
    
              // if it is an action event type
              if (__arr_16.contains(this._actions.eventTypes, type)) {
                this.events[method](type, listener);
              } // delegated event
              else if (__is_16.string(this.target)) {
                  ___events_16["default"]["".concat(addRemove, "Delegate")](this.target, this._context, type, listener, options);
                } // remove listener from this Interatable's element
                else {
                    ___events_16["default"][addRemove](this.target, type, listener, options);
                  }
            }
          }
    
          return this;
        }
        /**
         * Binds a listener for an InteractEvent, pointerEvent or DOM event.
         *
         * @param {string | array | object} types The types of events to listen
         * for
         * @param {function | array | object} [listener] The event listener function(s)
         * @param {object | boolean} [options] options object or useCapture flag for
         * addEventListener
         * @return {Interactable} This Interactable
         */
    
      }, {
        key: "on",
        value: function on(types, listener, options) {
          return this._onOff('on', types, listener, options);
        }
        /**
         * Removes an InteractEvent, pointerEvent or DOM event listener.
         *
         * @param {string | array | object} types The types of events that were
         * listened for
         * @param {function | array | object} [listener] The event listener function(s)
         * @param {object | boolean} [options] options object or useCapture flag for
         * removeEventListener
         * @return {Interactable} This Interactable
         */
    
      }, {
        key: "off",
        value: function off(types, listener, options) {
          return this._onOff('off', types, listener, options);
        }
        /**
         * Reset the options of this Interactable
         *
         * @param {object} options The new settings to apply
         * @return {object} This Interactable
         */
    
      }, {
        key: "set",
        value: function set(options) {
          var defaults = this._defaults;
    
          if (!__is_16.object(options)) {
            options = {};
          }
    
          this.options = (0, ___clone_16["default"])(defaults.base);
    
          for (var actionName in this._actions.methodDict) {
            var methodName = this._actions.methodDict[actionName];
            this.options[actionName] = {};
            this.setPerAction(actionName, (0, ___extend_16["default"])((0, ___extend_16["default"])({}, defaults.perAction), defaults.actions[actionName]));
            this[methodName](options[actionName]);
          }
    
          for (var setting in options) {
            if (__is_16.func(this[setting])) {
              this[setting](options[setting]);
            }
          }
    
          return this;
        }
        /**
         * Remove this interactable from the list of interactables and remove it's
         * action capabilities and event listeners
         *
         * @return {interact}
         */
    
      }, {
        key: "unset",
        value: function unset() {
          ___events_16["default"].remove(this.target, 'all');
    
          if (__is_16.string(this.target)) {
            // remove delegated events
            for (var type in ___events_16["default"].delegatedEvents) {
              var delegated = ___events_16["default"].delegatedEvents[type];
    
              if (delegated.selectors[0] === this.target && delegated.contexts[0] === this._context) {
                delegated.selectors.splice(0, 1);
                delegated.contexts.splice(0, 1);
                delegated.listeners.splice(0, 1); // remove the arrays if they are empty
    
                if (!delegated.selectors.length) {
                  delegated[type] = null;
                }
              }
    
              ___events_16["default"].remove(this._context, type, ___events_16["default"].delegateListener);
    
              ___events_16["default"].remove(this._context, type, ___events_16["default"].delegateUseCapture, true);
            }
          } else {
            ___events_16["default"].remove(this.target, 'all');
          }
        }
      }, {
        key: "_defaults",
        get: function get() {
          return {
            base: {},
            perAction: {},
            actions: {}
          };
        }
      }]);
    
      return Interactable;
    }();
    
    _$Interactable_16.Interactable = Interactable;
    var ___default_16 = Interactable;
    _$Interactable_16["default"] = ___default_16;
    
    var _$InteractableSet_17 = {};
    "use strict";
    
    Object.defineProperty(_$InteractableSet_17, "__esModule", {
      value: true
    });
    _$InteractableSet_17["default"] = void 0;
    
    var __arr_17 = ___interopRequireWildcard_17(_$arr_47);
    
    var __domUtils_17 = ___interopRequireWildcard_17(_$domUtils_51);
    
    var ___extend_17 = ___interopRequireDefault_17(_$extend_53);
    
    var __is_17 = ___interopRequireWildcard_17(_$is_57);
    
    var ___Signals_17 = ___interopRequireDefault_17(_$Signals_46);
    
    function ___interopRequireDefault_17(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_17(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___classCallCheck_17(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_17(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_17(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_17(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_17(Constructor, staticProps); return Constructor; }
    
    var InteractableSet =
    /*#__PURE__*/
    function () {
      function InteractableSet(scope) {
        var _this = this;
    
        ___classCallCheck_17(this, InteractableSet);
    
        this.scope = scope;
        this.signals = new ___Signals_17["default"](); // all set interactables
    
        this.list = [];
        this.selectorMap = {};
        this.signals.on('unset', function (_ref) {
          var interactable = _ref.interactable;
          var target = interactable.target,
              context = interactable._context;
          var targetMappings = __is_17.string(target) ? _this.selectorMap[target] : target[_this.scope.id];
          var targetIndex = targetMappings.findIndex(function (m) {
            return m.context === context;
          });
    
          if (targetMappings[targetIndex]) {
            // Destroying mappingInfo's context and interactable
            targetMappings[targetIndex].context = null;
            targetMappings[targetIndex].interactable = null;
          }
    
          targetMappings.splice(targetIndex, 1);
        });
      }
    
      ___createClass_17(InteractableSet, [{
        key: "new",
        value: function _new(target, options) {
          options = (0, ___extend_17["default"])(options || {}, {
            actions: this.scope.actions
          });
          var interactable = new this.scope.Interactable(target, options, this.scope.document);
          var mappingInfo = {
            context: interactable._context,
            interactable: interactable
          };
          this.scope.addDocument(interactable._doc);
          this.list.push(interactable);
    
          if (__is_17.string(target)) {
            if (!this.selectorMap[target]) {
              this.selectorMap[target] = [];
            }
    
            this.selectorMap[target].push(mappingInfo);
          } else {
            if (!interactable.target[this.scope.id]) {
              Object.defineProperty(target, this.scope.id, {
                value: [],
                configurable: true
              });
            }
    
            target[this.scope.id].push(mappingInfo);
          }
    
          this.signals.fire('new', {
            target: target,
            options: options,
            interactable: interactable,
            win: this.scope._win
          });
          return interactable;
        }
      }, {
        key: "get",
        value: function get(target, options) {
          var context = options && options.context || this.scope.document;
          var isSelector = __is_17.string(target);
          var targetMappings = isSelector ? this.selectorMap[target] : target[this.scope.id];
    
          if (!targetMappings) {
            return null;
          }
    
          var found = __arr_17.find(targetMappings, function (m) {
            return m.context === context && (isSelector || m.interactable.inContext(target));
          });
          return found && found.interactable;
        }
      }, {
        key: "forEachMatch",
        value: function forEachMatch(node, callback) {
          for (var _i = 0; _i < this.list.length; _i++) {
            var _ref2;
    
            _ref2 = this.list[_i];
            var interactable = _ref2;
            var ret = void 0;
    
            if ((__is_17.string(interactable.target) // target is a selector and the element matches
            ? __is_17.element(node) && __domUtils_17.matchesSelector(node, interactable.target) : // target is the element
            node === interactable.target) && // the element is in context
            interactable.inContext(node)) {
              ret = callback(interactable);
            }
    
            if (ret !== undefined) {
              return ret;
            }
          }
        }
      }]);
    
      return InteractableSet;
    }();
    
    _$InteractableSet_17["default"] = InteractableSet;
    
    var _$BaseEvent_13 = {};
    "use strict";
    
    Object.defineProperty(_$BaseEvent_13, "__esModule", {
      value: true
    });
    _$BaseEvent_13["default"] = _$BaseEvent_13.BaseEvent = _$BaseEvent_13.EventPhase = void 0;
    
    function ___classCallCheck_13(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_13(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_13(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_13(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_13(Constructor, staticProps); return Constructor; }
    
    var EventPhase;
    _$BaseEvent_13.EventPhase = EventPhase;
    
    (function (EventPhase) {
      EventPhase["Start"] = "start";
      EventPhase["Move"] = "move";
      EventPhase["End"] = "end";
      EventPhase["_NONE"] = "";
    })(EventPhase || (_$BaseEvent_13.EventPhase = EventPhase = {}));
    
    var BaseEvent =
    /*#__PURE__*/
    function () {
      function BaseEvent(interaction) {
        ___classCallCheck_13(this, BaseEvent);
    
        this.immediatePropagationStopped = false;
        this.propagationStopped = false;
        this._interaction = interaction;
      }
    
      ___createClass_13(BaseEvent, [{
        key: "preventDefault",
        value: function preventDefault() {}
        /**
         * Don't call any other listeners (even on the current target)
         */
    
      }, {
        key: "stopPropagation",
        value: function stopPropagation() {
          this.propagationStopped = true;
        }
        /**
         * Don't call listeners on the remaining targets
         */
    
      }, {
        key: "stopImmediatePropagation",
        value: function stopImmediatePropagation() {
          this.immediatePropagationStopped = this.propagationStopped = true;
        }
      }, {
        key: "interaction",
        get: function get() {
          return this._interaction._proxy;
        }
      }]);
    
      return BaseEvent;
    }();
    
    _$BaseEvent_13.BaseEvent = BaseEvent;
    var ___default_13 = BaseEvent;
    _$BaseEvent_13["default"] = ___default_13;
    
    var _$InteractEvent_15 = {};
    "use strict";
    
    Object.defineProperty(_$InteractEvent_15, "__esModule", {
      value: true
    });
    _$InteractEvent_15["default"] = _$InteractEvent_15.InteractEvent = _$InteractEvent_15.EventPhase = void 0;
    
    var ___extend_15 = ___interopRequireDefault_15(_$extend_53);
    
    var ___getOriginXY_15 = ___interopRequireDefault_15(_$getOriginXY_54);
    
    var ___hypot_15 = ___interopRequireDefault_15(_$hypot_55);
    
    var _BaseEvent2 = ___interopRequireDefault_15(_$BaseEvent_13);
    
    var _defaultOptions = ___interopRequireDefault_15(_$defaultOptions_20);
    
    function ___interopRequireDefault_15(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___typeof_15(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_15 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_15 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_15(obj); }
    
    function ___classCallCheck_15(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_15(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_15(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_15(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_15(Constructor, staticProps); return Constructor; }
    
    function _possibleConstructorReturn(self, call) { if (call && (___typeof_15(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
    
    function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
    
    function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    
    function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
    
    function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
    
    var __EventPhase_15;
    _$InteractEvent_15.EventPhase = __EventPhase_15;
    
    (function (EventPhase) {
      EventPhase["Start"] = "start";
      EventPhase["Move"] = "move";
      EventPhase["End"] = "end";
      EventPhase["_NONE"] = "";
    })(__EventPhase_15 || (_$InteractEvent_15.EventPhase = __EventPhase_15 = {}));
    
    var InteractEvent =
    /*#__PURE__*/
    function (_BaseEvent) {
      _inherits(InteractEvent, _BaseEvent);
    
      /** */
      function InteractEvent(interaction, event, actionName, phase, element, related, preEnd, type) {
        var _this;
    
        ___classCallCheck_15(this, InteractEvent);
    
        _this = _possibleConstructorReturn(this, _getPrototypeOf(InteractEvent).call(this, interaction));
        element = element || interaction.element;
        var target = interaction.interactable;
        var deltaSource = (target && target.options || _defaultOptions["default"]).deltaSource;
        var origin = (0, ___getOriginXY_15["default"])(target, element, actionName);
        var starting = phase === 'start';
        var ending = phase === 'end';
        var prevEvent = starting ? _assertThisInitialized(_this) : interaction.prevEvent;
        var coords = starting ? interaction.coords.start : ending ? {
          page: prevEvent.page,
          client: prevEvent.client,
          timeStamp: interaction.coords.cur.timeStamp
        } : interaction.coords.cur;
        _this.page = (0, ___extend_15["default"])({}, coords.page);
        _this.client = (0, ___extend_15["default"])({}, coords.client);
        _this.rect = (0, ___extend_15["default"])({}, interaction.rect);
        _this.timeStamp = coords.timeStamp;
    
        if (!ending) {
          _this.page.x -= origin.x;
          _this.page.y -= origin.y;
          _this.client.x -= origin.x;
          _this.client.y -= origin.y;
        }
    
        _this.ctrlKey = event.ctrlKey;
        _this.altKey = event.altKey;
        _this.shiftKey = event.shiftKey;
        _this.metaKey = event.metaKey;
        _this.button = event.button;
        _this.buttons = event.buttons;
        _this.target = element;
        _this.currentTarget = element;
        _this.relatedTarget = related || null;
        _this.preEnd = preEnd;
        _this.type = type || actionName + (phase || '');
        _this.interactable = target;
        _this.t0 = starting ? interaction.pointers[interaction.pointers.length - 1].downTime : prevEvent.t0;
        _this.x0 = interaction.coords.start.page.x - origin.x;
        _this.y0 = interaction.coords.start.page.y - origin.y;
        _this.clientX0 = interaction.coords.start.client.x - origin.x;
        _this.clientY0 = interaction.coords.start.client.y - origin.y;
    
        if (starting || ending) {
          _this.delta = {
            x: 0,
            y: 0
          };
        } else {
          _this.delta = {
            x: _this[deltaSource].x - prevEvent[deltaSource].x,
            y: _this[deltaSource].y - prevEvent[deltaSource].y
          };
        }
    
        _this.dt = interaction.coords.delta.timeStamp;
        _this.duration = _this.timeStamp - _this.t0; // velocity and speed in pixels per second
    
        _this.velocity = (0, ___extend_15["default"])({}, interaction.coords.velocity[deltaSource]);
        _this.speed = (0, ___hypot_15["default"])(_this.velocity.x, _this.velocity.y);
        _this.swipe = ending || phase === 'inertiastart' ? _this.getSwipe() : null;
        return _this;
      }
    
      ___createClass_15(InteractEvent, [{
        key: "getSwipe",
        value: function getSwipe() {
          var interaction = this._interaction;
    
          if (interaction.prevEvent.speed < 600 || this.timeStamp - interaction.prevEvent.timeStamp > 150) {
            return null;
          }
    
          var angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI;
          var overlap = 22.5;
    
          if (angle < 0) {
            angle += 360;
          }
    
          var left = 135 - overlap <= angle && angle < 225 + overlap;
          var up = 225 - overlap <= angle && angle < 315 + overlap;
          var right = !left && (315 - overlap <= angle || angle < 45 + overlap);
          var down = !up && 45 - overlap <= angle && angle < 135 + overlap;
          return {
            up: up,
            down: down,
            left: left,
            right: right,
            angle: angle,
            speed: interaction.prevEvent.speed,
            velocity: {
              x: interaction.prevEvent.velocityX,
              y: interaction.prevEvent.velocityY
            }
          };
        }
      }, {
        key: "preventDefault",
        value: function preventDefault() {}
        /**
         * Don't call listeners on the remaining targets
         */
    
      }, {
        key: "stopImmediatePropagation",
        value: function stopImmediatePropagation() {
          this.immediatePropagationStopped = this.propagationStopped = true;
        }
        /**
         * Don't call any other listeners (even on the current target)
         */
    
      }, {
        key: "stopPropagation",
        value: function stopPropagation() {
          this.propagationStopped = true;
        }
      }, {
        key: "pageX",
        get: function get() {
          return this.page.x;
        },
        set: function set(value) {
          this.page.x = value;
        }
      }, {
        key: "pageY",
        get: function get() {
          return this.page.y;
        },
        set: function set(value) {
          this.page.y = value;
        }
      }, {
        key: "clientX",
        get: function get() {
          return this.client.x;
        },
        set: function set(value) {
          this.client.x = value;
        }
      }, {
        key: "clientY",
        get: function get() {
          return this.client.y;
        },
        set: function set(value) {
          this.client.y = value;
        }
      }, {
        key: "dx",
        get: function get() {
          return this.delta.x;
        },
        set: function set(value) {
          this.delta.x = value;
        }
      }, {
        key: "dy",
        get: function get() {
          return this.delta.y;
        },
        set: function set(value) {
          this.delta.y = value;
        }
      }, {
        key: "velocityX",
        get: function get() {
          return this.velocity.x;
        },
        set: function set(value) {
          this.velocity.x = value;
        }
      }, {
        key: "velocityY",
        get: function get() {
          return this.velocity.y;
        },
        set: function set(value) {
          this.velocity.y = value;
        }
      }]);
    
      return InteractEvent;
    }(_BaseEvent2["default"]);
    
    _$InteractEvent_15.InteractEvent = InteractEvent;
    var ___default_15 = InteractEvent;
    _$InteractEvent_15["default"] = ___default_15;
    
    var _$PointerInfo_19 = {};
    "use strict";
    
    Object.defineProperty(_$PointerInfo_19, "__esModule", {
      value: true
    });
    _$PointerInfo_19["default"] = _$PointerInfo_19.PointerInfo = void 0;
    
    function ___classCallCheck_19(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    /* eslint-disable @typescript-eslint/no-parameter-properties */
    var PointerInfo = function PointerInfo(id, pointer, event, downTime, downTarget) {
      ___classCallCheck_19(this, PointerInfo);
    
      this.id = id;
      this.pointer = pointer;
      this.event = event;
      this.downTime = downTime;
      this.downTarget = downTarget;
    };
    
    _$PointerInfo_19.PointerInfo = PointerInfo;
    var ___default_19 = PointerInfo;
    _$PointerInfo_19["default"] = ___default_19;
    
    var _$interactionFinder_22 = {};
    "use strict";
    
    Object.defineProperty(_$interactionFinder_22, "__esModule", {
      value: true
    });
    _$interactionFinder_22["default"] = void 0;
    
    var __dom_22 = ___interopRequireWildcard_22(_$domUtils_51);
    
    function ___interopRequireWildcard_22(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    var finder = {
      methodOrder: ['simulationResume', 'mouseOrPen', 'hasPointer', 'idle'],
      search: function search(details) {
        for (var _i = 0; _i < finder.methodOrder.length; _i++) {
          var _ref;
    
          _ref = finder.methodOrder[_i];
          var method = _ref;
          var interaction = finder[method](details);
    
          if (interaction) {
            return interaction;
          }
        }
      },
      // try to resume simulation with a new pointer
      simulationResume: function simulationResume(_ref2) {
        var pointerType = _ref2.pointerType,
            eventType = _ref2.eventType,
            eventTarget = _ref2.eventTarget,
            scope = _ref2.scope;
    
        if (!/down|start/i.test(eventType)) {
          return null;
        }
    
        for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
          var _ref3;
    
          _ref3 = scope.interactions.list[_i2];
          var interaction = _ref3;
          var element = eventTarget;
    
          if (interaction.simulation && interaction.simulation.allowResume && interaction.pointerType === pointerType) {
            while (element) {
              // if the element is the interaction element
              if (element === interaction.element) {
                return interaction;
              }
    
              element = __dom_22.parentNode(element);
            }
          }
        }
    
        return null;
      },
      // if it's a mouse or pen interaction
      mouseOrPen: function mouseOrPen(_ref4) {
        var pointerId = _ref4.pointerId,
            pointerType = _ref4.pointerType,
            eventType = _ref4.eventType,
            scope = _ref4.scope;
    
        if (pointerType !== 'mouse' && pointerType !== 'pen') {
          return null;
        }
    
        var firstNonActive;
    
        for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
          var _ref5;
    
          _ref5 = scope.interactions.list[_i3];
          var interaction = _ref5;
    
          if (interaction.pointerType === pointerType) {
            // if it's a down event, skip interactions with running simulations
            if (interaction.simulation && !hasPointerId(interaction, pointerId)) {
              continue;
            } // if the interaction is active, return it immediately
    
    
            if (interaction.interacting()) {
              return interaction;
            } // otherwise save it and look for another active interaction
            else if (!firstNonActive) {
                firstNonActive = interaction;
              }
          }
        } // if no active mouse interaction was found use the first inactive mouse
        // interaction
    
    
        if (firstNonActive) {
          return firstNonActive;
        } // find any mouse or pen interaction.
        // ignore the interaction if the eventType is a *down, and a simulation
        // is active
    
    
        for (var _i4 = 0; _i4 < scope.interactions.list.length; _i4++) {
          var _ref6;
    
          _ref6 = scope.interactions.list[_i4];
          var _interaction = _ref6;
    
          if (_interaction.pointerType === pointerType && !(/down/i.test(eventType) && _interaction.simulation)) {
            return _interaction;
          }
        }
    
        return null;
      },
      // get interaction that has this pointer
      hasPointer: function hasPointer(_ref7) {
        var pointerId = _ref7.pointerId,
            scope = _ref7.scope;
    
        for (var _i5 = 0; _i5 < scope.interactions.list.length; _i5++) {
          var _ref8;
    
          _ref8 = scope.interactions.list[_i5];
          var interaction = _ref8;
    
          if (hasPointerId(interaction, pointerId)) {
            return interaction;
          }
        }
    
        return null;
      },
      // get first idle interaction with a matching pointerType
      idle: function idle(_ref9) {
        var pointerType = _ref9.pointerType,
            scope = _ref9.scope;
    
        for (var _i6 = 0; _i6 < scope.interactions.list.length; _i6++) {
          var _ref10;
    
          _ref10 = scope.interactions.list[_i6];
          var interaction = _ref10;
    
          // if there's already a pointer held down
          if (interaction.pointers.length === 1) {
            var target = interaction.interactable; // don't add this pointer if there is a target interactable and it
            // isn't gesturable
    
            if (target && !(target.options.gesture && target.options.gesture.enabled)) {
              continue;
            }
          } // maximum of 2 pointers per interaction
          else if (interaction.pointers.length >= 2) {
              continue;
            }
    
          if (!interaction.interacting() && pointerType === interaction.pointerType) {
            return interaction;
          }
        }
    
        return null;
      }
    };
    
    function hasPointerId(interaction, pointerId) {
      return interaction.pointers.some(function (_ref11) {
        var id = _ref11.id;
        return id === pointerId;
      });
    }
    
    var ___default_22 = finder;
    _$interactionFinder_22["default"] = ___default_22;
    
    var _$drag_1 = {};
    "use strict";
    
    Object.defineProperty(_$drag_1, "__esModule", {
      value: true
    });
    _$drag_1["default"] = void 0;
    
    var ___scope_1 = _$scope_24({});
    
    var __arr_1 = ___interopRequireWildcard_1(_$arr_47);
    
    var __is_1 = ___interopRequireWildcard_1(_$is_57);
    
    function ___interopRequireWildcard_1(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    ___scope_1.ActionName.Drag = 'drag';
    
    function __install_1(scope) {
      var actions = scope.actions,
          Interactable = scope.Interactable,
          interactions = scope.interactions,
          defaults = scope.defaults;
      interactions.signals.on('before-action-move', beforeMove);
      interactions.signals.on('action-resume', beforeMove); // dragmove
    
      interactions.signals.on('action-move', move);
      Interactable.prototype.draggable = drag.draggable;
      actions[___scope_1.ActionName.Drag] = drag;
      actions.names.push(___scope_1.ActionName.Drag);
      __arr_1.merge(actions.eventTypes, ['dragstart', 'dragmove', 'draginertiastart', 'dragresume', 'dragend']);
      actions.methodDict.drag = 'draggable';
      defaults.actions.drag = drag.defaults;
    }
    
    function beforeMove(_ref) {
      var interaction = _ref.interaction;
    
      if (interaction.prepared.name !== 'drag') {
        return;
      }
    
      var axis = interaction.prepared.axis;
    
      if (axis === 'x') {
        interaction.coords.cur.page.y = interaction.coords.start.page.y;
        interaction.coords.cur.client.y = interaction.coords.start.client.y;
        interaction.coords.velocity.client.y = 0;
        interaction.coords.velocity.page.y = 0;
      } else if (axis === 'y') {
        interaction.coords.cur.page.x = interaction.coords.start.page.x;
        interaction.coords.cur.client.x = interaction.coords.start.client.x;
        interaction.coords.velocity.client.x = 0;
        interaction.coords.velocity.page.x = 0;
      }
    }
    
    function move(_ref2) {
      var iEvent = _ref2.iEvent,
          interaction = _ref2.interaction;
    
      if (interaction.prepared.name !== 'drag') {
        return;
      }
    
      var axis = interaction.prepared.axis;
    
      if (axis === 'x' || axis === 'y') {
        var opposite = axis === 'x' ? 'y' : 'x';
        iEvent.page[opposite] = interaction.coords.start.page[opposite];
        iEvent.client[opposite] = interaction.coords.start.client[opposite];
        iEvent.delta[opposite] = 0;
      }
    }
    /**
     * ```js
     * interact(element).draggable({
     *     onstart: function (event) {},
     *     onmove : function (event) {},
     *     onend  : function (event) {},
     *
     *     // the axis in which the first movement must be
     *     // for the drag sequence to start
     *     // 'xy' by default - any direction
     *     startAxis: 'x' || 'y' || 'xy',
     *
     *     // 'xy' by default - don't restrict to one axis (move in any direction)
     *     // 'x' or 'y' to restrict movement to either axis
     *     // 'start' to restrict movement to the axis the drag started in
     *     lockAxis: 'x' || 'y' || 'xy' || 'start',
     *
     *     // max number of drags that can happen concurrently
     *     // with elements of this Interactable. Infinity by default
     *     max: Infinity,
     *
     *     // max number of drags that can target the same element+Interactable
     *     // 1 by default
     *     maxPerElement: 2
     * })
     *
     * var isDraggable = interact('element').draggable(); // true
     * ```
     *
     * Get or set whether drag actions can be performed on the target
     *
     * @alias Interactable.prototype.draggable
     *
     * @param {boolean | object} [options] true/false or An object with event
     * listeners to be fired on drag events (object makes the Interactable
     * draggable)
     * @return {boolean | Interactable} boolean indicating if this can be the
     * target of drag events, or this Interctable
     */
    
    
    var draggable = function draggable(options) {
      if (__is_1.object(options)) {
        this.options.drag.enabled = options.enabled !== false;
        this.setPerAction('drag', options);
        this.setOnEvents('drag', options);
    
        if (/^(xy|x|y|start)$/.test(options.lockAxis)) {
          this.options.drag.lockAxis = options.lockAxis;
        }
    
        if (/^(xy|x|y)$/.test(options.startAxis)) {
          this.options.drag.startAxis = options.startAxis;
        }
    
        return this;
      }
    
      if (__is_1.bool(options)) {
        this.options.drag.enabled = options;
        return this;
      }
    
      return this.options.drag;
    };
    
    var drag = {
      id: 'actions/drag',
      install: __install_1,
      draggable: draggable,
      beforeMove: beforeMove,
      move: move,
      defaults: {
        startAxis: 'xy',
        lockAxis: 'xy'
      },
      checker: function checker(_pointer, _event, interactable) {
        var dragOptions = interactable.options.drag;
        return dragOptions.enabled ? {
          name: 'drag',
          axis: dragOptions.lockAxis === 'start' ? dragOptions.startAxis : dragOptions.lockAxis
        } : null;
      },
      getCursor: function getCursor() {
        return 'move';
      }
    };
    var ___default_1 = drag;
    _$drag_1["default"] = ___default_1;
    
    var _$DropEvent_2 = {};
    "use strict";
    
    Object.defineProperty(_$DropEvent_2, "__esModule", {
      value: true
    });
    _$DropEvent_2["default"] = void 0;
    
    var ___BaseEvent2_2 = ___interopRequireDefault_2(_$BaseEvent_13);
    
    var __arr_2 = ___interopRequireWildcard_2(_$arr_47);
    
    function ___interopRequireWildcard_2(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_2(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___typeof_2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_2 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_2(obj); }
    
    function ___toConsumableArray_2(arr) { return ___arrayWithoutHoles_2(arr) || ___iterableToArray_2(arr) || ___nonIterableSpread_2(); }
    
    function ___nonIterableSpread_2() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
    
    function ___iterableToArray_2(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
    
    function ___arrayWithoutHoles_2(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
    
    function ___classCallCheck_2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_2(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_2(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_2(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_2(Constructor, staticProps); return Constructor; }
    
    function ___possibleConstructorReturn_2(self, call) { if (call && (___typeof_2(call) === "object" || typeof call === "function")) { return call; } return ___assertThisInitialized_2(self); }
    
    function ___assertThisInitialized_2(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    
    function ___getPrototypeOf_2(o) { ___getPrototypeOf_2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ___getPrototypeOf_2(o); }
    
    function ___inherits_2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ___setPrototypeOf_2(subClass, superClass); }
    
    function ___setPrototypeOf_2(o, p) { ___setPrototypeOf_2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ___setPrototypeOf_2(o, p); }
    
    var DropEvent =
    /*#__PURE__*/
    function (_BaseEvent) {
      ___inherits_2(DropEvent, _BaseEvent);
    
      /**
       * Class of events fired on dropzones during drags with acceptable targets.
       */
      function DropEvent(dropState, dragEvent, type) {
        var _this;
    
        ___classCallCheck_2(this, DropEvent);
    
        _this = ___possibleConstructorReturn_2(this, ___getPrototypeOf_2(DropEvent).call(this, dragEvent._interaction));
        _this.propagationStopped = false;
        _this.immediatePropagationStopped = false;
    
        var _ref = type === 'dragleave' ? dropState.prev : dropState.cur,
            element = _ref.element,
            dropzone = _ref.dropzone;
    
        _this.type = type;
        _this.target = element;
        _this.currentTarget = element;
        _this.dropzone = dropzone;
        _this.dragEvent = dragEvent;
        _this.relatedTarget = dragEvent.target;
        _this.draggable = dragEvent.interactable;
        _this.timeStamp = dragEvent.timeStamp;
        return _this;
      }
      /**
       * If this is a `dropactivate` event, the dropzone element will be
       * deactivated.
       *
       * If this is a `dragmove` or `dragenter`, a `dragleave` will be fired on the
       * dropzone element and more.
       */
    
    
      ___createClass_2(DropEvent, [{
        key: "reject",
        value: function reject() {
          var _this2 = this;
    
          var dropState = this._interaction.dropState;
    
          if (this.type !== 'dropactivate' && (!this.dropzone || dropState.cur.dropzone !== this.dropzone || dropState.cur.element !== this.target)) {
            return;
          }
    
          dropState.prev.dropzone = this.dropzone;
          dropState.prev.element = this.target;
          dropState.rejected = true;
          dropState.events.enter = null;
          this.stopImmediatePropagation();
    
          if (this.type === 'dropactivate') {
            var activeDrops = dropState.activeDrops;
            var index = __arr_2.findIndex(activeDrops, function (_ref2) {
              var dropzone = _ref2.dropzone,
                  element = _ref2.element;
              return dropzone === _this2.dropzone && element === _this2.target;
            });
            dropState.activeDrops = [].concat(___toConsumableArray_2(activeDrops.slice(0, index)), ___toConsumableArray_2(activeDrops.slice(index + 1)));
            var deactivateEvent = new DropEvent(dropState, this.dragEvent, 'dropdeactivate');
            deactivateEvent.dropzone = this.dropzone;
            deactivateEvent.target = this.target;
            this.dropzone.fire(deactivateEvent);
          } else {
            this.dropzone.fire(new DropEvent(dropState, this.dragEvent, 'dragleave'));
          }
        }
      }, {
        key: "preventDefault",
        value: function preventDefault() {}
      }, {
        key: "stopPropagation",
        value: function stopPropagation() {
          this.propagationStopped = true;
        }
      }, {
        key: "stopImmediatePropagation",
        value: function stopImmediatePropagation() {
          this.immediatePropagationStopped = this.propagationStopped = true;
        }
      }]);
    
      return DropEvent;
    }(___BaseEvent2_2["default"]);
    
    var ___default_2 = DropEvent;
    _$DropEvent_2["default"] = ___default_2;
    
    var _$drop_3 = {};
    "use strict";
    
    Object.defineProperty(_$drop_3, "__esModule", {
      value: true
    });
    _$drop_3["default"] = void 0;
    
    var __utils_3 = ___interopRequireWildcard_3(_$utils_56);
    
    var _drag = ___interopRequireDefault_3(_$drag_1);
    
    var _DropEvent = ___interopRequireDefault_3(_$DropEvent_2);
    
    function ___interopRequireDefault_3(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_3(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function __install_3(scope) {
      var actions = scope.actions,
          interact = scope.interact,
          Interactable = scope.Interactable,
          interactions = scope.interactions,
          defaults = scope.defaults;
      scope.usePlugin(_drag["default"]);
      interactions.signals.on('before-action-start', function (_ref) {
        var interaction = _ref.interaction;
    
        if (interaction.prepared.name !== 'drag') {
          return;
        }
    
        interaction.dropState = {
          cur: {
            dropzone: null,
            element: null
          },
          prev: {
            dropzone: null,
            element: null
          },
          rejected: null,
          events: null,
          activeDrops: null
        };
      });
      interactions.signals.on('after-action-start', function (_ref2) {
        var interaction = _ref2.interaction,
            event = _ref2.event,
            dragEvent = _ref2.iEvent;
    
        if (interaction.prepared.name !== 'drag') {
          return;
        }
    
        var dropState = interaction.dropState; // reset active dropzones
    
        dropState.activeDrops = null;
        dropState.events = null;
        dropState.activeDrops = getActiveDrops(scope, interaction.element);
        dropState.events = getDropEvents(interaction, event, dragEvent);
    
        if (dropState.events.activate) {
          fireActivationEvents(dropState.activeDrops, dropState.events.activate);
        }
      }); // FIXME proper signal types
    
      interactions.signals.on('action-move', function (arg) {
        return onEventCreated(arg, scope);
      });
      interactions.signals.on('action-end', function (arg) {
        return onEventCreated(arg, scope);
      });
      interactions.signals.on('after-action-move', function (_ref3) {
        var interaction = _ref3.interaction;
    
        if (interaction.prepared.name !== 'drag') {
          return;
        }
    
        fireDropEvents(interaction, interaction.dropState.events);
        interaction.dropState.events = {};
      });
      interactions.signals.on('after-action-end', function (_ref4) {
        var interaction = _ref4.interaction;
    
        if (interaction.prepared.name !== 'drag') {
          return;
        }
    
        fireDropEvents(interaction, interaction.dropState.events);
      });
      interactions.signals.on('stop', function (_ref5) {
        var interaction = _ref5.interaction;
    
        if (interaction.prepared.name !== 'drag') {
          return;
        }
    
        var dropState = interaction.dropState;
    
        if (dropState) {
          dropState.activeDrops = null;
          dropState.events = null;
          dropState.cur.dropzone = null;
          dropState.cur.element = null;
          dropState.prev.dropzone = null;
          dropState.prev.element = null;
          dropState.rejected = false;
        }
      });
      /**
       *
       * ```js
       * interact('.drop').dropzone({
       *   accept: '.can-drop' || document.getElementById('single-drop'),
       *   overlap: 'pointer' || 'center' || zeroToOne
       * }
       * ```
       *
       * Returns or sets whether draggables can be dropped onto this target to
       * trigger drop events
       *
       * Dropzones can receive the following events:
       *  - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends
       *  - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone
       *  - `dragmove` when a draggable that has entered the dropzone is moved
       *  - `drop` when a draggable is dropped into this dropzone
       *
       * Use the `accept` option to allow only elements that match the given CSS
       * selector or element. The value can be:
       *
       *  - **an Element** - only that element can be dropped into this dropzone.
       *  - **a string**, - the element being dragged must match it as a CSS selector.
       *  - **`null`** - accept options is cleared - it accepts any element.
       *
       * Use the `overlap` option to set how drops are checked for. The allowed
       * values are:
       *
       *   - `'pointer'`, the pointer must be over the dropzone (default)
       *   - `'center'`, the draggable element's center must be over the dropzone
       *   - a number from 0-1 which is the `(intersection area) / (draggable area)`.
       *   e.g. `0.5` for drop to happen when half of the area of the draggable is
       *   over the dropzone
       *
       * Use the `checker` option to specify a function to check if a dragged element
       * is over this Interactable.
       *
       * @param {boolean | object | null} [options] The new options to be set.
       * @return {boolean | Interactable} The current setting or this Interactable
       */
    
      Interactable.prototype.dropzone = function (options) {
        return dropzoneMethod(this, options);
      };
      /**
       * ```js
       * interact(target)
       * .dropChecker(function(dragEvent,         // related dragmove or dragend event
       *                       event,             // TouchEvent/PointerEvent/MouseEvent
       *                       dropped,           // bool result of the default checker
       *                       dropzone,          // dropzone Interactable
       *                       dropElement,       // dropzone elemnt
       *                       draggable,         // draggable Interactable
       *                       draggableElement) {// draggable element
       *
       *   return dropped && event.target.hasAttribute('allow-drop')
       * }
       * ```
       */
    
    
      Interactable.prototype.dropCheck = function (dragEvent, event, draggable, draggableElement, dropElement, rect) {
        return dropCheckMethod(this, dragEvent, event, draggable, draggableElement, dropElement, rect);
      };
      /**
       * Returns or sets whether the dimensions of dropzone elements are calculated
       * on every dragmove or only on dragstart for the default dropChecker
       *
       * @param {boolean} [newValue] True to check on each move. False to check only
       * before start
       * @return {boolean | interact} The current setting or interact
       */
    
    
      interact.dynamicDrop = function (newValue) {
        if (__utils_3.is.bool(newValue)) {
          // if (dragging && scope.dynamicDrop !== newValue && !newValue) {
          //  calcRects(dropzones)
          // }
          scope.dynamicDrop = newValue;
          return interact;
        }
    
        return scope.dynamicDrop;
      };
    
      __utils_3.arr.merge(actions.eventTypes, ['dragenter', 'dragleave', 'dropactivate', 'dropdeactivate', 'dropmove', 'drop']);
      actions.methodDict.drop = 'dropzone';
      scope.dynamicDrop = false;
      defaults.actions.drop = drop.defaults;
    }
    
    function collectDrops(_ref6, draggableElement) {
      var interactables = _ref6.interactables;
      var drops = []; // collect all dropzones and their elements which qualify for a drop
    
      for (var _i = 0; _i < interactables.list.length; _i++) {
        var _ref7;
    
        _ref7 = interactables.list[_i];
        var dropzone = _ref7;
    
        if (!dropzone.options.drop.enabled) {
          continue;
        }
    
        var accept = dropzone.options.drop.accept; // test the draggable draggableElement against the dropzone's accept setting
    
        if (__utils_3.is.element(accept) && accept !== draggableElement || __utils_3.is.string(accept) && !__utils_3.dom.matchesSelector(draggableElement, accept) || __utils_3.is.func(accept) && !accept({
          dropzone: dropzone,
          draggableElement: draggableElement
        })) {
          continue;
        } // query for new elements if necessary
    
    
        var dropElements = __utils_3.is.string(dropzone.target) ? dropzone._context.querySelectorAll(dropzone.target) : __utils_3.is.array(dropzone.target) ? dropzone.target : [dropzone.target];
    
        for (var _i2 = 0; _i2 < dropElements.length; _i2++) {
          var _ref8;
    
          _ref8 = dropElements[_i2];
          var dropzoneElement = _ref8;
    
          if (dropzoneElement !== draggableElement) {
            drops.push({
              dropzone: dropzone,
              element: dropzoneElement
            });
          }
        }
      }
    
      return drops;
    }
    
    function fireActivationEvents(activeDrops, event) {
      // loop through all active dropzones and trigger event
      for (var _i3 = 0; _i3 < activeDrops.length; _i3++) {
        var _ref9;
    
        _ref9 = activeDrops[_i3];
        var _ref10 = _ref9,
            dropzone = _ref10.dropzone,
            element = _ref10.element;
        event.dropzone = dropzone; // set current element as event target
    
        event.target = element;
        dropzone.fire(event);
        event.propagationStopped = event.immediatePropagationStopped = false;
      }
    } // return a new array of possible drops. getActiveDrops should always be
    // called when a drag has just started or a drag event happens while
    // dynamicDrop is true
    
    
    function getActiveDrops(scope, dragElement) {
      // get dropzones and their elements that could receive the draggable
      var activeDrops = collectDrops(scope, dragElement);
    
      for (var _i4 = 0; _i4 < activeDrops.length; _i4++) {
        var _ref11;
    
        _ref11 = activeDrops[_i4];
        var activeDrop = _ref11;
        activeDrop.rect = activeDrop.dropzone.getRect(activeDrop.element);
      }
    
      return activeDrops;
    }
    
    function getDrop(_ref12, dragEvent, pointerEvent) {
      var dropState = _ref12.dropState,
          draggable = _ref12.interactable,
          dragElement = _ref12.element;
      var validDrops = []; // collect all dropzones and their elements which qualify for a drop
    
      for (var _i5 = 0; _i5 < dropState.activeDrops.length; _i5++) {
        var _ref13;
    
        _ref13 = dropState.activeDrops[_i5];
        var _ref14 = _ref13,
            dropzone = _ref14.dropzone,
            dropzoneElement = _ref14.element,
            rect = _ref14.rect;
        validDrops.push(dropzone.dropCheck(dragEvent, pointerEvent, draggable, dragElement, dropzoneElement, rect) ? dropzoneElement : null);
      } // get the most appropriate dropzone based on DOM depth and order
    
    
      var dropIndex = __utils_3.dom.indexOfDeepestElement(validDrops);
      return dropState.activeDrops[dropIndex] || null;
    }
    
    function getDropEvents(interaction, _pointerEvent, dragEvent) {
      var dropState = interaction.dropState;
      var dropEvents = {
        enter: null,
        leave: null,
        activate: null,
        deactivate: null,
        move: null,
        drop: null
      };
    
      if (dragEvent.type === 'dragstart') {
        dropEvents.activate = new _DropEvent["default"](dropState, dragEvent, 'dropactivate');
        dropEvents.activate.target = null;
        dropEvents.activate.dropzone = null;
      }
    
      if (dragEvent.type === 'dragend') {
        dropEvents.deactivate = new _DropEvent["default"](dropState, dragEvent, 'dropdeactivate');
        dropEvents.deactivate.target = null;
        dropEvents.deactivate.dropzone = null;
      }
    
      if (dropState.rejected) {
        return dropEvents;
      }
    
      if (dropState.cur.element !== dropState.prev.element) {
        // if there was a previous dropzone, create a dragleave event
        if (dropState.prev.dropzone) {
          dropEvents.leave = new _DropEvent["default"](dropState, dragEvent, 'dragleave');
          dragEvent.dragLeave = dropEvents.leave.target = dropState.prev.element;
          dragEvent.prevDropzone = dropEvents.leave.dropzone = dropState.prev.dropzone;
        } // if dropzone is not null, create a dragenter event
    
    
        if (dropState.cur.dropzone) {
          dropEvents.enter = new _DropEvent["default"](dropState, dragEvent, 'dragenter');
          dragEvent.dragEnter = dropState.cur.element;
          dragEvent.dropzone = dropState.cur.dropzone;
        }
      }
    
      if (dragEvent.type === 'dragend' && dropState.cur.dropzone) {
        dropEvents.drop = new _DropEvent["default"](dropState, dragEvent, 'drop');
        dragEvent.dropzone = dropState.cur.dropzone;
        dragEvent.relatedTarget = dropState.cur.element;
      }
    
      if (dragEvent.type === 'dragmove' && dropState.cur.dropzone) {
        dropEvents.move = new _DropEvent["default"](dropState, dragEvent, 'dropmove');
        dropEvents.move.dragmove = dragEvent;
        dragEvent.dropzone = dropState.cur.dropzone;
      }
    
      return dropEvents;
    }
    
    function fireDropEvents(interaction, events) {
      var dropState = interaction.dropState;
      var activeDrops = dropState.activeDrops,
          cur = dropState.cur,
          prev = dropState.prev;
    
      if (events.leave) {
        prev.dropzone.fire(events.leave);
      }
    
      if (events.move) {
        cur.dropzone.fire(events.move);
      }
    
      if (events.enter) {
        cur.dropzone.fire(events.enter);
      }
    
      if (events.drop) {
        cur.dropzone.fire(events.drop);
      }
    
      if (events.deactivate) {
        fireActivationEvents(activeDrops, events.deactivate);
      }
    
      dropState.prev.dropzone = cur.dropzone;
      dropState.prev.element = cur.element;
    }
    
    function onEventCreated(_ref15, scope) {
      var interaction = _ref15.interaction,
          iEvent = _ref15.iEvent,
          event = _ref15.event;
    
      if (iEvent.type !== 'dragmove' && iEvent.type !== 'dragend') {
        return;
      }
    
      var dropState = interaction.dropState;
    
      if (scope.dynamicDrop) {
        dropState.activeDrops = getActiveDrops(scope, interaction.element);
      }
    
      var dragEvent = iEvent;
      var dropResult = getDrop(interaction, dragEvent, event); // update rejected status
    
      dropState.rejected = dropState.rejected && !!dropResult && dropResult.dropzone === dropState.cur.dropzone && dropResult.element === dropState.cur.element;
      dropState.cur.dropzone = dropResult && dropResult.dropzone;
      dropState.cur.element = dropResult && dropResult.element;
      dropState.events = getDropEvents(interaction, event, dragEvent);
    }
    
    function dropzoneMethod(interactable, options) {
      if (__utils_3.is.object(options)) {
        interactable.options.drop.enabled = options.enabled !== false;
    
        if (options.listeners) {
          var normalized = __utils_3.normalizeListeners(options.listeners); // rename 'drop' to '' as it will be prefixed with 'drop'
    
          var corrected = Object.keys(normalized).reduce(function (acc, type) {
            var correctedType = /^(enter|leave)/.test(type) ? "drag".concat(type) : /^(activate|deactivate|move)/.test(type) ? "drop".concat(type) : type;
            acc[correctedType] = normalized[type];
            return acc;
          }, {});
          interactable.off(interactable.options.drop.listeners);
          interactable.on(corrected);
          interactable.options.drop.listeners = corrected;
        }
    
        if (__utils_3.is.func(options.ondrop)) {
          interactable.on('drop', options.ondrop);
        }
    
        if (__utils_3.is.func(options.ondropactivate)) {
          interactable.on('dropactivate', options.ondropactivate);
        }
    
        if (__utils_3.is.func(options.ondropdeactivate)) {
          interactable.on('dropdeactivate', options.ondropdeactivate);
        }
    
        if (__utils_3.is.func(options.ondragenter)) {
          interactable.on('dragenter', options.ondragenter);
        }
    
        if (__utils_3.is.func(options.ondragleave)) {
          interactable.on('dragleave', options.ondragleave);
        }
    
        if (__utils_3.is.func(options.ondropmove)) {
          interactable.on('dropmove', options.ondropmove);
        }
    
        if (/^(pointer|center)$/.test(options.overlap)) {
          interactable.options.drop.overlap = options.overlap;
        } else if (__utils_3.is.number(options.overlap)) {
          interactable.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0);
        }
    
        if ('accept' in options) {
          interactable.options.drop.accept = options.accept;
        }
    
        if ('checker' in options) {
          interactable.options.drop.checker = options.checker;
        }
    
        return interactable;
      }
    
      if (__utils_3.is.bool(options)) {
        interactable.options.drop.enabled = options;
        return interactable;
      }
    
      return interactable.options.drop;
    }
    
    function dropCheckMethod(interactable, dragEvent, event, draggable, draggableElement, dropElement, rect) {
      var dropped = false; // if the dropzone has no rect (eg. display: none)
      // call the custom dropChecker or just return false
    
      if (!(rect = rect || interactable.getRect(dropElement))) {
        return interactable.options.drop.checker ? interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement) : false;
      }
    
      var dropOverlap = interactable.options.drop.overlap;
    
      if (dropOverlap === 'pointer') {
        var origin = __utils_3.getOriginXY(draggable, draggableElement, 'drag');
        var page = __utils_3.pointer.getPageXY(dragEvent);
        page.x += origin.x;
        page.y += origin.y;
        var horizontal = page.x > rect.left && page.x < rect.right;
        var vertical = page.y > rect.top && page.y < rect.bottom;
        dropped = horizontal && vertical;
      }
    
      var dragRect = draggable.getRect(draggableElement);
    
      if (dragRect && dropOverlap === 'center') {
        var cx = dragRect.left + dragRect.width / 2;
        var cy = dragRect.top + dragRect.height / 2;
        dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom;
      }
    
      if (dragRect && __utils_3.is.number(dropOverlap)) {
        var overlapArea = Math.max(0, Math.min(rect.right, dragRect.right) - Math.max(rect.left, dragRect.left)) * Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top, dragRect.top));
        var overlapRatio = overlapArea / (dragRect.width * dragRect.height);
        dropped = overlapRatio >= dropOverlap;
      }
    
      if (interactable.options.drop.checker) {
        dropped = interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement);
      }
    
      return dropped;
    }
    
    var drop = {
      id: 'actions/drop',
      install: __install_3,
      getActiveDrops: getActiveDrops,
      getDrop: getDrop,
      getDropEvents: getDropEvents,
      fireDropEvents: fireDropEvents,
      defaults: {
        enabled: false,
        accept: null,
        overlap: 'pointer'
      }
    };
    var ___default_3 = drop;
    _$drop_3["default"] = ___default_3;
    
    var _$gesture_4 = {};
    "use strict";
    
    Object.defineProperty(_$gesture_4, "__esModule", {
      value: true
    });
    _$gesture_4["default"] = void 0;
    
    var ___InteractEvent_4 = ___interopRequireDefault_4(_$InteractEvent_15);
    
    var ___scope_4 = _$scope_24({});
    
    var __utils_4 = ___interopRequireWildcard_4(_$utils_56);
    
    function ___interopRequireWildcard_4(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_4(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    ___scope_4.ActionName.Gesture = 'gesture';
    
    function __install_4(scope) {
      var actions = scope.actions,
          Interactable = scope.Interactable,
          interactions = scope.interactions,
          defaults = scope.defaults;
      /**
       * ```js
       * interact(element).gesturable({
       *     onstart: function (event) {},
       *     onmove : function (event) {},
       *     onend  : function (event) {},
       *
       *     // limit multiple gestures.
       *     // See the explanation in {@link Interactable.draggable} example
       *     max: Infinity,
       *     maxPerElement: 1,
       * })
       *
       * var isGestureable = interact(element).gesturable()
       * ```
       *
       * Gets or sets whether multitouch gestures can be performed on the target
       *
       * @param {boolean | object} [options] true/false or An object with event
       * listeners to be fired on gesture events (makes the Interactable gesturable)
       * @return {boolean | Interactable} A boolean indicating if this can be the
       * target of gesture events, or this Interactable
       */
    
      Interactable.prototype.gesturable = function (options) {
        if (__utils_4.is.object(options)) {
          this.options.gesture.enabled = options.enabled !== false;
          this.setPerAction('gesture', options);
          this.setOnEvents('gesture', options);
          return this;
        }
    
        if (__utils_4.is.bool(options)) {
          this.options.gesture.enabled = options;
          return this;
        }
    
        return this.options.gesture;
      };
    
      interactions.signals.on('action-start', updateGestureProps);
      interactions.signals.on('action-move', updateGestureProps);
      interactions.signals.on('action-end', updateGestureProps);
      interactions.signals.on('new', function (_ref) {
        var interaction = _ref.interaction;
        interaction.gesture = {
          angle: 0,
          distance: 0,
          scale: 1,
          startAngle: 0,
          startDistance: 0
        };
      });
      actions[___scope_4.ActionName.Gesture] = gesture;
      actions.names.push(___scope_4.ActionName.Gesture);
      __utils_4.arr.merge(actions.eventTypes, ['gesturestart', 'gesturemove', 'gestureend']);
      actions.methodDict.gesture = 'gesturable';
      defaults.actions.gesture = gesture.defaults;
    }
    
    var gesture = {
      id: 'actions/gesture',
      install: __install_4,
      defaults: {},
      checker: function checker(_pointer, _event, _interactable, _element, interaction) {
        if (interaction.pointers.length >= 2) {
          return {
            name: 'gesture'
          };
        }
    
        return null;
      },
      getCursor: function getCursor() {
        return '';
      }
    };
    
    function updateGestureProps(_ref2) {
      var interaction = _ref2.interaction,
          iEvent = _ref2.iEvent,
          event = _ref2.event,
          phase = _ref2.phase;
    
      if (interaction.prepared.name !== 'gesture') {
        return;
      }
    
      var pointers = interaction.pointers.map(function (p) {
        return p.pointer;
      });
      var starting = phase === 'start';
      var ending = phase === 'end';
      var deltaSource = interaction.interactable.options.deltaSource;
      iEvent.touches = [pointers[0], pointers[1]];
    
      if (starting) {
        iEvent.distance = __utils_4.pointer.touchDistance(pointers, deltaSource);
        iEvent.box = __utils_4.pointer.touchBBox(pointers);
        iEvent.scale = 1;
        iEvent.ds = 0;
        iEvent.angle = __utils_4.pointer.touchAngle(pointers, deltaSource);
        iEvent.da = 0;
        interaction.gesture.startDistance = iEvent.distance;
        interaction.gesture.startAngle = iEvent.angle;
      } else if (ending || event instanceof ___InteractEvent_4["default"]) {
        var prevEvent = interaction.prevEvent;
        iEvent.distance = prevEvent.distance;
        iEvent.box = prevEvent.box;
        iEvent.scale = prevEvent.scale;
        iEvent.ds = 0;
        iEvent.angle = prevEvent.angle;
        iEvent.da = 0;
      } else {
        iEvent.distance = __utils_4.pointer.touchDistance(pointers, deltaSource);
        iEvent.box = __utils_4.pointer.touchBBox(pointers);
        iEvent.scale = iEvent.distance / interaction.gesture.startDistance;
        iEvent.angle = __utils_4.pointer.touchAngle(pointers, deltaSource);
        iEvent.ds = iEvent.scale - interaction.gesture.scale;
        iEvent.da = iEvent.angle - interaction.gesture.angle;
      }
    
      interaction.gesture.distance = iEvent.distance;
      interaction.gesture.angle = iEvent.angle;
    
      if (__utils_4.is.number(iEvent.scale) && iEvent.scale !== Infinity && !isNaN(iEvent.scale)) {
        interaction.gesture.scale = iEvent.scale;
      }
    }
    
    var ___default_4 = gesture;
    _$gesture_4["default"] = ___default_4;
    
    var _$resize_6 = {};
    "use strict";
    
    Object.defineProperty(_$resize_6, "__esModule", {
      value: true
    });
    _$resize_6["default"] = void 0;
    
    var ___scope_6 = _$scope_24({});
    
    var __arr_6 = ___interopRequireWildcard_6(_$arr_47);
    
    var __dom_6 = ___interopRequireWildcard_6(_$domUtils_51);
    
    var ___extend_6 = ___interopRequireDefault_6(_$extend_53);
    
    var __is_6 = ___interopRequireWildcard_6(_$is_57);
    
    function ___interopRequireDefault_6(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_6(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    ___scope_6.ActionName.Resize = 'resize';
    
    function __install_6(scope) {
      var actions = scope.actions,
          browser = scope.browser,
          Interactable = scope.Interactable,
          interactions = scope.interactions,
          defaults = scope.defaults; // Less Precision with touch input
    
      interactions.signals.on('new', function (interaction) {
        interaction.resizeAxes = 'xy';
      });
      interactions.signals.on('action-start', start);
      interactions.signals.on('action-move', __move_6);
      interactions.signals.on('action-start', updateEventAxes);
      interactions.signals.on('action-move', updateEventAxes);
      resize.cursors = initCursors(browser);
      resize.defaultMargin = browser.supportsTouch || browser.supportsPointerEvent ? 20 : 10;
      /**
       * ```js
       * interact(element).resizable({
       *   onstart: function (event) {},
       *   onmove : function (event) {},
       *   onend  : function (event) {},
       *
       *   edges: {
       *     top   : true,       // Use pointer coords to check for resize.
       *     left  : false,      // Disable resizing from left edge.
       *     bottom: '.resize-s',// Resize if pointer target matches selector
       *     right : handleEl    // Resize if pointer target is the given Element
       *   },
       *
       *     // Width and height can be adjusted independently. When `true`, width and
       *     // height are adjusted at a 1:1 ratio.
       *     square: false,
       *
       *     // Width and height can be adjusted independently. When `true`, width and
       *     // height maintain the aspect ratio they had when resizing started.
       *     preserveAspectRatio: false,
       *
       *   // a value of 'none' will limit the resize rect to a minimum of 0x0
       *   // 'negate' will allow the rect to have negative width/height
       *   // 'reposition' will keep the width/height positive by swapping
       *   // the top and bottom edges and/or swapping the left and right edges
       *   invert: 'none' || 'negate' || 'reposition'
       *
       *   // limit multiple resizes.
       *   // See the explanation in the {@link Interactable.draggable} example
       *   max: Infinity,
       *   maxPerElement: 1,
       * })
       *
       * var isResizeable = interact(element).resizable()
       * ```
       *
       * Gets or sets whether resize actions can be performed on the target
       *
       * @param {boolean | object} [options] true/false or An object with event
       * listeners to be fired on resize events (object makes the Interactable
       * resizable)
       * @return {boolean | Interactable} A boolean indicating if this can be the
       * target of resize elements, or this Interactable
       */
    
      Interactable.prototype.resizable = function (options) {
        return resizable(this, options, scope);
      };
    
      actions[___scope_6.ActionName.Resize] = resize;
      actions.names.push(___scope_6.ActionName.Resize);
      __arr_6.merge(actions.eventTypes, ['resizestart', 'resizemove', 'resizeinertiastart', 'resizeresume', 'resizeend']);
      actions.methodDict.resize = 'resizable';
      defaults.actions.resize = resize.defaults;
    }
    
    var resize = {
      id: 'actions/resize',
      install: __install_6,
      defaults: {
        square: false,
        preserveAspectRatio: false,
        axis: 'xy',
        // use default margin
        margin: NaN,
        // object with props left, right, top, bottom which are
        // true/false values to resize when the pointer is over that edge,
        // CSS selectors to match the handles for each direction
        // or the Elements for each handle
        edges: null,
        // a value of 'none' will limit the resize rect to a minimum of 0x0
        // 'negate' will alow the rect to have negative width/height
        // 'reposition' will keep the width/height positive by swapping
        // the top and bottom edges and/or swapping the left and right edges
        invert: 'none'
      },
      checker: function checker(_pointer, _event, interactable, element, interaction, rect) {
        if (!rect) {
          return null;
        }
    
        var page = (0, ___extend_6["default"])({}, interaction.coords.cur.page);
        var options = interactable.options;
    
        if (options.resize.enabled) {
          var resizeOptions = options.resize;
          var resizeEdges = {
            left: false,
            right: false,
            top: false,
            bottom: false
          }; // if using resize.edges
    
          if (__is_6.object(resizeOptions.edges)) {
            for (var edge in resizeEdges) {
              resizeEdges[edge] = checkResizeEdge(edge, resizeOptions.edges[edge], page, interaction._latestPointer.eventTarget, element, rect, resizeOptions.margin || this.defaultMargin);
            }
    
            resizeEdges.left = resizeEdges.left && !resizeEdges.right;
            resizeEdges.top = resizeEdges.top && !resizeEdges.bottom;
    
            if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) {
              return {
                name: 'resize',
                edges: resizeEdges
              };
            }
          } else {
            var right = options.resize.axis !== 'y' && page.x > rect.right - this.defaultMargin;
            var bottom = options.resize.axis !== 'x' && page.y > rect.bottom - this.defaultMargin;
    
            if (right || bottom) {
              return {
                name: 'resize',
                axes: (right ? 'x' : '') + (bottom ? 'y' : '')
              };
            }
          }
        }
    
        return null;
      },
      cursors: null,
      getCursor: function getCursor(_ref) {
        var edges = _ref.edges,
            axis = _ref.axis,
            name = _ref.name;
        var cursors = resize.cursors;
        var result = null;
    
        if (axis) {
          result = cursors[name + axis];
        } else if (edges) {
          var cursorKey = '';
          var _arr = ['top', 'bottom', 'left', 'right'];
    
          for (var _i = 0; _i < _arr.length; _i++) {
            var edge = _arr[_i];
    
            if (edges[edge]) {
              cursorKey += edge;
            }
          }
    
          result = cursors[cursorKey];
        }
    
        return result;
      },
      defaultMargin: null
    };
    
    function resizable(interactable, options, scope) {
      if (__is_6.object(options)) {
        interactable.options.resize.enabled = options.enabled !== false;
        interactable.setPerAction('resize', options);
        interactable.setOnEvents('resize', options);
    
        if (__is_6.string(options.axis) && /^x$|^y$|^xy$/.test(options.axis)) {
          interactable.options.resize.axis = options.axis;
        } else if (options.axis === null) {
          interactable.options.resize.axis = scope.defaults.actions.resize.axis;
        }
    
        if (__is_6.bool(options.preserveAspectRatio)) {
          interactable.options.resize.preserveAspectRatio = options.preserveAspectRatio;
        } else if (__is_6.bool(options.square)) {
          interactable.options.resize.square = options.square;
        }
    
        return interactable;
      }
    
      if (__is_6.bool(options)) {
        interactable.options.resize.enabled = options;
        return interactable;
      }
    
      return interactable.options.resize;
    }
    
    function checkResizeEdge(name, value, page, element, interactableElement, rect, margin) {
      // false, '', undefined, null
      if (!value) {
        return false;
      } // true value, use pointer coords and element rect
    
    
      if (value === true) {
        // if dimensions are negative, "switch" edges
        var width = __is_6.number(rect.width) ? rect.width : rect.right - rect.left;
        var height = __is_6.number(rect.height) ? rect.height : rect.bottom - rect.top; // don't use margin greater than half the relevent dimension
    
        margin = Math.min(margin, (name === 'left' || name === 'right' ? width : height) / 2);
    
        if (width < 0) {
          if (name === 'left') {
            name = 'right';
          } else if (name === 'right') {
            name = 'left';
          }
        }
    
        if (height < 0) {
          if (name === 'top') {
            name = 'bottom';
          } else if (name === 'bottom') {
            name = 'top';
          }
        }
    
        if (name === 'left') {
          return page.x < (width >= 0 ? rect.left : rect.right) + margin;
        }
    
        if (name === 'top') {
          return page.y < (height >= 0 ? rect.top : rect.bottom) + margin;
        }
    
        if (name === 'right') {
          return page.x > (width >= 0 ? rect.right : rect.left) - margin;
        }
    
        if (name === 'bottom') {
          return page.y > (height >= 0 ? rect.bottom : rect.top) - margin;
        }
      } // the remaining checks require an element
    
    
      if (!__is_6.element(element)) {
        return false;
      }
    
      return __is_6.element(value) // the value is an element to use as a resize handle
      ? value === element // otherwise check if element matches value as selector
      : __dom_6.matchesUpTo(element, value, interactableElement);
    }
    
    function initCursors(browser) {
      return browser.isIe9 ? {
        x: 'e-resize',
        y: 's-resize',
        xy: 'se-resize',
        top: 'n-resize',
        left: 'w-resize',
        bottom: 's-resize',
        right: 'e-resize',
        topleft: 'se-resize',
        bottomright: 'se-resize',
        topright: 'ne-resize',
        bottomleft: 'ne-resize'
      } : {
        x: 'ew-resize',
        y: 'ns-resize',
        xy: 'nwse-resize',
        top: 'ns-resize',
        left: 'ew-resize',
        bottom: 'ns-resize',
        right: 'ew-resize',
        topleft: 'nwse-resize',
        bottomright: 'nwse-resize',
        topright: 'nesw-resize',
        bottomleft: 'nesw-resize'
      };
    }
    
    function start(_ref2) {
      var iEvent = _ref2.iEvent,
          interaction = _ref2.interaction;
    
      if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) {
        return;
      }
    
      var startRect = interaction.rect;
      var resizeOptions = interaction.interactable.options.resize;
      /*
       * When using the `resizable.square` or `resizable.preserveAspectRatio` options, resizing from one edge
       * will affect another. E.g. with `resizable.square`, resizing to make the right edge larger will make
       * the bottom edge larger by the same amount. We call these 'linked' edges. Any linked edges will depend
       * on the active edges and the edge being interacted with.
       */
    
      if (resizeOptions.square || resizeOptions.preserveAspectRatio) {
        var linkedEdges = (0, ___extend_6["default"])({}, interaction.prepared.edges);
        linkedEdges.top = linkedEdges.top || linkedEdges.left && !linkedEdges.bottom;
        linkedEdges.left = linkedEdges.left || linkedEdges.top && !linkedEdges.right;
        linkedEdges.bottom = linkedEdges.bottom || linkedEdges.right && !linkedEdges.top;
        linkedEdges.right = linkedEdges.right || linkedEdges.bottom && !linkedEdges.left;
        interaction.prepared._linkedEdges = linkedEdges;
      } else {
        interaction.prepared._linkedEdges = null;
      } // if using `resizable.preserveAspectRatio` option, record aspect ratio at the start of the resize
    
    
      if (resizeOptions.preserveAspectRatio) {
        interaction.resizeStartAspectRatio = startRect.width / startRect.height;
      }
    
      interaction.resizeRects = {
        start: startRect,
        current: (0, ___extend_6["default"])({}, startRect),
        inverted: (0, ___extend_6["default"])({}, startRect),
        previous: (0, ___extend_6["default"])({}, startRect),
        delta: {
          left: 0,
          right: 0,
          width: 0,
          top: 0,
          bottom: 0,
          height: 0
        }
      };
      iEvent.rect = interaction.resizeRects.inverted;
      iEvent.deltaRect = interaction.resizeRects.delta;
    }
    
    function __move_6(_ref3) {
      var iEvent = _ref3.iEvent,
          interaction = _ref3.interaction;
    
      if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) {
        return;
      }
    
      var resizeOptions = interaction.interactable.options.resize;
      var invert = resizeOptions.invert;
      var invertible = invert === 'reposition' || invert === 'negate';
      var edges = interaction.prepared.edges; // eslint-disable-next-line no-shadow
    
      var start = interaction.resizeRects.start;
      var current = interaction.resizeRects.current;
      var inverted = interaction.resizeRects.inverted;
      var deltaRect = interaction.resizeRects.delta;
      var previous = (0, ___extend_6["default"])(interaction.resizeRects.previous, inverted);
      var originalEdges = edges;
      var eventDelta = (0, ___extend_6["default"])({}, iEvent.delta);
    
      if (resizeOptions.preserveAspectRatio || resizeOptions.square) {
        // `resize.preserveAspectRatio` takes precedence over `resize.square`
        var startAspectRatio = resizeOptions.preserveAspectRatio ? interaction.resizeStartAspectRatio : 1;
        edges = interaction.prepared._linkedEdges;
    
        if (originalEdges.left && originalEdges.bottom || originalEdges.right && originalEdges.top) {
          eventDelta.y = -eventDelta.x / startAspectRatio;
        } else if (originalEdges.left || originalEdges.right) {
          eventDelta.y = eventDelta.x / startAspectRatio;
        } else if (originalEdges.top || originalEdges.bottom) {
          eventDelta.x = eventDelta.y * startAspectRatio;
        }
      } // update the 'current' rect without modifications
    
    
      if (edges.top) {
        current.top += eventDelta.y;
      }
    
      if (edges.bottom) {
        current.bottom += eventDelta.y;
      }
    
      if (edges.left) {
        current.left += eventDelta.x;
      }
    
      if (edges.right) {
        current.right += eventDelta.x;
      }
    
      if (invertible) {
        // if invertible, copy the current rect
        (0, ___extend_6["default"])(inverted, current);
    
        if (invert === 'reposition') {
          // swap edge values if necessary to keep width/height positive
          var swap;
    
          if (inverted.top > inverted.bottom) {
            swap = inverted.top;
            inverted.top = inverted.bottom;
            inverted.bottom = swap;
          }
    
          if (inverted.left > inverted.right) {
            swap = inverted.left;
            inverted.left = inverted.right;
            inverted.right = swap;
          }
        }
      } else {
        // if not invertible, restrict to minimum of 0x0 rect
        inverted.top = Math.min(current.top, start.bottom);
        inverted.bottom = Math.max(current.bottom, start.top);
        inverted.left = Math.min(current.left, start.right);
        inverted.right = Math.max(current.right, start.left);
      }
    
      inverted.width = inverted.right - inverted.left;
      inverted.height = inverted.bottom - inverted.top;
    
      for (var edge in inverted) {
        deltaRect[edge] = inverted[edge] - previous[edge];
      }
    
      iEvent.edges = interaction.prepared.edges;
      iEvent.rect = inverted;
      iEvent.deltaRect = deltaRect;
    }
    
    function updateEventAxes(_ref4) {
      var interaction = _ref4.interaction,
          iEvent = _ref4.iEvent,
          action = _ref4.action;
    
      if (action !== 'resize' || !interaction.resizeAxes) {
        return;
      }
    
      var options = interaction.interactable.options;
    
      if (options.resize.square) {
        if (interaction.resizeAxes === 'y') {
          iEvent.delta.x = iEvent.delta.y;
        } else {
          iEvent.delta.y = iEvent.delta.x;
        }
    
        iEvent.axes = 'xy';
      } else {
        iEvent.axes = interaction.resizeAxes;
    
        if (interaction.resizeAxes === 'x') {
          iEvent.delta.y = 0;
        } else if (interaction.resizeAxes === 'y') {
          iEvent.delta.x = 0;
        }
      }
    }
    
    var ___default_6 = resize;
    _$resize_6["default"] = ___default_6;
    
    var _$actions_5 = {};
    "use strict";
    
    Object.defineProperty(_$actions_5, "__esModule", {
      value: true
    });
    _$actions_5.install = __install_5;
    Object.defineProperty(_$actions_5, "drag", {
      enumerable: true,
      get: function get() {
        return ___drag_5["default"];
      }
    });
    Object.defineProperty(_$actions_5, "drop", {
      enumerable: true,
      get: function get() {
        return _drop["default"];
      }
    });
    Object.defineProperty(_$actions_5, "gesture", {
      enumerable: true,
      get: function get() {
        return _gesture["default"];
      }
    });
    Object.defineProperty(_$actions_5, "resize", {
      enumerable: true,
      get: function get() {
        return _resize["default"];
      }
    });
    _$actions_5.id = void 0;
    
    var ___drag_5 = ___interopRequireDefault_5(_$drag_1);
    
    var _drop = ___interopRequireDefault_5(_$drop_3);
    
    var _gesture = ___interopRequireDefault_5(_$gesture_4);
    
    var _resize = ___interopRequireDefault_5(_$resize_6);
    
    function ___interopRequireDefault_5(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function __install_5(scope) {
      scope.usePlugin(_gesture["default"]);
      scope.usePlugin(_resize["default"]);
      scope.usePlugin(___drag_5["default"]);
      scope.usePlugin(_drop["default"]);
    }
    
    var id = 'actions';
    _$actions_5.id = id;
    
    var _$autoScroll_7 = {};
    "use strict";
    
    Object.defineProperty(_$autoScroll_7, "__esModule", {
      value: true
    });
    _$autoScroll_7.getContainer = getContainer;
    _$autoScroll_7.getScroll = getScroll;
    _$autoScroll_7.getScrollSize = getScrollSize;
    _$autoScroll_7.getScrollSizeDelta = getScrollSizeDelta;
    _$autoScroll_7["default"] = void 0;
    
    var __domUtils_7 = ___interopRequireWildcard_7(_$domUtils_51);
    
    var __is_7 = ___interopRequireWildcard_7(_$is_57);
    
    var ___raf_7 = ___interopRequireDefault_7(_$raf_62);
    
    /* removed: var _$rect_63 = require("@interactjs/utils/rect"); */;
    
    /* removed: var _$window_66 = require("@interactjs/utils/window"); */;
    
    function ___interopRequireDefault_7(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_7(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function __install_7(scope) {
      var interactions = scope.interactions,
          defaults = scope.defaults,
          actions = scope.actions;
      scope.autoScroll = autoScroll;
    
      autoScroll.now = function () {
        return scope.now();
      };
    
      interactions.signals.on('new', function (_ref) {
        var interaction = _ref.interaction;
        interaction.autoScroll = null;
      });
      interactions.signals.on('destroy', function (_ref2) {
        var interaction = _ref2.interaction;
        interaction.autoScroll = null;
        autoScroll.stop();
    
        if (autoScroll.interaction) {
          autoScroll.interaction = null;
        }
      });
      interactions.signals.on('stop', autoScroll.stop);
      interactions.signals.on('action-move', function (arg) {
        return autoScroll.onInteractionMove(arg);
      });
      actions.eventTypes.push('autoscroll');
      defaults.perAction.autoScroll = autoScroll.defaults;
    }
    
    var autoScroll = {
      defaults: {
        enabled: false,
        margin: 60,
        // the item that is scrolled (Window or HTMLElement)
        container: null,
        // the scroll speed in pixels per second
        speed: 300
      },
      now: Date.now,
      interaction: null,
      i: null,
      x: 0,
      y: 0,
      isScrolling: false,
      prevTime: 0,
      margin: 0,
      speed: 0,
      start: function start(interaction) {
        autoScroll.isScrolling = true;
    
        ___raf_7["default"].cancel(autoScroll.i);
    
        interaction.autoScroll = autoScroll;
        autoScroll.interaction = interaction;
        autoScroll.prevTime = autoScroll.now();
        autoScroll.i = ___raf_7["default"].request(autoScroll.scroll);
      },
      stop: function stop() {
        autoScroll.isScrolling = false;
    
        if (autoScroll.interaction) {
          autoScroll.interaction.autoScroll = null;
        }
    
        ___raf_7["default"].cancel(autoScroll.i);
      },
      // scroll the window by the values in scroll.x/y
      scroll: function scroll() {
        var interaction = autoScroll.interaction;
        var interactable = interaction.interactable,
            element = interaction.element;
        var options = interactable.options[autoScroll.interaction.prepared.name].autoScroll;
        var container = getContainer(options.container, interactable, element);
        var now = autoScroll.now(); // change in time in seconds
    
        var dt = (now - autoScroll.prevTime) / 1000; // displacement
    
        var s = options.speed * dt;
    
        if (s >= 1) {
          var scrollBy = {
            x: autoScroll.x * s,
            y: autoScroll.y * s
          };
    
          if (scrollBy.x || scrollBy.y) {
            var prevScroll = getScroll(container);
    
            if (__is_7.window(container)) {
              container.scrollBy(scrollBy.x, scrollBy.y);
            } else if (container) {
              container.scrollLeft += scrollBy.x;
              container.scrollTop += scrollBy.y;
            }
    
            var curScroll = getScroll(container);
            var delta = {
              x: curScroll.x - prevScroll.x,
              y: curScroll.y - prevScroll.y
            };
    
            if (delta.x || delta.y) {
              interactable.fire({
                type: 'autoscroll',
                target: element,
                interactable: interactable,
                delta: delta,
                interaction: interaction,
                container: container
              });
            }
          }
    
          autoScroll.prevTime = now;
        }
    
        if (autoScroll.isScrolling) {
          ___raf_7["default"].cancel(autoScroll.i);
    
          autoScroll.i = ___raf_7["default"].request(autoScroll.scroll);
        }
      },
      check: function check(interactable, actionName) {
        var options = interactable.options;
        return options[actionName].autoScroll && options[actionName].autoScroll.enabled;
      },
      onInteractionMove: function onInteractionMove(_ref3) {
        var interaction = _ref3.interaction,
            pointer = _ref3.pointer;
    
        if (!(interaction.interacting() && autoScroll.check(interaction.interactable, interaction.prepared.name))) {
          return;
        }
    
        if (interaction.simulation) {
          autoScroll.x = autoScroll.y = 0;
          return;
        }
    
        var top;
        var right;
        var bottom;
        var left;
        var interactable = interaction.interactable,
            element = interaction.element;
        var options = interactable.options[interaction.prepared.name].autoScroll;
        var container = getContainer(options.container, interactable, element);
    
        if (__is_7.window(container)) {
          left = pointer.clientX < autoScroll.margin;
          top = pointer.clientY < autoScroll.margin;
          right = pointer.clientX > container.innerWidth - autoScroll.margin;
          bottom = pointer.clientY > container.innerHeight - autoScroll.margin;
        } else {
          var rect = __domUtils_7.getElementClientRect(container);
          left = pointer.clientX < rect.left + autoScroll.margin;
          top = pointer.clientY < rect.top + autoScroll.margin;
          right = pointer.clientX > rect.right - autoScroll.margin;
          bottom = pointer.clientY > rect.bottom - autoScroll.margin;
        }
    
        autoScroll.x = right ? 1 : left ? -1 : 0;
        autoScroll.y = bottom ? 1 : top ? -1 : 0;
    
        if (!autoScroll.isScrolling) {
          // set the autoScroll properties to those of the target
          autoScroll.margin = options.margin;
          autoScroll.speed = options.speed;
          autoScroll.start(interaction);
        }
      }
    };
    
    function getContainer(value, interactable, element) {
      return (__is_7.string(value) ? (0, _$rect_63.getStringOptionResult)(value, interactable, element) : value) || (0, _$window_66.getWindow)(element);
    }
    
    function getScroll(container) {
      if (__is_7.window(container)) {
        container = window.document.body;
      }
    
      return {
        x: container.scrollLeft,
        y: container.scrollTop
      };
    }
    
    function getScrollSize(container) {
      if (__is_7.window(container)) {
        container = window.document.body;
      }
    
      return {
        x: container.scrollWidth,
        y: container.scrollHeight
      };
    }
    
    function getScrollSizeDelta(_ref4, func) {
      var interaction = _ref4.interaction,
          element = _ref4.element;
      var scrollOptions = interaction && interaction.interactable.options[interaction.prepared.name].autoScroll;
    
      if (!scrollOptions || !scrollOptions.enabled) {
        func();
        return {
          x: 0,
          y: 0
        };
      }
    
      var scrollContainer = getContainer(scrollOptions.container, interaction.interactable, element);
      var prevSize = getScroll(scrollContainer);
      func();
      var curSize = getScroll(scrollContainer);
      return {
        x: curSize.x - prevSize.x,
        y: curSize.y - prevSize.y
      };
    }
    
    var ___default_7 = {
      id: 'auto-scroll',
      install: __install_7
    };
    _$autoScroll_7["default"] = ___default_7;
    
    var _$InteractableMethods_8 = {};
    "use strict";
    
    Object.defineProperty(_$InteractableMethods_8, "__esModule", {
      value: true
    });
    _$InteractableMethods_8["default"] = void 0;
    
    /* removed: var _$utils_56 = require("@interactjs/utils"); */;
    
    var __is_8 = ___interopRequireWildcard_8(_$is_57);
    
    function ___interopRequireWildcard_8(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function __install_8(scope) {
      var Interactable = scope.Interactable,
          actions = scope.actions;
      Interactable.prototype.getAction = getAction;
      /**
       * ```js
       * interact(element, { ignoreFrom: document.getElementById('no-action') })
       * // or
       * interact(element).ignoreFrom('input, textarea, a')
       * ```
       * @deprecated
       * If the target of the `mousedown`, `pointerdown` or `touchstart` event or any
       * of it's parents match the given CSS selector or Element, no
       * drag/resize/gesture is started.
       *
       * Don't use this method. Instead set the `ignoreFrom` option for each action
       * or for `pointerEvents`
       *
       * @example
       * interact(targett)
       *   .draggable({
       *     ignoreFrom: 'input, textarea, a[href]'',
       *   })
       *   .pointerEvents({
       *     ignoreFrom: '[no-pointer]',
       *   })
       *
       * @param {string | Element | null} [newValue] a CSS selector string, an
       * Element or `null` to not ignore any elements
       * @return {string | Element | object} The current ignoreFrom value or this
       * Interactable
       */
    
      Interactable.prototype.ignoreFrom = (0, _$utils_56.warnOnce)(function (newValue) {
        return this._backCompatOption('ignoreFrom', newValue);
      }, 'Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).');
      /**
       * @deprecated
       *
       * A drag/resize/gesture is started only If the target of the `mousedown`,
       * `pointerdown` or `touchstart` event or any of it's parents match the given
       * CSS selector or Element.
       *
       * Don't use this method. Instead set the `allowFrom` option for each action
       * or for `pointerEvents`
       *
       * @example
       * interact(targett)
       *   .resizable({
       *     allowFrom: '.resize-handle',
       *   .pointerEvents({
       *     allowFrom: '.handle',,
       *   })
       *
       * @param {string | Element | null} [newValue] a CSS selector string, an
       * Element or `null` to allow from any element
       * @return {string | Element | object} The current allowFrom value or this
       * Interactable
       */
    
      Interactable.prototype.allowFrom = (0, _$utils_56.warnOnce)(function (newValue) {
        return this._backCompatOption('allowFrom', newValue);
      }, 'Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).');
      /**
       * ```js
       * interact('.resize-drag')
       *   .resizable(true)
       *   .draggable(true)
       *   .actionChecker(function (pointer, event, action, interactable, element, interaction) {
       *
       *   if (interact.matchesSelector(event.target, '.drag-handle')) {
       *     // force drag with handle target
       *     action.name = drag
       *   }
       *   else {
       *     // resize from the top and right edges
       *     action.name  = 'resize'
       *     action.edges = { top: true, right: true }
       *   }
       *
       *   return action
       * })
       * ```
       *
       * Returns or sets the function used to check action to be performed on
       * pointerDown
       *
       * @param {function | null} [checker] A function which takes a pointer event,
       * defaultAction string, interactable, element and interaction as parameters
       * and returns an object with name property 'drag' 'resize' or 'gesture' and
       * optionally an `edges` object with boolean 'top', 'left', 'bottom' and right
       * props.
       * @return {Function | Interactable} The checker function or this Interactable
       */
    
      Interactable.prototype.actionChecker = actionChecker;
      /**
       * Returns or sets whether the the cursor should be changed depending on the
       * action that would be performed if the mouse were pressed and dragged.
       *
       * @param {boolean} [newValue]
       * @return {boolean | Interactable} The current setting or this Interactable
       */
    
      Interactable.prototype.styleCursor = styleCursor;
    
      Interactable.prototype.defaultActionChecker = function (pointer, event, interaction, element) {
        return defaultActionChecker(this, pointer, event, interaction, element, actions);
      };
    }
    
    function getAction(pointer, event, interaction, element) {
      var action = this.defaultActionChecker(pointer, event, interaction, element);
    
      if (this.options.actionChecker) {
        return this.options.actionChecker(pointer, event, action, this, element, interaction);
      }
    
      return action;
    }
    
    function defaultActionChecker(interactable, pointer, event, interaction, element, actions) {
      var rect = interactable.getRect(element);
      var buttons = event.buttons || {
        0: 1,
        1: 4,
        3: 8,
        4: 16
      }[event.button];
      var action = null;
    
      for (var _i = 0; _i < actions.names.length; _i++) {
        var _ref;
    
        _ref = actions.names[_i];
        var actionName = _ref;
    
        // check mouseButton setting if the pointer is down
        if (interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & interactable.options[actionName].mouseButtons) === 0) {
          continue;
        }
    
        action = actions[actionName].checker(pointer, event, interactable, element, interaction, rect);
    
        if (action) {
          return action;
        }
      }
    }
    
    function styleCursor(newValue) {
      if (__is_8.bool(newValue)) {
        this.options.styleCursor = newValue;
        return this;
      }
    
      if (newValue === null) {
        delete this.options.styleCursor;
        return this;
      }
    
      return this.options.styleCursor;
    }
    
    function actionChecker(checker) {
      if (__is_8.func(checker)) {
        this.options.actionChecker = checker;
        return this;
      }
    
      if (checker === null) {
        delete this.options.actionChecker;
        return this;
      }
    
      return this.options.actionChecker;
    }
    
    var ___default_8 = {
      id: 'auto-start/interactableMethods',
      install: __install_8
    };
    _$InteractableMethods_8["default"] = ___default_8;
    
    var _$base_9 = {};
    "use strict";
    
    Object.defineProperty(_$base_9, "__esModule", {
      value: true
    });
    _$base_9["default"] = void 0;
    
    var __utils_9 = ___interopRequireWildcard_9(_$utils_56);
    
    var _InteractableMethods = ___interopRequireDefault_9(_$InteractableMethods_8);
    
    function ___interopRequireDefault_9(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_9(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function __install_9(scope) {
      var interact = scope.interact,
          interactions = scope.interactions,
          defaults = scope.defaults;
      scope.usePlugin(_InteractableMethods["default"]); // set cursor style on mousedown
    
      interactions.signals.on('down', function (_ref) {
        var interaction = _ref.interaction,
            pointer = _ref.pointer,
            event = _ref.event,
            eventTarget = _ref.eventTarget;
    
        if (interaction.interacting()) {
          return;
        }
    
        var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
        prepare(interaction, actionInfo, scope);
      }); // set cursor style on mousemove
    
      interactions.signals.on('move', function (_ref2) {
        var interaction = _ref2.interaction,
            pointer = _ref2.pointer,
            event = _ref2.event,
            eventTarget = _ref2.eventTarget;
    
        if (interaction.pointerType !== 'mouse' || interaction.pointerIsDown || interaction.interacting()) {
          return;
        }
    
        var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
        prepare(interaction, actionInfo, scope);
      });
      interactions.signals.on('move', function (arg) {
        var interaction = arg.interaction;
    
        if (!interaction.pointerIsDown || interaction.interacting() || !interaction.pointerWasMoved || !interaction.prepared.name) {
          return;
        }
    
        scope.autoStart.signals.fire('before-start', arg);
        var interactable = interaction.interactable;
    
        if (interaction.prepared.name && interactable) {
          // check manualStart and interaction limit
          if (interactable.options[interaction.prepared.name].manualStart || !withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) {
            interaction.stop();
          } else {
            interaction.start(interaction.prepared, interactable, interaction.element);
          }
        }
      });
      interactions.signals.on('stop', function (_ref3) {
        var interaction = _ref3.interaction;
        var interactable = interaction.interactable;
    
        if (interactable && interactable.options.styleCursor) {
          setCursor(interaction.element, '', scope);
        }
      });
      defaults.base.actionChecker = null;
      defaults.base.styleCursor = true;
      __utils_9.extend(defaults.perAction, {
        manualStart: false,
        max: Infinity,
        maxPerElement: 1,
        allowFrom: null,
        ignoreFrom: null,
        // only allow left button by default
        // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value
        mouseButtons: 1
      });
      /**
       * Returns or sets the maximum number of concurrent interactions allowed.  By
       * default only 1 interaction is allowed at a time (for backwards
       * compatibility). To allow multiple interactions on the same Interactables and
       * elements, you need to enable it in the draggable, resizable and gesturable
       * `'max'` and `'maxPerElement'` options.
       *
       * @alias module:interact.maxInteractions
       *
       * @param {number} [newValue] Any number. newValue <= 0 means no interactions.
       */
    
      interact.maxInteractions = function (newValue) {
        return maxInteractions(newValue, scope);
      };
    
      scope.autoStart = {
        // Allow this many interactions to happen simultaneously
        maxInteractions: Infinity,
        withinInteractionLimit: withinInteractionLimit,
        cursorElement: null,
        signals: new __utils_9.Signals()
      };
    } // Check if the current interactable supports the action.
    // If so, return the validated action. Otherwise, return null
    
    
    function validateAction(action, interactable, element, eventTarget, scope) {
      if (interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) && interactable.options[action.name].enabled && withinInteractionLimit(interactable, element, action, scope)) {
        return action;
      }
    
      return null;
    }
    
    function validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope) {
      for (var i = 0, len = matches.length; i < len; i++) {
        var match = matches[i];
        var matchElement = matchElements[i];
        var matchAction = match.getAction(pointer, event, interaction, matchElement);
    
        if (!matchAction) {
          continue;
        }
    
        var action = validateAction(matchAction, match, matchElement, eventTarget, scope);
    
        if (action) {
          return {
            action: action,
            interactable: match,
            element: matchElement
          };
        }
      }
    
      return {
        action: null,
        interactable: null,
        element: null
      };
    }
    
    function getActionInfo(interaction, pointer, event, eventTarget, scope) {
      var matches = [];
      var matchElements = [];
      var element = eventTarget;
    
      function pushMatches(interactable) {
        matches.push(interactable);
        matchElements.push(element);
      }
    
      while (__utils_9.is.element(element)) {
        matches = [];
        matchElements = [];
        scope.interactables.forEachMatch(element, pushMatches);
        var actionInfo = validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope);
    
        if (actionInfo.action && !actionInfo.interactable.options[actionInfo.action.name].manualStart) {
          return actionInfo;
        }
    
        element = __utils_9.dom.parentNode(element);
      }
    
      return {
        action: null,
        interactable: null,
        element: null
      };
    }
    
    function prepare(interaction, _ref4, scope) {
      var action = _ref4.action,
          interactable = _ref4.interactable,
          element = _ref4.element;
      action = action || {};
    
      if (interaction.interactable && interaction.interactable.options.styleCursor) {
        setCursor(interaction.element, '', scope);
      }
    
      interaction.interactable = interactable;
      interaction.element = element;
      __utils_9.copyAction(interaction.prepared, action);
      interaction.rect = interactable && action.name ? interactable.getRect(element) : null;
    
      if (interaction.pointerType === 'mouse' && interactable && interactable.options.styleCursor) {
        var cursor = '';
    
        if (action) {
          var cursorChecker = interactable.options[action.name].cursorChecker;
    
          if (__utils_9.is.func(cursorChecker)) {
            cursor = cursorChecker(action, interactable, element);
          } else {
            cursor = scope.actions[action.name].getCursor(action);
          }
        }
    
        setCursor(interaction.element, cursor || '', scope);
      }
    
      scope.autoStart.signals.fire('prepared', {
        interaction: interaction
      });
    }
    
    function withinInteractionLimit(interactable, element, action, scope) {
      var options = interactable.options;
      var maxActions = options[action.name].max;
      var maxPerElement = options[action.name].maxPerElement;
      var autoStartMax = scope.autoStart.maxInteractions;
      var activeInteractions = 0;
      var interactableCount = 0;
      var elementCount = 0; // no actions if any of these values == 0
    
      if (!(maxActions && maxPerElement && autoStartMax)) {
        return false;
      }
    
      for (var _i = 0; _i < scope.interactions.list.length; _i++) {
        var _ref5;
    
        _ref5 = scope.interactions.list[_i];
        var interaction = _ref5;
        var otherAction = interaction.prepared.name;
    
        if (!interaction.interacting()) {
          continue;
        }
    
        activeInteractions++;
    
        if (activeInteractions >= autoStartMax) {
          return false;
        }
    
        if (interaction.interactable !== interactable) {
          continue;
        }
    
        interactableCount += otherAction === action.name ? 1 : 0;
    
        if (interactableCount >= maxActions) {
          return false;
        }
    
        if (interaction.element === element) {
          elementCount++;
    
          if (otherAction === action.name && elementCount >= maxPerElement) {
            return false;
          }
        }
      }
    
      return autoStartMax > 0;
    }
    
    function maxInteractions(newValue, scope) {
      if (__utils_9.is.number(newValue)) {
        scope.autoStart.maxInteractions = newValue;
        return this;
      }
    
      return scope.autoStart.maxInteractions;
    }
    
    function setCursor(element, cursor, scope) {
      if (scope.autoStart.cursorElement) {
        scope.autoStart.cursorElement.style.cursor = '';
      }
    
      element.ownerDocument.documentElement.style.cursor = cursor;
      element.style.cursor = cursor;
      scope.autoStart.cursorElement = cursor ? element : null;
    }
    
    var ___default_9 = {
      id: 'auto-start/base',
      install: __install_9,
      maxInteractions: maxInteractions,
      withinInteractionLimit: withinInteractionLimit,
      validateAction: validateAction
    };
    _$base_9["default"] = ___default_9;
    
    var _$dragAxis_10 = {};
    "use strict";
    
    Object.defineProperty(_$dragAxis_10, "__esModule", {
      value: true
    });
    _$dragAxis_10["default"] = void 0;
    
    var ___scope_10 = _$scope_24({});
    
    /* removed: var _$domUtils_51 = require("@interactjs/utils/domUtils"); */;
    
    var __is_10 = ___interopRequireWildcard_10(_$is_57);
    
    var _base = ___interopRequireDefault_10(_$base_9);
    
    function ___interopRequireDefault_10(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_10(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function __install_10(scope) {
      scope.autoStart.signals.on('before-start', function (_ref) {
        var interaction = _ref.interaction,
            eventTarget = _ref.eventTarget,
            dx = _ref.dx,
            dy = _ref.dy;
    
        if (interaction.prepared.name !== 'drag') {
          return;
        } // check if a drag is in the correct axis
    
    
        var absX = Math.abs(dx);
        var absY = Math.abs(dy);
        var targetOptions = interaction.interactable.options.drag;
        var startAxis = targetOptions.startAxis;
        var currentAxis = absX > absY ? 'x' : absX < absY ? 'y' : 'xy';
        interaction.prepared.axis = targetOptions.lockAxis === 'start' ? currentAxis[0] // always lock to one axis even if currentAxis === 'xy'
        : targetOptions.lockAxis; // if the movement isn't in the startAxis of the interactable
    
        if (currentAxis !== 'xy' && startAxis !== 'xy' && startAxis !== currentAxis) {
          // cancel the prepared action
          interaction.prepared.name = null; // then try to get a drag from another ineractable
    
          var element = eventTarget;
    
          var getDraggable = function getDraggable(interactable) {
            if (interactable === interaction.interactable) {
              return;
            }
    
            var options = interaction.interactable.options.drag;
    
            if (!options.manualStart && interactable.testIgnoreAllow(options, element, eventTarget)) {
              var action = interactable.getAction(interaction.downPointer, interaction.downEvent, interaction, element);
    
              if (action && action.name === ___scope_10.ActionName.Drag && checkStartAxis(currentAxis, interactable) && _base["default"].validateAction(action, interactable, element, eventTarget, scope)) {
                return interactable;
              }
            }
          }; // check all interactables
    
    
          while (__is_10.element(element)) {
            var interactable = scope.interactables.forEachMatch(element, getDraggable);
    
            if (interactable) {
              interaction.prepared.name = ___scope_10.ActionName.Drag;
              interaction.interactable = interactable;
              interaction.element = element;
              break;
            }
    
            element = (0, _$domUtils_51.parentNode)(element);
          }
        }
      });
    
      function checkStartAxis(startAxis, interactable) {
        if (!interactable) {
          return false;
        }
    
        var thisAxis = interactable.options[___scope_10.ActionName.Drag].startAxis;
        return startAxis === 'xy' || thisAxis === 'xy' || thisAxis === startAxis;
      }
    }
    
    var ___default_10 = {
      id: 'auto-start/dragAxis',
      install: __install_10
    };
    _$dragAxis_10["default"] = ___default_10;
    
    var _$hold_11 = {};
    "use strict";
    
    Object.defineProperty(_$hold_11, "__esModule", {
      value: true
    });
    _$hold_11["default"] = void 0;
    
    var ___base_11 = ___interopRequireDefault_11(_$base_9);
    
    function ___interopRequireDefault_11(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function __install_11(scope) {
      var autoStart = scope.autoStart,
          interactions = scope.interactions,
          defaults = scope.defaults;
      scope.usePlugin(___base_11["default"]);
      defaults.perAction.hold = 0;
      defaults.perAction.delay = 0;
      interactions.signals.on('new', function (interaction) {
        interaction.autoStartHoldTimer = null;
      });
      autoStart.signals.on('prepared', function (_ref) {
        var interaction = _ref.interaction;
        var hold = getHoldDuration(interaction);
    
        if (hold > 0) {
          interaction.autoStartHoldTimer = setTimeout(function () {
            interaction.start(interaction.prepared, interaction.interactable, interaction.element);
          }, hold);
        }
      });
      interactions.signals.on('move', function (_ref2) {
        var interaction = _ref2.interaction,
            duplicate = _ref2.duplicate;
    
        if (interaction.pointerWasMoved && !duplicate) {
          clearTimeout(interaction.autoStartHoldTimer);
        }
      }); // prevent regular down->move autoStart
    
      autoStart.signals.on('before-start', function (_ref3) {
        var interaction = _ref3.interaction;
        var hold = getHoldDuration(interaction);
    
        if (hold > 0) {
          interaction.prepared.name = null;
        }
      });
    }
    
    function getHoldDuration(interaction) {
      var actionName = interaction.prepared && interaction.prepared.name;
    
      if (!actionName) {
        return null;
      }
    
      var options = interaction.interactable.options;
      return options[actionName].hold || options[actionName].delay;
    }
    
    var ___default_11 = {
      id: 'auto-start/hold',
      install: __install_11,
      getHoldDuration: getHoldDuration
    };
    _$hold_11["default"] = ___default_11;
    
    var _$autoStart_12 = {};
    "use strict";
    
    Object.defineProperty(_$autoStart_12, "__esModule", {
      value: true
    });
    _$autoStart_12.install = __install_12;
    Object.defineProperty(_$autoStart_12, "autoStart", {
      enumerable: true,
      get: function get() {
        return ___base_12["default"];
      }
    });
    Object.defineProperty(_$autoStart_12, "dragAxis", {
      enumerable: true,
      get: function get() {
        return _dragAxis["default"];
      }
    });
    Object.defineProperty(_$autoStart_12, "hold", {
      enumerable: true,
      get: function get() {
        return _hold["default"];
      }
    });
    _$autoStart_12.id = void 0;
    
    var ___base_12 = ___interopRequireDefault_12(_$base_9);
    
    var _dragAxis = ___interopRequireDefault_12(_$dragAxis_10);
    
    var _hold = ___interopRequireDefault_12(_$hold_11);
    
    function ___interopRequireDefault_12(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function __install_12(scope) {
      scope.usePlugin(___base_12["default"]);
      scope.usePlugin(_hold["default"]);
      scope.usePlugin(_dragAxis["default"]);
    }
    
    var __id_12 = 'auto-start';
    _$autoStart_12.id = __id_12;
    
    var _$interactablePreventDefault_21 = {};
    "use strict";
    
    Object.defineProperty(_$interactablePreventDefault_21, "__esModule", {
      value: true
    });
    _$interactablePreventDefault_21.install = __install_21;
    _$interactablePreventDefault_21["default"] = void 0;
    
    /* removed: var _$domUtils_51 = require("@interactjs/utils/domUtils"); */;
    
    var ___events_21 = ___interopRequireDefault_21(_$events_52);
    
    var __is_21 = ___interopRequireWildcard_21(_$is_57);
    
    /* removed: var _$window_66 = require("@interactjs/utils/window"); */;
    
    function ___interopRequireWildcard_21(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_21(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function preventDefault(newValue) {
      if (/^(always|never|auto)$/.test(newValue)) {
        this.options.preventDefault = newValue;
        return this;
      }
    
      if (__is_21.bool(newValue)) {
        this.options.preventDefault = newValue ? 'always' : 'never';
        return this;
      }
    
      return this.options.preventDefault;
    }
    
    function checkAndPreventDefault(interactable, scope, event) {
      var setting = interactable.options.preventDefault;
    
      if (setting === 'never') {
        return;
      }
    
      if (setting === 'always') {
        event.preventDefault();
        return;
      } // setting === 'auto'
      // if the browser supports passive event listeners and isn't running on iOS,
      // don't preventDefault of touch{start,move} events. CSS touch-action and
      // user-select should be used instead of calling event.preventDefault().
    
    
      if (___events_21["default"].supportsPassive && /^touch(start|move)$/.test(event.type)) {
        var doc = (0, _$window_66.getWindow)(event.target).document;
        var docOptions = scope.getDocOptions(doc);
    
        if (!(docOptions && docOptions.events) || docOptions.events.passive !== false) {
          return;
        }
      } // don't preventDefault of pointerdown events
    
    
      if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) {
        return;
      } // don't preventDefault on editable elements
    
    
      if (__is_21.element(event.target) && (0, _$domUtils_51.matchesSelector)(event.target, 'input,select,textarea,[contenteditable=true],[contenteditable=true] *')) {
        return;
      }
    
      event.preventDefault();
    }
    
    function onInteractionEvent(_ref) {
      var interaction = _ref.interaction,
          event = _ref.event;
    
      if (interaction.interactable) {
        interaction.interactable.checkAndPreventDefault(event);
      }
    }
    
    function __install_21(scope) {
      /** @lends Interactable */
      var Interactable = scope.Interactable;
      /**
       * Returns or sets whether to prevent the browser's default behaviour in
       * response to pointer events. Can be set to:
       *  - `'always'` to always prevent
       *  - `'never'` to never prevent
       *  - `'auto'` to let interact.js try to determine what would be best
       *
       * @param {string} [newValue] `'always'`, `'never'` or `'auto'`
       * @return {string | Interactable} The current setting or this Interactable
       */
    
      Interactable.prototype.preventDefault = preventDefault;
    
      Interactable.prototype.checkAndPreventDefault = function (event) {
        return checkAndPreventDefault(this, scope, event);
      };
    
      var _arr = ['down', 'move', 'up', 'cancel'];
    
      for (var _i = 0; _i < _arr.length; _i++) {
        var eventSignal = _arr[_i];
        scope.interactions.signals.on(eventSignal, onInteractionEvent);
      } // prevent native HTML5 drag on interact.js target elements
    
    
      scope.interactions.docEvents.push({
        type: 'dragstart',
        listener: function listener(event) {
          for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
            var _ref2;
    
            _ref2 = scope.interactions.list[_i2];
            var interaction = _ref2;
    
            if (interaction.element && (interaction.element === event.target || (0, _$domUtils_51.nodeContains)(interaction.element, event.target))) {
              interaction.interactable.checkAndPreventDefault(event);
              return;
            }
          }
        }
      });
    }
    
    var ___default_21 = {
      id: 'core/interactablePreventDefault',
      install: __install_21
    };
    _$interactablePreventDefault_21["default"] = ___default_21;
    
    var _$devTools_25 = {};
    "use strict";
    
    Object.defineProperty(_$devTools_25, "__esModule", {
      value: true
    });
    _$devTools_25["default"] = void 0;
    
    var ___domObjects_25 = ___interopRequireDefault_25(_$domObjects_50);
    
    /* removed: var _$domUtils_51 = require("@interactjs/utils/domUtils"); */;
    
    var ___extend_25 = ___interopRequireDefault_25(_$extend_53);
    
    var __is_25 = ___interopRequireWildcard_25(_$is_57);
    
    var ___window_25 = ___interopRequireDefault_25(_$window_66);
    
    function ___interopRequireWildcard_25(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_25(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___toConsumableArray_25(arr) { return ___arrayWithoutHoles_25(arr) || ___iterableToArray_25(arr) || ___nonIterableSpread_25(); }
    
    function ___nonIterableSpread_25() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
    
    function ___iterableToArray_25(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
    
    function ___arrayWithoutHoles_25(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
    
    var CheckName;
    
    (function (CheckName) {
      CheckName["touchAction"] = "";
      CheckName["boxSizing"] = "";
      CheckName["noListeners"] = "";
    })(CheckName || (CheckName = {}));
    
    var prefix = '[interact.js] ';
    var links = {
      touchAction: 'https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action',
      boxSizing: 'https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing'
    };
    var isProduction = "production" === 'production'; // eslint-disable-next-line no-restricted-syntax
    
    function __install_25(scope) {
      var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
          logger = _ref.logger;
    
      var interactions = scope.interactions,
          Interactable = scope.Interactable,
          defaults = scope.defaults;
      logger = logger || console;
      interactions.signals.on('action-start', function (_ref2) {
        var interaction = _ref2.interaction;
    
        for (var _i = 0; _i < checks.length; _i++) {
          var _ref3;
    
          _ref3 = checks[_i];
          var check = _ref3;
          var options = interaction.interactable && interaction.interactable.options[interaction.prepared.name];
    
          if (!(options && options.devTools && options.devTools.ignore[check.name]) && check.perform(interaction)) {
            var _logger;
    
            (_logger = logger).warn.apply(_logger, [prefix + check.text].concat(___toConsumableArray_25(check.getInfo(interaction))));
          }
        }
      });
      defaults.base.devTools = {
        ignore: {}
      };
    
      Interactable.prototype.devTools = function (options) {
        if (options) {
          (0, ___extend_25["default"])(this.options.devTools, options);
          return this;
        }
    
        return this.options.devTools;
      };
    }
    
    var checks = [{
      name: 'touchAction',
      perform: function perform(_ref4) {
        var element = _ref4.element;
        return !parentHasStyle(element, 'touchAction', /pan-|pinch|none/);
      },
      getInfo: function getInfo(_ref5) {
        var element = _ref5.element;
        return [element, links.touchAction];
      },
      text: 'Consider adding CSS "touch-action: none" to this element\n'
    }, {
      name: 'boxSizing',
      perform: function perform(interaction) {
        var element = interaction.element;
        return interaction.prepared.name === 'resize' && element instanceof ___domObjects_25["default"].HTMLElement && !hasStyle(element, 'boxSizing', /border-box/);
      },
      text: 'Consider adding CSS "box-sizing: border-box" to this resizable element',
      getInfo: function getInfo(_ref6) {
        var element = _ref6.element;
        return [element, links.boxSizing];
      }
    }, {
      name: 'noListeners',
      perform: function perform(interaction) {
        var actionName = interaction.prepared.name;
        var moveListeners = interaction.interactable.events.types["".concat(actionName, "move")] || [];
        return !moveListeners.length;
      },
      getInfo: function getInfo(interaction) {
        return [interaction.prepared.name, interaction.interactable];
      },
      text: 'There are no listeners set for this action'
    }];
    
    function hasStyle(element, prop, styleRe) {
      return styleRe.test(element.style[prop] || ___window_25["default"].window.getComputedStyle(element)[prop]);
    }
    
    function parentHasStyle(element, prop, styleRe) {
      var parent = element;
    
      while (__is_25.element(parent)) {
        if (hasStyle(parent, prop, styleRe)) {
          return true;
        }
    
        parent = (0, _$domUtils_51.parentNode)(parent);
      }
    
      return false;
    }
    
    var __id_25 = 'dev-tools';
    var defaultExport = isProduction ? {
      id: __id_25,
      install: function install() {}
    } : {
      id: __id_25,
      install: __install_25,
      checks: checks,
      CheckName: CheckName,
      links: links,
      prefix: prefix
    };
    var ___default_25 = defaultExport;
    _$devTools_25["default"] = ___default_25;
    
    var _$base_30 = {};
    "use strict";
    
    Object.defineProperty(_$base_30, "__esModule", {
      value: true
    });
    _$base_30.startAll = startAll;
    _$base_30.setAll = setAll;
    _$base_30.prepareStates = prepareStates;
    _$base_30.makeModifier = makeModifier;
    _$base_30["default"] = void 0;
    
    var ___extend_30 = ___interopRequireDefault_30(_$extend_53);
    
    function ___interopRequireDefault_30(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___slicedToArray_30(arr, i) { return ___arrayWithHoles_30(arr) || ___iterableToArrayLimit_30(arr, i) || ___nonIterableRest_30(); }
    
    function ___nonIterableRest_30() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
    
    function ___iterableToArrayLimit_30(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
    
    function ___arrayWithHoles_30(arr) { if (Array.isArray(arr)) return arr; }
    
    function __install_30(scope) {
      var interactions = scope.interactions;
      scope.defaults.perAction.modifiers = [];
      interactions.signals.on('new', function (_ref) {
        var interaction = _ref.interaction;
        interaction.modifiers = {
          startOffset: {
            left: 0,
            right: 0,
            top: 0,
            bottom: 0
          },
          offsets: {},
          states: null,
          result: null,
          endPrevented: false,
          startDelta: null
        };
      });
      interactions.signals.on('before-action-start', function (arg) {
        __start_30(arg, arg.interaction.coords.start.page);
      });
      interactions.signals.on('action-resume', function (arg) {
        stop(arg);
        __start_30(arg, arg.interaction.coords.cur.page);
        __beforeMove_30(arg);
      });
      interactions.signals.on('after-action-move', restoreCoords);
      interactions.signals.on('before-action-move', __beforeMove_30);
      interactions.signals.on('before-action-start', setCoords);
      interactions.signals.on('after-action-start', restoreCoords);
      interactions.signals.on('before-action-end', beforeEnd);
      interactions.signals.on('stop', stop);
    }
    
    function __start_30(_ref2, pageCoords) {
      var interaction = _ref2.interaction,
          phase = _ref2.phase;
      var interactable = interaction.interactable,
          element = interaction.element;
      var modifierList = getModifierList(interaction);
      var states = prepareStates(modifierList);
      var rect = (0, ___extend_30["default"])({}, interaction.rect);
    
      if (!('width' in rect)) {
        rect.width = rect.right - rect.left;
      }
    
      if (!('height' in rect)) {
        rect.height = rect.bottom - rect.top;
      }
    
      var startOffset = getRectOffset(rect, pageCoords);
      interaction.modifiers.startOffset = startOffset;
      interaction.modifiers.startDelta = {
        x: 0,
        y: 0
      };
      var arg = {
        interaction: interaction,
        interactable: interactable,
        element: element,
        pageCoords: pageCoords,
        phase: phase,
        rect: rect,
        startOffset: startOffset,
        states: states,
        preEnd: false,
        requireEndOnly: false
      };
      interaction.modifiers.states = states;
      interaction.modifiers.result = null;
      startAll(arg);
      arg.pageCoords = (0, ___extend_30["default"])({}, interaction.coords.start.page);
      var result = interaction.modifiers.result = setAll(arg);
      return result;
    }
    
    function startAll(arg) {
      var states = arg.states;
    
      for (var _i = 0; _i < states.length; _i++) {
        var _ref3;
    
        _ref3 = states[_i];
        var state = _ref3;
    
        if (state.methods.start) {
          arg.state = state;
          state.methods.start(arg);
        }
      }
    }
    
    function setAll(arg) {
      var interaction = arg.interaction,
          _arg$modifiersState = arg.modifiersState,
          modifiersState = _arg$modifiersState === void 0 ? interaction.modifiers : _arg$modifiersState,
          _arg$prevCoords = arg.prevCoords,
          prevCoords = _arg$prevCoords === void 0 ? modifiersState.result ? modifiersState.result.coords : interaction.coords.prev.page : _arg$prevCoords,
          phase = arg.phase,
          preEnd = arg.preEnd,
          requireEndOnly = arg.requireEndOnly,
          rect = arg.rect,
          skipModifiers = arg.skipModifiers;
      var states = skipModifiers ? arg.states.slice(skipModifiers) : arg.states;
      arg.coords = (0, ___extend_30["default"])({}, arg.pageCoords);
      arg.rect = (0, ___extend_30["default"])({}, rect);
      var result = {
        delta: {
          x: 0,
          y: 0
        },
        rectDelta: {
          left: 0,
          right: 0,
          top: 0,
          bottom: 0
        },
        coords: arg.coords,
        changed: true
      };
    
      for (var _i2 = 0; _i2 < states.length; _i2++) {
        var _ref4;
    
        _ref4 = states[_i2];
        var state = _ref4;
        var options = state.options;
    
        if (!state.methods.set || !shouldDo(options, preEnd, requireEndOnly, phase)) {
          continue;
        }
    
        arg.state = state;
        state.methods.set(arg);
      }
    
      result.delta.x = arg.coords.x - arg.pageCoords.x;
      result.delta.y = arg.coords.y - arg.pageCoords.y;
      var rectChanged = false;
    
      if (rect) {
        result.rectDelta.left = arg.rect.left - rect.left;
        result.rectDelta.right = arg.rect.right - rect.right;
        result.rectDelta.top = arg.rect.top - rect.top;
        result.rectDelta.bottom = arg.rect.bottom - rect.bottom;
        rectChanged = result.rectDelta.left !== 0 || result.rectDelta.right !== 0 || result.rectDelta.top !== 0 || result.rectDelta.bottom !== 0;
      }
    
      result.changed = prevCoords.x !== result.coords.x || prevCoords.y !== result.coords.y || rectChanged;
      return result;
    }
    
    function __beforeMove_30(arg) {
      var interaction = arg.interaction,
          phase = arg.phase,
          preEnd = arg.preEnd,
          skipModifiers = arg.skipModifiers;
      var interactable = interaction.interactable,
          element = interaction.element;
      var modifierResult = setAll({
        interaction: interaction,
        interactable: interactable,
        element: element,
        preEnd: preEnd,
        phase: phase,
        pageCoords: interaction.coords.cur.page,
        rect: interaction.rect,
        states: interaction.modifiers.states,
        requireEndOnly: false,
        skipModifiers: skipModifiers
      });
      interaction.modifiers.result = modifierResult; // don't fire an action move if a modifier would keep the event in the same
      // cordinates as before
    
      if (!modifierResult.changed && interaction.interacting()) {
        return false;
      }
    
      setCoords(arg);
    }
    
    function beforeEnd(arg) {
      var interaction = arg.interaction,
          event = arg.event,
          noPreEnd = arg.noPreEnd;
      var states = interaction.modifiers.states;
    
      if (noPreEnd || !states || !states.length) {
        return;
      }
    
      var didPreEnd = false;
    
      for (var _i3 = 0; _i3 < states.length; _i3++) {
        var _ref5;
    
        _ref5 = states[_i3];
        var state = _ref5;
        arg.state = state;
        var options = state.options,
            methods = state.methods;
        var endResult = methods.beforeEnd && methods.beforeEnd(arg);
    
        if (endResult === false) {
          interaction.modifiers.endPrevented = true;
          return false;
        } // if the endOnly option is true for any modifier
    
    
        if (!didPreEnd && shouldDo(options, true, true)) {
          // fire a move event at the modified coordinates
          interaction.move({
            event: event,
            preEnd: true
          });
          didPreEnd = true;
        }
      }
    }
    
    function stop(arg) {
      var interaction = arg.interaction;
      var states = interaction.modifiers.states;
    
      if (!states || !states.length) {
        return;
      }
    
      var modifierArg = (0, ___extend_30["default"])({
        states: states,
        interactable: interaction.interactable,
        element: interaction.element
      }, arg);
      restoreCoords(arg);
    
      for (var _i4 = 0; _i4 < states.length; _i4++) {
        var _ref6;
    
        _ref6 = states[_i4];
        var state = _ref6;
        modifierArg.state = state;
    
        if (state.methods.stop) {
          state.methods.stop(modifierArg);
        }
      }
    
      arg.interaction.modifiers.states = null;
      arg.interaction.modifiers.endPrevented = false;
    }
    
    function getModifierList(interaction) {
      var actionOptions = interaction.interactable.options[interaction.prepared.name];
      var actionModifiers = actionOptions.modifiers;
    
      if (actionModifiers && actionModifiers.length) {
        return actionModifiers.filter(function (modifier) {
          return !modifier.options || modifier.options.enabled !== false;
        });
      }
    
      return ['snap', 'snapSize', 'snapEdges', 'restrict', 'restrictEdges', 'restrictSize'].map(function (type) {
        var options = actionOptions[type];
        return options && options.enabled && {
          options: options,
          methods: options._methods
        };
      }).filter(function (m) {
        return !!m;
      });
    }
    
    function prepareStates(modifierList) {
      var states = [];
    
      for (var index = 0; index < modifierList.length; index++) {
        var _modifierList$index = modifierList[index],
            options = _modifierList$index.options,
            methods = _modifierList$index.methods,
            name = _modifierList$index.name;
    
        if (options && options.enabled === false) {
          continue;
        }
    
        states.push({
          options: options,
          methods: methods,
          index: index,
          name: name
        });
      }
    
      return states;
    }
    
    function setCoords(arg) {
      var interaction = arg.interaction,
          phase = arg.phase;
      var curCoords = arg.curCoords || interaction.coords.cur;
      var startCoords = arg.startCoords || interaction.coords.start;
      var _interaction$modifier = interaction.modifiers,
          result = _interaction$modifier.result,
          startDelta = _interaction$modifier.startDelta;
      var curDelta = result.delta;
    
      if (phase === 'start') {
        (0, ___extend_30["default"])(interaction.modifiers.startDelta, result.delta);
      }
    
      var _arr = [[startCoords, startDelta], [curCoords, curDelta]];
    
      for (var _i5 = 0; _i5 < _arr.length; _i5++) {
        var _arr$_i = ___slicedToArray_30(_arr[_i5], 2),
            coordsSet = _arr$_i[0],
            delta = _arr$_i[1];
    
        coordsSet.page.x += delta.x;
        coordsSet.page.y += delta.y;
        coordsSet.client.x += delta.x;
        coordsSet.client.y += delta.y;
      }
    
      var rectDelta = interaction.modifiers.result.rectDelta;
      var rect = arg.rect || interaction.rect;
      rect.left += rectDelta.left;
      rect.right += rectDelta.right;
      rect.top += rectDelta.top;
      rect.bottom += rectDelta.bottom;
      rect.width = rect.right - rect.left;
      rect.height = rect.bottom - rect.top;
    }
    
    function restoreCoords(_ref7) {
      var _ref7$interaction = _ref7.interaction,
          coords = _ref7$interaction.coords,
          rect = _ref7$interaction.rect,
          modifiers = _ref7$interaction.modifiers;
    
      if (!modifiers.result) {
        return;
      }
    
      var startDelta = modifiers.startDelta;
      var _modifiers$result = modifiers.result,
          curDelta = _modifiers$result.delta,
          rectDelta = _modifiers$result.rectDelta;
      var coordsAndDeltas = [[coords.start, startDelta], [coords.cur, curDelta]];
    
      for (var _i6 = 0; _i6 < coordsAndDeltas.length; _i6++) {
        var _coordsAndDeltas$_i = ___slicedToArray_30(coordsAndDeltas[_i6], 2),
            coordsSet = _coordsAndDeltas$_i[0],
            delta = _coordsAndDeltas$_i[1];
    
        coordsSet.page.x -= delta.x;
        coordsSet.page.y -= delta.y;
        coordsSet.client.x -= delta.x;
        coordsSet.client.y -= delta.y;
      }
    
      rect.left -= rectDelta.left;
      rect.right -= rectDelta.right;
      rect.top -= rectDelta.top;
      rect.bottom -= rectDelta.bottom;
    }
    
    function shouldDo(options, preEnd, requireEndOnly, phase) {
      return options ? options.enabled !== false && (preEnd || !options.endOnly) && (!requireEndOnly || options.endOnly || options.alwaysOnEnd) && (options.setStart || phase !== 'start') : !requireEndOnly;
    }
    
    function getRectOffset(rect, coords) {
      return rect ? {
        left: coords.x - rect.left,
        top: coords.y - rect.top,
        right: rect.right - coords.x,
        bottom: rect.bottom - coords.y
      } : {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0
      };
    }
    
    function makeModifier(module, name) {
      var defaults = module.defaults;
      var methods = {
        start: module.start,
        set: module.set,
        beforeEnd: module.beforeEnd,
        stop: module.stop
      };
    
      var modifier = function modifier(_options) {
        var options = _options || {}; // add missing defaults to options
    
        for (var prop in defaults) {
          if (!(prop in options)) {
            options[prop] = defaults[prop];
          }
        }
    
        var m = {
          options: options,
          methods: methods,
          name: name
        };
        return m;
      };
    
      if (name && typeof name === 'string') {
        // for backwrads compatibility
        modifier._defaults = defaults;
        modifier._methods = methods;
      }
    
      return modifier;
    }
    
    var ___default_30 = {
      id: 'modifiers/base',
      install: __install_30,
      startAll: startAll,
      setAll: setAll,
      prepareStates: prepareStates,
      start: __start_30,
      beforeMove: __beforeMove_30,
      beforeEnd: beforeEnd,
      stop: stop,
      shouldDo: shouldDo,
      getModifierList: getModifierList,
      getRectOffset: getRectOffset,
      makeModifier: makeModifier
    };
    _$base_30["default"] = ___default_30;
    
    var _$inertia_26 = {};
    "use strict";
    
    Object.defineProperty(_$inertia_26, "__esModule", {
      value: true
    });
    _$inertia_26["default"] = void 0;
    
    /* removed: var _$InteractEvent_15 = require("@interactjs/core/InteractEvent"); */;
    
    var ___base_26 = ___interopRequireDefault_26(_$base_30);
    
    var __utils_26 = ___interopRequireWildcard_26(_$utils_56);
    
    var ___raf_26 = ___interopRequireDefault_26(_$raf_62);
    
    function ___interopRequireWildcard_26(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_26(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    _$InteractEvent_15.EventPhase.Resume = 'resume';
    _$InteractEvent_15.EventPhase.InertiaStart = 'inertiastart';
    
    function __install_26(scope) {
      var interactions = scope.interactions,
          defaults = scope.defaults;
      interactions.signals.on('new', function (_ref) {
        var interaction = _ref.interaction;
        interaction.inertia = {
          active: false,
          smoothEnd: false,
          allowResume: false,
          upCoords: {},
          timeout: null
        };
      }); // FIXME proper signal typing
    
      interactions.signals.on('before-action-end', function (arg) {
        return release(arg, scope);
      });
      interactions.signals.on('down', function (arg) {
        return resume(arg, scope);
      });
      interactions.signals.on('stop', function (arg) {
        return __stop_26(arg);
      });
      defaults.perAction.inertia = {
        enabled: false,
        resistance: 10,
        minSpeed: 100,
        endSpeed: 10,
        allowResume: true,
        smoothEndDuration: 300
      };
      scope.usePlugin(___base_26["default"]);
    }
    
    function resume(_ref2, scope) {
      var interaction = _ref2.interaction,
          event = _ref2.event,
          pointer = _ref2.pointer,
          eventTarget = _ref2.eventTarget;
      var state = interaction.inertia; // Check if the down event hits the current inertia target
    
      if (state.active) {
        var element = eventTarget; // climb up the DOM tree from the event target
    
        while (__utils_26.is.element(element)) {
          // if interaction element is the current inertia target element
          if (element === interaction.element) {
            // stop inertia
            ___raf_26["default"].cancel(state.timeout);
    
            state.active = false;
            interaction.simulation = null; // update pointers to the down event's coordinates
    
            interaction.updatePointer(pointer, event, eventTarget, true);
            __utils_26.pointer.setCoords(interaction.coords.cur, interaction.pointers.map(function (p) {
              return p.pointer;
            }), interaction._now()); // fire appropriate signals
    
            var signalArg = {
              interaction: interaction
            };
            scope.interactions.signals.fire('action-resume', signalArg); // fire a reume event
    
            var resumeEvent = new scope.InteractEvent(interaction, event, interaction.prepared.name, _$InteractEvent_15.EventPhase.Resume, interaction.element);
    
            interaction._fireEvent(resumeEvent);
    
            __utils_26.pointer.copyCoords(interaction.coords.prev, interaction.coords.cur);
            break;
          }
    
          element = __utils_26.dom.parentNode(element);
        }
      }
    }
    
    function release(_ref3, scope) {
      var interaction = _ref3.interaction,
          event = _ref3.event,
          noPreEnd = _ref3.noPreEnd;
      var state = interaction.inertia;
    
      if (!interaction.interacting() || interaction.simulation && interaction.simulation.active || noPreEnd) {
        return null;
      }
    
      var options = __getOptions_26(interaction);
    
      var now = interaction._now();
    
      var velocityClient = interaction.coords.velocity.client;
      var pointerSpeed = __utils_26.hypot(velocityClient.x, velocityClient.y);
      var smoothEnd = false;
      var modifierResult; // check if inertia should be started
    
      var inertiaPossible = options && options.enabled && interaction.prepared.name !== 'gesture' && event !== state.startEvent;
      var inertia = inertiaPossible && now - interaction.coords.cur.timeStamp < 50 && pointerSpeed > options.minSpeed && pointerSpeed > options.endSpeed;
      var modifierArg = {
        interaction: interaction,
        pageCoords: __utils_26.extend({}, interaction.coords.cur.page),
        states: inertiaPossible && interaction.modifiers.states.map(function (modifierStatus) {
          return __utils_26.extend({}, modifierStatus);
        }),
        preEnd: true,
        prevCoords: undefined,
        requireEndOnly: null
      }; // smoothEnd
    
      if (inertiaPossible && !inertia) {
        modifierArg.prevCoords = interaction.prevEvent.page;
        modifierArg.requireEndOnly = false;
        modifierResult = ___base_26["default"].setAll(modifierArg);
    
        if (modifierResult.changed) {
          smoothEnd = true;
        }
      }
    
      if (!(inertia || smoothEnd)) {
        return null;
      }
    
      __utils_26.pointer.copyCoords(state.upCoords, interaction.coords.cur);
      interaction.pointers[0].pointer = state.startEvent = new scope.InteractEvent(interaction, event, // FIXME add proper typing Action.name
      interaction.prepared.name, _$InteractEvent_15.EventPhase.InertiaStart, interaction.element);
      state.t0 = now;
      state.active = true;
      state.allowResume = options.allowResume;
      interaction.simulation = state;
      interaction.interactable.fire(state.startEvent);
    
      if (inertia) {
        state.vx0 = interaction.coords.velocity.client.x;
        state.vy0 = interaction.coords.velocity.client.y;
        state.v0 = pointerSpeed;
        calcInertia(interaction, state);
        __utils_26.extend(modifierArg.pageCoords, interaction.coords.cur.page);
        modifierArg.pageCoords.x += state.xe;
        modifierArg.pageCoords.y += state.ye;
        modifierArg.prevCoords = undefined;
        modifierArg.requireEndOnly = true;
        modifierResult = ___base_26["default"].setAll(modifierArg);
        state.modifiedXe += modifierResult.delta.x;
        state.modifiedYe += modifierResult.delta.y;
        state.timeout = ___raf_26["default"].request(function () {
          return inertiaTick(interaction);
        });
      } else {
        state.smoothEnd = true;
        state.xe = modifierResult.delta.x;
        state.ye = modifierResult.delta.y;
        state.sx = state.sy = 0;
        state.timeout = ___raf_26["default"].request(function () {
          return smothEndTick(interaction);
        });
      }
    
      return false;
    }
    
    function __stop_26(_ref4) {
      var interaction = _ref4.interaction;
      var state = interaction.inertia;
    
      if (state.active) {
        ___raf_26["default"].cancel(state.timeout);
    
        state.active = false;
        interaction.simulation = null;
      }
    }
    
    function calcInertia(interaction, state) {
      var options = __getOptions_26(interaction);
      var lambda = options.resistance;
      var inertiaDur = -Math.log(options.endSpeed / state.v0) / lambda;
      state.x0 = interaction.prevEvent.page.x;
      state.y0 = interaction.prevEvent.page.y;
      state.t0 = state.startEvent.timeStamp / 1000;
      state.sx = state.sy = 0;
      state.modifiedXe = state.xe = (state.vx0 - inertiaDur) / lambda;
      state.modifiedYe = state.ye = (state.vy0 - inertiaDur) / lambda;
      state.te = inertiaDur;
      state.lambda_v0 = lambda / state.v0;
      state.one_ve_v0 = 1 - options.endSpeed / state.v0;
    }
    
    function inertiaTick(interaction) {
      updateInertiaCoords(interaction);
      __utils_26.pointer.setCoordDeltas(interaction.coords.delta, interaction.coords.prev, interaction.coords.cur);
      __utils_26.pointer.setCoordVelocity(interaction.coords.velocity, interaction.coords.delta);
      var state = interaction.inertia;
      var options = __getOptions_26(interaction);
      var lambda = options.resistance;
      var t = interaction._now() / 1000 - state.t0;
    
      if (t < state.te) {
        var progress = 1 - (Math.exp(-lambda * t) - state.lambda_v0) / state.one_ve_v0;
    
        if (state.modifiedXe === state.xe && state.modifiedYe === state.ye) {
          state.sx = state.xe * progress;
          state.sy = state.ye * progress;
        } else {
          var quadPoint = __utils_26.getQuadraticCurvePoint(0, 0, state.xe, state.ye, state.modifiedXe, state.modifiedYe, progress);
          state.sx = quadPoint.x;
          state.sy = quadPoint.y;
        }
    
        interaction.move();
        state.timeout = ___raf_26["default"].request(function () {
          return inertiaTick(interaction);
        });
      } else {
        state.sx = state.modifiedXe;
        state.sy = state.modifiedYe;
        interaction.move();
        interaction.end(state.startEvent);
        state.active = false;
        interaction.simulation = null;
      }
    
      __utils_26.pointer.copyCoords(interaction.coords.prev, interaction.coords.cur);
    }
    
    function smothEndTick(interaction) {
      updateInertiaCoords(interaction);
      var state = interaction.inertia;
      var t = interaction._now() - state.t0;
    
      var _getOptions = __getOptions_26(interaction),
          duration = _getOptions.smoothEndDuration;
    
      if (t < duration) {
        state.sx = __utils_26.easeOutQuad(t, 0, state.xe, duration);
        state.sy = __utils_26.easeOutQuad(t, 0, state.ye, duration);
        interaction.move();
        state.timeout = ___raf_26["default"].request(function () {
          return smothEndTick(interaction);
        });
      } else {
        state.sx = state.xe;
        state.sy = state.ye;
        interaction.move();
        interaction.end(state.startEvent);
        state.smoothEnd = state.active = false;
        interaction.simulation = null;
      }
    }
    
    function updateInertiaCoords(interaction) {
      var state = interaction.inertia; // return if inertia isn't running
    
      if (!state.active) {
        return;
      }
    
      var pageUp = state.upCoords.page;
      var clientUp = state.upCoords.client;
      __utils_26.pointer.setCoords(interaction.coords.cur, [{
        pageX: pageUp.x + state.sx,
        pageY: pageUp.y + state.sy,
        clientX: clientUp.x + state.sx,
        clientY: clientUp.y + state.sy
      }], interaction._now());
    }
    
    function __getOptions_26(_ref5) {
      var interactable = _ref5.interactable,
          prepared = _ref5.prepared;
      return interactable && interactable.options && prepared.name && interactable.options[prepared.name].inertia;
    }
    
    var ___default_26 = {
      id: 'inertia',
      install: __install_26,
      calcInertia: calcInertia,
      inertiaTick: inertiaTick,
      smothEndTick: smothEndTick,
      updateInertiaCoords: updateInertiaCoords
    };
    _$inertia_26["default"] = ___default_26;
    
    var _$pointer_33 = {};
    "use strict";
    
    Object.defineProperty(_$pointer_33, "__esModule", {
      value: true
    });
    _$pointer_33["default"] = void 0;
    
    var ___extend_33 = ___interopRequireDefault_33(_$extend_53);
    
    var __is_33 = ___interopRequireWildcard_33(_$is_57);
    
    var ___rect_33 = ___interopRequireDefault_33(_$rect_63);
    
    function ___interopRequireWildcard_33(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_33(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function __start_33(_ref) {
      var rect = _ref.rect,
          startOffset = _ref.startOffset,
          state = _ref.state,
          interaction = _ref.interaction,
          pageCoords = _ref.pageCoords;
      var options = state.options;
      var elementRect = options.elementRect;
      var offset = (0, ___extend_33["default"])({
        left: 0,
        top: 0,
        right: 0,
        bottom: 0
      }, options.offset || {});
    
      if (rect && elementRect) {
        var restriction = getRestrictionRect(options.restriction, interaction, pageCoords);
    
        if (restriction) {
          var widthDiff = restriction.right - restriction.left - rect.width;
          var heightDiff = restriction.bottom - restriction.top - rect.height;
    
          if (widthDiff < 0) {
            offset.left += widthDiff;
            offset.right += widthDiff;
          }
    
          if (heightDiff < 0) {
            offset.top += heightDiff;
            offset.bottom += heightDiff;
          }
        }
    
        offset.left += startOffset.left - rect.width * elementRect.left;
        offset.top += startOffset.top - rect.height * elementRect.top;
        offset.right += startOffset.right - rect.width * (1 - elementRect.right);
        offset.bottom += startOffset.bottom - rect.height * (1 - elementRect.bottom);
      }
    
      state.offset = offset;
    }
    
    function set(_ref2) {
      var coords = _ref2.coords,
          interaction = _ref2.interaction,
          state = _ref2.state;
      var options = state.options,
          offset = state.offset;
      var restriction = getRestrictionRect(options.restriction, interaction, coords);
    
      if (!restriction) {
        return;
      }
    
      var rect = ___rect_33["default"].xywhToTlbr(restriction);
    
      coords.x = Math.max(Math.min(rect.right - offset.right, coords.x), rect.left + offset.left);
      coords.y = Math.max(Math.min(rect.bottom - offset.bottom, coords.y), rect.top + offset.top);
    }
    
    function getRestrictionRect(value, interaction, coords) {
      if (__is_33.func(value)) {
        return ___rect_33["default"].resolveRectLike(value, interaction.interactable, interaction.element, [coords.x, coords.y, interaction]);
      } else {
        return ___rect_33["default"].resolveRectLike(value, interaction.interactable, interaction.element);
      }
    }
    
    var __defaults_33 = {
      restriction: null,
      elementRect: null,
      offset: null,
      endOnly: false,
      enabled: false
    };
    var restrict = {
      start: __start_33,
      set: set,
      getRestrictionRect: getRestrictionRect,
      defaults: __defaults_33
    };
    var ___default_33 = restrict;
    _$pointer_33["default"] = ___default_33;
    
    var _$edges_32 = {};
    "use strict";
    
    Object.defineProperty(_$edges_32, "__esModule", {
      value: true
    });
    _$edges_32["default"] = void 0;
    
    var ___extend_32 = ___interopRequireDefault_32(_$extend_53);
    
    var ___rect_32 = ___interopRequireDefault_32(_$rect_63);
    
    var _pointer = ___interopRequireDefault_32(_$pointer_33);
    
    function ___interopRequireDefault_32(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    // This module adds the options.resize.restrictEdges setting which sets min and
    // max for the top, left, bottom and right edges of the target being resized.
    //
    // interact(target).resize({
    //   edges: { top: true, left: true },
    //   restrictEdges: {
    //     inner: { top: 200, left: 200, right: 400, bottom: 400 },
    //     outer: { top:   0, left:   0, right: 600, bottom: 600 },
    //   },
    // })
    var __getRestrictionRect_32 = _pointer["default"].getRestrictionRect;
    var noInner = {
      top: +Infinity,
      left: +Infinity,
      bottom: -Infinity,
      right: -Infinity
    };
    var noOuter = {
      top: -Infinity,
      left: -Infinity,
      bottom: +Infinity,
      right: +Infinity
    };
    
    function __start_32(_ref) {
      var interaction = _ref.interaction,
          state = _ref.state;
      var options = state.options;
      var startOffset = interaction.modifiers.startOffset;
      var offset;
    
      if (options) {
        var offsetRect = __getRestrictionRect_32(options.offset, interaction, interaction.coords.start.page);
        offset = ___rect_32["default"].rectToXY(offsetRect);
      }
    
      offset = offset || {
        x: 0,
        y: 0
      };
      state.offset = {
        top: offset.y + startOffset.top,
        left: offset.x + startOffset.left,
        bottom: offset.y - startOffset.bottom,
        right: offset.x - startOffset.right
      };
    }
    
    function __set_32(_ref2) {
      var coords = _ref2.coords,
          interaction = _ref2.interaction,
          state = _ref2.state;
      var offset = state.offset,
          options = state.options;
      var edges = interaction.prepared._linkedEdges || interaction.prepared.edges;
    
      if (!edges) {
        return;
      }
    
      var page = (0, ___extend_32["default"])({}, coords);
      var inner = __getRestrictionRect_32(options.inner, interaction, page) || {};
      var outer = __getRestrictionRect_32(options.outer, interaction, page) || {};
      fixRect(inner, noInner);
      fixRect(outer, noOuter);
    
      if (edges.top) {
        coords.y = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top);
      } else if (edges.bottom) {
        coords.y = Math.max(Math.min(outer.bottom + offset.bottom, page.y), inner.bottom + offset.bottom);
      }
    
      if (edges.left) {
        coords.x = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left);
      } else if (edges.right) {
        coords.x = Math.max(Math.min(outer.right + offset.right, page.x), inner.right + offset.right);
      }
    }
    
    function fixRect(rect, defaults) {
      var _arr = ['top', 'left', 'bottom', 'right'];
    
      for (var _i = 0; _i < _arr.length; _i++) {
        var edge = _arr[_i];
    
        if (!(edge in rect)) {
          rect[edge] = defaults[edge];
        }
      }
    
      return rect;
    }
    
    var __defaults_32 = {
      inner: null,
      outer: null,
      offset: null,
      endOnly: false,
      enabled: false
    };
    var restrictEdges = {
      noInner: noInner,
      noOuter: noOuter,
      getRestrictionRect: __getRestrictionRect_32,
      start: __start_32,
      set: __set_32,
      defaults: __defaults_32
    };
    var ___default_32 = restrictEdges;
    _$edges_32["default"] = ___default_32;
    
    var _$rect_34 = {};
    "use strict";
    
    Object.defineProperty(_$rect_34, "__esModule", {
      value: true
    });
    _$rect_34["default"] = void 0;
    
    var ___extend_34 = ___interopRequireDefault_34(_$extend_53);
    
    var ___pointer_34 = ___interopRequireDefault_34(_$pointer_33);
    
    function ___interopRequireDefault_34(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    var __defaults_34 = (0, ___extend_34["default"])({
      get elementRect() {
        return {
          top: 0,
          left: 0,
          bottom: 1,
          right: 1
        };
      },
    
      set elementRect(_) {}
    
    }, ___pointer_34["default"].defaults);
    var restrictRect = {
      start: ___pointer_34["default"].start,
      set: ___pointer_34["default"].set,
      defaults: __defaults_34
    };
    var ___default_34 = restrictRect;
    _$rect_34["default"] = ___default_34;
    
    var _$size_35 = {};
    "use strict";
    
    Object.defineProperty(_$size_35, "__esModule", {
      value: true
    });
    _$size_35["default"] = void 0;
    
    var ___extend_35 = ___interopRequireDefault_35(_$extend_53);
    
    var ___rect_35 = ___interopRequireDefault_35(_$rect_63);
    
    var _edges = ___interopRequireDefault_35(_$edges_32);
    
    function ___interopRequireDefault_35(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    var noMin = {
      width: -Infinity,
      height: -Infinity
    };
    var noMax = {
      width: +Infinity,
      height: +Infinity
    };
    
    function __start_35(arg) {
      return _edges["default"].start(arg);
    }
    
    function __set_35(arg) {
      var interaction = arg.interaction,
          state = arg.state;
      var options = state.options;
      var edges = interaction.prepared._linkedEdges || interaction.prepared.edges;
    
      if (!edges) {
        return;
      }
    
      var rect = ___rect_35["default"].xywhToTlbr(interaction.resizeRects.inverted);
    
      var minSize = ___rect_35["default"].tlbrToXywh(_edges["default"].getRestrictionRect(options.min, interaction, arg.coords)) || noMin;
      var maxSize = ___rect_35["default"].tlbrToXywh(_edges["default"].getRestrictionRect(options.max, interaction, arg.coords)) || noMax;
      state.options = {
        endOnly: options.endOnly,
        inner: (0, ___extend_35["default"])({}, _edges["default"].noInner),
        outer: (0, ___extend_35["default"])({}, _edges["default"].noOuter)
      };
    
      if (edges.top) {
        state.options.inner.top = rect.bottom - minSize.height;
        state.options.outer.top = rect.bottom - maxSize.height;
      } else if (edges.bottom) {
        state.options.inner.bottom = rect.top + minSize.height;
        state.options.outer.bottom = rect.top + maxSize.height;
      }
    
      if (edges.left) {
        state.options.inner.left = rect.right - minSize.width;
        state.options.outer.left = rect.right - maxSize.width;
      } else if (edges.right) {
        state.options.inner.right = rect.left + minSize.width;
        state.options.outer.right = rect.left + maxSize.width;
      }
    
      _edges["default"].set(arg);
    
      state.options = options;
    }
    
    var __defaults_35 = {
      min: null,
      max: null,
      endOnly: false,
      enabled: false
    };
    var restrictSize = {
      start: __start_35,
      set: __set_35,
      defaults: __defaults_35
    };
    var ___default_35 = restrictSize;
    _$size_35["default"] = ___default_35;
    
    var _$pointer_37 = {};
    "use strict";
    
    Object.defineProperty(_$pointer_37, "__esModule", {
      value: true
    });
    _$pointer_37["default"] = void 0;
    
    var __utils_37 = ___interopRequireWildcard_37(_$utils_56);
    
    function ___interopRequireWildcard_37(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function __start_37(arg) {
      var interaction = arg.interaction,
          interactable = arg.interactable,
          element = arg.element,
          rect = arg.rect,
          state = arg.state,
          startOffset = arg.startOffset;
      var options = state.options;
      var offsets = [];
      var origin = options.offsetWithOrigin ? getOrigin(arg) : {
        x: 0,
        y: 0
      };
      var snapOffset;
    
      if (options.offset === 'startCoords') {
        snapOffset = {
          x: interaction.coords.start.page.x,
          y: interaction.coords.start.page.y
        };
      } else {
        var offsetRect = __utils_37.rect.resolveRectLike(options.offset, interactable, element, [interaction]);
        snapOffset = __utils_37.rect.rectToXY(offsetRect) || {
          x: 0,
          y: 0
        };
        snapOffset.x += origin.x;
        snapOffset.y += origin.y;
      }
    
      var relativePoints = options.relativePoints || [];
    
      if (rect && options.relativePoints && options.relativePoints.length) {
        for (var index = 0; index < relativePoints.length; index++) {
          var relativePoint = relativePoints[index];
          offsets.push({
            index: index,
            relativePoint: relativePoint,
            x: startOffset.left - rect.width * relativePoint.x + snapOffset.x,
            y: startOffset.top - rect.height * relativePoint.y + snapOffset.y
          });
        }
      } else {
        offsets.push(__utils_37.extend({
          index: 0,
          relativePoint: null
        }, snapOffset));
      }
    
      state.offsets = offsets;
    }
    
    function __set_37(arg) {
      var interaction = arg.interaction,
          coords = arg.coords,
          state = arg.state;
      var options = state.options,
          offsets = state.offsets;
      var origin = __utils_37.getOriginXY(interaction.interactable, interaction.element, interaction.prepared.name);
      var page = __utils_37.extend({}, coords);
      var targets = [];
      var target;
    
      if (!options.offsetWithOrigin) {
        page.x -= origin.x;
        page.y -= origin.y;
      }
    
      state.realX = page.x;
      state.realY = page.y;
    
      for (var _i = 0; _i < offsets.length; _i++) {
        var _ref;
    
        _ref = offsets[_i];
        var offset = _ref;
        var relativeX = page.x - offset.x;
        var relativeY = page.y - offset.y;
    
        for (var index = 0, _len = options.targets.length; index < _len; index++) {
          var snapTarget = options.targets[index];
    
          if (__utils_37.is.func(snapTarget)) {
            target = snapTarget(relativeX, relativeY, interaction, offset, index);
          } else {
            target = snapTarget;
          }
    
          if (!target) {
            continue;
          }
    
          targets.push({
            x: (__utils_37.is.number(target.x) ? target.x : relativeX) + offset.x,
            y: (__utils_37.is.number(target.y) ? target.y : relativeY) + offset.y,
            range: __utils_37.is.number(target.range) ? target.range : options.range
          });
        }
      }
    
      var closest = {
        target: null,
        inRange: false,
        distance: 0,
        range: 0,
        dx: 0,
        dy: 0
      };
    
      for (var i = 0, len = targets.length; i < len; i++) {
        target = targets[i];
        var range = target.range;
        var dx = target.x - page.x;
        var dy = target.y - page.y;
        var distance = __utils_37.hypot(dx, dy);
        var inRange = distance <= range; // Infinite targets count as being out of range
        // compared to non infinite ones that are in range
    
        if (range === Infinity && closest.inRange && closest.range !== Infinity) {
          inRange = false;
        }
    
        if (!closest.target || (inRange // is the closest target in range?
        ? closest.inRange && range !== Infinity // the pointer is relatively deeper in this target
        ? distance / range < closest.distance / closest.range // this target has Infinite range and the closest doesn't
        : range === Infinity && closest.range !== Infinity || // OR this target is closer that the previous closest
        distance < closest.distance : // The other is not in range and the pointer is closer to this target
        !closest.inRange && distance < closest.distance)) {
          closest.target = target;
          closest.distance = distance;
          closest.range = range;
          closest.inRange = inRange;
          closest.dx = dx;
          closest.dy = dy;
          state.range = range;
        }
      }
    
      if (closest.inRange) {
        coords.x = closest.target.x;
        coords.y = closest.target.y;
      }
    
      state.closest = closest;
    }
    
    function getOrigin(arg) {
      var optionsOrigin = __utils_37.rect.rectToXY(__utils_37.rect.resolveRectLike(arg.state.options.origin, [arg.interaction.element]));
      var origin = optionsOrigin || __utils_37.getOriginXY(arg.interactable, arg.interaction.element, arg.interaction.prepared.name);
      return origin;
    }
    
    var __defaults_37 = {
      range: Infinity,
      targets: null,
      offset: null,
      offsetWithOrigin: true,
      origin: null,
      relativePoints: null,
      endOnly: false,
      enabled: false
    };
    var snap = {
      start: __start_37,
      set: __set_37,
      defaults: __defaults_37
    };
    var ___default_37 = snap;
    _$pointer_37["default"] = ___default_37;
    
    var _$size_38 = {};
    "use strict";
    
    Object.defineProperty(_$size_38, "__esModule", {
      value: true
    });
    _$size_38["default"] = void 0;
    
    var ___extend_38 = ___interopRequireDefault_38(_$extend_53);
    
    var __is_38 = ___interopRequireWildcard_38(_$is_57);
    
    var ___pointer_38 = ___interopRequireDefault_38(_$pointer_37);
    
    function ___interopRequireWildcard_38(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___interopRequireDefault_38(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___slicedToArray_38(arr, i) { return ___arrayWithHoles_38(arr) || ___iterableToArrayLimit_38(arr, i) || ___nonIterableRest_38(); }
    
    function ___nonIterableRest_38() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
    
    function ___iterableToArrayLimit_38(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
    
    function ___arrayWithHoles_38(arr) { if (Array.isArray(arr)) return arr; }
    
    function __start_38(arg) {
      var interaction = arg.interaction,
          state = arg.state;
      var options = state.options;
      var edges = interaction.prepared.edges;
    
      if (!edges) {
        return null;
      }
    
      arg.state = {
        options: {
          targets: null,
          relativePoints: [{
            x: edges.left ? 0 : 1,
            y: edges.top ? 0 : 1
          }],
          offset: options.offset || 'self',
          origin: {
            x: 0,
            y: 0
          },
          range: options.range
        }
      };
      state.targetFields = state.targetFields || [['width', 'height'], ['x', 'y']];
    
      ___pointer_38["default"].start(arg);
    
      state.offsets = arg.state.offsets;
      arg.state = state;
    }
    
    function __set_38(arg) {
      var interaction = arg.interaction,
          state = arg.state,
          coords = arg.coords;
      var options = state.options,
          offsets = state.offsets;
      var relative = {
        x: coords.x - offsets[0].x,
        y: coords.y - offsets[0].y
      };
      state.options = (0, ___extend_38["default"])({}, options);
      state.options.targets = [];
    
      for (var _i = 0; _i < (options.targets || []).length; _i++) {
        var _ref;
    
        _ref = (options.targets || [])[_i];
        var snapTarget = _ref;
        var target = void 0;
    
        if (__is_38.func(snapTarget)) {
          target = snapTarget(relative.x, relative.y, interaction);
        } else {
          target = snapTarget;
        }
    
        if (!target) {
          continue;
        }
    
        for (var _i2 = 0; _i2 < state.targetFields.length; _i2++) {
          var _ref2;
    
          _ref2 = state.targetFields[_i2];
    
          var _ref3 = _ref2,
              _ref4 = ___slicedToArray_38(_ref3, 2),
              xField = _ref4[0],
              yField = _ref4[1];
    
          if (xField in target || yField in target) {
            target.x = target[xField];
            target.y = target[yField];
            break;
          }
        }
    
        state.options.targets.push(target);
      }
    
      ___pointer_38["default"].set(arg);
    
      state.options = options;
    }
    
    var __defaults_38 = {
      range: Infinity,
      targets: null,
      offset: null,
      endOnly: false,
      enabled: false
    };
    var snapSize = {
      start: __start_38,
      set: __set_38,
      defaults: __defaults_38
    };
    var ___default_38 = snapSize;
    _$size_38["default"] = ___default_38;
    
    var _$edges_36 = {};
    "use strict";
    
    Object.defineProperty(_$edges_36, "__esModule", {
      value: true
    });
    _$edges_36["default"] = void 0;
    
    var ___clone_36 = ___interopRequireDefault_36(_$clone_49);
    
    var ___extend_36 = ___interopRequireDefault_36(_$extend_53);
    
    var _size = ___interopRequireDefault_36(_$size_38);
    
    function ___interopRequireDefault_36(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    /**
     * @module modifiers/snapEdges
     *
     * @description
     * This module allows snapping of the edges of targets during resize
     * interactions.
     *
     * @example
     * interact(target).resizable({
     *   snapEdges: {
     *     targets: [interact.snappers.grid({ x: 100, y: 50 })],
     *   },
     * })
     *
     * interact(target).resizable({
     *   snapEdges: {
     *     targets: [
     *       interact.snappers.grid({
     *        top: 50,
     *        left: 50,
     *        bottom: 100,
     *        right: 100,
     *       }),
     *     ],
     *   },
     * })
     */
    function __start_36(arg) {
      var edges = arg.interaction.prepared.edges;
    
      if (!edges) {
        return null;
      }
    
      arg.state.targetFields = arg.state.targetFields || [[edges.left ? 'left' : 'right', edges.top ? 'top' : 'bottom']];
      return _size["default"].start(arg);
    }
    
    function __set_36(arg) {
      return _size["default"].set(arg);
    }
    
    var snapEdges = {
      start: __start_36,
      set: __set_36,
      defaults: (0, ___extend_36["default"])((0, ___clone_36["default"])(_size["default"].defaults), {
        offset: {
          x: 0,
          y: 0
        }
      })
    };
    var ___default_36 = snapEdges;
    _$edges_36["default"] = ___default_36;
    
    var _$modifiers_31 = {};
    "use strict";
    
    Object.defineProperty(_$modifiers_31, "__esModule", {
      value: true
    });
    _$modifiers_31.restrictSize = _$modifiers_31.restrictEdges = _$modifiers_31.restrictRect = _$modifiers_31.restrict = _$modifiers_31.snapEdges = _$modifiers_31.snapSize = _$modifiers_31.snap = void 0;
    
    var ___base_31 = ___interopRequireDefault_31(_$base_30);
    
    var ___edges_31 = ___interopRequireDefault_31(_$edges_32);
    
    var ___pointer_31 = ___interopRequireDefault_31(_$pointer_33);
    
    var ___rect_31 = ___interopRequireDefault_31(_$rect_34);
    
    var ___size_31 = ___interopRequireDefault_31(_$size_35);
    
    var _edges2 = ___interopRequireDefault_31(_$edges_36);
    
    var _pointer2 = ___interopRequireDefault_31(_$pointer_37);
    
    var _size2 = ___interopRequireDefault_31(_$size_38);
    
    function ___interopRequireDefault_31(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    var __makeModifier_31 = ___base_31["default"].makeModifier;
    var __snap_31 = __makeModifier_31(_pointer2["default"], 'snap');
    _$modifiers_31.snap = __snap_31;
    var __snapSize_31 = __makeModifier_31(_size2["default"], 'snapSize');
    _$modifiers_31.snapSize = __snapSize_31;
    var __snapEdges_31 = __makeModifier_31(_edges2["default"], 'snapEdges');
    _$modifiers_31.snapEdges = __snapEdges_31;
    var __restrict_31 = __makeModifier_31(___pointer_31["default"], 'restrict');
    _$modifiers_31.restrict = __restrict_31;
    var __restrictRect_31 = __makeModifier_31(___rect_31["default"], 'restrictRect');
    _$modifiers_31.restrictRect = __restrictRect_31;
    var __restrictEdges_31 = __makeModifier_31(___edges_31["default"], 'restrictEdges');
    _$modifiers_31.restrictEdges = __restrictEdges_31;
    var __restrictSize_31 = __makeModifier_31(___size_31["default"], 'restrictSize');
    _$modifiers_31.restrictSize = __restrictSize_31;
    
    var _$PointerEvent_39 = {};
    "use strict";
    
    Object.defineProperty(_$PointerEvent_39, "__esModule", {
      value: true
    });
    _$PointerEvent_39["default"] = void 0;
    
    var ___BaseEvent2_39 = ___interopRequireDefault_39(_$BaseEvent_13);
    
    var ___pointerUtils_39 = ___interopRequireDefault_39(_$pointerUtils_61);
    
    function ___interopRequireDefault_39(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___typeof_39(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_39 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_39 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_39(obj); }
    
    function ___classCallCheck_39(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    
    function ___defineProperties_39(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    
    function ___createClass_39(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_39(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_39(Constructor, staticProps); return Constructor; }
    
    function ___possibleConstructorReturn_39(self, call) { if (call && (___typeof_39(call) === "object" || typeof call === "function")) { return call; } return ___assertThisInitialized_39(self); }
    
    function ___getPrototypeOf_39(o) { ___getPrototypeOf_39 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ___getPrototypeOf_39(o); }
    
    function ___assertThisInitialized_39(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
    
    function ___inherits_39(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ___setPrototypeOf_39(subClass, superClass); }
    
    function ___setPrototypeOf_39(o, p) { ___setPrototypeOf_39 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ___setPrototypeOf_39(o, p); }
    
    /** */
    var PointerEvent =
    /*#__PURE__*/
    function (_BaseEvent) {
      ___inherits_39(PointerEvent, _BaseEvent);
    
      /** */
      function PointerEvent(type, pointer, event, eventTarget, interaction, timeStamp) {
        var _this;
    
        ___classCallCheck_39(this, PointerEvent);
    
        _this = ___possibleConstructorReturn_39(this, ___getPrototypeOf_39(PointerEvent).call(this, interaction));
    
        ___pointerUtils_39["default"].pointerExtend(___assertThisInitialized_39(_this), event);
    
        if (event !== pointer) {
          ___pointerUtils_39["default"].pointerExtend(___assertThisInitialized_39(_this), pointer);
        }
    
        _this.timeStamp = timeStamp;
        _this.originalEvent = event;
        _this.type = type;
        _this.pointerId = ___pointerUtils_39["default"].getPointerId(pointer);
        _this.pointerType = ___pointerUtils_39["default"].getPointerType(pointer);
        _this.target = eventTarget;
        _this.currentTarget = null;
    
        if (type === 'tap') {
          var pointerIndex = interaction.getPointerIndex(pointer);
          _this.dt = _this.timeStamp - interaction.pointers[pointerIndex].downTime;
          var interval = _this.timeStamp - interaction.tapTime;
          _this["double"] = !!(interaction.prevTap && interaction.prevTap.type !== 'doubletap' && interaction.prevTap.target === _this.target && interval < 500);
        } else if (type === 'doubletap') {
          _this.dt = pointer.timeStamp - interaction.tapTime;
        }
    
        return _this;
      }
    
      ___createClass_39(PointerEvent, [{
        key: "_subtractOrigin",
        value: function _subtractOrigin(_ref) {
          var originX = _ref.x,
              originY = _ref.y;
          this.pageX -= originX;
          this.pageY -= originY;
          this.clientX -= originX;
          this.clientY -= originY;
          return this;
        }
      }, {
        key: "_addOrigin",
        value: function _addOrigin(_ref2) {
          var originX = _ref2.x,
              originY = _ref2.y;
          this.pageX += originX;
          this.pageY += originY;
          this.clientX += originX;
          this.clientY += originY;
          return this;
        }
        /**
         * Prevent the default behaviour of the original Event
         */
    
      }, {
        key: "preventDefault",
        value: function preventDefault() {
          this.originalEvent.preventDefault();
        }
      }]);
    
      return PointerEvent;
    }(___BaseEvent2_39["default"]);
    
    _$PointerEvent_39["default"] = PointerEvent;
    
    var _$base_40 = {};
    "use strict";
    
    Object.defineProperty(_$base_40, "__esModule", {
      value: true
    });
    _$base_40["default"] = void 0;
    
    var __utils_40 = ___interopRequireWildcard_40(_$utils_56);
    
    var _PointerEvent = ___interopRequireDefault_40(_$PointerEvent_39);
    
    function ___interopRequireDefault_40(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_40(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    var signals = new __utils_40.Signals();
    var simpleSignals = ['down', 'up', 'cancel'];
    var simpleEvents = ['down', 'up', 'cancel'];
    var __defaults_40 = {
      holdDuration: 600,
      ignoreFrom: null,
      allowFrom: null,
      origin: {
        x: 0,
        y: 0
      }
    };
    var pointerEvents = {
      id: 'pointer-events/base',
      install: __install_40,
      signals: signals,
      PointerEvent: _PointerEvent["default"],
      fire: fire,
      collectEventTargets: collectEventTargets,
      createSignalListener: createSignalListener,
      defaults: __defaults_40,
      types: ['down', 'move', 'up', 'cancel', 'tap', 'doubletap', 'hold']
    };
    
    function fire(arg, scope) {
      var interaction = arg.interaction,
          pointer = arg.pointer,
          event = arg.event,
          eventTarget = arg.eventTarget,
          _arg$type = arg.type,
          type = _arg$type === void 0 ? arg.pointerEvent.type : _arg$type,
          _arg$targets = arg.targets,
          targets = _arg$targets === void 0 ? collectEventTargets(arg) : _arg$targets;
      var _arg$pointerEvent = arg.pointerEvent,
          pointerEvent = _arg$pointerEvent === void 0 ? new _PointerEvent["default"](type, pointer, event, eventTarget, interaction, scope.now()) : _arg$pointerEvent;
      var signalArg = {
        interaction: interaction,
        pointer: pointer,
        event: event,
        eventTarget: eventTarget,
        targets: targets,
        type: type,
        pointerEvent: pointerEvent
      };
    
      for (var i = 0; i < targets.length; i++) {
        var target = targets[i];
    
        for (var prop in target.props || {}) {
          pointerEvent[prop] = target.props[prop];
        }
    
        var origin = __utils_40.getOriginXY(target.eventable, target.node);
    
        pointerEvent._subtractOrigin(origin);
    
        pointerEvent.eventable = target.eventable;
        pointerEvent.currentTarget = target.node;
        target.eventable.fire(pointerEvent);
    
        pointerEvent._addOrigin(origin);
    
        if (pointerEvent.immediatePropagationStopped || pointerEvent.propagationStopped && i + 1 < targets.length && targets[i + 1].node !== pointerEvent.currentTarget) {
          break;
        }
      }
    
      signals.fire('fired', signalArg);
    
      if (type === 'tap') {
        // if pointerEvent should make a double tap, create and fire a doubletap
        // PointerEvent and use that as the prevTap
        var prevTap = pointerEvent["double"] ? fire({
          interaction: interaction,
          pointer: pointer,
          event: event,
          eventTarget: eventTarget,
          type: 'doubletap'
        }, scope) : pointerEvent;
        interaction.prevTap = prevTap;
        interaction.tapTime = prevTap.timeStamp;
      }
    
      return pointerEvent;
    }
    
    function collectEventTargets(_ref) {
      var interaction = _ref.interaction,
          pointer = _ref.pointer,
          event = _ref.event,
          eventTarget = _ref.eventTarget,
          type = _ref.type;
      var pointerIndex = interaction.getPointerIndex(pointer);
      var pointerInfo = interaction.pointers[pointerIndex]; // do not fire a tap event if the pointer was moved before being lifted
    
      if (type === 'tap' && (interaction.pointerWasMoved || // or if the pointerup target is different to the pointerdown target
      !(pointerInfo && pointerInfo.downTarget === eventTarget))) {
        return [];
      }
    
      var path = __utils_40.dom.getPath(eventTarget);
      var signalArg = {
        interaction: interaction,
        pointer: pointer,
        event: event,
        eventTarget: eventTarget,
        type: type,
        path: path,
        targets: [],
        node: null
      };
    
      for (var _i = 0; _i < path.length; _i++) {
        var _ref2;
    
        _ref2 = path[_i];
        var node = _ref2;
        signalArg.node = node;
        signals.fire('collect-targets', signalArg);
      }
    
      if (type === 'hold') {
        signalArg.targets = signalArg.targets.filter(function (target) {
          return target.eventable.options.holdDuration === interaction.pointers[pointerIndex].hold.duration;
        });
      }
    
      return signalArg.targets;
    }
    
    function __install_40(scope) {
      var interactions = scope.interactions;
      scope.pointerEvents = pointerEvents;
      scope.defaults.actions.pointerEvents = pointerEvents.defaults;
      interactions.signals.on('new', function (_ref3) {
        var interaction = _ref3.interaction;
        interaction.prevTap = null; // the most recent tap event on this interaction
    
        interaction.tapTime = 0; // time of the most recent tap event
      });
      interactions.signals.on('update-pointer', function (_ref4) {
        var down = _ref4.down,
            pointerInfo = _ref4.pointerInfo;
    
        if (!down && pointerInfo.hold) {
          return;
        }
    
        pointerInfo.hold = {
          duration: Infinity,
          timeout: null
        };
      });
      interactions.signals.on('move', function (_ref5) {
        var interaction = _ref5.interaction,
            pointer = _ref5.pointer,
            event = _ref5.event,
            eventTarget = _ref5.eventTarget,
            duplicateMove = _ref5.duplicateMove;
        var pointerIndex = interaction.getPointerIndex(pointer);
    
        if (!duplicateMove && (!interaction.pointerIsDown || interaction.pointerWasMoved)) {
          if (interaction.pointerIsDown) {
            clearTimeout(interaction.pointers[pointerIndex].hold.timeout);
          }
    
          fire({
            interaction: interaction,
            pointer: pointer,
            event: event,
            eventTarget: eventTarget,
            type: 'move'
          }, scope);
        }
      });
      interactions.signals.on('down', function (_ref6) {
        var interaction = _ref6.interaction,
            pointer = _ref6.pointer,
            event = _ref6.event,
            eventTarget = _ref6.eventTarget,
            pointerIndex = _ref6.pointerIndex;
        var timer = interaction.pointers[pointerIndex].hold;
        var path = __utils_40.dom.getPath(eventTarget);
        var signalArg = {
          interaction: interaction,
          pointer: pointer,
          event: event,
          eventTarget: eventTarget,
          type: 'hold',
          targets: [],
          path: path,
          node: null
        };
    
        for (var _i2 = 0; _i2 < path.length; _i2++) {
          var _ref7;
    
          _ref7 = path[_i2];
          var node = _ref7;
          signalArg.node = node;
          signals.fire('collect-targets', signalArg);
        }
    
        if (!signalArg.targets.length) {
          return;
        }
    
        var minDuration = Infinity;
    
        for (var _i3 = 0; _i3 < signalArg.targets.length; _i3++) {
          var _ref8;
    
          _ref8 = signalArg.targets[_i3];
          var target = _ref8;
          var holdDuration = target.eventable.options.holdDuration;
    
          if (holdDuration < minDuration) {
            minDuration = holdDuration;
          }
        }
    
        timer.duration = minDuration;
        timer.timeout = setTimeout(function () {
          fire({
            interaction: interaction,
            eventTarget: eventTarget,
            pointer: pointer,
            event: event,
            type: 'hold'
          }, scope);
        }, minDuration);
      });
      var _arr = ['up', 'cancel'];
    
      for (var _i4 = 0; _i4 < _arr.length; _i4++) {
        var signalName = _arr[_i4];
        interactions.signals.on(signalName, function (_ref10) {
          var interaction = _ref10.interaction,
              pointerIndex = _ref10.pointerIndex;
    
          if (interaction.pointers[pointerIndex].hold) {
            clearTimeout(interaction.pointers[pointerIndex].hold.timeout);
          }
        });
      }
    
      for (var i = 0; i < simpleSignals.length; i++) {
        interactions.signals.on(simpleSignals[i], createSignalListener(simpleEvents[i], scope));
      }
    
      interactions.signals.on('up', function (_ref9) {
        var interaction = _ref9.interaction,
            pointer = _ref9.pointer,
            event = _ref9.event,
            eventTarget = _ref9.eventTarget;
    
        if (!interaction.pointerWasMoved) {
          fire({
            interaction: interaction,
            eventTarget: eventTarget,
            pointer: pointer,
            event: event,
            type: 'tap'
          }, scope);
        }
      });
    }
    
    function createSignalListener(type, scope) {
      return function (_ref11) {
        var interaction = _ref11.interaction,
            pointer = _ref11.pointer,
            event = _ref11.event,
            eventTarget = _ref11.eventTarget;
        fire({
          interaction: interaction,
          eventTarget: eventTarget,
          pointer: pointer,
          event: event,
          type: type
        }, scope);
      };
    }
    
    var ___default_40 = pointerEvents;
    _$base_40["default"] = ___default_40;
    
    var _$holdRepeat_41 = {};
    "use strict";
    
    Object.defineProperty(_$holdRepeat_41, "__esModule", {
      value: true
    });
    _$holdRepeat_41["default"] = void 0;
    
    var ___base_41 = ___interopRequireDefault_41(_$base_40);
    
    function ___interopRequireDefault_41(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function __install_41(scope) {
      var pointerEvents = scope.pointerEvents,
          interactions = scope.interactions;
      scope.usePlugin(___base_41["default"]);
      pointerEvents.signals.on('new', onNew);
      pointerEvents.signals.on('fired', function (arg) {
        return onFired(arg, scope);
      });
      var _arr = ['move', 'up', 'cancel', 'endall'];
    
      for (var _i = 0; _i < _arr.length; _i++) {
        var signal = _arr[_i];
        interactions.signals.on(signal, endHoldRepeat);
      } // don't repeat by default
    
    
      pointerEvents.defaults.holdRepeatInterval = 0;
      pointerEvents.types.push('holdrepeat');
    }
    
    function onNew(_ref) {
      var pointerEvent = _ref.pointerEvent;
    
      if (pointerEvent.type !== 'hold') {
        return;
      }
    
      pointerEvent.count = (pointerEvent.count || 0) + 1;
    }
    
    function onFired(_ref2, scope) {
      var interaction = _ref2.interaction,
          pointerEvent = _ref2.pointerEvent,
          eventTarget = _ref2.eventTarget,
          targets = _ref2.targets;
    
      if (pointerEvent.type !== 'hold' || !targets.length) {
        return;
      } // get the repeat interval from the first eventable
    
    
      var interval = targets[0].eventable.options.holdRepeatInterval; // don't repeat if the interval is 0 or less
    
      if (interval <= 0) {
        return;
      } // set a timeout to fire the holdrepeat event
    
    
      interaction.holdIntervalHandle = setTimeout(function () {
        scope.pointerEvents.fire({
          interaction: interaction,
          eventTarget: eventTarget,
          type: 'hold',
          pointer: pointerEvent,
          event: pointerEvent
        }, scope);
      }, interval);
    }
    
    function endHoldRepeat(_ref3) {
      var interaction = _ref3.interaction;
    
      // set the interaction's holdStopTime property
      // to stop further holdRepeat events
      if (interaction.holdIntervalHandle) {
        clearInterval(interaction.holdIntervalHandle);
        interaction.holdIntervalHandle = null;
      }
    }
    
    var ___default_41 = {
      id: 'pointer-events/holdRepeat',
      install: __install_41
    };
    _$holdRepeat_41["default"] = ___default_41;
    
    var _$interactableTargets_43 = {};
    "use strict";
    
    Object.defineProperty(_$interactableTargets_43, "__esModule", {
      value: true
    });
    _$interactableTargets_43["default"] = void 0;
    
    /* removed: var _$arr_47 = require("@interactjs/utils/arr"); */;
    
    var ___extend_43 = ___interopRequireDefault_43(_$extend_53);
    
    function ___interopRequireDefault_43(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function __install_43(scope) {
      var pointerEvents = scope.pointerEvents,
          actions = scope.actions,
          Interactable = scope.Interactable,
          interactables = scope.interactables;
      pointerEvents.signals.on('collect-targets', function (_ref) {
        var targets = _ref.targets,
            node = _ref.node,
            type = _ref.type,
            eventTarget = _ref.eventTarget;
        scope.interactables.forEachMatch(node, function (interactable) {
          var eventable = interactable.events;
          var options = eventable.options;
    
          if (eventable.types[type] && eventable.types[type].length && interactable.testIgnoreAllow(options, node, eventTarget)) {
            targets.push({
              node: node,
              eventable: eventable,
              props: {
                interactable: interactable
              }
            });
          }
        });
      });
      interactables.signals.on('new', function (_ref2) {
        var interactable = _ref2.interactable;
    
        interactable.events.getRect = function (element) {
          return interactable.getRect(element);
        };
      });
      interactables.signals.on('set', function (_ref3) {
        var interactable = _ref3.interactable,
            options = _ref3.options;
        (0, ___extend_43["default"])(interactable.events.options, pointerEvents.defaults);
        (0, ___extend_43["default"])(interactable.events.options, options.pointerEvents || {});
      });
      (0, _$arr_47.merge)(actions.eventTypes, pointerEvents.types);
      Interactable.prototype.pointerEvents = pointerEventsMethod;
      var __backCompatOption = Interactable.prototype._backCompatOption;
    
      Interactable.prototype._backCompatOption = function (optionName, newValue) {
        var ret = __backCompatOption.call(this, optionName, newValue);
    
        if (ret === this) {
          this.events.options[optionName] = newValue;
        }
    
        return ret;
      };
    }
    
    function pointerEventsMethod(options) {
      (0, ___extend_43["default"])(this.events.options, options);
      return this;
    }
    
    var ___default_43 = {
      id: 'pointer-events/interactableTargets',
      install: __install_43
    };
    _$interactableTargets_43["default"] = ___default_43;
    
    var _$pointerEvents_42 = {};
    "use strict";
    
    Object.defineProperty(_$pointerEvents_42, "__esModule", {
      value: true
    });
    _$pointerEvents_42.install = __install_42;
    Object.defineProperty(_$pointerEvents_42, "pointerEvents", {
      enumerable: true,
      get: function get() {
        return ___base_42["default"];
      }
    });
    Object.defineProperty(_$pointerEvents_42, "holdRepeat", {
      enumerable: true,
      get: function get() {
        return _holdRepeat["default"];
      }
    });
    Object.defineProperty(_$pointerEvents_42, "interactableTargets", {
      enumerable: true,
      get: function get() {
        return _interactableTargets["default"];
      }
    });
    _$pointerEvents_42.id = void 0;
    
    var ___base_42 = ___interopRequireDefault_42(_$base_40);
    
    var _holdRepeat = ___interopRequireDefault_42(_$holdRepeat_41);
    
    var _interactableTargets = ___interopRequireDefault_42(_$interactableTargets_43);
    
    function ___interopRequireDefault_42(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function __install_42(scope) {
      scope.usePlugin(___base_42["default"]);
      scope.usePlugin(_holdRepeat["default"]);
      scope.usePlugin(_interactableTargets["default"]);
    }
    
    var __id_42 = 'pointer-events';
    _$pointerEvents_42.id = __id_42;
    
    var _$reflow_44 = {};
    "use strict";
    
    Object.defineProperty(_$reflow_44, "__esModule", {
      value: true
    });
    _$reflow_44.install = __install_44;
    _$reflow_44["default"] = void 0;
    
    /* removed: var _$InteractEvent_15 = require("@interactjs/core/InteractEvent"); */;
    
    /* removed: var _$utils_56 = require("@interactjs/utils"); */;
    
    _$InteractEvent_15.EventPhase.Reflow = 'reflow';
    
    function __install_44(scope) {
      var actions = scope.actions,
          interactions = scope.interactions,
          Interactable = scope.Interactable; // add action reflow event types
    
      for (var _i = 0; _i < actions.names.length; _i++) {
        var _ref;
    
        _ref = actions.names[_i];
        var actionName = _ref;
        actions.eventTypes.push("".concat(actionName, "reflow"));
      } // remove completed reflow interactions
    
    
      interactions.signals.on('stop', function (_ref2) {
        var interaction = _ref2.interaction;
    
        if (interaction.pointerType === _$InteractEvent_15.EventPhase.Reflow) {
          if (interaction._reflowResolve) {
            interaction._reflowResolve();
          }
    
          _$utils_56.arr.remove(scope.interactions.list, interaction);
        }
      });
      /**
       * ```js
       * const interactable = interact(target)
       * const drag = { name: drag, axis: 'x' }
       * const resize = { name: resize, edges: { left: true, bottom: true }
       *
       * interactable.reflow(drag)
       * interactable.reflow(resize)
       * ```
       *
       * Start an action sequence to re-apply modifiers, check drops, etc.
       *
       * @param { Object } action The action to begin
       * @param { string } action.name The name of the action
       * @returns { Promise<Interactable> }
       */
    
      Interactable.prototype.reflow = function (action) {
        return reflow(this, action, scope);
      };
    }
    
    function reflow(interactable, action, scope) {
      var elements = _$utils_56.is.string(interactable.target) ? _$utils_56.arr.from(interactable._context.querySelectorAll(interactable.target)) : [interactable.target]; // tslint:disable-next-line variable-name
    
      var Promise = _$utils_56.win.window.Promise;
      var promises = Promise ? [] : null;
    
      var _loop = function _loop() {
        _ref3 = elements[_i2];
        var element = _ref3;
        var rect = interactable.getRect(element);
    
        if (!rect) {
          return "break";
        }
    
        var runningInteraction = _$utils_56.arr.find(scope.interactions.list, function (interaction) {
          return interaction.interacting() && interaction.interactable === interactable && interaction.element === element && interaction.prepared.name === action.name;
        });
    
        var reflowPromise = void 0;
    
        if (runningInteraction) {
          runningInteraction.move();
    
          if (promises) {
            reflowPromise = runningInteraction._reflowPromise || new Promise(function (resolve) {
              runningInteraction._reflowResolve = resolve;
            });
          }
        } else {
          var xywh = _$utils_56.rect.tlbrToXywh(rect);
    
          var coords = {
            page: {
              x: xywh.x,
              y: xywh.y
            },
            client: {
              x: xywh.x,
              y: xywh.y
            },
            timeStamp: scope.now()
          };
    
          var event = _$utils_56.pointer.coordsToEvent(coords);
    
          reflowPromise = startReflow(scope, interactable, element, action, event);
        }
    
        if (promises) {
          promises.push(reflowPromise);
        }
      };
    
      for (var _i2 = 0; _i2 < elements.length; _i2++) {
        var _ref3;
    
        var _ret = _loop();
    
        if (_ret === "break") break;
      }
    
      return promises && Promise.all(promises).then(function () {
        return interactable;
      });
    }
    
    function startReflow(scope, interactable, element, action, event) {
      var interaction = scope.interactions["new"]({
        pointerType: 'reflow'
      });
      var signalArg = {
        interaction: interaction,
        event: event,
        pointer: event,
        eventTarget: element,
        phase: _$InteractEvent_15.EventPhase.Reflow
      };
      interaction.interactable = interactable;
      interaction.element = element;
      interaction.prepared = (0, _$utils_56.extend)({}, action);
      interaction.prevEvent = event;
      interaction.updatePointer(event, event, element, true);
    
      interaction._doPhase(signalArg);
    
      var reflowPromise = _$utils_56.win.window.Promise ? new _$utils_56.win.window.Promise(function (resolve) {
        interaction._reflowResolve = resolve;
      }) : null;
      interaction._reflowPromise = reflowPromise;
      interaction.start(action, interactable, element);
    
      if (interaction._interacting) {
        interaction.move(signalArg);
        interaction.end(event);
      } else {
        interaction.stop();
      }
    
      interaction.removePointer(event, event);
      interaction.pointerIsDown = false;
      return reflowPromise;
    }
    
    var ___default_44 = {
      id: 'reflow',
      install: __install_44
    };
    _$reflow_44["default"] = ___default_44;
    
    var _$interact_28 = {};
    "use strict";
    
    Object.defineProperty(_$interact_28, "__esModule", {
      value: true
    });
    _$interact_28["default"] = _$interact_28.scope = _$interact_28.interact = void 0;
    
    var ___scope_28 = _$scope_24({});
    
    var __utils_28 = ___interopRequireWildcard_28(_$utils_56);
    
    var ___browser_28 = ___interopRequireDefault_28(_$browser_48);
    
    var ___events_28 = ___interopRequireDefault_28(_$events_52);
    
    function ___interopRequireDefault_28(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_28(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    /** @module interact */
    var globalEvents = {};
    var scope = new ___scope_28.Scope();
    /**
     * ```js
     * interact('#draggable').draggable(true)
     *
     * var rectables = interact('rect')
     * rectables
     *   .gesturable(true)
     *   .on('gesturemove', function (event) {
     *       // ...
     *   })
     * ```
     *
     * The methods of this variable can be used to set elements as interactables
     * and also to change various default settings.
     *
     * Calling it as a function and passing an element or a valid CSS selector
     * string returns an Interactable object which has various methods to configure
     * it.
     *
     * @global
     *
     * @param {Element | string} target The HTML or SVG Element to interact with
     * or CSS selector
     * @return {Interactable}
     */
    
    _$interact_28.scope = scope;
    
    var interact = function interact(target, options) {
      var interactable = scope.interactables.get(target, options);
    
      if (!interactable) {
        interactable = scope.interactables["new"](target, options);
        interactable.events.global = globalEvents;
      }
    
      return interactable;
    };
    /**
     * Use a plugin
     *
     * @alias module:interact.use
     *
     * @param {Object} plugin
     * @param {function} plugin.install
     * @return {interact}
     */
    
    
    _$interact_28.interact = interact;
    interact.use = use;
    
    function use(plugin, options) {
      scope.usePlugin(plugin, options);
      return interact;
    }
    /**
     * Check if an element or selector has been set with the {@link interact}
     * function
     *
     * @alias module:interact.isSet
     *
     * @param {Element} element The Element being searched for
     * @return {boolean} Indicates if the element or CSS selector was previously
     * passed to interact
     */
    
    
    interact.isSet = isSet;
    
    function isSet(target, options) {
      return !!scope.interactables.get(target, options && options.context);
    }
    /**
     * Add a global listener for an InteractEvent or adds a DOM event to `document`
     *
     * @alias module:interact.on
     *
     * @param {string | array | object} type The types of events to listen for
     * @param {function} listener The function event (s)
     * @param {object | boolean} [options] object or useCapture flag for
     * addEventListener
     * @return {object} interact
     */
    
    
    interact.on = on;
    
    function on(type, listener, options) {
      if (__utils_28.is.string(type) && type.search(' ') !== -1) {
        type = type.trim().split(/ +/);
      }
    
      if (__utils_28.is.array(type)) {
        for (var _i = 0; _i < type.length; _i++) {
          var _ref;
    
          _ref = type[_i];
          var eventType = _ref;
          interact.on(eventType, listener, options);
        }
    
        return interact;
      }
    
      if (__utils_28.is.object(type)) {
        for (var prop in type) {
          interact.on(prop, type[prop], listener);
        }
    
        return interact;
      } // if it is an InteractEvent type, add listener to globalEvents
    
    
      if (__utils_28.arr.contains(scope.actions.eventTypes, type)) {
        // if this type of event was never bound
        if (!globalEvents[type]) {
          globalEvents[type] = [listener];
        } else {
          globalEvents[type].push(listener);
        }
      } // If non InteractEvent type, addEventListener to document
      else {
          ___events_28["default"].add(scope.document, type, listener, {
            options: options
          });
        }
    
      return interact;
    }
    /**
     * Removes a global InteractEvent listener or DOM event from `document`
     *
     * @alias module:interact.off
     *
     * @param {string | array | object} type The types of events that were listened
     * for
     * @param {function} listener The listener function to be removed
     * @param {object | boolean} options [options] object or useCapture flag for
     * removeEventListener
     * @return {object} interact
     */
    
    
    interact.off = off;
    
    function off(type, listener, options) {
      if (__utils_28.is.string(type) && type.search(' ') !== -1) {
        type = type.trim().split(/ +/);
      }
    
      if (__utils_28.is.array(type)) {
        for (var _i2 = 0; _i2 < type.length; _i2++) {
          var _ref2;
    
          _ref2 = type[_i2];
          var eventType = _ref2;
          interact.off(eventType, listener, options);
        }
    
        return interact;
      }
    
      if (__utils_28.is.object(type)) {
        for (var prop in type) {
          interact.off(prop, type[prop], listener);
        }
    
        return interact;
      }
    
      if (!__utils_28.arr.contains(scope.actions.eventTypes, type)) {
        ___events_28["default"].remove(scope.document, type, listener, options);
      } else {
        var index;
    
        if (type in globalEvents && (index = globalEvents[type].indexOf(listener)) !== -1) {
          globalEvents[type].splice(index, 1);
        }
      }
    
      return interact;
    }
    /**
     * Returns an object which exposes internal data
     * @alias module:interact.debug
     *
     * @return {object} An object with properties that outline the current state
     * and expose internal functions and variables
     */
    
    
    interact.debug = debug;
    
    function debug() {
      return scope;
    } // expose the functions used to calculate multi-touch properties
    
    
    interact.getPointerAverage = __utils_28.pointer.pointerAverage;
    interact.getTouchBBox = __utils_28.pointer.touchBBox;
    interact.getTouchDistance = __utils_28.pointer.touchDistance;
    interact.getTouchAngle = __utils_28.pointer.touchAngle;
    interact.getElementRect = __utils_28.dom.getElementRect;
    interact.getElementClientRect = __utils_28.dom.getElementClientRect;
    interact.matchesSelector = __utils_28.dom.matchesSelector;
    interact.closest = __utils_28.dom.closest;
    /**
     * @alias module:interact.supportsTouch
     *
     * @return {boolean} Whether or not the browser supports touch input
     */
    
    interact.supportsTouch = supportsTouch;
    
    function supportsTouch() {
      return ___browser_28["default"].supportsTouch;
    }
    /**
     * @alias module:interact.supportsPointerEvent
     *
     * @return {boolean} Whether or not the browser supports PointerEvents
     */
    
    
    interact.supportsPointerEvent = supportsPointerEvent;
    
    function supportsPointerEvent() {
      return ___browser_28["default"].supportsPointerEvent;
    }
    /**
     * Cancels all interactions (end events are not fired)
     *
     * @alias module:interact.stop
     *
     * @return {object} interact
     */
    
    
    interact.stop = __stop_28;
    
    function __stop_28() {
      for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
        var _ref3;
    
        _ref3 = scope.interactions.list[_i3];
        var interaction = _ref3;
        interaction.stop();
      }
    
      return interact;
    }
    /**
     * Returns or sets the distance the pointer must be moved before an action
     * sequence occurs. This also affects tolerance for tap events.
     *
     * @alias module:interact.pointerMoveTolerance
     *
     * @param {number} [newValue] The movement from the start position must be greater than this value
     * @return {interact | number}
     */
    
    
    interact.pointerMoveTolerance = pointerMoveTolerance;
    
    function pointerMoveTolerance(newValue) {
      if (__utils_28.is.number(newValue)) {
        scope.interactions.pointerMoveTolerance = newValue;
        return interact;
      }
    
      return scope.interactions.pointerMoveTolerance;
    }
    
    scope.interactables.signals.on('unset', function (_ref4) {
      var interactable = _ref4.interactable;
      scope.interactables.list.splice(scope.interactables.list.indexOf(interactable), 1); // Stop related interactions when an Interactable is unset
    
      for (var _i4 = 0; _i4 < scope.interactions.list.length; _i4++) {
        var _ref5;
    
        _ref5 = scope.interactions.list[_i4];
        var interaction = _ref5;
    
        if (interaction.interactable === interactable && interaction.interacting() && !interaction._ending) {
          interaction.stop();
        }
      }
    });
    
    interact.addDocument = function (doc, options) {
      return scope.addDocument(doc, options);
    };
    
    interact.removeDocument = function (doc) {
      return scope.removeDocument(doc);
    };
    
    scope.interact = interact;
    var ___default_28 = interact;
    _$interact_28["default"] = ___default_28;
    
    var _$interact_27 = {};
    "use strict";
    
    Object.defineProperty(_$interact_27, "__esModule", {
      value: true
    });
    _$interact_27.init = __init_27;
    Object.defineProperty(_$interact_27, "autoScroll", {
      enumerable: true,
      get: function get() {
        return _autoScroll["default"];
      }
    });
    Object.defineProperty(_$interact_27, "interactablePreventDefault", {
      enumerable: true,
      get: function get() {
        return _interactablePreventDefault["default"];
      }
    });
    Object.defineProperty(_$interact_27, "inertia", {
      enumerable: true,
      get: function get() {
        return _inertia["default"];
      }
    });
    Object.defineProperty(_$interact_27, "modifiers", {
      enumerable: true,
      get: function get() {
        return ___base_27["default"];
      }
    });
    Object.defineProperty(_$interact_27, "reflow", {
      enumerable: true,
      get: function get() {
        return _reflow["default"];
      }
    });
    Object.defineProperty(_$interact_27, "interact", {
      enumerable: true,
      get: function get() {
        return _interact["default"];
      }
    });
    _$interact_27.pointerEvents = _$interact_27.actions = _$interact_27["default"] = void 0;
    
    var actions = ___interopRequireWildcard_27(_$actions_5);
    
    _$interact_27.actions = actions;
    
    var _autoScroll = ___interopRequireDefault_27(_$autoScroll_7);
    
    var autoStart = ___interopRequireWildcard_27(_$autoStart_12);
    
    var _interactablePreventDefault = ___interopRequireDefault_27(_$interactablePreventDefault_21);
    
    var _devTools = ___interopRequireDefault_27(_$devTools_25);
    
    var _inertia = ___interopRequireDefault_27(_$inertia_26);
    
    var modifiers = ___interopRequireWildcard_27(_$modifiers_31);
    
    var ___base_27 = ___interopRequireDefault_27(_$base_30);
    
    var __pointerEvents_27 = ___interopRequireWildcard_27(_$pointerEvents_42);
    
    _$interact_27.pointerEvents = __pointerEvents_27;
    
    var _reflow = ___interopRequireDefault_27(_$reflow_44);
    
    var _interact = ___interopRequireWildcard_27(_$interact_28);
    
    function ___interopRequireDefault_27(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_27(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function __init_27(window) {
      _interact.scope.init(window);
    
      _interact["default"].use(_interactablePreventDefault["default"]); // pointerEvents
    
    
      _interact["default"].use(__pointerEvents_27); // inertia
    
    
      _interact["default"].use(_inertia["default"]); // autoStart, hold
    
    
      _interact["default"].use(autoStart); // drag and drop, resize, gesture
    
    
      _interact["default"].use(actions); // snap, resize, etc.
    
    
      _interact["default"].use(___base_27["default"]); // for backwrads compatibility
    
    
      for (var type in modifiers) {
        var _modifiers$type = modifiers[type],
            _defaults = _modifiers$type._defaults,
            _methods = _modifiers$type._methods;
        _defaults._methods = _methods;
        _interact.scope.defaults.perAction[type] = _defaults;
      } // autoScroll
    
    
      _interact["default"].use(_autoScroll["default"]); // reflow
    
    
      _interact["default"].use(_reflow["default"]); // eslint-disable-next-line no-undef
    
    
      if ("production" !== 'production') {
        _interact["default"].use(_devTools["default"]);
      }
    
      return _interact["default"];
    } // eslint-disable-next-line no-undef
    
    
    _interact["default"].version = "1.5.3";
    var ___default_27 = _interact["default"];
    _$interact_27["default"] = ___default_27;
    
    var _$types_45 = {};
    /// <reference path="./types.d.ts" />
    "use strict";
    
    var _$grid_64 = {};
    "use strict";
    
    Object.defineProperty(_$grid_64, "__esModule", {
      value: true
    });
    _$grid_64["default"] = void 0;
    
    function ___slicedToArray_64(arr, i) { return ___arrayWithHoles_64(arr) || ___iterableToArrayLimit_64(arr, i) || ___nonIterableRest_64(); }
    
    function ___nonIterableRest_64() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
    
    function ___iterableToArrayLimit_64(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
    
    function ___arrayWithHoles_64(arr) { if (Array.isArray(arr)) return arr; }
    
    function createGrid(grid) {
      var coordFields = [['x', 'y'], ['left', 'top'], ['right', 'bottom'], ['width', 'height']].filter(function (_ref) {
        var _ref2 = ___slicedToArray_64(_ref, 2),
            xField = _ref2[0],
            yField = _ref2[1];
    
        return xField in grid || yField in grid;
      });
      return function (x, y) {
        var range = grid.range,
            _grid$limits = grid.limits,
            limits = _grid$limits === void 0 ? {
          left: -Infinity,
          right: Infinity,
          top: -Infinity,
          bottom: Infinity
        } : _grid$limits,
            _grid$offset = grid.offset,
            offset = _grid$offset === void 0 ? {
          x: 0,
          y: 0
        } : _grid$offset;
        var result = {
          range: range
        };
    
        for (var _i2 = 0; _i2 < coordFields.length; _i2++) {
          var _ref3;
    
          _ref3 = coordFields[_i2];
    
          var _ref4 = _ref3,
              _ref5 = ___slicedToArray_64(_ref4, 2),
              xField = _ref5[0],
              yField = _ref5[1];
    
          var gridx = Math.round((x - offset.x) / grid[xField]);
          var gridy = Math.round((y - offset.y) / grid[yField]);
          result[xField] = Math.max(limits.left, Math.min(limits.right, gridx * grid[xField] + offset.x));
          result[yField] = Math.max(limits.top, Math.min(limits.bottom, gridy * grid[yField] + offset.y));
        }
    
        return result;
      };
    }
    
    var ___default_64 = createGrid;
    _$grid_64["default"] = ___default_64;
    
    var _$snappers_65 = {};
    "use strict";
    
    Object.defineProperty(_$snappers_65, "__esModule", {
      value: true
    });
    Object.defineProperty(_$snappers_65, "grid", {
      enumerable: true,
      get: function get() {
        return _grid["default"];
      }
    });
    
    var _grid = ___interopRequireDefault_65(_$grid_64);
    
    function ___interopRequireDefault_65(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    var _$index_29 = { exports: {} };
    "use strict";
    
    Object.defineProperty(_$index_29.exports, "__esModule", {
      value: true
    });
    _$index_29.exports.init = __init_29;
    _$index_29.exports["default"] = void 0;
    
    var ___interact_29 = ___interopRequireWildcard_29(_$interact_27);
    
    var __modifiers_29 = ___interopRequireWildcard_29(_$modifiers_31);
    
    _$types_45;
    
    var ___extend_29 = ___interopRequireDefault_29(_$extend_53);
    
    var snappers = ___interopRequireWildcard_29(_$snappers_65);
    
    function ___interopRequireDefault_29(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
    
    function ___interopRequireWildcard_29(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
    
    function ___typeof_29(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_29 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_29 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_29(obj); }
    
    if ((typeof window === "undefined" ? "undefined" : ___typeof_29(window)) === 'object' && !!window) {
      __init_29(window);
    }
    
    function __init_29(win) {
      (0, ___interact_29.init)(win);
      return ___interact_29["default"].use({
        id: 'interactjs',
        install: function install() {
          ___interact_29["default"].modifiers = (0, ___extend_29["default"])({}, __modifiers_29);
          ___interact_29["default"].snappers = snappers;
          ___interact_29["default"].createSnapGrid = ___interact_29["default"].snappers.grid;
        }
      });
    }
    
    var ___default_29 = ___interact_29["default"];
    _$index_29.exports["default"] = ___default_29;
    ___interact_29["default"]['default'] = ___interact_29["default"]; // tslint:disable-line no-string-literal
    
    ___interact_29["default"]['init'] = __init_29; // tslint:disable-line no-string-literal
    
    if (("object" === "undefined" ? "undefined" : ___typeof_29(_$index_29)) === 'object' && !!_$index_29) {
      _$index_29.exports = ___interact_29["default"];
    }
    
    _$index_29 = _$index_29.exports
    return _$index_29;
    
    });
    
    
    //# sourceMappingURL=interact.js.map