function $AdfSafariTouchMoveManager$$($element$$141$$, $handlerCallback$$5$$, $touchCount$$5$$) {
  $AdfAssert$$.$assertDomNode$($element$$141$$, "Must have a DOM element to register a touch move with.");
  this.Init($element$$141$$, $handlerCallback$$5$$, $touchCount$$5$$);
}
$goog$exportSymbol$$("AdfSafariTouchMoveManager", $AdfSafariTouchMoveManager$$);
$AdfObject$$.$createSubclass$($AdfSafariTouchMoveManager$$, $AdfTouchMoveManager$$);
$AdfSafariTouchMoveManager$$.prototype.Init = function $$AdfSafariTouchMoveManager$$$$Init$($element$$142$$, $handlerCallback$$6_overflowValue$$, $touchCount$$6$$) {
  $AdfSafariTouchMoveManager$$.$superclass$.Init.call(this, $element$$142$$, $handlerCallback$$6_overflowValue$$, $touchCount$$6$$);
  this.$_touchCount$ = $touchCount$$6$$;
  this.$_handlerCallback$ = $handlerCallback$$6_overflowValue$$;
  this.$_element$ = $element$$142$$;
  this.$_touchMap$ = {};
  this.$_handleTouchStartCallaback$ = this.$createCallback$(this.$_handleTouchStart$);
  this.$_handleTouchEndCallaback$ = this.$createCallback$(this.$_handleTouchEnd$);
  this.$_handleTouchCancelCallaback$ = this.$createCallback$(this.$_handleTouchCancel$);
  this.$_handleTouchMoveCallaback$ = this.$createCallback$(this.$_handleTouchMove$);
  $element$$142$$.addEventListener("touchstart", this.$_handleTouchStartCallaback$, !0);
  $element$$142$$.addEventListener("touchend", this.$_handleTouchEndCallaback$, !0);
  $element$$142$$.addEventListener("touchcancel", this.$_handleTouchEndCallaback$, !0);
  $element$$142$$.addEventListener("touchmove", this.$_handleTouchMoveCallaback$, !0);
  $handlerCallback$$6_overflowValue$$ = $AdfAgent$$.$AGENT$.getComputedStyle($element$$142$$).overflow;
  "scroll" != $handlerCallback$$6_overflowValue$$ && ($element$$142$$.style.overflow = "scroll", this.$_originalOverflowValue$ = $handlerCallback$$6_overflowValue$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfSafariTouchMoveManager.prototype.Init", {Init:$AdfSafariTouchMoveManager$$.prototype.Init});
$AdfSafariTouchMoveManager$$.prototype.unregister = function $$AdfSafariTouchMoveManager$$$$unregister$() {
  var $element$$143$$ = this.$_element$;
  $element$$143$$.removeEventListener("touchstart", this.$_handleTouchStartCallaback$, !0);
  $element$$143$$.removeEventListener("touchend", this.$_handleTouchEndCallaback$, !0);
  $element$$143$$.removeEventListener("touchcancel", this.$_handleTouchEndCallaback$, !0);
  $element$$143$$.removeEventListener("touchmove", this.$_handleTouchMoveCallaback$, !0);
  delete this.$_handleTouchStartCallaback$;
  delete this.$_handleTouchEndCallaback$;
  delete this.$_handleTouchCancelCallaback$;
  delete this.$_handleTouchMoveCallaback$;
  delete this.$_touchMap$;
  delete this.$_element$;
  delete this.$_handlerCallback$;
  delete this.$_touchCount$;
  this.$_longTouchTimer$ && $AdfPage$$.$PAGE$.$cancelTimer$(this.$_longTouchTimer$);
  delete this.$_longTouchTimer$;
  delete this.$_longTouchEventCallback$;
  null != this.$_originalOverflowValue$ && ($element$$143$$.style.overflow = this.$_originalOverflowValue$, delete this.$_originalOverflowValue$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfSafariTouchMoveManager.prototype.unregister", {unregister:$AdfSafariTouchMoveManager$$.prototype.unregister});
$AdfSafariTouchMoveManager$$.prototype.$setLongTouchEventCallback$ = function $$AdfSafariTouchMoveManager$$$$$setLongTouchEventCallback$$($callback$$79$$) {
  this.$_longTouchEventCallback$ = $callback$$79$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfSafariTouchMoveManager.prototype.setLongTouchEventCallback", {$setLongTouchEventCallback$:$AdfSafariTouchMoveManager$$.prototype.$setLongTouchEventCallback$});
$JSCompiler_prototypeAlias$$ = $AdfSafariTouchMoveManager$$.prototype;
$JSCompiler_prototypeAlias$$.$_handleTouchStart$ = function $$JSCompiler_prototypeAlias$$$$_handleTouchStart$$($touchEvent$$) {
  for (var $agent$$30$$ = $AdfAgent$$.$AGENT$, $changedTouches$$1$$ = $touchEvent$$.changedTouches, $changedTouch_identifier$$2$$, $i$$100$$ = 0;$i$$100$$ < $changedTouches$$1$$.length;$i$$100$$++) {
    $changedTouch_identifier$$2$$ = $changedTouches$$1$$[$i$$100$$];
    var $screenX$$3$$ = $changedTouch_identifier$$2$$.screenX, $screenY$$3$$ = $changedTouch_identifier$$2$$.screenY;
    $changedTouch_identifier$$2$$ = $changedTouch_identifier$$2$$.identifier;
    this.$_touchMap$[$changedTouch_identifier$$2$$] = {x:$screenX$$3$$, y:$screenY$$3$$, t:(new Date).getTime(), dx:0, dy:0, touchtype:null, target:$agent$$30$$.$getEventTarget$($touchEvent$$)};
  }
  1 == $changedTouches$$1$$.length && this.$_longTouchEventCallback$ && (this.$_longTouchTimer$ = $AdfPage$$.$PAGE$.$scheduleTimer$(this, this.$_handleLongTouchStart$, $changedTouch_identifier$$2$$, 500));
};
$JSCompiler_prototypeAlias$$.$_handleLongTouchStart$ = function $$JSCompiler_prototypeAlias$$$$_handleLongTouchStart$$($eventId_touch$$2$$) {
  this.$_longTouchTimer$ = null;
  $eventId_touch$$2$$ = this.$_touchMap$[$eventId_touch$$2$$];
  this.$_longTouchEventCallback$ && $eventId_touch$$2$$ && ($eventId_touch$$2$$.touchtype = "longtouch", this.$_longTouchEventCallback$($eventId_touch$$2$$));
};
$JSCompiler_prototypeAlias$$.$_handleTouchEnd$ = function $$JSCompiler_prototypeAlias$$$$_handleTouchEnd$$($changedTouches$$2_touchEvent$$1$$) {
  this.$_longTouchTimer$ && ($AdfPage$$.$PAGE$.$cancelTimer$(this.$_longTouchTimer$), delete this.$_longTouchTimer$);
  $changedTouches$$2_touchEvent$$1$$ = $changedTouches$$2_touchEvent$$1$$.changedTouches;
  for (var $i$$101$$ = 0;$i$$101$$ < $changedTouches$$2_touchEvent$$1$$.length;$i$$101$$++) {
    var $touchWrapper$$ = this.$_touchMap$[$changedTouches$$2_touchEvent$$1$$[$i$$101$$].identifier];
    "longtouch" == $touchWrapper$$.touchtype && this.$_longTouchEventCallback$ && this.$_longTouchEventCallback$();
    delete $touchWrapper$$;
  }
};
$JSCompiler_prototypeAlias$$.$_handleTouchCancel$ = function $$JSCompiler_prototypeAlias$$$$_handleTouchCancel$$($touchEvent$$2$$) {
  this.$_handleTouchEnd$($touchEvent$$2$$);
};
$JSCompiler_prototypeAlias$$.$_handleTouchMove$ = function $$JSCompiler_prototypeAlias$$$$_handleTouchMove$$($scaleFactor_touchEvent$$3$$) {
  var $averageXDelta_touch1Direction_touches$$2$$ = $scaleFactor_touchEvent$$3$$.touches;
  this.$_longTouchTimer$ && ($AdfPage$$.$PAGE$.$cancelTimer$(this.$_longTouchTimer$), delete this.$_longTouchTimer$);
  if ($averageXDelta_touch1Direction_touches$$2$$ && $averageXDelta_touch1Direction_touches$$2$$.length == this.$_touchCount$) {
    var $averageYDelta_t_touch2Data_touch2Direction$$ = (new Date).getTime(), $changedTouches$$3$$ = $scaleFactor_touchEvent$$3$$.changedTouches, $i$$102$$, $touch$$3_touch1Data_touchData$$, $j$$8_touchType$$;
    for ($i$$102$$ = 0;$i$$102$$ < $changedTouches$$3$$.length;$i$$102$$++) {
      $touch$$3_touch1Data_touchData$$ = $changedTouches$$3$$[$i$$102$$];
      var $changesWereMovement_screenX$$4$$ = $touch$$3_touch1Data_touchData$$.screenX, $screenY$$4$$ = $touch$$3_touch1Data_touchData$$.screenY, $identifier$$4$$ = $touch$$3_touch1Data_touchData$$.identifier;
      $touch$$3_touch1Data_touchData$$ = this.$_touchMap$[$identifier$$4$$];
      var $deltaX$$1$$ = 0, $deltaY$$1$$ = 0, $origX$$ = null, $origY$$ = null;
      $j$$8_touchType$$ = null;
      $touch$$3_touch1Data_touchData$$ && ($deltaX$$1$$ = $changesWereMovement_screenX$$4$$ - $touch$$3_touch1Data_touchData$$.x, $deltaY$$1$$ = $screenY$$4$$ - $touch$$3_touch1Data_touchData$$.y, $origX$$ = $touch$$3_touch1Data_touchData$$.origx, $origY$$ = $touch$$3_touch1Data_touchData$$.origy, $j$$8_touchType$$ = $touch$$3_touch1Data_touchData$$.touchtype);
      null == $origX$$ && ($origX$$ = $changesWereMovement_screenX$$4$$, $origY$$ = $screenY$$4$$);
      this.$_touchMap$[$identifier$$4$$] = {x:$changesWereMovement_screenX$$4$$, y:$screenY$$4$$, t:$averageYDelta_t_touch2Data_touch2Direction$$, dx:$deltaX$$1$$, dy:$deltaY$$1$$, origx:$origX$$, origy:$origY$$, touchtype:$j$$8_touchType$$};
    }
    $changedTouches$$3$$ = [];
    for ($i$$102$$ in this.$_touchMap$) {
      $touch$$3_touch1Data_touchData$$ = this.$_touchMap$[$i$$102$$], 500 > $averageYDelta_t_touch2Data_touch2Direction$$ - $touch$$3_touch1Data_touchData$$.t && $changedTouches$$3$$.push($touch$$3_touch1Data_touchData$$);
    }
    if (2 == this.$_touchCount$) {
      $touch$$3_touch1Data_touchData$$ = this.$_touchMap$[$averageXDelta_touch1Direction_touches$$2$$[0].identifier];
      $averageYDelta_t_touch2Data_touch2Direction$$ = this.$_touchMap$[$averageXDelta_touch1Direction_touches$$2$$[1].identifier];
      if (null == $touch$$3_touch1Data_touchData$$ || null == $averageYDelta_t_touch2Data_touch2Direction$$) {
        return;
      }
      null == $touch$$3_touch1Data_touchData$$.touchtype && ($averageXDelta_touch1Direction_touches$$2$$ = $JSCompiler_StaticMethods__determineTouchDirection$$($touch$$3_touch1Data_touchData$$), null != $averageXDelta_touch1Direction_touches$$2$$ && ($averageYDelta_t_touch2Data_touch2Direction$$ = $JSCompiler_StaticMethods__determineTouchDirection$$($averageYDelta_t_touch2Data_touch2Direction$$), null != $averageYDelta_t_touch2Data_touch2Direction$$ && ($j$$8_touchType$$ = $averageXDelta_touch1Direction_touches$$2$$ != 
      $averageYDelta_t_touch2Data_touch2Direction$$ && (2 == $averageXDelta_touch1Direction_touches$$2$$.length && 1 == $averageYDelta_t_touch2Data_touch2Direction$$.length ? $averageXDelta_touch1Direction_touches$$2$$.charAt(0) != $averageYDelta_t_touch2Data_touch2Direction$$ && $averageXDelta_touch1Direction_touches$$2$$.charAt(1) != $averageYDelta_t_touch2Data_touch2Direction$$ : 1 != $averageXDelta_touch1Direction_touches$$2$$.length || 2 != $averageYDelta_t_touch2Data_touch2Direction$$.length || 
      $averageXDelta_touch1Direction_touches$$2$$ != $averageYDelta_t_touch2Data_touch2Direction$$.charAt(0) && $averageYDelta_t_touch2Data_touch2Direction$$ != $averageXDelta_touch1Direction_touches$$2$$.charAt(1)) ? "pinch" : "scroll", $touch$$3_touch1Data_touchData$$.touchtype = $j$$8_touchType$$)));
      $j$$8_touchType$$ = $touch$$3_touch1Data_touchData$$.touchtype;
      if (null == $j$$8_touchType$$ || "pinch" == $j$$8_touchType$$) {
        return;
      }
    }
    if ($changedTouches$$3$$.length <= this.$_touchCount$) {
      for ($j$$8_touchType$$ = $averageYDelta_t_touch2Data_touch2Direction$$ = $averageXDelta_touch1Direction_touches$$2$$ = 0;$j$$8_touchType$$ < $changedTouches$$3$$.length;$j$$8_touchType$$++) {
        $touch$$3_touch1Data_touchData$$ = $changedTouches$$3$$[$j$$8_touchType$$], $averageXDelta_touch1Direction_touches$$2$$ += $touch$$3_touch1Data_touchData$$.dx, $averageYDelta_t_touch2Data_touch2Direction$$ += $touch$$3_touch1Data_touchData$$.dy;
      }
      $averageXDelta_touch1Direction_touches$$2$$ /= this.$_touchCount$;
      $averageYDelta_t_touch2Data_touch2Direction$$ /= this.$_touchCount$;
      $changesWereMovement_screenX$$4$$ = !0;
      for ($j$$8_touchType$$ = 0;$j$$8_touchType$$ < $changedTouches$$3$$.length;$j$$8_touchType$$++) {
        if ($touch$$3_touch1Data_touchData$$ = $changedTouches$$3$$[$j$$8_touchType$$], 20 < Math.abs($touch$$3_touch1Data_touchData$$.dx - $averageXDelta_touch1Direction_touches$$2$$) || 20 < Math.abs($touch$$3_touch1Data_touchData$$.dy - $averageYDelta_t_touch2Data_touch2Direction$$)) {
          $changesWereMovement_screenX$$4$$ = !1;
          break;
        }
      }
      $changesWereMovement_screenX$$4$$ && ($AdfAgent$$.$AGENT$.preventDefault($scaleFactor_touchEvent$$3$$), 0 != $averageXDelta_touch1Direction_touches$$2$$ || 0 != $averageYDelta_t_touch2Data_touch2Direction$$) && ($scaleFactor_touchEvent$$3$$ = window.outerWidth / window.innerWidth, this.$_handlerCallback$($averageXDelta_touch1Direction_touches$$2$$ * $scaleFactor_touchEvent$$3$$, $averageYDelta_t_touch2Data_touch2Direction$$ * $scaleFactor_touchEvent$$3$$));
      for ($i$$102$$ in this.$_touchMap$) {
        this.$_touchMap$[$i$$102$$].t = 0;
      }
    }
  }
};
function $JSCompiler_StaticMethods__determineTouchDirection$$($distanceY_touchData$$1$$) {
  var $distanceX_origX$$1$$ = $distanceY_touchData$$1$$.origx, $directionX_origY$$1$$ = $distanceY_touchData$$1$$.origy;
  if (null == $distanceX_origX$$1$$ || null == $directionX_origY$$1$$) {
    return null;
  }
  $distanceX_origX$$1$$ = $distanceY_touchData$$1$$.x - $distanceX_origX$$1$$;
  $distanceY_touchData$$1$$ = $distanceY_touchData$$1$$.y - $directionX_origY$$1$$;
  if (Math.sqrt(Math.pow($distanceX_origX$$1$$, 2) + Math.pow($distanceY_touchData$$1$$, 2)) < .01 * window.innerWidth) {
    return null;
  }
  $directionX_origY$$1$$ = null;
  .25 <= Math.abs($distanceX_origX$$1$$ / $distanceY_touchData$$1$$) && ($directionX_origY$$1$$ = 0 > $distanceX_origX$$1$$ ? "l" : "r");
  var $directionY$$ = null;
  .25 <= Math.abs($distanceY_touchData$$1$$ / $distanceX_origX$$1$$) && ($directionY$$ = 0 > $distanceY_touchData$$1$$ ? "u" : "d");
  return null != $directionX_origY$$1$$ && null != $directionY$$ ? $directionY$$ + $directionX_origY$$1$$ : null == $directionX_origY$$1$$ ? $directionY$$ : null == $directionY$$ ? $directionX_origY$$1$$ : null;
}
;