(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
    typeof define === 'function' && define.amd ? define(['exports'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.swipey = {}));
})(this, (function (exports) { 'use strict';

    // import initSwipeyJqueryPlugin from './swipey.jquery.plugin';
    class SwipeAnimation {
        bindEvents() {
            if (window['PointerEvent']) {
                return ['pointer'];
            }
            return ['touch'];
        }
        bounds(e, $d) { return {}; }
        context() { return {}; }
        direction() { return $.fn.swipey.DIRECTIONS.HORIZONTAL; }
        setGesturesEnabled(enabled) { this._isGesturesEnabled = enabled; }
        isGesturesEnabled() { return this._isGesturesEnabled; }
        goToLower(time) {
            this._$ele.swipeAnimation('gotoLower', time);
        }
        goToUpper(time) {
            this._$ele.swipeAnimation('gotoUpper', time);
        }
        onAnimation(e, distanceMoved) { }
        onUpper(event) { }
        onLower(event) { }
        threshold() { return 30; }
        constructor() {
            this._isGesturesEnabled = true;
        }
        init($ele, $swipeTargetEle) {
            this._$ele = $ele;
            $ele.swipeAnimation({
                animation: this.animation(),
                target: $swipeTargetEle,
                bounds: this.bounds.bind(this),
                bindEvents: this.bindEvents(),
                context: this.context.bind(this),
                direction: this.direction(),
                enableGestures: this.isGesturesEnabled.bind(this),
                onAnimation: this.onAnimation.bind(this),
                onLower: this.onLower.bind(this),
                onUpper: this.onUpper.bind(this),
                threshold: this.threshold(),
                disableMouse: true
            });
        }
    }

    exports.SwipeAnimation = SwipeAnimation;

}));
