$AdfObject$$.$createSubclass$($AdfAutoSaveBehavior$$, $AdfClientBehavior$$);
function $AdfAutoSaveBehavior$$($idleTimeSubmit$$) {
  this.Init($idleTimeSubmit$$);
}
$goog$exportSymbol$$("AdfAutoSaveBehavior", $AdfAutoSaveBehavior$$);
$AdfAutoSaveBehavior$$.$InitClass$ = function $$AdfAutoSaveBehavior$$$$InitClass$$() {
  this.$_IDLE_TIME_SUBMIT$ = 3E5;
  this.$_MIN_IDLE_TIME_SUBMIT$ = 3E4;
};
$goog$exportSymbol$$("AdfAutoSaveBehavior.InitClass", $AdfAutoSaveBehavior$$.$InitClass$);
$AdfAutoSaveBehavior$$.prototype.Init = function $$AdfAutoSaveBehavior$$$$Init$($idleTimeSubmit$$1$$) {
  $AdfAutoSaveBehavior$$.$superclass$.Init.call(this);
  $idleTimeSubmit$$1$$ = $idleTimeSubmit$$1$$ || $AdfAutoSaveBehavior$$.$_IDLE_TIME_SUBMIT$;
  this.$_idleTimeSubmit$ = Math.max($AdfAutoSaveBehavior$$.$_MIN_IDLE_TIME_SUBMIT$, $idleTimeSubmit$$1$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfAutoSaveBehavior.prototype.Init", {Init:$AdfAutoSaveBehavior$$.prototype.Init});
$AdfAutoSaveBehavior$$.prototype.$initialize$ = function $$AdfAutoSaveBehavior$$$$$initialize$$($component$$227$$) {
  $AdfAssert$$.assert($component$$227$$ instanceof AdfUIEditableValue, "Component must be an instance of AdfUIEditableValue");
  this.$_component$ = $component$$227$$;
  this.$_lastNonDirtySubmittedValue$ = this.$_idleSubmitHandler$ = null;
  $component$$227$$.addEventListener($AdfPropertyChangeEvent$$.$PROPERTY_CHANGE_TYPE$, this.$_propertyChange$, this);
  $component$$227$$.getReadOnly() || $component$$227$$.getDisabled() || $JSCompiler_StaticMethods__setUp$$(this);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfAutoSaveBehavior.prototype.initialize", {$initialize$:$AdfAutoSaveBehavior$$.prototype.$initialize$});
function $JSCompiler_StaticMethods__setUp$$($JSCompiler_StaticMethods__setUp$self$$) {
  var $component$$228$$ = $JSCompiler_StaticMethods__setUp$self$$.$_component$;
  $component$$228$$.addEventListener($AdfUIInputEvent$$.$KEY_UP_EVENT_TYPE$, $JSCompiler_StaticMethods__setUp$self$$.$_setUpIdleTimer$, $JSCompiler_StaticMethods__setUp$self$$);
  $component$$228$$.addEventListener($AdfUIInputEvent$$.$MOUSE_UP_EVENT_TYPE$, $JSCompiler_StaticMethods__setUp$self$$.$_setUpIdleTimer$, $JSCompiler_StaticMethods__setUp$self$$);
  $component$$228$$.addEventListener($AdfUIInputEvent$$.$KEY_DOWN_EVENT_TYPE$, $JSCompiler_StaticMethods__setUp$self$$.$_setUpComponentInitValue$, $JSCompiler_StaticMethods__setUp$self$$);
  $component$$228$$.addEventListener($AdfUIInputEvent$$.$MOUSE_DOWN_EVENT_TYPE$, $JSCompiler_StaticMethods__setUp$self$$.$_setUpComponentInitValue$, $JSCompiler_StaticMethods__setUp$self$$);
}
$AdfAutoSaveBehavior$$.prototype.$_propertyChange$ = function $$AdfAutoSaveBehavior$$$$$_propertyChange$$($component$$inline_538_propertyChange$$1$$) {
  var $propName$$27$$ = $component$$inline_538_propertyChange$$1$$.$getPropertyName$();
  if ("disabled" == $propName$$27$$ || "readOnly" == $propName$$27$$) {
    $component$$inline_538_propertyChange$$1$$.$getNewValue$() ? ($component$$inline_538_propertyChange$$1$$ = this.$_component$, $JSCompiler_StaticMethods__resetIdleSubmitHandler$$(this), this.$_lastNonDirtySubmittedValue$ = null, $component$$inline_538_propertyChange$$1$$.removeEventListener($AdfUIInputEvent$$.$KEY_UP_EVENT_TYPE$, this.$_setUpIdleTimer$, this), $component$$inline_538_propertyChange$$1$$.removeEventListener($AdfUIInputEvent$$.$MOUSE_UP_EVENT_TYPE$, this.$_setUpIdleTimer$, this)) : 
    $JSCompiler_StaticMethods__setUp$$(this);
  }
};
$AdfAutoSaveBehavior$$.prototype.$_setUpComponentInitValue$ = function $$AdfAutoSaveBehavior$$$$$_setUpComponentInitValue$$() {
  null == this.$_lastNonDirtySubmittedValue$ && (this.$_lastNonDirtySubmittedValue$ = $JSCompiler_StaticMethods__getSubmittedValue$$(this), this.$_component$.removeEventListener($AdfUIInputEvent$$.$KEY_DOWN_EVENT_TYPE$, this.$_setUpComponentInitValue$, this), this.$_component$.removeEventListener($AdfUIInputEvent$$.$MOUSE_DOWN_EVENT_TYPE$, this.$_setUpComponentInitValue$, this));
};
$AdfAutoSaveBehavior$$.prototype.$_setUpIdleTimer$ = function $$AdfAutoSaveBehavior$$$$$_setUpIdleTimer$$() {
  $JSCompiler_StaticMethods__resetIdleSubmitHandler$$(this);
  var $self$$2$$ = this;
  this.$_idleSubmitHandler$ = setTimeout(function() {
    var $submittedValue$$inline_541$$ = $JSCompiler_StaticMethods__getSubmittedValue$$($self$$2$$);
    $self$$2$$.$_idleSubmitHandler$ = null;
    $self$$2$$.$_lastNonDirtySubmittedValue$ != $submittedValue$$inline_541$$ && $AdfCustomEvent$$.$queue$($self$$2$$.$_component$, "_autoSave", {$dirtyValue$:$submittedValue$$inline_541$$}, !0, !0);
  }, this.$_idleTimeSubmit$);
};
function $JSCompiler_StaticMethods__resetIdleSubmitHandler$$($JSCompiler_StaticMethods__resetIdleSubmitHandler$self$$) {
  $JSCompiler_StaticMethods__resetIdleSubmitHandler$self$$.$_idleSubmitHandler$ && (clearTimeout($JSCompiler_StaticMethods__resetIdleSubmitHandler$self$$.$_idleSubmitHandler$), $JSCompiler_StaticMethods__resetIdleSubmitHandler$self$$.$_idleSubmitHandler$ = null);
}
function $JSCompiler_StaticMethods__getSubmittedValue$$($JSCompiler_StaticMethods__getSubmittedValue$self_component$$230$$) {
  $JSCompiler_StaticMethods__getSubmittedValue$self_component$$230$$ = $JSCompiler_StaticMethods__getSubmittedValue$self_component$$230$$.$_component$;
  var $peer$$32$$ = $JSCompiler_StaticMethods__getSubmittedValue$self_component$$230$$.$getPeer$();
  return "oracle.adf.RichTextEditor" === $JSCompiler_StaticMethods__getSubmittedValue$self_component$$230$$.getComponentType() ? $peer$$32$$.$getCurrentContent$($JSCompiler_StaticMethods__getSubmittedValue$self_component$$230$$) : $peer$$32$$.$GetSubmittedValue$($JSCompiler_StaticMethods__getSubmittedValue$self_component$$230$$);
}
$AdfAutoSaveBehavior$$.$_getAutoSaveBehavior$ = function $$AdfAutoSaveBehavior$$$$_getAutoSaveBehavior$$($behaviors$$5_component$$231$$) {
  $behaviors$$5_component$$231$$ = $behaviors$$5_component$$231$$.$getBehaviors$();
  var $autoSaveBehavior$$ = null;
  if ($AdfCollections$$.isArray($behaviors$$5_component$$231$$)) {
    for (var $behaviorCount$$ = $behaviors$$5_component$$231$$.length, $i$$108$$ = 0;$i$$108$$ < $behaviorCount$$;$i$$108$$++) {
      if ($behaviors$$5_component$$231$$[$i$$108$$] instanceof $AdfAutoSaveBehavior$$) {
        $autoSaveBehavior$$ = $behaviors$$5_component$$231$$[$i$$108$$];
        break;
      }
    }
  } else {
    $behaviors$$5_component$$231$$ instanceof $AdfAutoSaveBehavior$$ && ($autoSaveBehavior$$ = $behaviors$$5_component$$231$$);
  }
  return $autoSaveBehavior$$;
};
$AdfAutoSaveBehavior$$.$removeTimer$ = function $$AdfAutoSaveBehavior$$$$removeTimer$$($autoSaveBehavior$$1_component$$232_componentId$$8$$) {
  if ($autoSaveBehavior$$1_component$$232_componentId$$8$$ = $AdfPage$$.$PAGE$.$findComponent$($autoSaveBehavior$$1_component$$232_componentId$$8$$)) {
    if ($autoSaveBehavior$$1_component$$232_componentId$$8$$ = this.$_getAutoSaveBehavior$($autoSaveBehavior$$1_component$$232_componentId$$8$$)) {
      $JSCompiler_StaticMethods__resetIdleSubmitHandler$$($autoSaveBehavior$$1_component$$232_componentId$$8$$), $autoSaveBehavior$$1_component$$232_componentId$$8$$.$_lastNonDirtySubmittedValue$ = $JSCompiler_StaticMethods__getSubmittedValue$$($autoSaveBehavior$$1_component$$232_componentId$$8$$);
    }
  }
};
$goog$exportSymbol$$("AdfAutoSaveBehavior.removeTimer", $AdfAutoSaveBehavior$$.$removeTimer$);
