!function(e){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):"undefined"!=typeof module&&module.exports?e(require("jquery")):e(jQuery)}(function(ae){"use strict";var ue="left",se="right",ce="up",pe="down",fe="in",he="out",ge="none",de="auto",we="swipe",ve="pinch",Te="tap",ye="doubletap",Ee="longtap",me="horizontal",xe="vertical",be="all",Se=10,Oe="start",Me="move",Pe="end",De="cancel",Le="ontouchstart"in window,Re=window.navigator.msPointerEnabled&&!window.PointerEvent&&!Le,ke=(window.PointerEvent||window.navigator.msPointerEnabled)&&!Le,Ae="TouchSwipe";function r(e,a){a=ae.extend({},a);var t=Le||ke||!a.fallbackToMouseEvents,n=t?ke?Re?"MSPointerDown":"pointerdown":"touchstart":"mousedown",r=t?ke?Re?"MSPointerMove":"pointermove":"touchmove":"mousemove",i=t?ke?Re?"MSPointerUp":"pointerup":"touchend":"mouseup",l=t?ke?"mouseleave":null:"mouseleave",o=ke?Re?"MSPointerCancel":"pointercancel":"touchcancel",u=0,s=null,c=null,p=0,f=0,h=0,g=1,d=0,w=0,v=null,T=ae(e),y="start",E=0,m={},x=0,b=0,S=0,O=0,M=0,P=null,D=null;try{T.on(n,L),T.on(o,A)}catch(e){ae.error("events not supported "+n+","+o+" on jQuery.swipe")}function L(e){if(!0!==T.data(Ae+"_intouch")&&!(0t.left&&e.xt.top&&e.ya.longTapThreshold&&u=a.threshold),e}function q(){var e=!1;return null!==a.cancelThreshold&&null!==s&&(e=te(s)-u>=a.cancelThreshold),e}function Q(){return!a.maxTimeThreshold||!(p>=a.maxTimeThreshold)}function C(){var e=V(),t=W(),n=null===a.pinchThreshold||d>=a.pinchThreshold;return e&&t&&n}function F(){return!!(a.pinchStatus||a.pinchIn||a.pinchOut)}function X(){var e=Q(),t=_(),n=V(),r=W();return!q()&&r&&n&&t&&e}function Y(){return!!(a.swipe||a.swipeStatus||a.swipeLeft||a.swipeRight||a.swipeUp||a.swipeDown)}function V(){return E===a.fingers||a.fingers===be||!Le}function W(){return 0!==m[0].end.x}function z(){return!!a.tap}function G(){return!!a.doubleTap}function Z(){if(null==M)return!1;var e=oe();return G()&&e-M<=a.doubleTapThreshold}function B(){O=S=0}function J(){var e=!1;S&&oe()-S<=a.fingerReleaseThreshold&&(e=!0);return e}function K(e){T&&(!0===e?(T.on(r,R),T.on(i,k),l&&T.on(l,I)):(T.off(r,R,!1),T.off(i,k,!1),l&&T.off(l,I,!1)),T.data(Ae+"_intouch",!0===e))}function $(e,t){var n={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return n.start.x=n.last.x=n.end.x=t.pageX||t.clientX,n.start.y=n.last.y=n.end.y=t.pageY||t.clientY,m[e]=n}function ee(e){var t=void 0!==e.identifier?e.identifier:0,n=function(e){return m[e]||null}(t);return null===n&&(n=$(t,e)),n.last.x=n.end.x,n.last.y=n.end.y,n.end.x=e.pageX||e.clientX,n.end.y=e.pageY||e.clientY,n}function te(e){if(v[e])return v[e].distance}function ne(e){return{direction:e,distance:0}}function re(){return b-x}function ie(e,t){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.round(Math.sqrt(n*n+r*r))}function le(e,t){if(function(e,t){return e.x==t.x&&e.y==t.y}(e,t))return ge;var n=function(e,t){var n=e.x-t.x,r=t.y-e.y,i=Math.atan2(r,n),l=Math.round(180*i/Math.PI);return l<0&&(l=360-Math.abs(l)),l}(e,t);return n<=45&&0<=n?ue:n<=360&&315<=n?ue:135<=n&&n<=225?se:45