var ImageDetailSwipe;(function(n){var t=function(){function n(n,t,i,r,u,f,e,o,s){e===void 0&&(e=!0);o===void 0&&(o=5);s===void 0&&(s=!1);var h=this;if(this.utils=pMMUtils,this.moved=!1,this.doubletap=!1,this.touchStartPoint=null,this.touchStartElementLeft=0,this.nowtouchpid=0,this.swipeDelta=null,this.touchStartTime=0,this.timeDelta=0,this.captureEvent=!0,this.enableEndHandlerWithoutMove=!1,this.moveSensitivity=5,this.cleanUp=function(){h.handleEventsSetting(!1)},this.isMoved=function(){return h.moved},this.resetMoved=function(){h.moved=!1},this.handleEventsSetting=function(n){var t=n?sj_be:sj_ue;typeof sb_de!="undefined"&&("ontouchstart"in sb_de?(t(h.touchElement,"touchstart",h.touchStart,h.captureEvent),t(h.touchElement,"touchmove",h.touchMove,h.captureEvent),t(h.touchElement,"touchend",h.touchEnd,h.captureEvent)):window.navigator.msPointerEnabled?(h.touchElement.style.msTouchAction="none",h.touchElement.style.touchAction="none",t(h.touchElement,"MSPointerDown",h.touchStart,h.captureEvent),t(h.touchElement,"MSPointerMove",h.touchMove,h.captureEvent),t(h.touchElement,"MSPointerUp",h.touchEnd,h.captureEvent),t(_d,"MSPointerUp",h.touchEnd,h.captureEvent)):"onpointermove"in sb_de&&(h.touchElement.style.msTouchAction="none",h.touchElement.style.touchAction="none",t(h.touchElement,"pointerdown",h.touchStart,h.captureEvent),t(h.touchElement,"pointermove",h.touchMove,h.captureEvent),t(h.touchElement,"pointerup",h.touchEnd,h.captureEvent),t(_d,"pointerup",h.touchEnd,h.captureEvent)),t(_d,"mousedown",h.resetMoved,!0))},this.getHandlerOrEmpty=function(n){return n!=null?n:h.Empty},this.Empty=function(){},this.setMoved=function(n){n===void 0&&(n=!1);h.moved=n},this.checkIfDoubleTap=function(){return sb_gt()-h.touchStartTime<250&&!!h.doubleTapHandler&&!h.isMoved()},this.touchStart=function(n){if(h.isTouchEvent(n)&&(h.doubletap=h.checkIfDoubleTap(),!h.doubletap)){h.setMoved(!1);h.touchStartPoint=h.getTouchPointFromEvent(n);var t=h.utils.gcs(h.touchElement);h.touchStartElementLeft=parseInt(typeof _G!="undefined"&&_G.RTL?t.marginRight:t.marginLeft);h.touchStartTime=sb_gt();!n.pointerId||(h.nowtouchpid=n.pointerId);h.touchStartHandler(n)}},this.touchMove=function(n){if(h.isTouchEvent(n)&&h.isValidTouch(n)){var t=h.getTouchPointFromEvent(n);if(!h.touchStartPoint||!t)return;h.swipeDelta=h.getDistanceBetweenPoints(h.touchStartPoint,t);h.setMoved(Math.abs(h.swipeDelta.X)>h.moveSensitivity||Math.abs(h.swipeDelta.Y)>h.moveSensitivity);h.isMoved()&&!h.doubletap&&h.touchMoveHandler(h.touchStartElementLeft,h.swipeDelta)&&h.preventDefault(n)}},this.touchEnd=function(n){var t=h.isMoved(),i;h.isTouchEvent(n)&&(h.doubletap&&!h.isMoved()?(h.doubleTapHandler(n),h.preventDefault(n),h.doubletap=!1):(t||h.enableEndHandlerWithoutMove)&&h.isValidTouch(n)&&(h.timeDelta=sb_gt()-h.touchStartTime,i=t?h.swipeDelta:h.getNewPoint(),h.touchEndHandler(h.touchStartElementLeft,i,h.timeDelta)&&h.preventDefault(n)),sj_ue(_d,"mousedown",h.resetMoved,!0),sb_st(function(){sj_be(_d,"mousedown",this.resetMoved,!0)},150))},this.preventDefault=function(n){n.stopPropagation();n.preventDefault()},this.getTouchPointFromEvent=function(n){var t=h.getNewPoint();return t.X=n.touches?n.touches[0].pageX:n.pageX!=undefined&&n.pageX!=0?n.pageX:0,t.Y=n.touches?n.touches[0].pageY:n.pageY!=undefined&&n.pageY!=0?n.pageY:0,t},this.getDistanceBetweenPoints=function(n,t){var i=h.getNewPoint();return i.X=t.X-n.X,i.Y=t.Y-n.Y,i},this.getNewPoint=function(){return{X:0,Y:0}},this.isTouchEvent=function(n){return typeof n.pointerType=="undefined"||n.pointerType==2||n.pointerType=="touch"||n.pointerType=="pen"},this.isValidTouch=function(n){return!n.pointerId||n.pointerId==h.nowtouchpid},!n)throw"container cannot be null!";this.container=n;this.touchElement=!t?this.container:t;this.touchStartHandler=this.getHandlerOrEmpty(i);this.touchMoveHandler=this.getHandlerOrEmpty(r);this.touchEndHandler=this.getHandlerOrEmpty(u);this.doubleTapHandler=this.getHandlerOrEmpty(f);this.enableEndHandlerWithoutMove=s;this.captureEvent=e;this.moveSensitivity=o;this.handleEventsSetting(!0)}return n}();n.MmReactSwipe=t})(ImageDetailSwipe||(ImageDetailSwipe={}))