function $AdfSwipeSupport$$($element$$397$$, $callbacks$$8$$, $options$$53$$) {
  this.Init($element$$397$$, $callbacks$$8$$, $options$$53$$);
}
$goog$exportSymbol$$("AdfSwipeSupport", $AdfSwipeSupport$$);
$AdfObject$$.$createSubclass$($AdfSwipeSupport$$);
$AdfSwipeSupport$$.$InitClass$ = function $$AdfSwipeSupport$$$$InitClass$$() {
  this.$DIRECTION_LEFT$ = 1;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_LEFT", $AdfSwipeSupport$$.$DIRECTION_LEFT$);
  this.$DIRECTION_RIGHT$ = 2;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_RIGHT", $AdfSwipeSupport$$.$DIRECTION_RIGHT$);
  this.$DIRECTION_UP$ = 3;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_UP", $AdfSwipeSupport$$.$DIRECTION_UP$);
  this.$DIRECTION_DOWN$ = 4;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_DOWN", $AdfSwipeSupport$$.$DIRECTION_DOWN$);
  this.$PANSTART_CALLBACK$ = "panstart";
  $goog$exportSymbol$$("AdfSwipeSupport.PANSTART_CALLBACK", $AdfSwipeSupport$$.$PANSTART_CALLBACK$);
  this.$PANNING_CALLBACK$ = "panning";
  $goog$exportSymbol$$("AdfSwipeSupport.PANNING_CALLBACK", $AdfSwipeSupport$$.$PANNING_CALLBACK$);
  this.$PANEND_CALLBACK$ = "panend";
  $goog$exportSymbol$$("AdfSwipeSupport.PANEND_CALLBACK", $AdfSwipeSupport$$.$PANEND_CALLBACK$);
  this.$PANCANCEL_CALLBACK$ = "pancancel";
  $goog$exportSymbol$$("AdfSwipeSupport.PANCANCEL_CALLBACK", $AdfSwipeSupport$$.$PANCANCEL_CALLBACK$);
  this.$SWIPE_CALLBACK$ = "swipe";
  $goog$exportSymbol$$("AdfSwipeSupport.SWIPE_CALLBACK", $AdfSwipeSupport$$.$SWIPE_CALLBACK$);
  this.$SUPPORT_MOUSE$ = "mouseSupport";
  $goog$exportSymbol$$("AdfSwipeSupport.SUPPORT_MOUSE", $AdfSwipeSupport$$.$SUPPORT_MOUSE$);
  this.MODE = "mode";
  $goog$exportSymbol$$("AdfSwipeSupport.MODE", $AdfSwipeSupport$$.MODE);
  this.$MODE_VERTICAL$ = 1;
  $goog$exportSymbol$$("AdfSwipeSupport.MODE_VERTICAL", $AdfSwipeSupport$$.$MODE_VERTICAL$);
  this.$CALLBACK_PARAM$ = "cp";
  $goog$exportSymbol$$("AdfSwipeSupport.CALLBACK_PARAM", $AdfSwipeSupport$$.$CALLBACK_PARAM$);
  this.$_SWIPE_VELOCITY_THRESHOLD$ = .3;
  this.$_SWIPE_DISTANCE_THRESHOLD$ = 10;
  this.$_MOUSE_SWIPE_DISTANCE_THRESHOLD$ = 3;
  this.$_TOUCH_ACTION_PANX_CLASS$ = "AFPrivateTouchActionPanX";
  this.$_TOUCH_ACTION_PANY_CLASS$ = "AFPrivateTouchActionPanY";
  this.$_USER_SELECT_NONE_CLASS$ = "AFPrivateUserSelectNone";
};
$goog$exportSymbol$$("AdfSwipeSupport.InitClass", $AdfSwipeSupport$$.$InitClass$);
$AdfSwipeSupport$$.prototype.Init = function $$AdfSwipeSupport$$$$Init$($element$$398$$, $callbacks$$9$$, $options$$54$$) {
  $AdfSwipeSupport$$.$superclass$.Init.call(this);
  this.$_element$ = $element$$398$$;
  this.$_callbacks$ = $callbacks$$9$$;
  this.$_supportMouse$ = $options$$54$$ && $options$$54$$[$AdfSwipeSupport$$.$SUPPORT_MOUSE$];
  this.$_isVertical$ = $options$$54$$ && $options$$54$$[$AdfSwipeSupport$$.MODE] === $AdfSwipeSupport$$.$MODE_VERTICAL$;
  this.$_callbackParam$ = $options$$54$$ && $options$$54$$[$AdfSwipeSupport$$.$CALLBACK_PARAM$];
  this.$_usesPointerEvents$ = void 0 === window.ontouchstart;
  $AdfDomUtils$$.$addCSSClassName$($element$$398$$, this.$_isVertical$ ? $AdfSwipeSupport$$.$_TOUCH_ACTION_PANX_CLASS$ : $AdfSwipeSupport$$.$_TOUCH_ACTION_PANY_CLASS$);
  this.$_usesPointerEvents$ ? (this.$_pointerDownHandler$ = this.$createCallback$(this.$_handlePointerDown$), $element$$398$$.addEventListener("pointerdown", this.$_pointerDownHandler$, !1)) : (this.$_touchStartHandler$ = this.$createCallback$(this.$_handleTouchStart$), $element$$398$$.addEventListener("touchstart", this.$_touchStartHandler$, !1));
  this.$_supportMouse$ && ($AdfDomUtils$$.$addCSSClassName$($element$$398$$, $AdfSwipeSupport$$.$_USER_SELECT_NONE_CLASS$), this.$_mouseDownHandler$ = this.$createCallback$(this.$_handleMouseDown$), $element$$398$$.addEventListener("mousedown", this.$_mouseDownHandler$, !1));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfSwipeSupport.prototype.Init", {Init:$AdfSwipeSupport$$.prototype.Init});
$AdfSwipeSupport$$.prototype.release = function $$AdfSwipeSupport$$$$release$() {
  this.$_isPanning$ && $JSCompiler_StaticMethods__cleanupState$$(this);
  var $element$$399$$ = this.$_element$;
  this.$_callbackParam$ = this.$_callbacks$ = this.$_element$ = null;
  this.$_usesPointerEvents$ ? $element$$399$$.removeEventListener("pointerdown", this.$_pointerDownHandler$, !1) : $element$$399$$.removeEventListener("touchstart", this.$_touchStartHandler$, !1);
  $AdfDomUtils$$.$removeCSSClassName$($element$$399$$, this.$_isVertical$ ? $AdfSwipeSupport$$.$_TOUCH_ACTION_PANX_CLASS$ : $AdfSwipeSupport$$.$_TOUCH_ACTION_PANY_CLASS$);
  this.$_supportMouse$ && ($element$$399$$.removeEventListener("mousedown", this.$_mouseDownHandler$, !1), $AdfDomUtils$$.$removeCSSClassName$($element$$399$$, $AdfSwipeSupport$$.$_USER_SELECT_NONE_CLASS$));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfSwipeSupport.prototype.release", {release:$AdfSwipeSupport$$.prototype.release});
$JSCompiler_prototypeAlias$$ = $AdfSwipeSupport$$.prototype;
$JSCompiler_prototypeAlias$$.$_handlePointerDown$ = function $$JSCompiler_prototypeAlias$$$$_handlePointerDown$$($event$$343$$) {
  if ("touch" == $event$$343$$.pointerType) {
    if (this.$_pointerId$) {
      try {
        this.$_isPanning$ && $JSCompiler_StaticMethods__cancelPanning$$(this, $event$$343$$);
      } finally {
        $JSCompiler_StaticMethods__cleanupState$$(this);
      }
    } else {
      this.$_pointerId$ = $event$$343$$.pointerId, $JSCompiler_StaticMethods__initiatePanning$$(this, $event$$343$$);
    }
  }
};
$JSCompiler_prototypeAlias$$.$_handleTouchStart$ = function $$JSCompiler_prototypeAlias$$$$_handleTouchStart$$($event$$344$$) {
  1 < $event$$344$$.touches.length || $JSCompiler_StaticMethods__initiatePanning$$(this, $event$$344$$);
};
$JSCompiler_prototypeAlias$$.$_handleMouseDown$ = function $$JSCompiler_prototypeAlias$$$$_handleMouseDown$$($event$$345$$) {
  $JSCompiler_StaticMethods__initiatePanning$$(this, $event$$345$$);
};
function $JSCompiler_StaticMethods__initiatePanning$$($JSCompiler_StaticMethods__initiatePanning$self$$, $event$$346$$) {
  if (!$JSCompiler_StaticMethods__initiatePanning$self$$.$_startTime$ && !$AdfSwipeSupport$$.$_shouldPreventPanning$($event$$346$$)) {
    var $pos$$43$$ = $AdfAgent$$.$AGENT$.$getMousePosition$($event$$346$$);
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_panStartX$ = $pos$$43$$.x;
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_panStartY$ = $pos$$43$$.y;
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_startTime$ = Date.now();
    "mousedown" == $event$$346$$.type ? ($JSCompiler_StaticMethods__initiatePanning$self$$.$_fromMouseHandler$ = !0, $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanning$), document.addEventListener("mousemove", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$ = 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanEnd$), document.addEventListener("mouseup", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$, !0)) : "pointerdown" == $event$$346$$.type ? ($JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanning$), document.addEventListener("pointermove", 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanEnd$), document.addEventListener("pointerup", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanCancel$), 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("pointercancel", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$, !1)) : ($JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanning$), $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("touchmove", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$, 
    !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanEnd$), $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("touchend", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanCancel$), 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("touchcancel", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$, !1));
  }
}
function $JSCompiler_StaticMethods__cleanupState$$($JSCompiler_StaticMethods__cleanupState$self$$) {
  $JSCompiler_StaticMethods__cleanupState$self$$.$_isPanning$ = !1;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_direction$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_panStartX$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_panStartY$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_startTime$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_pointerId$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_fromMouseHandler$ ? (document.removeEventListener("mousemove", $JSCompiler_StaticMethods__cleanupState$self$$.$_panningHandler$, !1), document.removeEventListener("mouseup", $JSCompiler_StaticMethods__cleanupState$self$$.$_panEndHandler$, !0)) : $JSCompiler_StaticMethods__cleanupState$self$$.$_usesPointerEvents$ ? (document.removeEventListener("pointermove", $JSCompiler_StaticMethods__cleanupState$self$$.$_panningHandler$, !1), document.removeEventListener("pointerup", 
  $JSCompiler_StaticMethods__cleanupState$self$$.$_panEndHandler$, !1), document.removeEventListener("pointercancel", $JSCompiler_StaticMethods__cleanupState$self$$.$_panCancelHandler$, !1)) : ($JSCompiler_StaticMethods__cleanupState$self$$.$_element$.removeEventListener("touchmove", $JSCompiler_StaticMethods__cleanupState$self$$.$_panningHandler$, !1), $JSCompiler_StaticMethods__cleanupState$self$$.$_element$.removeEventListener("touchend", $JSCompiler_StaticMethods__cleanupState$self$$.$_panEndHandler$, 
  !1), $JSCompiler_StaticMethods__cleanupState$self$$.$_element$.removeEventListener("touchcancel", $JSCompiler_StaticMethods__cleanupState$self$$.$_panCancelHandler$, !1));
  $JSCompiler_StaticMethods__cleanupState$self$$.$_fromMouseHandler$ = !1;
}
$JSCompiler_prototypeAlias$$.$_handlePanning$ = function $$JSCompiler_prototypeAlias$$$$_handlePanning$$($event$$347$$) {
  if ($AdfSwipeSupport$$.$_shouldPreventPanning$($event$$347$$)) {
    try {
      this.$_isPanning$ && $JSCompiler_StaticMethods__cancelPanning$$(this, $event$$347$$);
    } finally {
      $JSCompiler_StaticMethods__cleanupState$$(this);
    }
  } else {
    var $gestureEvent_pos$$44$$ = $AdfAgent$$.$AGENT$.$getMousePosition$($event$$347$$);
    if (this.$_isPanning$) {
      $event$$347$$.cancelable && $AdfAgent$$.$AGENT$.preventDefault($event$$347$$), $distance$$4_type$$213$$ = $AdfSwipeSupport$$.$PANNING_CALLBACK$, $gestureEvent_pos$$44$$ = $JSCompiler_StaticMethods__getGestureEvent$$(this, $distance$$4_type$$213$$, $event$$347$$, $gestureEvent_pos$$44$$), $JSCompiler_StaticMethods__invokeCallback$$(this, $distance$$4_type$$213$$, $gestureEvent_pos$$44$$);
    } else {
      var $distance$$4_type$$213$$ = this.$_isVertical$ ? $gestureEvent_pos$$44$$.y - this.$_panStartY$ : $gestureEvent_pos$$44$$.x - this.$_panStartX$;
      Math.abs($distance$$4_type$$213$$) > (this.$_fromMouseHandler$ ? $AdfSwipeSupport$$.$_MOUSE_SWIPE_DISTANCE_THRESHOLD$ : $AdfSwipeSupport$$.$_SWIPE_DISTANCE_THRESHOLD$) && (this.$_isPanning$ = !0, this.$_direction$ = 0 > $distance$$4_type$$213$$ ? this.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_UP$ : $AdfSwipeSupport$$.$DIRECTION_LEFT$ : this.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_DOWN$ : $AdfSwipeSupport$$.$DIRECTION_RIGHT$, $distance$$4_type$$213$$ = $AdfSwipeSupport$$.$PANSTART_CALLBACK$, 
      $gestureEvent_pos$$44$$ = $JSCompiler_StaticMethods__getGestureEvent$$(this, $distance$$4_type$$213$$, $event$$347$$, $gestureEvent_pos$$44$$), $JSCompiler_StaticMethods__invokeCallback$$(this, $distance$$4_type$$213$$, $gestureEvent_pos$$44$$), $event$$347$$.cancelable && $AdfAgent$$.$AGENT$.preventDefault($event$$347$$));
    }
  }
};
$JSCompiler_prototypeAlias$$.$_handlePanEnd$ = function $$JSCompiler_prototypeAlias$$$$_handlePanEnd$$($event$$348_gestureEvent$$1$$) {
  if (this.$_isPanning$) {
    var $type$$214$$ = $AdfSwipeSupport$$.$PANEND_CALLBACK$;
    $event$$348_gestureEvent$$1$$ = $JSCompiler_StaticMethods__getGestureEvent$$(this, $type$$214$$, $event$$348_gestureEvent$$1$$);
    $AdfSwipeSupport$$.$_isSwipe$($event$$348_gestureEvent$$1$$) && ($type$$214$$ = $AdfSwipeSupport$$.$SWIPE_CALLBACK$, $event$$348_gestureEvent$$1$$.type = $type$$214$$);
    try {
      $JSCompiler_StaticMethods__invokeCallback$$(this, $type$$214$$, $event$$348_gestureEvent$$1$$);
    } finally {
      $JSCompiler_StaticMethods__cleanupState$$(this);
    }
  } else {
    $JSCompiler_StaticMethods__cleanupState$$(this);
  }
};
$JSCompiler_prototypeAlias$$.$_handlePanCancel$ = function $$JSCompiler_prototypeAlias$$$$_handlePanCancel$$($event$$349$$) {
  try {
    this.$_isPanning$ && $JSCompiler_StaticMethods__cancelPanning$$(this, $event$$349$$);
  } finally {
    $JSCompiler_StaticMethods__cleanupState$$(this);
  }
};
function $JSCompiler_StaticMethods__cancelPanning$$($JSCompiler_StaticMethods__cancelPanning$self$$, $event$$350$$) {
  var $gestureEvent$$2$$, $type$$215$$ = $AdfSwipeSupport$$.$PANCANCEL_CALLBACK$;
  $gestureEvent$$2$$ ? $gestureEvent$$2$$.type = $type$$215$$ : $gestureEvent$$2$$ = $JSCompiler_StaticMethods__getGestureEvent$$($JSCompiler_StaticMethods__cancelPanning$self$$, $type$$215$$, $event$$350$$);
  $JSCompiler_StaticMethods__invokeCallback$$($JSCompiler_StaticMethods__cancelPanning$self$$, $type$$215$$, $gestureEvent$$2$$);
}
$AdfSwipeSupport$$.$_isSwipe$ = function $$AdfSwipeSupport$$$$_isSwipe$$($gestureEvent$$3$$) {
  return $gestureEvent$$3$$.$offsetDirection$ === $gestureEvent$$3$$.direction && $gestureEvent$$3$$.$velocity$ > $AdfSwipeSupport$$.$_SWIPE_VELOCITY_THRESHOLD$ && Math.abs($gestureEvent$$3$$.$_deltaXorY$) > $AdfSwipeSupport$$.$_SWIPE_DISTANCE_THRESHOLD$;
};
$AdfSwipeSupport$$.$_shouldPreventPanning$ = function $$AdfSwipeSupport$$$$_shouldPreventPanning$$($event$$351$$) {
  var $page$$253$$ = $AdfPage$$.$PAGE$, $dndContext$$88$$ = $page$$253$$.$getDnDContext$();
  return $event$$351$$.defaultPrevented || $page$$253$$.$isDragging$() || $dndContext$$88$$ && $dndContext$$88$$.$isDragging$();
};
function $JSCompiler_StaticMethods__getGestureEvent$$($JSCompiler_StaticMethods__getGestureEvent$self$$, $eventType$$57$$, $srcEvent$$, $pos$$45$$) {
  $pos$$45$$ || ($pos$$45$$ = $AdfAgent$$.$AGENT$.$getMousePosition$($srcEvent$$));
  var $event$$352$$ = {};
  $event$$352$$.type = $eventType$$57$$;
  $event$$352$$.deltaX = $pos$$45$$.x - $JSCompiler_StaticMethods__getGestureEvent$self$$.$_panStartX$;
  $event$$352$$.deltaY = $pos$$45$$.y - $JSCompiler_StaticMethods__getGestureEvent$self$$.$_panStartY$;
  $event$$352$$.$_deltaXorY$ = $JSCompiler_StaticMethods__getGestureEvent$self$$.$_isVertical$ ? $event$$352$$.deltaY : $event$$352$$.deltaX;
  $event$$352$$.$deltaTime$ = Date.now() - $JSCompiler_StaticMethods__getGestureEvent$self$$.$_startTime$;
  $event$$352$$.$velocity$ = Math.abs($event$$352$$.$_deltaXorY$ / $event$$352$$.$deltaTime$);
  $event$$352$$.direction = $JSCompiler_StaticMethods__getGestureEvent$self$$.$_direction$;
  $event$$352$$.$offsetDirection$ = 0 > $event$$352$$.$_deltaXorY$ ? $JSCompiler_StaticMethods__getGestureEvent$self$$.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_UP$ : $AdfSwipeSupport$$.$DIRECTION_LEFT$ : $JSCompiler_StaticMethods__getGestureEvent$self$$.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_DOWN$ : $AdfSwipeSupport$$.$DIRECTION_RIGHT$;
  $event$$352$$.$srcEvent$ = $srcEvent$$;
  return $event$$352$$;
}
function $JSCompiler_StaticMethods__invokeCallback$$($JSCompiler_StaticMethods__invokeCallback$self$$, $callback$$127_type$$216$$, $gestureEvent$$4$$) {
  ($callback$$127_type$$216$$ = $JSCompiler_StaticMethods__invokeCallback$self$$.$_callbacks$ && $JSCompiler_StaticMethods__invokeCallback$self$$.$_callbacks$[$callback$$127_type$$216$$]) && $callback$$127_type$$216$$($gestureEvent$$4$$, $JSCompiler_StaticMethods__invokeCallback$self$$.$_callbackParam$);
}
;