function $AdfScriptLoadingService$$($domWindow$$129$$, $domDocument$$68$$, $policy$$1$$) {
  this.Init($domWindow$$129$$, $domDocument$$68$$, $policy$$1$$)
}
$goog$exportSymbol$$("AdfScriptLoadingService", $AdfScriptLoadingService$$);
$AdfObject$$.$createSubclass$($AdfScriptLoadingService$$);
$AdfScriptLoadingService$$.$InitClass$ = function $$AdfScriptLoadingService$$$$InitClass$$() {
  this.$POLICY_SAME_ORIGIN$ = "sameOrigin";
  $goog$exportSymbol$$("AdfScriptLoadingService.POLICY_SAME_ORIGIN", $AdfScriptLoadingService$$.$POLICY_SAME_ORIGIN$);
  this.$POLICY_CROSS_ORIGIN$ = "crossOrigin";
  $goog$exportSymbol$$("AdfScriptLoadingService.POLICY_CROSS_ORIGIN", $AdfScriptLoadingService$$.$POLICY_CROSS_ORIGIN$);
  this.$POLICY_AUTO$ = "auto";
  $goog$exportSymbol$$("AdfScriptLoadingService.POLICY_AUTO", $AdfScriptLoadingService$$.$POLICY_AUTO$);
  this.$METHOD_ANY$ = 0;
  $goog$exportSymbol$$("AdfScriptLoadingService.METHOD_ANY", $AdfScriptLoadingService$$.$METHOD_ANY$);
  this.$METHOD_SYNCHRONOUS$ = 1;
  $goog$exportSymbol$$("AdfScriptLoadingService.METHOD_SYNCHRONOUS", $AdfScriptLoadingService$$.$METHOD_SYNCHRONOUS$);
  this.$METHOD_ASYNCHRONOUS$ = 2;
  $goog$exportSymbol$$("AdfScriptLoadingService.METHOD_ASYNCHRONOUS", $AdfScriptLoadingService$$.$METHOD_ASYNCHRONOUS$);
  this.$METHOD_BACKGROUND$ = 3;
  $goog$exportSymbol$$("AdfScriptLoadingService.METHOD_BACKGROUND", $AdfScriptLoadingService$$.$METHOD_BACKGROUND$);
  this.$STATUS_LOADING$ = 0;
  $goog$exportSymbol$$("AdfScriptLoadingService.STATUS_LOADING", $AdfScriptLoadingService$$.$STATUS_LOADING$);
  this.$STATUS_LOADED$ = 1;
  $goog$exportSymbol$$("AdfScriptLoadingService.STATUS_LOADED", $AdfScriptLoadingService$$.$STATUS_LOADED$)
};
$goog$exportSymbol$$("AdfScriptLoadingService.InitClass", $AdfScriptLoadingService$$.$InitClass$);
$AdfScriptLoadingService$$.prototype.Init = function $$AdfScriptLoadingService$$$$Init$($domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$, $domDocument$$69_scriptElements$$inline_4708$$, $i$$inline_4709_policy$$2$$) {
  $AdfScriptLoadingService$$.$superclass$.Init.call(this);
  $AdfAssert$$.assert($i$$inline_4709_policy$$2$$ == $JSCompiler_alias_NULL$$ || $i$$inline_4709_policy$$2$$ == $AdfScriptLoadingService$$.$POLICY_SAME_ORIGIN$ || $i$$inline_4709_policy$$2$$ == $AdfScriptLoadingService$$.$POLICY_CROSS_ORIGIN$ || $i$$inline_4709_policy$$2$$ == $AdfScriptLoadingService$$.$POLICY_AUTO$);
  this.$_domWindow$ = $domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$;
  this.$_domDocument$ = $domDocument$$69_scriptElements$$inline_4708$$;
  this.$_policy$ = $i$$inline_4709_policy$$2$$;
  this.$_loadableScripts$ = [];
  this.$_loadingScript$ = $JSCompiler_alias_NULL$$;
  this.$_loading$ = $JSCompiler_alias_FALSE$$;
  this.$_loadListeners$ = [];
  this.$_syncCallback$ = this.$createCallback$(this.$_syncLoadComplete$);
  this.$_asyncCallback$ = this.$createCallback$(this.$_asyncLoadComplete$);
  $AdfAssert$$.assert(this.$_domDocument$ != $JSCompiler_alias_NULL$$);
  $domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$ = this.$_domDocument$.location.hostname;
  $AdfAssert$$.assert($domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$ != $JSCompiler_alias_NULL$$);
  this.$_sameOriginRegexp$ = RegExp("^(http|https):([\\w-]+\\.)?" + $domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$ + "[:/]", "i");
  if(!this.$_loadedLibraries$) {
    $domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$ = {};
    $domDocument$$69_scriptElements$$inline_4708$$ = $domDocument$$69_scriptElements$$inline_4708$$.getElementsByTagName("script");
    for($i$$inline_4709_policy$$2$$ = 0;$i$$inline_4709_policy$$2$$ < $domDocument$$69_scriptElements$$inline_4708$$.length;$i$$inline_4709_policy$$2$$++) {
      var $librarySource$$inline_4710$$ = $AdfScriptLoadingService$$.$_stripSessionId$($domDocument$$69_scriptElements$$inline_4708$$[$i$$inline_4709_policy$$2$$].getAttribute("src"));
      $librarySource$$inline_4710$$ && ($domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$[$librarySource$$inline_4710$$] = $JSCompiler_alias_TRUE$$)
    }
    this.$_loadedLibraries$ = $domWindow$$130_hostname$$inline_4703_loadedLibraries$$inline_4707$$
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.Init", {Init:$AdfScriptLoadingService$$.prototype.Init});
$AdfScriptLoadingService$$.prototype.$addLibraryScript$ = function $$AdfScriptLoadingService$$$$$addLibraryScript$$($librarySource$$2$$, $loadMethod$$2$$) {
  var $script$$6_strippedLibrarySource$$inline_4714_strippedLibrarySource$$inline_4718$$ = $AdfScriptLoadingService$$.$_stripSessionId$($librarySource$$2$$);
  this.$_loadedLibraries$[$script$$6_strippedLibrarySource$$inline_4714_strippedLibrarySource$$inline_4718$$] || ($script$$6_strippedLibrarySource$$inline_4714_strippedLibrarySource$$inline_4718$$ = $AdfScriptLoadingService$$.$_stripSessionId$($librarySource$$2$$), this.$_loadedLibraries$[$script$$6_strippedLibrarySource$$inline_4714_strippedLibrarySource$$inline_4718$$] = $JSCompiler_alias_TRUE$$, $script$$6_strippedLibrarySource$$inline_4714_strippedLibrarySource$$inline_4718$$ = this.$CreateLibraryLoadableScript$($librarySource$$2$$, 
  $loadMethod$$2$$), $JSCompiler_StaticMethods__addLoadableScript$$(this, $script$$6_strippedLibrarySource$$inline_4714_strippedLibrarySource$$inline_4718$$))
};
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.addLibraryScript", {$addLibraryScript$:$AdfScriptLoadingService$$.prototype.$addLibraryScript$});
$AdfScriptLoadingService$$.prototype.$addInlineScript$ = function $$AdfScriptLoadingService$$$$$addInlineScript$$($content$$37_loadableScript$$) {
  $content$$37_loadableScript$$ = new $AdfInlineLoadableScript$$(this.$_domWindow$, $content$$37_loadableScript$$);
  $JSCompiler_StaticMethods__addLoadableScript$$(this, $content$$37_loadableScript$$)
};
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.addInlineScript", {$addInlineScript$:$AdfScriptLoadingService$$.prototype.$addInlineScript$});
$AdfScriptLoadingService$$.prototype.$addCallbackScript$ = function $$AdfScriptLoadingService$$$$$addCallbackScript$$($context$$66_loadableScript$$1$$, $callback$$75$$, $state$$99$$) {
  $context$$66_loadableScript$$1$$ = new $AdfCallbackLoadableScript$$($context$$66_loadableScript$$1$$, $callback$$75$$, $state$$99$$);
  $JSCompiler_StaticMethods__addLoadableScript$$(this, $context$$66_loadableScript$$1$$)
};
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.addCallbackScript", {$addCallbackScript$:$AdfScriptLoadingService$$.prototype.$addCallbackScript$});
$AdfScriptLoadingService$$.prototype.$addLoadListener$ = function $$AdfScriptLoadingService$$$$$addLoadListener$$($listener$$107$$) {
  $AdfAssert$$.$assertFunction$($listener$$107$$);
  this.$_loadListeners$.push($listener$$107$$)
};
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.addLoadListener", {$addLoadListener$:$AdfScriptLoadingService$$.prototype.$addLoadListener$});
$AdfScriptLoadingService$$.prototype.$removeLoadListener$ = function $$AdfScriptLoadingService$$$$$removeLoadListener$$($index$$187_listener$$108$$) {
  var $listeners$$21$$ = this.$_loadListeners$;
  $index$$187_listener$$108$$ = $listeners$$21$$.indexOf($index$$187_listener$$108$$);
  -1 < $index$$187_listener$$108$$ && $listeners$$21$$.splice($index$$187_listener$$108$$, 1)
};
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.removeLoadListener", {$removeLoadListener$:$AdfScriptLoadingService$$.prototype.$removeLoadListener$});
$AdfScriptLoadingService$$.prototype.$CreateLibraryLoadableScript$ = function $$AdfScriptLoadingService$$$$$CreateLibraryLoadableScript$$($librarySource$$3$$, $loadMethod$$3$$) {
  var $loadableScript$$2$$ = $JSCompiler_alias_NULL$$;
  return $loadableScript$$2$$ = this.$_policy$ == $AdfScriptLoadingService$$.$POLICY_SAME_ORIGIN$ || (this.$_policy$ == $AdfScriptLoadingService$$.$POLICY_CROSS_ORIGIN$ ? 0 : "/" == $librarySource$$3$$.charAt(0) || this.$_sameOriginRegexp$.test($librarySource$$3$$)) || $loadMethod$$3$$ == $AdfScriptLoadingService$$.$METHOD_SYNCHRONOUS$ ? new $AdfXmlHttpLibraryLoadableScript$$(this.$GetDomWindow$(), $librarySource$$3$$, $loadMethod$$3$$) : new $AdfDomLibraryLoadableScript$$(this.$GetDomWindow$(), 
  this.$GetDomDocument$(), $librarySource$$3$$, $loadMethod$$3$$)
};
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.CreateLibraryLoadableScript", {$CreateLibraryLoadableScript$:$AdfScriptLoadingService$$.prototype.$CreateLibraryLoadableScript$});
$AdfScriptLoadingService$$.prototype.$GetDomWindow$ = $JSCompiler_get$$("$_domWindow$");
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.GetDomWindow", {$GetDomWindow$:$AdfScriptLoadingService$$.prototype.$GetDomWindow$});
$AdfScriptLoadingService$$.prototype.$GetDomDocument$ = $JSCompiler_get$$("$_domDocument$");
$AdfObject$$.$exportPrototypeSymbol$("AdfScriptLoadingService.prototype.GetDomDocument", {$GetDomDocument$:$AdfScriptLoadingService$$.prototype.$GetDomDocument$});
function $JSCompiler_StaticMethods__addLoadableScript$$($JSCompiler_StaticMethods__addLoadableScript$self$$, $loadableScript$$3$$) {
  var $numScripts$$ = $JSCompiler_StaticMethods__addLoadableScript$self$$.$_loadableScripts$.length;
  if(0 < $numScripts$$ && $loadableScript$$3$$.$getLoadMethod$() !== $AdfScriptLoadingService$$.$METHOD_BACKGROUND$) {
    for(var $added$$7$$ = $JSCompiler_alias_FALSE$$, $i$$639$$ = 0;$i$$639$$ < $numScripts$$;++$i$$639$$) {
      if($JSCompiler_StaticMethods__addLoadableScript$self$$.$_loadableScripts$[$i$$639$$].$getLoadMethod$() === $AdfScriptLoadingService$$.$METHOD_BACKGROUND$) {
        $JSCompiler_StaticMethods__addLoadableScript$self$$.$_loadableScripts$.splice($i$$639$$, 0, $loadableScript$$3$$);
        $added$$7$$ = $JSCompiler_alias_TRUE$$;
        break
      }
    }
    $added$$7$$ || $JSCompiler_StaticMethods__addLoadableScript$self$$.$_loadableScripts$.push($loadableScript$$3$$)
  }else {
    $JSCompiler_StaticMethods__addLoadableScript$self$$.$_loadableScripts$.push($loadableScript$$3$$)
  }
  $JSCompiler_StaticMethods__loadNextScript$$($JSCompiler_StaticMethods__addLoadableScript$self$$)
}
function $JSCompiler_StaticMethods__loadNextScript$$($JSCompiler_StaticMethods__loadNextScript$self$$) {
  if(!$JSCompiler_StaticMethods__loadNextScript$self$$.$_loadingScript$) {
    for(var $JSCompiler_StaticMethods__notifyLoading$self$$inline_4720_loadableScripts$$ = $JSCompiler_StaticMethods__loadNextScript$self$$.$_loadableScripts$;0 < $JSCompiler_StaticMethods__notifyLoading$self$$inline_4720_loadableScripts$$.length;) {
      var $loadableScript$$4$$ = $JSCompiler_StaticMethods__loadNextScript$self$$.$_loadingScript$ = $JSCompiler_StaticMethods__notifyLoading$self$$inline_4720_loadableScripts$$.shift(), $loadMethod$$4$$ = $loadableScript$$4$$.$getLoadMethod$();
      if($loadMethod$$4$$ === $AdfScriptLoadingService$$.$METHOD_SYNCHRONOUS$) {
        $loadableScript$$4$$.load($JSCompiler_StaticMethods__loadNextScript$self$$.$_syncCallback$)
      }else {
        $loadMethod$$4$$ === $AdfScriptLoadingService$$.$METHOD_BACKGROUND$ ? $JSCompiler_StaticMethods__notifyLoaded$$($JSCompiler_StaticMethods__loadNextScript$self$$) : ($JSCompiler_StaticMethods__notifyLoading$self$$inline_4720_loadableScripts$$ = $JSCompiler_StaticMethods__loadNextScript$self$$, $JSCompiler_StaticMethods__notifyLoading$self$$inline_4720_loadableScripts$$.$_loading$ || ($JSCompiler_StaticMethods__notify$$($JSCompiler_StaticMethods__notifyLoading$self$$inline_4720_loadableScripts$$, 
        $AdfScriptLoadingService$$.$STATUS_LOADING$), $JSCompiler_StaticMethods__notifyLoading$self$$inline_4720_loadableScripts$$.$_loading$ = $JSCompiler_alias_TRUE$$));
        $loadableScript$$4$$.load($JSCompiler_StaticMethods__loadNextScript$self$$.$_asyncCallback$);
        return
      }
    }
    $JSCompiler_StaticMethods__notifyLoaded$$($JSCompiler_StaticMethods__loadNextScript$self$$)
  }
}
function $JSCompiler_StaticMethods__notifyLoaded$$($JSCompiler_StaticMethods__notifyLoaded$self$$) {
  $JSCompiler_StaticMethods__notifyLoaded$self$$.$_loading$ && ($JSCompiler_StaticMethods__notifyLoaded$self$$.$_loading$ = $JSCompiler_alias_FALSE$$, $JSCompiler_StaticMethods__notify$$($JSCompiler_StaticMethods__notifyLoaded$self$$, $AdfScriptLoadingService$$.$STATUS_LOADED$))
}
function $JSCompiler_StaticMethods__notify$$($JSCompiler_StaticMethods__notify$self$$, $status$$12$$) {
  for(var $listeners$$22$$ = $JSCompiler_StaticMethods__notify$self$$.$_loadListeners$, $i$$640$$ = 0;$i$$640$$ < $listeners$$22$$.length;$i$$640$$++) {
    $listeners$$22$$[$i$$640$$]($status$$12$$)
  }
}
$AdfScriptLoadingService$$.prototype.$_syncLoadComplete$ = function $$AdfScriptLoadingService$$$$$_syncLoadComplete$$() {
  this.$_loadingScript$ = $JSCompiler_alias_NULL$$
};
$AdfScriptLoadingService$$.prototype.$_asyncLoadComplete$ = function $$AdfScriptLoadingService$$$$$_asyncLoadComplete$$() {
  this.$_syncLoadComplete$();
  $JSCompiler_StaticMethods__loadNextScript$$(this)
};
$AdfScriptLoadingService$$.$_stripSessionId$ = function $$AdfScriptLoadingService$$$$_stripSessionId$$($uri$$18$$) {
  return!$uri$$18$$ ? $JSCompiler_alias_NULL$$ : $uri$$18$$.replace(/;[^\?]*/, "")
};
