(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{167:function(module,exports,__webpack_require__){function touchX(event){return event.touches[0].clientX}function touchY(event){return event.touches[0].clientY}var isPassiveSupported=function(){var supportsPassive=!1;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassive=!0}});window.addEventListener("test",null,opts)}catch(e){}return supportsPassive}(),vueTouchEvents={install:function(Vue,options){function touchStartEvent(event){var $this=this.$$touchObj;$this.supportTouch=!0,$this.touchStarted||(addTouchClass(this),$this.touchStarted=!0,$this.touchMoved=!1,$this.swipeOutBounded=!1,$this.startX=touchX(event),$this.startY=touchY(event),$this.currentX=0,$this.currentY=0,$this.touchStartTime=event.timeStamp,triggerEvent(event,this,"start"))}function touchMoveEvent(event){var $this=this.$$touchObj;if($this.currentX=touchX(event),$this.currentY=touchY(event),$this.touchMoved){if(!$this.swipeOutBounded){var swipeOutBounded=options.swipeTolerance;$this.swipeOutBounded=Math.abs($this.startX-$this.currentX)>swipeOutBounded&&Math.abs($this.startY-$this.currentY)>swipeOutBounded}}else{var tapTolerance=options.tapTolerance;$this.touchMoved=Math.abs($this.startX-$this.currentX)>tapTolerance||Math.abs($this.startY-$this.currentY)>tapTolerance,$this.touchMoved&&triggerEvent(event,this,"moved")}$this.touchMoved&&triggerEvent(event,this,"moving")}function touchCancelEvent(){var $this=this.$$touchObj;removeTouchClass(this),$this.touchStarted=$this.touchMoved=!1,$this.startX=$this.startY=0}function touchEndEvent(event){var $this=this.$$touchObj;if($this.touchStarted=!1,removeTouchClass(this),$this.touchMoved){if(!$this.swipeOutBounded){var direction,swipeOutBounded=options.swipeTolerance;direction=Math.abs($this.startX-$this.currentX)$this.currentY?"top":"bottom":$this.startX>$this.currentX?"left":"right",$this.callbacks["swipe."+direction]?triggerEvent(event,this,"swipe."+direction,direction):triggerEvent(event,this,"swipe",direction)}}else $this.callbacks.longtap&&event.timeStamp-$this.touchStartTime>options.longTapTimeInterval?(event.preventDefault(),triggerEvent(event,this,"longtap")):triggerEvent(event,this,"tap"),triggerEvent(event,this,"end")}function clickEvent(event){this.$$touchObj.supportTouch||options.disableClick||triggerEvent(event,this,"tap")}function mouseDownEvent(event){this.$$touchObj.supportTouch||options.disableClick||triggerEvent(event,this,"start")}function mouseUpEvent(event){this.$$touchObj.supportTouch||options.disableClick||triggerEvent(event,this,"end")}function mouseEnterEvent(){addTouchClass(this)}function mouseLeaveEvent(){removeTouchClass(this)}function triggerEvent(e,$el,eventType,param){var callbacks=$el.$$touchObj.callbacks[eventType]||[];if(0===callbacks.length)return null;for(var i=0;i=0){var _e="swipe."+i;$el.$$touchObj.callbacks[_e]=$el.$$touchObj.callbacks[_e]||[],$el.$$touchObj.callbacks[_e].push(binding)}}else $el.$$touchObj.callbacks.swipe=$el.$$touchObj.callbacks.swipe||[],$el.$$touchObj.callbacks.swipe.push(binding);break;default:$el.$$touchObj.callbacks[eventType]=$el.$$touchObj.callbacks[eventType]||[],$el.$$touchObj.callbacks[eventType].push(binding)}if(!$el.$$touchObj.hasBindTouchEvents){var passiveOpt=!!isPassiveSupported&&{passive:!0};$el.addEventListener("touchstart",touchStartEvent,passiveOpt),$el.addEventListener("touchmove",touchMoveEvent,passiveOpt),$el.addEventListener("touchcancel",touchCancelEvent),$el.addEventListener("touchend",touchEndEvent),options.disableClick||($el.addEventListener("click",clickEvent),$el.addEventListener("mousedown",mouseDownEvent),$el.addEventListener("mouseup",mouseUpEvent),$el.addEventListener("mouseenter",mouseEnterEvent),$el.addEventListener("mouseleave",mouseLeaveEvent)),$el.$$touchObj.hasBindTouchEvents=!0}},unbind:function($el){$el.removeEventListener("touchstart",touchStartEvent),$el.removeEventListener("touchmove",touchMoveEvent),$el.removeEventListener("touchcancel",touchCancelEvent),$el.removeEventListener("touchend",touchEndEvent),options.disableClick||($el.removeEventListener("click",clickEvent),$el.removeEventListener("mousedown",mouseDownEvent),$el.removeEventListener("mouseup",mouseUpEvent),$el.removeEventListener("mouseenter",mouseEnterEvent),$el.removeEventListener("mouseleave",mouseLeaveEvent)),delete $el.$$touchObj}}),Vue.directive("touch-class",{bind:function($el,binding){$el.$$touchClass=binding.value},unbind:function($el){delete $el.$$touchClass}})}};module.exports=vueTouchEvents}}]);