blob: 321fdcdeec15d1a349a53252d38cb91aa8bc3f08 [file] [log] [blame]
(function(){var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.isDef = function(a) {
return void 0 !== a;
};
goog.exportPath_ = function(a, b, c) {
a = a.split(".");
c = c || goog.global;
a[0] in c || !c.execScript || c.execScript("var " + a[0]);
for (var d;a.length && (d = a.shift());) {
!a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {};
}
};
goog.define = function(a, b) {
var c = b;
COMPILED || (goog.global.CLOSURE_UNCOMPILED_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES, a) ? c = goog.global.CLOSURE_UNCOMPILED_DEFINES[a] : goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a]));
goog.exportPath_(a, c);
};
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.TRUSTED_SITE = !0;
goog.STRICT_MODE_COMPATIBLE = !1;
goog.DISALLOW_TEST_ONLY_CODE = COMPILED && !goog.DEBUG;
goog.provide = function(a) {
if (!COMPILED && goog.isProvided_(a)) {
throw Error('Namespace "' + a + '" already declared.');
}
goog.constructNamespace_(a);
};
goog.constructNamespace_ = function(a, b) {
if (!COMPILED) {
delete goog.implicitNamespaces_[a];
for (var c = a;(c = c.substring(0, c.lastIndexOf("."))) && !goog.getObjectByName(c);) {
goog.implicitNamespaces_[c] = !0;
}
}
goog.exportPath_(a, b);
};
goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/;
goog.module = function(a) {
if (!goog.isString(a) || !a || -1 == a.search(goog.VALID_MODULE_RE_)) {
throw Error("Invalid module identifier");
}
if (!goog.isInModuleLoader_()) {
throw Error("Module " + a + " has been loaded incorrectly.");
}
if (goog.moduleLoaderState_.moduleName) {
throw Error("goog.module may only be called once per module.");
}
goog.moduleLoaderState_.moduleName = a;
if (!COMPILED) {
if (goog.isProvided_(a)) {
throw Error('Namespace "' + a + '" already declared.');
}
delete goog.implicitNamespaces_[a];
}
};
goog.module.get = function(a) {
return goog.module.getInternal_(a);
};
goog.module.getInternal_ = function(a) {
if (!COMPILED) {
return goog.isProvided_(a) ? a in goog.loadedModules_ ? goog.loadedModules_[a] : goog.getObjectByName(a) : null;
}
};
goog.moduleLoaderState_ = null;
goog.isInModuleLoader_ = function() {
return null != goog.moduleLoaderState_;
};
goog.module.declareTestMethods = function() {
if (!goog.isInModuleLoader_()) {
throw Error("goog.module.declareTestMethods must be called from within a goog.module");
}
goog.moduleLoaderState_.declareTestMethods = !0;
};
goog.module.declareLegacyNamespace = function() {
if (!COMPILED && !goog.isInModuleLoader_()) {
throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");
}
if (!COMPILED && !goog.moduleLoaderState_.moduleName) {
throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");
}
goog.moduleLoaderState_.declareLegacyNamespace = !0;
};
goog.setTestOnly = function(a) {
if (goog.DISALLOW_TEST_ONLY_CODE) {
throw a = a || "", Error("Importing test-only code into non-debug environment" + (a ? ": " + a : "."));
}
};
goog.forwardDeclare = function(a) {
};
COMPILED || (goog.isProvided_ = function(a) {
return a in goog.loadedModules_ || !goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByName(a));
}, goog.implicitNamespaces_ = {"goog.module":!0});
goog.getObjectByName = function(a, b) {
for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) {
if (goog.isDefAndNotNull(d[e])) {
d = d[e];
} else {
return null;
}
}
return d;
};
goog.globalize = function(a, b) {
var c = b || goog.global, d;
for (d in a) {
c[d] = a[d];
}
};
goog.addDependency = function(a, b, c, d) {
if (goog.DEPENDENCIES_ENABLED) {
var e;
a = a.replace(/\\/g, "/");
for (var f = goog.dependencies_, g = 0;e = b[g];g++) {
f.nameToPath[e] = a, f.pathIsModule[a] = !!d;
}
for (d = 0;b = c[d];d++) {
a in f.requires || (f.requires[a] = {}), f.requires[a][b] = !0;
}
}
};
goog.ENABLE_DEBUG_LOADER = !0;
goog.logToConsole_ = function(a) {
goog.global.console && goog.global.console.error(a);
};
goog.require = function(a) {
if (!COMPILED) {
goog.ENABLE_DEBUG_LOADER && goog.IS_OLD_IE_ && goog.maybeProcessDeferredDep_(a);
if (goog.isProvided_(a)) {
return goog.isInModuleLoader_() ? goog.module.getInternal_(a) : null;
}
if (goog.ENABLE_DEBUG_LOADER) {
var b = goog.getPathFromDeps_(a);
if (b) {
return goog.included_[b] = !0, goog.writeScripts_(), null;
}
}
a = "goog.require could not find: " + a;
goog.logToConsole_(a);
throw Error(a);
}
};
goog.basePath = "";
goog.nullFunction = function() {
};
goog.identityFunction = function(a, b) {
return a;
};
goog.abstractMethod = function() {
throw Error("unimplemented abstract method");
};
goog.addSingletonGetter = function(a) {
a.getInstance = function() {
if (a.instance_) {
return a.instance_;
}
goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a);
return a.instance_ = new a;
};
};
goog.instantiatedSingletons_ = [];
goog.LOAD_MODULE_USING_EVAL = !0;
goog.SEAL_MODULE_EXPORTS = goog.DEBUG;
goog.loadedModules_ = {};
goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;
goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathIsModule:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = function() {
var a = goog.global.document;
return "undefined" != typeof a && "write" in a;
}, goog.findBasePath_ = function() {
if (goog.global.CLOSURE_BASE_PATH) {
goog.basePath = goog.global.CLOSURE_BASE_PATH;
} else {
if (goog.inHtmlDocument_()) {
for (var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) {
var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d;
if ("base.js" == c.substr(d - 7, 7)) {
goog.basePath = c.substr(0, d - 7);
break;
}
}
}
}
}, goog.importScript_ = function(a, b) {
(goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_)(a, b) && (goog.dependencies_.written[a] = !0);
}, goog.IS_OLD_IE_ = !goog.global.atob && goog.global.document && goog.global.document.all, goog.importModule_ = function(a) {
goog.importScript_("", 'goog.retrieveAndExecModule_("' + a + '");') && (goog.dependencies_.written[a] = !0);
}, goog.queuedModules_ = [], goog.wrapModule_ = function(a, b) {
return goog.LOAD_MODULE_USING_EVAL && goog.isDef(goog.global.JSON) ? "goog.loadModule(" + goog.global.JSON.stringify(b + "\n//# sourceURL=" + a + "\n") + ");" : 'goog.loadModule(function(exports) {"use strict";' + b + "\n;return exports});\n//# sourceURL=" + a + "\n";
}, goog.loadQueuedModules_ = function() {
var a = goog.queuedModules_.length;
if (0 < a) {
var b = goog.queuedModules_;
goog.queuedModules_ = [];
for (var c = 0;c < a;c++) {
goog.maybeProcessDeferredPath_(b[c]);
}
}
}, goog.maybeProcessDeferredDep_ = function(a) {
goog.isDeferredModule_(a) && goog.allDepsAreAvailable_(a) && (a = goog.getPathFromDeps_(a), goog.maybeProcessDeferredPath_(goog.basePath + a));
}, goog.isDeferredModule_ = function(a) {
return (a = goog.getPathFromDeps_(a)) && goog.dependencies_.pathIsModule[a] ? goog.basePath + a in goog.dependencies_.deferred : !1;
}, goog.allDepsAreAvailable_ = function(a) {
if ((a = goog.getPathFromDeps_(a)) && a in goog.dependencies_.requires) {
for (var b in goog.dependencies_.requires[a]) {
if (!goog.isProvided_(b) && !goog.isDeferredModule_(b)) {
return !1;
}
}
}
return !0;
}, goog.maybeProcessDeferredPath_ = function(a) {
if (a in goog.dependencies_.deferred) {
var b = goog.dependencies_.deferred[a];
delete goog.dependencies_.deferred[a];
goog.globalEval(b);
}
}, goog.loadModule = function(a) {
var b = goog.moduleLoaderState_;
try {
goog.moduleLoaderState_ = {moduleName:void 0, declareTestMethods:!1};
var c;
if (goog.isFunction(a)) {
c = a.call(goog.global, {});
} else {
if (goog.isString(a)) {
c = goog.loadModuleFromSource_.call(goog.global, a);
} else {
throw Error("Invalid module definition");
}
}
var d = goog.moduleLoaderState_.moduleName;
if (!goog.isString(d) || !d) {
throw Error('Invalid module name "' + d + '"');
}
goog.moduleLoaderState_.declareLegacyNamespace ? goog.constructNamespace_(d, c) : goog.SEAL_MODULE_EXPORTS && Object.seal && Object.seal(c);
goog.loadedModules_[d] = c;
if (goog.moduleLoaderState_.declareTestMethods) {
for (var e in c) {
if (0 === e.indexOf("test", 0) || "tearDown" == e || "setUp" == e || "setUpPage" == e || "tearDownPage" == e) {
goog.global[e] = c[e];
}
}
}
} finally {
goog.moduleLoaderState_ = b;
}
}, goog.loadModuleFromSource_ = function(a) {
eval(a);
return {};
}, goog.writeScriptTag_ = function(a, b) {
if (goog.inHtmlDocument_()) {
var c = goog.global.document;
if ("complete" == c.readyState) {
if (/\bdeps.js$/.test(a)) {
return !1;
}
throw Error('Cannot write "' + a + '" after document load');
}
var d = goog.IS_OLD_IE_;
void 0 === b ? d ? (d = " onreadystatechange='goog.onScriptLoad_(this, " + ++goog.lastNonModuleScriptIndex_ + ")' ", c.write('<script type="text/javascript" src="' + a + '"' + d + ">\x3c/script>")) : c.write('<script type="text/javascript" src="' + a + '">\x3c/script>') : c.write('<script type="text/javascript">' + b + "\x3c/script>");
return !0;
}
return !1;
}, goog.lastNonModuleScriptIndex_ = 0, goog.onScriptLoad_ = function(a, b) {
"complete" == a.readyState && goog.lastNonModuleScriptIndex_ == b && goog.loadQueuedModules_();
return !0;
}, goog.writeScripts_ = function() {
function a(e) {
if (!(e in d.written)) {
if (!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) {
for (var f in d.requires[e]) {
if (!goog.isProvided_(f)) {
if (f in d.nameToPath) {
a(d.nameToPath[f]);
} else {
throw Error("Undefined nameToPath for " + f);
}
}
}
}
e in c || (c[e] = !0, b.push(e));
}
}
var b = [], c = {}, d = goog.dependencies_, e;
for (e in goog.included_) {
d.written[e] || a(e);
}
for (var f = 0;f < b.length;f++) {
e = b[f], goog.dependencies_.written[e] = !0;
}
var g = goog.moduleLoaderState_;
goog.moduleLoaderState_ = null;
for (f = 0;f < b.length;f++) {
if (e = b[f]) {
d.pathIsModule[e] ? goog.importModule_(goog.basePath + e) : goog.importScript_(goog.basePath + e);
} else {
throw goog.moduleLoaderState_ = g, Error("Undefined script input");
}
}
goog.moduleLoaderState_ = g;
}, goog.getPathFromDeps_ = function(a) {
return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null;
}, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js"));
goog.normalizePath_ = function(a) {
a = a.split("/");
for (var b = 0;b < a.length;) {
"." == a[b] ? a.splice(b, 1) : b && ".." == a[b] && a[b - 1] && ".." != a[b - 1] ? a.splice(--b, 2) : b++;
}
return a.join("/");
};
goog.retrieveAndExecModule_ = function(a) {
if (!COMPILED) {
var b = a;
a = goog.normalizePath_(a);
var c = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_, d = null, e = new goog.global.XMLHttpRequest;
e.onload = function() {
d = this.responseText;
};
e.open("get", a, !1);
e.send();
d = e.responseText;
if (null != d) {
e = goog.wrapModule_(a, d), goog.IS_OLD_IE_ ? (goog.dependencies_.deferred[b] = e, goog.queuedModules_.push(b)) : c(a, e);
} else {
throw Error("load of " + a + "failed");
}
}
};
goog.typeOf = function(a) {
var b = typeof a;
if ("object" == b) {
if (a) {
if (a instanceof Array) {
return "array";
}
if (a instanceof Object) {
return b;
}
var c = Object.prototype.toString.call(a);
if ("[object Window]" == c) {
return "object";
}
if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) {
return "array";
}
if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) {
return "function";
}
} else {
return "null";
}
} else {
if ("function" == b && "undefined" == typeof a.call) {
return "object";
}
}
return b;
};
goog.isNull = function(a) {
return null === a;
};
goog.isDefAndNotNull = function(a) {
return null != a;
};
goog.isArray = function(a) {
return "array" == goog.typeOf(a);
};
goog.isArrayLike = function(a) {
var b = goog.typeOf(a);
return "array" == b || "object" == b && "number" == typeof a.length;
};
goog.isDateLike = function(a) {
return goog.isObject(a) && "function" == typeof a.getFullYear;
};
goog.isString = function(a) {
return "string" == typeof a;
};
goog.isBoolean = function(a) {
return "boolean" == typeof a;
};
goog.isNumber = function(a) {
return "number" == typeof a;
};
goog.isFunction = function(a) {
return "function" == goog.typeOf(a);
};
goog.isObject = function(a) {
var b = typeof a;
return "object" == b && null != a || "function" == b;
};
goog.getUid = function(a) {
return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_);
};
goog.hasUid = function(a) {
return !!a[goog.UID_PROPERTY_];
};
goog.removeUid = function(a) {
"removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_);
try {
delete a[goog.UID_PROPERTY_];
} catch (b) {
}
};
goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0);
goog.uidCounter_ = 0;
goog.getHashCode = goog.getUid;
goog.removeHashCode = goog.removeUid;
goog.cloneObject = function(a) {
var b = goog.typeOf(a);
if ("object" == b || "array" == b) {
if (a.clone) {
return a.clone();
}
var b = "array" == b ? [] : {}, c;
for (c in a) {
b[c] = goog.cloneObject(a[c]);
}
return b;
}
return a;
};
goog.bindNative_ = function(a, b, c) {
return a.call.apply(a.bind, arguments);
};
goog.bindJs_ = function(a, b, c) {
if (!a) {
throw Error();
}
if (2 < arguments.length) {
var d = Array.prototype.slice.call(arguments, 2);
return function() {
var c = Array.prototype.slice.call(arguments);
Array.prototype.unshift.apply(c, d);
return a.apply(b, c);
};
}
return function() {
return a.apply(b, arguments);
};
};
goog.bind = function(a, b, c) {
Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_;
return goog.bind.apply(null, arguments);
};
goog.partial = function(a, b) {
var c = Array.prototype.slice.call(arguments, 1);
return function() {
var b = c.slice();
b.push.apply(b, arguments);
return a.apply(this, b);
};
};
goog.mixin = function(a, b) {
for (var c in b) {
a[c] = b[c];
}
};
goog.now = goog.TRUSTED_SITE && Date.now || function() {
return +new Date;
};
goog.globalEval = function(a) {
if (goog.global.execScript) {
goog.global.execScript(a, "JavaScript");
} else {
if (goog.global.eval) {
if (null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) {
goog.global.eval(a);
} else {
var b = goog.global.document, c = b.createElement("script");
c.type = "text/javascript";
c.defer = !1;
c.appendChild(b.createTextNode(a));
b.body.appendChild(c);
b.body.removeChild(c);
}
} else {
throw Error("goog.globalEval not available");
}
}
};
goog.evalWorksForGlobals_ = null;
goog.getCssName = function(a, b) {
var c = function(a) {
return goog.cssNameMapping_[a] || a;
}, d = function(a) {
a = a.split("-");
for (var b = [], d = 0;d < a.length;d++) {
b.push(c(a[d]));
}
return b.join("-");
}, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) {
return a;
};
return b ? a + "-" + d(b) : d(a);
};
goog.setCssNameMapping = function(a, b) {
goog.cssNameMapping_ = a;
goog.cssNameMappingStyle_ = b;
};
!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING);
goog.getMsg = function(a, b) {
b && (a = a.replace(/\{\$([^}]+)}/g, function(a, d) {
return d in b ? b[d] : a;
}));
return a;
};
goog.getMsgWithFallback = function(a, b) {
return a;
};
goog.exportSymbol = function(a, b, c) {
goog.exportPath_(a, b, c);
};
goog.exportProperty = function(a, b, c) {
a[b] = c;
};
goog.inherits = function(a, b) {
function c() {
}
c.prototype = b.prototype;
a.superClass_ = b.prototype;
a.prototype = new c;
a.prototype.constructor = a;
a.base = function(a, c, f) {
for (var g = Array(arguments.length - 2), h = 2;h < arguments.length;h++) {
g[h - 2] = arguments[h];
}
return b.prototype[c].apply(a, g);
};
};
goog.base = function(a, b, c) {
var d = arguments.callee.caller;
if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !d) {
throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");
}
if (d.superClass_) {
for (var e = Array(arguments.length - 1), f = 1;f < arguments.length;f++) {
e[f - 1] = arguments[f];
}
return d.superClass_.constructor.apply(a, e);
}
e = Array(arguments.length - 2);
for (f = 2;f < arguments.length;f++) {
e[f - 2] = arguments[f];
}
for (var f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) {
if (g.prototype[b] === d) {
f = !0;
} else {
if (f) {
return g.prototype[b].apply(a, e);
}
}
}
if (a[b] === d) {
return a.constructor.prototype[b].apply(a, e);
}
throw Error("goog.base called from a method of one name to a method of a different name");
};
goog.scope = function(a) {
a.call(goog.global);
};
COMPILED || (goog.global.COMPILED = COMPILED);
goog.defineClass = function(a, b) {
var c = b.constructor, d = b.statics;
c && c != Object.prototype.constructor || (c = function() {
throw Error("cannot instantiate an interface (no constructor defined).");
});
c = goog.defineClass.createSealingConstructor_(c, a);
a && goog.inherits(c, a);
delete b.constructor;
delete b.statics;
goog.defineClass.applyProperties_(c.prototype, b);
null != d && (d instanceof Function ? d(c) : goog.defineClass.applyProperties_(c, d));
return c;
};
goog.defineClass.SEAL_CLASS_INSTANCES = goog.DEBUG;
goog.defineClass.createSealingConstructor_ = function(a, b) {
if (goog.defineClass.SEAL_CLASS_INSTANCES && Object.seal instanceof Function) {
if (b && b.prototype && b.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]) {
return a;
}
var c = function() {
var b = a.apply(this, arguments) || this;
b[goog.UID_PROPERTY_] = b[goog.UID_PROPERTY_];
this.constructor === c && Object.seal(b);
return b;
};
return c;
}
return a;
};
goog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
goog.defineClass.applyProperties_ = function(a, b) {
for (var c in b) {
Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]);
}
for (var d = 0;d < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++) {
c = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d], Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]);
}
};
goog.tagUnsealableClass = function(a) {
!COMPILED && goog.defineClass.SEAL_CLASS_INSTANCES && (a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_] = !0);
};
goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_ = "goog_defineClass_legacy_unsealable";
goog.debug = {};
goog.debug.Error = function(a) {
if (Error.captureStackTrace) {
Error.captureStackTrace(this, goog.debug.Error);
} else {
var b = Error().stack;
b && (this.stack = b);
}
a && (this.message = String(a));
};
goog.inherits(goog.debug.Error, Error);
goog.debug.Error.prototype.name = "CustomError";
goog.dom = {};
goog.dom.NodeType = {ELEMENT:1, ATTRIBUTE:2, TEXT:3, CDATA_SECTION:4, ENTITY_REFERENCE:5, ENTITY:6, PROCESSING_INSTRUCTION:7, COMMENT:8, DOCUMENT:9, DOCUMENT_TYPE:10, DOCUMENT_FRAGMENT:11, NOTATION:12};
goog.functions = {};
goog.functions.constant = function(a) {
return function() {
return a;
};
};
goog.functions.FALSE = goog.functions.constant(!1);
goog.functions.TRUE = goog.functions.constant(!0);
goog.functions.NULL = goog.functions.constant(null);
goog.functions.identity = function(a, b) {
return a;
};
goog.functions.error = function(a) {
return function() {
throw Error(a);
};
};
goog.functions.fail = function(a) {
return function() {
throw a;
};
};
goog.functions.lock = function(a, b) {
b = b || 0;
return function() {
return a.apply(this, Array.prototype.slice.call(arguments, 0, b));
};
};
goog.functions.nth = function(a) {
return function() {
return arguments[a];
};
};
goog.functions.withReturnValue = function(a, b) {
return goog.functions.sequence(a, goog.functions.constant(b));
};
goog.functions.equalTo = function(a, b) {
return function(c) {
return b ? a == c : a === c;
};
};
goog.functions.compose = function(a, b) {
var c = arguments, d = c.length;
return function() {
var a;
d && (a = c[d - 1].apply(this, arguments));
for (var b = d - 2;0 <= b;b--) {
a = c[b].call(this, a);
}
return a;
};
};
goog.functions.sequence = function(a) {
var b = arguments, c = b.length;
return function() {
for (var a, e = 0;e < c;e++) {
a = b[e].apply(this, arguments);
}
return a;
};
};
goog.functions.and = function(a) {
var b = arguments, c = b.length;
return function() {
for (var a = 0;a < c;a++) {
if (!b[a].apply(this, arguments)) {
return !1;
}
}
return !0;
};
};
goog.functions.or = function(a) {
var b = arguments, c = b.length;
return function() {
for (var a = 0;a < c;a++) {
if (b[a].apply(this, arguments)) {
return !0;
}
}
return !1;
};
};
goog.functions.not = function(a) {
return function() {
return !a.apply(this, arguments);
};
};
goog.functions.create = function(a, b) {
var c = function() {
};
c.prototype = a.prototype;
c = new c;
a.apply(c, Array.prototype.slice.call(arguments, 1));
return c;
};
goog.functions.CACHE_RETURN_VALUE = !0;
goog.functions.cacheReturnValue = function(a) {
var b = !1, c;
return function() {
if (!goog.functions.CACHE_RETURN_VALUE) {
return a();
}
b || (c = a(), b = !0);
return c;
};
};
goog.object = {};
goog.object.forEach = function(a, b, c) {
for (var d in a) {
b.call(c, a[d], d, a);
}
};
goog.object.filter = function(a, b, c) {
var d = {}, e;
for (e in a) {
b.call(c, a[e], e, a) && (d[e] = a[e]);
}
return d;
};
goog.object.map = function(a, b, c) {
var d = {}, e;
for (e in a) {
d[e] = b.call(c, a[e], e, a);
}
return d;
};
goog.object.some = function(a, b, c) {
for (var d in a) {
if (b.call(c, a[d], d, a)) {
return !0;
}
}
return !1;
};
goog.object.every = function(a, b, c) {
for (var d in a) {
if (!b.call(c, a[d], d, a)) {
return !1;
}
}
return !0;
};
goog.object.getCount = function(a) {
var b = 0, c;
for (c in a) {
b++;
}
return b;
};
goog.object.getAnyKey = function(a) {
for (var b in a) {
return b;
}
};
goog.object.getAnyValue = function(a) {
for (var b in a) {
return a[b];
}
};
goog.object.contains = function(a, b) {
return goog.object.containsValue(a, b);
};
goog.object.getValues = function(a) {
var b = [], c = 0, d;
for (d in a) {
b[c++] = a[d];
}
return b;
};
goog.object.getKeys = function(a) {
var b = [], c = 0, d;
for (d in a) {
b[c++] = d;
}
return b;
};
goog.object.getValueByKeys = function(a, b) {
for (var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) {
}
return a;
};
goog.object.containsKey = function(a, b) {
return b in a;
};
goog.object.containsValue = function(a, b) {
for (var c in a) {
if (a[c] == b) {
return !0;
}
}
return !1;
};
goog.object.findKey = function(a, b, c) {
for (var d in a) {
if (b.call(c, a[d], d, a)) {
return d;
}
}
};
goog.object.findValue = function(a, b, c) {
return (b = goog.object.findKey(a, b, c)) && a[b];
};
goog.object.isEmpty = function(a) {
for (var b in a) {
return !1;
}
return !0;
};
goog.object.clear = function(a) {
for (var b in a) {
delete a[b];
}
};
goog.object.remove = function(a, b) {
var c;
(c = b in a) && delete a[b];
return c;
};
goog.object.add = function(a, b, c) {
if (b in a) {
throw Error('The object already contains the key "' + b + '"');
}
goog.object.set(a, b, c);
};
goog.object.get = function(a, b, c) {
return b in a ? a[b] : c;
};
goog.object.set = function(a, b, c) {
a[b] = c;
};
goog.object.setIfUndefined = function(a, b, c) {
return b in a ? a[b] : a[b] = c;
};
goog.object.setWithReturnValueIfNotSet = function(a, b, c) {
if (b in a) {
return a[b];
}
c = c();
return a[b] = c;
};
goog.object.equals = function(a, b) {
for (var c in a) {
if (!(c in b) || a[c] !== b[c]) {
return !1;
}
}
for (c in b) {
if (!(c in a)) {
return !1;
}
}
return !0;
};
goog.object.clone = function(a) {
var b = {}, c;
for (c in a) {
b[c] = a[c];
}
return b;
};
goog.object.unsafeClone = function(a) {
var b = goog.typeOf(a);
if ("object" == b || "array" == b) {
if (a.clone) {
return a.clone();
}
var b = "array" == b ? [] : {}, c;
for (c in a) {
b[c] = goog.object.unsafeClone(a[c]);
}
return b;
}
return a;
};
goog.object.transpose = function(a) {
var b = {}, c;
for (c in a) {
b[a[c]] = c;
}
return b;
};
goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
goog.object.extend = function(a, b) {
for (var c, d, e = 1;e < arguments.length;e++) {
d = arguments[e];
for (c in d) {
a[c] = d[c];
}
for (var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) {
c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]);
}
}
};
goog.object.create = function(a) {
var b = arguments.length;
if (1 == b && goog.isArray(arguments[0])) {
return goog.object.create.apply(null, arguments[0]);
}
if (b % 2) {
throw Error("Uneven number of arguments");
}
for (var c = {}, d = 0;d < b;d += 2) {
c[arguments[d]] = arguments[d + 1];
}
return c;
};
goog.object.createSet = function(a) {
var b = arguments.length;
if (1 == b && goog.isArray(arguments[0])) {
return goog.object.createSet.apply(null, arguments[0]);
}
for (var c = {}, d = 0;d < b;d++) {
c[arguments[d]] = !0;
}
return c;
};
goog.object.createImmutableView = function(a) {
var b = a;
Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b));
return b;
};
goog.object.isImmutableView = function(a) {
return !!Object.isFrozen && Object.isFrozen(a);
};
goog.string = {};
goog.string.DETECT_DOUBLE_ESCAPING = !1;
goog.string.FORCE_NON_DOM_HTML_UNESCAPING = !1;
goog.string.Unicode = {NBSP:"\u00a0"};
goog.string.startsWith = function(a, b) {
return 0 == a.lastIndexOf(b, 0);
};
goog.string.endsWith = function(a, b) {
var c = a.length - b.length;
return 0 <= c && a.indexOf(b, c) == c;
};
goog.string.caseInsensitiveStartsWith = function(a, b) {
return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length));
};
goog.string.caseInsensitiveEndsWith = function(a, b) {
return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length));
};
goog.string.caseInsensitiveEquals = function(a, b) {
return a.toLowerCase() == b.toLowerCase();
};
goog.string.subs = function(a, b) {
for (var c = a.split("%s"), d = "", e = Array.prototype.slice.call(arguments, 1);e.length && 1 < c.length;) {
d += c.shift() + e.shift();
}
return d + c.join("%s");
};
goog.string.collapseWhitespace = function(a) {
return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, "");
};
goog.string.isEmptyOrWhitespace = function(a) {
return /^[\s\xa0]*$/.test(a);
};
goog.string.isEmptyString = function(a) {
return 0 == a.length;
};
goog.string.isEmpty = goog.string.isEmptyOrWhitespace;
goog.string.isEmptyOrWhitespaceSafe = function(a) {
return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(a));
};
goog.string.isEmptySafe = goog.string.isEmptyOrWhitespaceSafe;
goog.string.isBreakingWhitespace = function(a) {
return !/[^\t\n\r ]/.test(a);
};
goog.string.isAlpha = function(a) {
return !/[^a-zA-Z]/.test(a);
};
goog.string.isNumeric = function(a) {
return !/[^0-9]/.test(a);
};
goog.string.isAlphaNumeric = function(a) {
return !/[^a-zA-Z0-9]/.test(a);
};
goog.string.isSpace = function(a) {
return " " == a;
};
goog.string.isUnicodeChar = function(a) {
return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a;
};
goog.string.stripNewlines = function(a) {
return a.replace(/(\r\n|\r|\n)+/g, " ");
};
goog.string.canonicalizeNewlines = function(a) {
return a.replace(/(\r\n|\r|\n)/g, "\n");
};
goog.string.normalizeWhitespace = function(a) {
return a.replace(/\xa0|\s/g, " ");
};
goog.string.normalizeSpaces = function(a) {
return a.replace(/\xa0|[ \t]+/g, " ");
};
goog.string.collapseBreakingSpaces = function(a) {
return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, "");
};
goog.string.trim = goog.TRUSTED_SITE && String.prototype.trim ? function(a) {
return a.trim();
} : function(a) {
return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "");
};
goog.string.trimLeft = function(a) {
return a.replace(/^[\s\xa0]+/, "");
};
goog.string.trimRight = function(a) {
return a.replace(/[\s\xa0]+$/, "");
};
goog.string.caseInsensitiveCompare = function(a, b) {
var c = String(a).toLowerCase(), d = String(b).toLowerCase();
return c < d ? -1 : c == d ? 0 : 1;
};
goog.string.numerateCompareRegExp_ = /(\.\d+)|(\d+)|(\D+)/g;
goog.string.numerateCompare = function(a, b) {
if (a == b) {
return 0;
}
if (!a) {
return -1;
}
if (!b) {
return 1;
}
for (var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) {
var g = c[f], h = d[f];
if (g != h) {
return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1;
}
}
return c.length != d.length ? c.length - d.length : a < b ? -1 : 1;
};
goog.string.urlEncode = function(a) {
return encodeURIComponent(String(a));
};
goog.string.urlDecode = function(a) {
return decodeURIComponent(a.replace(/\+/g, " "));
};
goog.string.newLineToBr = function(a, b) {
return a.replace(/(\r\n|\r|\n)/g, b ? "<br />" : "<br>");
};
goog.string.htmlEscape = function(a, b) {
if (b) {
a = a.replace(goog.string.AMP_RE_, "&amp;").replace(goog.string.LT_RE_, "&lt;").replace(goog.string.GT_RE_, "&gt;").replace(goog.string.QUOT_RE_, "&quot;").replace(goog.string.SINGLE_QUOTE_RE_, "&#39;").replace(goog.string.NULL_RE_, "&#0;"), goog.string.DETECT_DOUBLE_ESCAPING && (a = a.replace(goog.string.E_RE_, "&#101;"));
} else {
if (!goog.string.ALL_RE_.test(a)) {
return a;
}
-1 != a.indexOf("&") && (a = a.replace(goog.string.AMP_RE_, "&amp;"));
-1 != a.indexOf("<") && (a = a.replace(goog.string.LT_RE_, "&lt;"));
-1 != a.indexOf(">") && (a = a.replace(goog.string.GT_RE_, "&gt;"));
-1 != a.indexOf('"') && (a = a.replace(goog.string.QUOT_RE_, "&quot;"));
-1 != a.indexOf("'") && (a = a.replace(goog.string.SINGLE_QUOTE_RE_, "&#39;"));
-1 != a.indexOf("\x00") && (a = a.replace(goog.string.NULL_RE_, "&#0;"));
goog.string.DETECT_DOUBLE_ESCAPING && -1 != a.indexOf("e") && (a = a.replace(goog.string.E_RE_, "&#101;"));
}
return a;
};
goog.string.AMP_RE_ = /&/g;
goog.string.LT_RE_ = /</g;
goog.string.GT_RE_ = />/g;
goog.string.QUOT_RE_ = /"/g;
goog.string.SINGLE_QUOTE_RE_ = /'/g;
goog.string.NULL_RE_ = /\x00/g;
goog.string.E_RE_ = /e/g;
goog.string.ALL_RE_ = goog.string.DETECT_DOUBLE_ESCAPING ? /[\x00&<>"'e]/ : /[\x00&<>"']/;
goog.string.unescapeEntities = function(a) {
return goog.string.contains(a, "&") ? !goog.string.FORCE_NON_DOM_HTML_UNESCAPING && "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a;
};
goog.string.unescapeEntitiesWithDocument = function(a, b) {
return goog.string.contains(a, "&") ? goog.string.unescapeEntitiesUsingDom_(a, b) : a;
};
goog.string.unescapeEntitiesUsingDom_ = function(a, b) {
var c = {"&amp;":"&", "&lt;":"<", "&gt;":">", "&quot;":'"'}, d;
d = b ? b.createElement("div") : goog.global.document.createElement("div");
return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, b) {
var g = c[a];
if (g) {
return g;
}
if ("#" == b.charAt(0)) {
var h = Number("0" + b.substr(1));
isNaN(h) || (g = String.fromCharCode(h));
}
g || (d.innerHTML = a + " ", g = d.firstChild.nodeValue.slice(0, -1));
return c[a] = g;
});
};
goog.string.unescapePureXmlEntities_ = function(a) {
return a.replace(/&([^;]+);/g, function(a, c) {
switch(c) {
case "amp":
return "&";
case "lt":
return "<";
case "gt":
return ">";
case "quot":
return '"';
default:
if ("#" == c.charAt(0)) {
var d = Number("0" + c.substr(1));
if (!isNaN(d)) {
return String.fromCharCode(d);
}
}
return a;
}
});
};
goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g;
goog.string.whitespaceEscape = function(a, b) {
return goog.string.newLineToBr(a.replace(/ /g, " &#160;"), b);
};
goog.string.preserveSpaces = function(a) {
return a.replace(/(^|[\n ]) /g, "$1" + goog.string.Unicode.NBSP);
};
goog.string.stripQuotes = function(a, b) {
for (var c = b.length, d = 0;d < c;d++) {
var e = 1 == c ? b : b.charAt(d);
if (a.charAt(0) == e && a.charAt(a.length - 1) == e) {
return a.substring(1, a.length - 1);
}
}
return a;
};
goog.string.truncate = function(a, b, c) {
c && (a = goog.string.unescapeEntities(a));
a.length > b && (a = a.substring(0, b - 3) + "...");
c && (a = goog.string.htmlEscape(a));
return a;
};
goog.string.truncateMiddle = function(a, b, c, d) {
c && (a = goog.string.unescapeEntities(a));
if (d && a.length > b) {
d > b && (d = b);
var e = a.length - d;
a = a.substring(0, b - d) + "..." + a.substring(e);
} else {
a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e));
}
c && (a = goog.string.htmlEscape(a));
return a;
};
goog.string.specialEscapeChars_ = {"\x00":"\\0", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\x0B", '"':'\\"', "\\":"\\\\"};
goog.string.jsEscapeCache_ = {"'":"\\'"};
goog.string.quote = function(a) {
a = String(a);
if (a.quote) {
return a.quote();
}
for (var b = ['"'], c = 0;c < a.length;c++) {
var d = a.charAt(c), e = d.charCodeAt(0);
b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d));
}
b.push('"');
return b.join("");
};
goog.string.escapeString = function(a) {
for (var b = [], c = 0;c < a.length;c++) {
b[c] = goog.string.escapeChar(a.charAt(c));
}
return b.join("");
};
goog.string.escapeChar = function(a) {
if (a in goog.string.jsEscapeCache_) {
return goog.string.jsEscapeCache_[a];
}
if (a in goog.string.specialEscapeChars_) {
return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a];
}
var b = a, c = a.charCodeAt(0);
if (31 < c && 127 > c) {
b = a;
} else {
if (256 > c) {
if (b = "\\x", 16 > c || 256 < c) {
b += "0";
}
} else {
b = "\\u", 4096 > c && (b += "0");
}
b += c.toString(16).toUpperCase();
}
return goog.string.jsEscapeCache_[a] = b;
};
goog.string.contains = function(a, b) {
return -1 != a.indexOf(b);
};
goog.string.caseInsensitiveContains = function(a, b) {
return goog.string.contains(a.toLowerCase(), b.toLowerCase());
};
goog.string.countOf = function(a, b) {
return a && b ? a.split(b).length - 1 : 0;
};
goog.string.removeAt = function(a, b, c) {
var d = a;
0 <= b && b < a.length && 0 < c && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c));
return d;
};
goog.string.remove = function(a, b) {
var c = new RegExp(goog.string.regExpEscape(b), "");
return a.replace(c, "");
};
goog.string.removeAll = function(a, b) {
var c = new RegExp(goog.string.regExpEscape(b), "g");
return a.replace(c, "");
};
goog.string.regExpEscape = function(a) {
return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08");
};
goog.string.repeat = function(a, b) {
return Array(b + 1).join(a);
};
goog.string.padNumber = function(a, b, c) {
a = goog.isDef(c) ? a.toFixed(c) : String(a);
c = a.indexOf(".");
-1 == c && (c = a.length);
return goog.string.repeat("0", Math.max(0, b - c)) + a;
};
goog.string.makeSafe = function(a) {
return null == a ? "" : String(a);
};
goog.string.buildString = function(a) {
return Array.prototype.join.call(arguments, "");
};
goog.string.getRandomString = function() {
return Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ goog.now()).toString(36);
};
goog.string.compareVersions = function(a, b) {
for (var c = 0, d = goog.string.trim(String(a)).split("."), e = goog.string.trim(String(b)).split("."), f = Math.max(d.length, e.length), g = 0;0 == c && g < f;g++) {
var h = d[g] || "", k = e[g] || "", l = RegExp("(\\d*)(\\D*)", "g"), p = RegExp("(\\d*)(\\D*)", "g");
do {
var m = l.exec(h) || ["", "", ""], n = p.exec(k) || ["", "", ""];
if (0 == m[0].length && 0 == n[0].length) {
break;
}
var c = 0 == m[1].length ? 0 : parseInt(m[1], 10), q = 0 == n[1].length ? 0 : parseInt(n[1], 10), c = goog.string.compareElements_(c, q) || goog.string.compareElements_(0 == m[2].length, 0 == n[2].length) || goog.string.compareElements_(m[2], n[2]);
} while (0 == c);
}
return c;
};
goog.string.compareElements_ = function(a, b) {
return a < b ? -1 : a > b ? 1 : 0;
};
goog.string.HASHCODE_MAX_ = 4294967296;
goog.string.hashCode = function(a) {
for (var b = 0, c = 0;c < a.length;++c) {
b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_;
}
return b;
};
goog.string.uniqueStringCounter_ = 2147483648 * Math.random() | 0;
goog.string.createUniqueString = function() {
return "goog_" + goog.string.uniqueStringCounter_++;
};
goog.string.toNumber = function(a) {
var b = Number(a);
return 0 == b && goog.string.isEmptyOrWhitespace(a) ? NaN : b;
};
goog.string.isLowerCamelCase = function(a) {
return /^[a-z]+([A-Z][a-z]*)*$/.test(a);
};
goog.string.isUpperCamelCase = function(a) {
return /^([A-Z][a-z]*)+$/.test(a);
};
goog.string.toCamelCase = function(a) {
return String(a).replace(/\-([a-z])/g, function(a, c) {
return c.toUpperCase();
});
};
goog.string.toSelectorCase = function(a) {
return String(a).replace(/([A-Z])/g, "-$1").toLowerCase();
};
goog.string.toTitleCase = function(a, b) {
var c = goog.isString(b) ? goog.string.regExpEscape(b) : "\\s";
return a.replace(new RegExp("(^" + (c ? "|[" + c + "]+" : "") + ")([a-z])", "g"), function(a, b, c) {
return b + c.toUpperCase();
});
};
goog.string.capitalize = function(a) {
return String(a.charAt(0)).toUpperCase() + String(a.substr(1)).toLowerCase();
};
goog.string.parseInt = function(a) {
isFinite(a) && (a = String(a));
return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN;
};
goog.string.splitLimit = function(a, b, c) {
a = a.split(b);
for (var d = [];0 < c && a.length;) {
d.push(a.shift()), c--;
}
a.length && d.push(a.join(b));
return d;
};
goog.string.editDistance = function(a, b) {
var c = [], d = [];
if (a == b) {
return 0;
}
if (!a.length || !b.length) {
return Math.max(a.length, b.length);
}
for (var e = 0;e < b.length + 1;e++) {
c[e] = e;
}
for (e = 0;e < a.length;e++) {
d[0] = e + 1;
for (var f = 0;f < b.length;f++) {
d[f + 1] = Math.min(d[f] + 1, c[f + 1] + 1, c[f] + (a[e] != b[f]));
}
for (f = 0;f < c.length;f++) {
c[f] = d[f];
}
}
return d[b.length];
};
goog.asserts = {};
goog.asserts.ENABLE_ASSERTS = goog.DEBUG;
goog.asserts.AssertionError = function(a, b) {
b.unshift(a);
goog.debug.Error.call(this, goog.string.subs.apply(null, b));
b.shift();
this.messagePattern = a;
};
goog.inherits(goog.asserts.AssertionError, goog.debug.Error);
goog.asserts.AssertionError.prototype.name = "AssertionError";
goog.asserts.DEFAULT_ERROR_HANDLER = function(a) {
throw a;
};
goog.asserts.errorHandler_ = goog.asserts.DEFAULT_ERROR_HANDLER;
goog.asserts.doAssertFailure_ = function(a, b, c, d) {
var e = "Assertion failed";
if (c) {
var e = e + (": " + c), f = d
} else {
a && (e += ": " + a, f = b);
}
a = new goog.asserts.AssertionError("" + e, f || []);
goog.asserts.errorHandler_(a);
};
goog.asserts.setErrorHandler = function(a) {
goog.asserts.ENABLE_ASSERTS && (goog.asserts.errorHandler_ = a);
};
goog.asserts.assert = function(a, b, c) {
goog.asserts.ENABLE_ASSERTS && !a && goog.asserts.doAssertFailure_("", null, b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.fail = function(a, b) {
goog.asserts.ENABLE_ASSERTS && goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1)));
};
goog.asserts.assertNumber = function(a, b, c) {
goog.asserts.ENABLE_ASSERTS && !goog.isNumber(a) && goog.asserts.doAssertFailure_("Expected number but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.assertString = function(a, b, c) {
goog.asserts.ENABLE_ASSERTS && !goog.isString(a) && goog.asserts.doAssertFailure_("Expected string but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.assertFunction = function(a, b, c) {
goog.asserts.ENABLE_ASSERTS && !goog.isFunction(a) && goog.asserts.doAssertFailure_("Expected function but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.assertObject = function(a, b, c) {
goog.asserts.ENABLE_ASSERTS && !goog.isObject(a) && goog.asserts.doAssertFailure_("Expected object but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.assertArray = function(a, b, c) {
goog.asserts.ENABLE_ASSERTS && !goog.isArray(a) && goog.asserts.doAssertFailure_("Expected array but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.assertBoolean = function(a, b, c) {
goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(a) && goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.assertElement = function(a, b, c) {
!goog.asserts.ENABLE_ASSERTS || goog.isObject(a) && a.nodeType == goog.dom.NodeType.ELEMENT || goog.asserts.doAssertFailure_("Expected Element but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2));
return a;
};
goog.asserts.assertInstanceof = function(a, b, c, d) {
!goog.asserts.ENABLE_ASSERTS || a instanceof b || goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.", [goog.asserts.getType_(b), goog.asserts.getType_(a)], c, Array.prototype.slice.call(arguments, 3));
return a;
};
goog.asserts.assertObjectPrototypeIsIntact = function() {
for (var a in Object.prototype) {
goog.asserts.fail(a + " should not be enumerable in Object.prototype.");
}
};
goog.asserts.getType_ = function(a) {
return a instanceof Function ? a.displayName || a.name || "unknown type name" : a instanceof Object ? a.constructor.displayName || a.constructor.name || Object.prototype.toString.call(a) : null === a ? "null" : typeof a;
};
goog.array = {};
goog.NATIVE_ARRAY_PROTOTYPES = goog.TRUSTED_SITE;
goog.array.ASSUME_NATIVE_FUNCTIONS = !1;
goog.array.peek = function(a) {
return a[a.length - 1];
};
goog.array.last = goog.array.peek;
goog.array.ARRAY_PROTOTYPE_ = Array.prototype;
goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.indexOf) ? function(a, b, c) {
goog.asserts.assert(null != a.length);
return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c);
} : function(a, b, c) {
c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c;
if (goog.isString(a)) {
return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1;
}
for (;c < a.length;c++) {
if (c in a && a[c] === b) {
return c;
}
}
return -1;
};
goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.lastIndexOf) ? function(a, b, c) {
goog.asserts.assert(null != a.length);
return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c);
} : function(a, b, c) {
c = null == c ? a.length - 1 : c;
0 > c && (c = Math.max(0, a.length + c));
if (goog.isString(a)) {
return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1;
}
for (;0 <= c;c--) {
if (c in a && a[c] === b) {
return c;
}
}
return -1;
};
goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.forEach) ? function(a, b, c) {
goog.asserts.assert(null != a.length);
goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c);
} : function(a, b, c) {
for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) {
f in e && b.call(c, e[f], f, a);
}
};
goog.array.forEachRight = function(a, b, c) {
for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) {
d in e && b.call(c, e[d], d, a);
}
};
goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.filter) ? function(a, b, c) {
goog.asserts.assert(null != a.length);
return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c);
} : function(a, b, c) {
for (var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) {
if (h in g) {
var k = g[h];
b.call(c, k, h, a) && (e[f++] = k);
}
}
return e;
};
goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.map) ? function(a, b, c) {
goog.asserts.assert(null != a.length);
return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c);
} : function(a, b, c) {
for (var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) {
g in f && (e[g] = b.call(c, f[g], g, a));
}
return e;
};
goog.array.reduce = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduce) ? function(a, b, c, d) {
goog.asserts.assert(null != a.length);
for (var e = [], f = 1, g = arguments.length;f < g;f++) {
e.push(arguments[f]);
}
d && (e[0] = goog.bind(b, d));
return goog.array.ARRAY_PROTOTYPE_.reduce.apply(a, e);
} : function(a, b, c, d) {
var e = c;
goog.array.forEach(a, function(c, g) {
e = b.call(d, e, c, g, a);
});
return e;
};
goog.array.reduceRight = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduceRight) ? function(a, b, c, d) {
goog.asserts.assert(null != a.length);
d && (b = goog.bind(b, d));
return goog.array.ARRAY_PROTOTYPE_.reduceRight.call(a, b, c);
} : function(a, b, c, d) {
var e = c;
goog.array.forEachRight(a, function(c, g) {
e = b.call(d, e, c, g, a);
});
return e;
};
goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.some) ? function(a, b, c) {
goog.asserts.assert(null != a.length);
return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c);
} : function(a, b, c) {
for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) {
if (f in e && b.call(c, e[f], f, a)) {
return !0;
}
}
return !1;
};
goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.every) ? function(a, b, c) {
goog.asserts.assert(null != a.length);
return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c);
} : function(a, b, c) {
for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) {
if (f in e && !b.call(c, e[f], f, a)) {
return !1;
}
}
return !0;
};
goog.array.count = function(a, b, c) {
var d = 0;
goog.array.forEach(a, function(a, f, g) {
b.call(c, a, f, g) && ++d;
}, c);
return d;
};
goog.array.find = function(a, b, c) {
b = goog.array.findIndex(a, b, c);
return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b];
};
goog.array.findIndex = function(a, b, c) {
for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) {
if (f in e && b.call(c, e[f], f, a)) {
return f;
}
}
return -1;
};
goog.array.findRight = function(a, b, c) {
b = goog.array.findIndexRight(a, b, c);
return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b];
};
goog.array.findIndexRight = function(a, b, c) {
for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) {
if (d in e && b.call(c, e[d], d, a)) {
return d;
}
}
return -1;
};
goog.array.contains = function(a, b) {
return 0 <= goog.array.indexOf(a, b);
};
goog.array.isEmpty = function(a) {
return 0 == a.length;
};
goog.array.clear = function(a) {
if (!goog.isArray(a)) {
for (var b = a.length - 1;0 <= b;b--) {
delete a[b];
}
}
a.length = 0;
};
goog.array.insert = function(a, b) {
goog.array.contains(a, b) || a.push(b);
};
goog.array.insertAt = function(a, b, c) {
goog.array.splice(a, c, 0, b);
};
goog.array.insertArrayAt = function(a, b, c) {
goog.partial(goog.array.splice, a, c, 0).apply(null, b);
};
goog.array.insertBefore = function(a, b, c) {
var d;
2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d);
};
goog.array.remove = function(a, b) {
var c = goog.array.indexOf(a, b), d;
(d = 0 <= c) && goog.array.removeAt(a, c);
return d;
};
goog.array.removeAt = function(a, b) {
goog.asserts.assert(null != a.length);
return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length;
};
goog.array.removeIf = function(a, b, c) {
b = goog.array.findIndex(a, b, c);
return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1;
};
goog.array.removeAllIf = function(a, b, c) {
var d = 0;
goog.array.forEachRight(a, function(e, f) {
b.call(c, e, f, a) && goog.array.removeAt(a, f) && d++;
});
return d;
};
goog.array.concat = function(a) {
return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments);
};
goog.array.join = function(a) {
return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments);
};
goog.array.toArray = function(a) {
var b = a.length;
if (0 < b) {
for (var c = Array(b), d = 0;d < b;d++) {
c[d] = a[d];
}
return c;
}
return [];
};
goog.array.clone = goog.array.toArray;
goog.array.extend = function(a, b) {
for (var c = 1;c < arguments.length;c++) {
var d = arguments[c];
if (goog.isArrayLike(d)) {
var e = a.length || 0, f = d.length || 0;
a.length = e + f;
for (var g = 0;g < f;g++) {
a[e + g] = d[g];
}
} else {
a.push(d);
}
}
};
goog.array.splice = function(a, b, c, d) {
goog.asserts.assert(null != a.length);
return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1));
};
goog.array.slice = function(a, b, c) {
goog.asserts.assert(null != a.length);
return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c);
};
goog.array.removeDuplicates = function(a, b, c) {
b = b || a;
var d = function(a) {
return goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g;
};
c = c || d;
for (var d = {}, e = 0, f = 0;f < a.length;) {
var g = a[f++], h = c(g);
Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, b[e++] = g);
}
b.length = e;
};
goog.array.binarySearch = function(a, b, c) {
return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b);
};
goog.array.binarySelect = function(a, b, c) {
return goog.array.binarySearch_(a, b, !0, void 0, c);
};
goog.array.binarySearch_ = function(a, b, c, d, e) {
for (var f = 0, g = a.length, h;f < g;) {
var k = f + g >> 1, l;
l = c ? b.call(e, a[k], k, a) : b(d, a[k]);
0 < l ? f = k + 1 : (g = k, h = !l);
}
return h ? f : ~f;
};
goog.array.sort = function(a, b) {
a.sort(b || goog.array.defaultCompare);
};
goog.array.stableSort = function(a, b) {
for (var c = 0;c < a.length;c++) {
a[c] = {index:c, value:a[c]};
}
var d = b || goog.array.defaultCompare;
goog.array.sort(a, function(a, b) {
return d(a.value, b.value) || a.index - b.index;
});
for (c = 0;c < a.length;c++) {
a[c] = a[c].value;
}
};
goog.array.sortByKey = function(a, b, c) {
var d = c || goog.array.defaultCompare;
goog.array.sort(a, function(a, c) {
return d(b(a), b(c));
});
};
goog.array.sortObjectsByKey = function(a, b, c) {
goog.array.sortByKey(a, function(a) {
return a[b];
}, c);
};
goog.array.isSorted = function(a, b, c) {
b = b || goog.array.defaultCompare;
for (var d = 1;d < a.length;d++) {
var e = b(a[d - 1], a[d]);
if (0 < e || 0 == e && c) {
return !1;
}
}
return !0;
};
goog.array.equals = function(a, b, c) {
if (!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) {
return !1;
}
var d = a.length;
c = c || goog.array.defaultCompareEquality;
for (var e = 0;e < d;e++) {
if (!c(a[e], b[e])) {
return !1;
}
}
return !0;
};
goog.array.compare3 = function(a, b, c) {
c = c || goog.array.defaultCompare;
for (var d = Math.min(a.length, b.length), e = 0;e < d;e++) {
var f = c(a[e], b[e]);
if (0 != f) {
return f;
}
}
return goog.array.defaultCompare(a.length, b.length);
};
goog.array.defaultCompare = function(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
};
goog.array.inverseDefaultCompare = function(a, b) {
return -goog.array.defaultCompare(a, b);
};
goog.array.defaultCompareEquality = function(a, b) {
return a === b;
};
goog.array.binaryInsert = function(a, b, c) {
c = goog.array.binarySearch(a, b, c);
return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1;
};
goog.array.binaryRemove = function(a, b, c) {
b = goog.array.binarySearch(a, b, c);
return 0 <= b ? goog.array.removeAt(a, b) : !1;
};
goog.array.bucket = function(a, b, c) {
for (var d = {}, e = 0;e < a.length;e++) {
var f = a[e], g = b.call(c, f, e, a);
goog.isDef(g) && (d[g] || (d[g] = [])).push(f);
}
return d;
};
goog.array.toObject = function(a, b, c) {
var d = {};
goog.array.forEach(a, function(e, f) {
d[b.call(c, e, f, a)] = e;
});
return d;
};
goog.array.range = function(a, b, c) {
var d = [], e = 0, f = a;
c = c || 1;
void 0 !== b && (e = a, f = b);
if (0 > c * (f - e)) {
return [];
}
if (0 < c) {
for (a = e;a < f;a += c) {
d.push(a);
}
} else {
for (a = e;a > f;a += c) {
d.push(a);
}
}
return d;
};
goog.array.repeat = function(a, b) {
for (var c = [], d = 0;d < b;d++) {
c[d] = a;
}
return c;
};
goog.array.flatten = function(a) {
for (var b = [], c = 0;c < arguments.length;c++) {
var d = arguments[c];
if (goog.isArray(d)) {
for (var e = 0;e < d.length;e += 8192) {
for (var f = goog.array.slice(d, e, e + 8192), f = goog.array.flatten.apply(null, f), g = 0;g < f.length;g++) {
b.push(f[g]);
}
}
} else {
b.push(d);
}
}
return b;
};
goog.array.rotate = function(a, b) {
goog.asserts.assert(null != a.length);
a.length && (b %= a.length, 0 < b ? goog.array.ARRAY_PROTOTYPE_.unshift.apply(a, a.splice(-b, b)) : 0 > b && goog.array.ARRAY_PROTOTYPE_.push.apply(a, a.splice(0, -b)));
return a;
};
goog.array.moveItem = function(a, b, c) {
goog.asserts.assert(0 <= b && b < a.length);
goog.asserts.assert(0 <= c && c < a.length);
b = goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1);
goog.array.ARRAY_PROTOTYPE_.splice.call(a, c, 0, b[0]);
};
goog.array.zip = function(a) {
if (!arguments.length) {
return [];
}
for (var b = [], c = 0;;c++) {
for (var d = [], e = 0;e < arguments.length;e++) {
var f = arguments[e];
if (c >= f.length) {
return b;
}
d.push(f[c]);
}
b.push(d);
}
};
goog.array.shuffle = function(a, b) {
for (var c = b || Math.random, d = a.length - 1;0 < d;d--) {
var e = Math.floor(c() * (d + 1)), f = a[d];
a[d] = a[e];
a[e] = f;
}
};
goog.array.copyByIndex = function(a, b) {
var c = [];
goog.array.forEach(b, function(b) {
c.push(a[b]);
});
return c;
};
goog.math = {};
goog.math.randomInt = function(a) {
return Math.floor(Math.random() * a);
};
goog.math.uniformRandom = function(a, b) {
return a + Math.random() * (b - a);
};
goog.math.clamp = function(a, b, c) {
return Math.min(Math.max(a, b), c);
};
goog.math.modulo = function(a, b) {
var c = a % b;
return 0 > c * b ? c + b : c;
};
goog.math.lerp = function(a, b, c) {
return a + c * (b - a);
};
goog.math.nearlyEquals = function(a, b, c) {
return Math.abs(a - b) <= (c || 1E-6);
};
goog.math.standardAngle = function(a) {
return goog.math.modulo(a, 360);
};
goog.math.standardAngleInRadians = function(a) {
return goog.math.modulo(a, 2 * Math.PI);
};
goog.math.toRadians = function(a) {
return a * Math.PI / 180;
};
goog.math.toDegrees = function(a) {
return 180 * a / Math.PI;
};
goog.math.angleDx = function(a, b) {
return b * Math.cos(goog.math.toRadians(a));
};
goog.math.angleDy = function(a, b) {
return b * Math.sin(goog.math.toRadians(a));
};
goog.math.angle = function(a, b, c, d) {
return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(d - b, c - a)));
};
goog.math.angleDifference = function(a, b) {
var c = goog.math.standardAngle(b) - goog.math.standardAngle(a);
180 < c ? c -= 360 : -180 >= c && (c = 360 + c);
return c;
};
goog.math.sign = function(a) {
return 0 == a ? 0 : 0 > a ? -1 : 1;
};
goog.math.longestCommonSubsequence = function(a, b, c, d) {
c = c || function(a, b) {
return a == b;
};
d = d || function(b, c) {
return a[b];
};
for (var e = a.length, f = b.length, g = [], h = 0;h < e + 1;h++) {
g[h] = [], g[h][0] = 0;
}
for (var k = 0;k < f + 1;k++) {
g[0][k] = 0;
}
for (h = 1;h <= e;h++) {
for (k = 1;k <= f;k++) {
c(a[h - 1], b[k - 1]) ? g[h][k] = g[h - 1][k - 1] + 1 : g[h][k] = Math.max(g[h - 1][k], g[h][k - 1]);
}
}
for (var l = [], h = e, k = f;0 < h && 0 < k;) {
c(a[h - 1], b[k - 1]) ? (l.unshift(d(h - 1, k - 1)), h--, k--) : g[h - 1][k] > g[h][k - 1] ? h-- : k--;
}
return l;
};
goog.math.sum = function(a) {
return goog.array.reduce(arguments, function(a, c) {
return a + c;
}, 0);
};
goog.math.average = function(a) {
return goog.math.sum.apply(null, arguments) / arguments.length;
};
goog.math.sampleVariance = function(a) {
var b = arguments.length;
if (2 > b) {
return 0;
}
var c = goog.math.average.apply(null, arguments);
return goog.math.sum.apply(null, goog.array.map(arguments, function(a) {
return Math.pow(a - c, 2);
})) / (b - 1);
};
goog.math.standardDeviation = function(a) {
return Math.sqrt(goog.math.sampleVariance.apply(null, arguments));
};
goog.math.isInt = function(a) {
return isFinite(a) && 0 == a % 1;
};
goog.math.isFiniteNumber = function(a) {
return isFinite(a) && !isNaN(a);
};
goog.math.log10Floor = function(a) {
if (0 < a) {
var b = Math.round(Math.log(a) * Math.LOG10E);
return b - (parseFloat("1e" + b) > a);
}
return 0 == a ? -Infinity : NaN;
};
goog.math.safeFloor = function(a, b) {
goog.asserts.assert(!goog.isDef(b) || 0 < b);
return Math.floor(a + (b || 2E-15));
};
goog.math.safeCeil = function(a, b) {
goog.asserts.assert(!goog.isDef(b) || 0 < b);
return Math.ceil(a - (b || 2E-15));
};
goog.iter = {};
goog.iter.StopIteration = "StopIteration" in goog.global ? goog.global.StopIteration : Error("StopIteration");
goog.iter.Iterator = function() {
};
goog.iter.Iterator.prototype.next = function() {
throw goog.iter.StopIteration;
};
goog.iter.Iterator.prototype.__iterator__ = function(a) {
return this;
};
goog.iter.toIterator = function(a) {
if (a instanceof goog.iter.Iterator) {
return a;
}
if ("function" == typeof a.__iterator__) {
return a.__iterator__(!1);
}
if (goog.isArrayLike(a)) {
var b = 0, c = new goog.iter.Iterator;
c.next = function() {
for (;;) {
if (b >= a.length) {
throw goog.iter.StopIteration;
}
if (b in a) {
return a[b++];
}
b++;
}
};
return c;
}
throw Error("Not implemented");
};
goog.iter.forEach = function(a, b, c) {
if (goog.isArrayLike(a)) {
try {
goog.array.forEach(a, b, c);
} catch (d) {
if (d !== goog.iter.StopIteration) {
throw d;
}
}
} else {
a = goog.iter.toIterator(a);
try {
for (;;) {
b.call(c, a.next(), void 0, a);
}
} catch (d) {
if (d !== goog.iter.StopIteration) {
throw d;
}
}
}
};
goog.iter.filter = function(a, b, c) {
var d = goog.iter.toIterator(a);
a = new goog.iter.Iterator;
a.next = function() {
for (;;) {
var a = d.next();
if (b.call(c, a, void 0, d)) {
return a;
}
}
};
return a;
};
goog.iter.filterFalse = function(a, b, c) {
return goog.iter.filter(a, goog.functions.not(b), c);
};
goog.iter.range = function(a, b, c) {
var d = 0, e = a, f = c || 1;
1 < arguments.length && (d = a, e = b);
if (0 == f) {
throw Error("Range step argument must not be zero");
}
var g = new goog.iter.Iterator;
g.next = function() {
if (0 < f && d >= e || 0 > f && d <= e) {
throw goog.iter.StopIteration;
}
var a = d;
d += f;
return a;
};
return g;
};
goog.iter.join = function(a, b) {
return goog.iter.toArray(a).join(b);
};
goog.iter.map = function(a, b, c) {
var d = goog.iter.toIterator(a);
a = new goog.iter.Iterator;
a.next = function() {
var a = d.next();
return b.call(c, a, void 0, d);
};
return a;
};
goog.iter.reduce = function(a, b, c, d) {
var e = c;
goog.iter.forEach(a, function(a) {
e = b.call(d, e, a);
});
return e;
};
goog.iter.some = function(a, b, c) {
a = goog.iter.toIterator(a);
try {
for (;;) {
if (b.call(c, a.next(), void 0, a)) {
return !0;
}
}
} catch (d) {
if (d !== goog.iter.StopIteration) {
throw d;
}
}
return !1;
};
goog.iter.every = function(a, b, c) {
a = goog.iter.toIterator(a);
try {
for (;;) {
if (!b.call(c, a.next(), void 0, a)) {
return !1;
}
}
} catch (d) {
if (d !== goog.iter.StopIteration) {
throw d;
}
}
return !0;
};
goog.iter.chain = function(a) {
return goog.iter.chainFromIterable(arguments);
};
goog.iter.chainFromIterable = function(a) {
var b = goog.iter.toIterator(a);
a = new goog.iter.Iterator;
var c = null;
a.next = function() {
for (;;) {
if (null == c) {
var a = b.next();
c = goog.iter.toIterator(a);
}
try {
return c.next();
} catch (e) {
if (e !== goog.iter.StopIteration) {
throw e;
}
c = null;
}
}
};
return a;
};
goog.iter.dropWhile = function(a, b, c) {
var d = goog.iter.toIterator(a);
a = new goog.iter.Iterator;
var e = !0;
a.next = function() {
for (;;) {
var a = d.next();
if (!e || !b.call(c, a, void 0, d)) {
return e = !1, a;
}
}
};
return a;
};
goog.iter.takeWhile = function(a, b, c) {
var d = goog.iter.toIterator(a);
a = new goog.iter.Iterator;
a.next = function() {
var a = d.next();
if (b.call(c, a, void 0, d)) {
return a;
}
throw goog.iter.StopIteration;
};
return a;
};
goog.iter.toArray = function(a) {
if (goog.isArrayLike(a)) {
return goog.array.toArray(a);
}
a = goog.iter.toIterator(a);
var b = [];
goog.iter.forEach(a, function(a) {
b.push(a);
});
return b;
};
goog.iter.equals = function(a, b, c) {
a = goog.iter.zipLongest({}, a, b);
var d = c || goog.array.defaultCompareEquality;
return goog.iter.every(a, function(a) {
return d(a[0], a[1]);
});
};
goog.iter.nextOrValue = function(a, b) {
try {
return goog.iter.toIterator(a).next();
} catch (c) {
if (c != goog.iter.StopIteration) {
throw c;
}
return b;
}
};
goog.iter.product = function(a) {
if (goog.array.some(arguments, function(a) {
return !a.length;
}) || !arguments.length) {
return new goog.iter.Iterator;
}
var b = new goog.iter.Iterator, c = arguments, d = goog.array.repeat(0, c.length);
b.next = function() {
if (d) {
for (var a = goog.array.map(d, function(a, b) {
return c[b][a];
}), b = d.length - 1;0 <= b;b--) {
goog.asserts.assert(d);
if (d[b] < c[b].length - 1) {
d[b]++;
break;
}
if (0 == b) {
d = null;
break;
}
d[b] = 0;
}
return a;
}
throw goog.iter.StopIteration;
};
return b;
};
goog.iter.cycle = function(a) {
var b = goog.iter.toIterator(a), c = [], d = 0;
a = new goog.iter.Iterator;
var e = !1;
a.next = function() {
var a = null;
if (!e) {
try {
return a = b.next(), c.push(a), a;
} catch (g) {
if (g != goog.iter.StopIteration || goog.array.isEmpty(c)) {
throw g;
}
e = !0;
}
}
a = c[d];
d = (d + 1) % c.length;
return a;
};
return a;
};
goog.iter.count = function(a, b) {
var c = a || 0, d = goog.isDef(b) ? b : 1, e = new goog.iter.Iterator;
e.next = function() {
var a = c;
c += d;
return a;
};
return e;
};
goog.iter.repeat = function(a) {
var b = new goog.iter.Iterator;
b.next = goog.functions.constant(a);
return b;
};
goog.iter.accumulate = function(a) {
var b = goog.iter.toIterator(a), c = 0;
a = new goog.iter.Iterator;
a.next = function() {
return c += b.next();
};
return a;
};
goog.iter.zip = function(a) {
var b = arguments, c = new goog.iter.Iterator;
if (0 < b.length) {
var d = goog.array.map(b, goog.iter.toIterator);
c.next = function() {
return goog.array.map(d, function(a) {
return a.next();
});
};
}
return c;
};
goog.iter.zipLongest = function(a, b) {
var c = goog.array.slice(arguments, 1), d = new goog.iter.Iterator;
if (0 < c.length) {
var e = goog.array.map(c, goog.iter.toIterator);
d.next = function() {
var b = !1, c = goog.array.map(e, function(c) {
var d;
try {
d = c.next(), b = !0;
} catch (e) {
if (e !== goog.iter.StopIteration) {
throw e;
}
d = a;
}
return d;
});
if (!b) {
throw goog.iter.StopIteration;
}
return c;
};
}
return d;
};
goog.iter.compress = function(a, b) {
var c = goog.iter.toIterator(b);
return goog.iter.filter(a, function() {
return !!c.next();
});
};
goog.iter.GroupByIterator_ = function(a, b) {
this.iterator = goog.iter.toIterator(a);
this.keyFunc = b || goog.functions.identity;
};
goog.inherits(goog.iter.GroupByIterator_, goog.iter.Iterator);
goog.iter.GroupByIterator_.prototype.next = function() {
for (;this.currentKey == this.targetKey;) {
this.currentValue = this.iterator.next(), this.currentKey = this.keyFunc(this.currentValue);
}
this.targetKey = this.currentKey;
return [this.currentKey, this.groupItems_(this.targetKey)];
};
goog.iter.GroupByIterator_.prototype.groupItems_ = function(a) {
for (var b = [];this.currentKey == a;) {
b.push(this.currentValue);
try {
this.currentValue = this.iterator.next();
} catch (c) {
if (c !== goog.iter.StopIteration) {
throw c;
}
break;
}
this.currentKey = this.keyFunc(this.currentValue);
}
return b;
};
goog.iter.groupBy = function(a, b) {
return new goog.iter.GroupByIterator_(a, b);
};
goog.iter.starMap = function(a, b, c) {
var d = goog.iter.toIterator(a);
a = new goog.iter.Iterator;
a.next = function() {
var a = goog.iter.toArray(d.next());
return b.apply(c, goog.array.concat(a, void 0, d));
};
return a;
};
goog.iter.tee = function(a, b) {
var c = goog.iter.toIterator(a), d = goog.isNumber(b) ? b : 2, e = goog.array.map(goog.array.range(d), function() {
return [];
}), f = function() {
var a = c.next();
goog.array.forEach(e, function(b) {
b.push(a);
});
};
return goog.array.map(e, function(a) {
var b = new goog.iter.Iterator;
b.next = function() {
goog.array.isEmpty(a) && f();
goog.asserts.assert(!goog.array.isEmpty(a));
return a.shift();
};
return b;
});
};
goog.iter.enumerate = function(a, b) {
return goog.iter.zip(goog.iter.count(b), a);
};
goog.iter.limit = function(a, b) {
goog.asserts.assert(goog.math.isInt(b) && 0 <= b);
var c = goog.iter.toIterator(a), d = new goog.iter.Iterator, e = b;
d.next = function() {
if (0 < e--) {
return c.next();
}
throw goog.iter.StopIteration;
};
return d;
};
goog.iter.consume = function(a, b) {
goog.asserts.assert(goog.math.isInt(b) && 0 <= b);
for (var c = goog.iter.toIterator(a);0 < b--;) {
goog.iter.nextOrValue(c, null);
}
return c;
};
goog.iter.slice = function(a, b, c) {
goog.asserts.assert(goog.math.isInt(b) && 0 <= b);
a = goog.iter.consume(a, b);
goog.isNumber(c) && (goog.asserts.assert(goog.math.isInt(c) && c >= b), a = goog.iter.limit(a, c - b));
return a;
};
goog.iter.hasDuplicates_ = function(a) {
var b = [];
goog.array.removeDuplicates(a, b);
return a.length != b.length;
};
goog.iter.permutations = function(a, b) {
var c = goog.iter.toArray(a), d = goog.isNumber(b) ? b : c.length, c = goog.array.repeat(c, d), c = goog.iter.product.apply(void 0, c);
return goog.iter.filter(c, function(a) {
return !goog.iter.hasDuplicates_(a);
});
};
goog.iter.combinations = function(a, b) {
function c(a) {
return d[a];
}
var d = goog.iter.toArray(a), e = goog.iter.range(d.length), e = goog.iter.permutations(e, b), f = goog.iter.filter(e, function(a) {
return goog.array.isSorted(a);
}), e = new goog.iter.Iterator;
e.next = function() {
return goog.array.map(f.next(), c);
};
return e;
};
goog.iter.combinationsWithReplacement = function(a, b) {
function c(a) {
return d[a];
}
var d = goog.iter.toArray(a), e = goog.array.range(d.length), e = goog.array.repeat(e, b), e = goog.iter.product.apply(void 0, e), f = goog.iter.filter(e, function(a) {
return goog.array.isSorted(a);
}), e = new goog.iter.Iterator;
e.next = function() {
return goog.array.map(f.next(), c);
};
return e;
};
goog.structs = {};
goog.structs.Collection = function() {
};
goog.structs.Map = function(a, b) {
this.map_ = {};
this.keys_ = [];
this.version_ = this.count_ = 0;
var c = arguments.length;
if (1 < c) {
if (c % 2) {
throw Error("Uneven number of arguments");
}
for (var d = 0;d < c;d += 2) {
this.set(arguments[d], arguments[d + 1]);
}
} else {
a && this.addAll(a);
}
};
goog.structs.Map.prototype.getCount = function() {
return this.count_;
};
goog.structs.Map.prototype.getValues = function() {
this.cleanupKeysArray_();
for (var a = [], b = 0;b < this.keys_.length;b++) {
a.push(this.map_[this.keys_[b]]);
}
return a;
};
goog.structs.Map.prototype.getKeys = function() {
this.cleanupKeysArray_();
return this.keys_.concat();
};
goog.structs.Map.prototype.containsKey = function(a) {
return goog.structs.Map.hasKey_(this.map_, a);
};
goog.structs.Map.prototype.containsValue = function(a) {
for (var b = 0;b < this.keys_.length;b++) {
var c = this.keys_[b];
if (goog.structs.Map.hasKey_(this.map_, c) && this.map_[c] == a) {
return !0;
}
}
return !1;
};
goog.structs.Map.prototype.equals = function(a, b) {
if (this === a) {
return !0;
}
if (this.count_ != a.getCount()) {
return !1;
}
var c = b || goog.structs.Map.defaultEquals;
this.cleanupKeysArray_();
for (var d, e = 0;d = this.keys_[e];e++) {
if (!c(this.get(d), a.get(d))) {
return !1;
}
}
return !0;
};
goog.structs.Map.defaultEquals = function(a, b) {
return a === b;
};
goog.structs.Map.prototype.isEmpty = function() {
return 0 == this.count_;
};
goog.structs.Map.prototype.clear = function() {
this.map_ = {};
this.version_ = this.count_ = this.keys_.length = 0;
};
goog.structs.Map.prototype.remove = function(a) {
return goog.structs.Map.hasKey_(this.map_, a) ? (delete this.map_[a], this.count_--, this.version_++, this.keys_.length > 2 * this.count_ && this.cleanupKeysArray_(), !0) : !1;
};
goog.structs.Map.prototype.cleanupKeysArray_ = function() {
if (this.count_ != this.keys_.length) {
for (var a = 0, b = 0;a < this.keys_.length;) {
var c = this.keys_[a];
goog.structs.Map.hasKey_(this.map_, c) && (this.keys_[b++] = c);
a++;
}
this.keys_.length = b;
}
if (this.count_ != this.keys_.length) {
for (var d = {}, b = a = 0;a < this.keys_.length;) {
c = this.keys_[a], goog.structs.Map.hasKey_(d, c) || (this.keys_[b++] = c, d[c] = 1), a++;
}
this.keys_.length = b;
}
};
goog.structs.Map.prototype.get = function(a, b) {
return goog.structs.Map.hasKey_(this.map_, a) ? this.map_[a] : b;
};
goog.structs.Map.prototype.set = function(a, b) {
goog.structs.Map.hasKey_(this.map_, a) || (this.count_++, this.keys_.push(a), this.version_++);
this.map_[a] = b;
};
goog.structs.Map.prototype.addAll = function(a) {
var b;
a instanceof goog.structs.Map ? (b = a.getKeys(), a = a.getValues()) : (b = goog.object.getKeys(a), a = goog.object.getValues(a));
for (var c = 0;c < b.length;c++) {
this.set(b[c], a[c]);
}
};
goog.structs.Map.prototype.forEach = function(a, b) {
for (var c = this.getKeys(), d = 0;d < c.length;d++) {
var e = c[d], f = this.get(e);
a.call(b, f, e, this);
}
};
goog.structs.Map.prototype.clone = function() {
return new goog.structs.Map(this);
};
goog.structs.Map.prototype.transpose = function() {
for (var a = new goog.structs.Map, b = 0;b < this.keys_.length;b++) {
var c = this.keys_[b];
a.set(this.map_[c], c);
}
return a;
};
goog.structs.Map.prototype.toObject = function() {
this.cleanupKeysArray_();
for (var a = {}, b = 0;b < this.keys_.length;b++) {
var c = this.keys_[b];
a[c] = this.map_[c];
}
return a;
};
goog.structs.Map.prototype.getKeyIterator = function() {
return this.__iterator__(!0);
};
goog.structs.Map.prototype.getValueIterator = function() {
return this.__iterator__(!1);
};
goog.structs.Map.prototype.__iterator__ = function(a) {
this.cleanupKeysArray_();
var b = 0, c = this.keys_, d = this.map_, e = this.version_, f = this, g = new goog.iter.Iterator;
g.next = function() {
for (;;) {
if (e != f.version_) {
throw Error("The map has changed since the iterator was created");
}
if (b >= c.length) {
throw goog.iter.StopIteration;
}
var g = c[b++];
return a ? g : d[g];
}
};
return g;
};
goog.structs.Map.hasKey_ = function(a, b) {
return Object.prototype.hasOwnProperty.call(a, b);
};
goog.structs.getCount = function(a) {
return "function" == typeof a.getCount ? a.getCount() : goog.isArrayLike(a) || goog.isString(a) ? a.length : goog.object.getCount(a);
};
goog.structs.getValues = function(a) {
if ("function" == typeof a.getValues) {
return a.getValues();
}
if (goog.isString(a)) {
return a.split("");
}
if (goog.isArrayLike(a)) {
for (var b = [], c = a.length, d = 0;d < c;d++) {
b.push(a[d]);
}
return b;
}
return goog.object.getValues(a);
};
goog.structs.getKeys = function(a) {
if ("function" == typeof a.getKeys) {
return a.getKeys();
}
if ("function" != typeof a.getValues) {
if (goog.isArrayLike(a) || goog.isString(a)) {
var b = [];
a = a.length;
for (var c = 0;c < a;c++) {
b.push(c);
}
return b;
}
return goog.object.getKeys(a);
}
};
goog.structs.contains = function(a, b) {
return "function" == typeof a.contains ? a.contains(b) : "function" == typeof a.containsValue ? a.containsValue(b) : goog.isArrayLike(a) || goog.isString(a) ? goog.array.contains(a, b) : goog.object.containsValue(a, b);
};
goog.structs.isEmpty = function(a) {
return "function" == typeof a.isEmpty ? a.isEmpty() : goog.isArrayLike(a) || goog.isString(a) ? goog.array.isEmpty(a) : goog.object.isEmpty(a);
};
goog.structs.clear = function(a) {
"function" == typeof a.clear ? a.clear() : goog.isArrayLike(a) ? goog.array.clear(a) : goog.object.clear(a);
};
goog.structs.forEach = function(a, b, c) {
if ("function" == typeof a.forEach) {
a.forEach(b, c);
} else {
if (goog.isArrayLike(a) || goog.isString(a)) {
goog.array.forEach(a, b, c);
} else {
for (var d = goog.structs.getKeys(a), e = goog.structs.getValues(a), f = e.length, g = 0;g < f;g++) {
b.call(c, e[g], d && d[g], a);
}
}
}
};
goog.structs.filter = function(a, b, c) {
if ("function" == typeof a.filter) {
return a.filter(b, c);
}
if (goog.isArrayLike(a) || goog.isString(a)) {
return goog.array.filter(a, b, c);
}
var d, e = goog.structs.getKeys(a), f = goog.structs.getValues(a), g = f.length;
if (e) {
d = {};
for (var h = 0;h < g;h++) {
b.call(c, f[h], e[h], a) && (d[e[h]] = f[h]);
}
} else {
for (d = [], h = 0;h < g;h++) {
b.call(c, f[h], void 0, a) && d.push(f[h]);
}
}
return d;
};
goog.structs.map = function(a, b, c) {
if ("function" == typeof a.map) {
return a.map(b, c);
}
if (goog.isArrayLike(a) || goog.isString(a)) {
return goog.array.map(a, b, c);
}
var d, e = goog.structs.getKeys(a), f = goog.structs.getValues(a), g = f.length;
if (e) {
d = {};
for (var h = 0;h < g;h++) {
d[e[h]] = b.call(c, f[h], e[h], a);
}
} else {
for (d = [], h = 0;h < g;h++) {
d[h] = b.call(c, f[h], void 0, a);
}
}
return d;
};
goog.structs.some = function(a, b, c) {
if ("function" == typeof a.some) {
return a.some(b, c);
}
if (goog.isArrayLike(a) || goog.isString(a)) {
return goog.array.some(a, b, c);
}
for (var d = goog.structs.getKeys(a), e = goog.structs.getValues(a), f = e.length, g = 0;g < f;g++) {
if (b.call(c, e[g], d && d[g], a)) {
return !0;
}
}
return !1;
};
goog.structs.every = function(a, b, c) {
if ("function" == typeof a.every) {
return a.every(b, c);
}
if (goog.isArrayLike(a) || goog.isString(a)) {
return goog.array.every(a, b, c);
}
for (var d = goog.structs.getKeys(a), e = goog.structs.getValues(a), f = e.length, g = 0;g < f;g++) {
if (!b.call(c, e[g], d && d[g], a)) {
return !1;
}
}
return !0;
};
goog.structs.Set = function(a) {
this.map_ = new goog.structs.Map;
a && this.addAll(a);
};
goog.structs.Set.getKey_ = function(a) {
var b = typeof a;
return "object" == b && a || "function" == b ? "o" + goog.getUid(a) : b.substr(0, 1) + a;
};
goog.structs.Set.prototype.getCount = function() {
return this.map_.getCount();
};
goog.structs.Set.prototype.add = function(a) {
this.map_.set(goog.structs.Set.getKey_(a), a);
};
goog.structs.Set.prototype.addAll = function(a) {
a = goog.structs.getValues(a);
for (var b = a.length, c = 0;c < b;c++) {
this.add(a[c]);
}
};
goog.structs.Set.prototype.removeAll = function(a) {
a = goog.structs.getValues(a);
for (var b = a.length, c = 0;c < b;c++) {
this.remove(a[c]);
}
};
goog.structs.Set.prototype.remove = function(a) {
return this.map_.remove(goog.structs.Set.getKey_(a));
};
goog.structs.Set.prototype.clear = function() {
this.map_.clear();
};
goog.structs.Set.prototype.isEmpty = function() {
return this.map_.isEmpty();
};
goog.structs.Set.prototype.contains = function(a) {
return this.map_.containsKey(goog.structs.Set.getKey_(a));
};
goog.structs.Set.prototype.containsAll = function(a) {
return goog.structs.every(a, this.contains, this);
};
goog.structs.Set.prototype.intersection = function(a) {
var b = new goog.structs.Set;
a = goog.structs.getValues(a);
for (var c = 0;c < a.length;c++) {
var d = a[c];
this.contains(d) && b.add(d);
}
return b;
};
goog.structs.Set.prototype.difference = function(a) {
var b = this.clone();
b.removeAll(a);
return b;
};
goog.structs.Set.prototype.getValues = function() {
return this.map_.getValues();
};
goog.structs.Set.prototype.clone = function() {
return new goog.structs.Set(this);
};
goog.structs.Set.prototype.equals = function(a) {
return this.getCount() == goog.structs.getCount(a) && this.isSubsetOf(a);
};
goog.structs.Set.prototype.isSubsetOf = function(a) {
var b = goog.structs.getCount(a);
if (this.getCount() > b) {
return !1;
}
!(a instanceof goog.structs.Set) && 5 < b && (a = new goog.structs.Set(a));
return goog.structs.every(this, function(b) {
return goog.structs.contains(a, b);
});
};
goog.structs.Set.prototype.__iterator__ = function(a) {
return this.map_.__iterator__(!1);
};
var pagespeed = {};
google.load("visualization", "1.0", {packages:["corechart"]});
pagespeed.error = function(a) {
window.console && console.error(a);
};
pagespeed.Console = function() {
this.graphs_ = [];
this.varsNeeded_ = new goog.structs.Set;
this.timestamps_ = this.variables_ = null;
this.lineChartOptions_ = {width:900, height:255, colors:["#4ECDC4", "#556270", "#C7F464"], legend:{position:"bottom"}, hAxis:{format:"MMM d, y hh:mma", gridlines:{color:"#F2F2F2"}, baselineColor:"#E5E5E5"}, vAxis:{format:"#.###%", minValue:0, viewWindowMode:"explicit", viewWindow:{min:0}, gridlines:{color:"#F2F2F2"}, baselineColor:"#E5E5E5"}, chartArea:{left:60, top:20, width:800}, pointSize:2};
};
pagespeed.statistics = {};
pagespeed.statistics.variable = function(a) {
var b = {};
b.varsNeeded = new goog.structs.Set([a]);
b.evaluate = function(b) {
return b(a);
};
return b;
};
pagespeed.statistics.sum = function(a) {
var b = {};
b.varsNeeded = new goog.structs.Set;
for (var c = 0;c < a.length;c++) {
b.varsNeeded.addAll(a[c].varsNeeded);
}
b.evaluate = function(b) {
for (var c = 0, f = 0;f < a.length;f++) {
c += a[f].evaluate(b);
}
return c;
};
return b;
};
pagespeed.statistics.percent = function(a, b) {
var c = {};
c.varsNeeded = new goog.structs.Set;
c.varsNeeded.addAll(a.varsNeeded);
c.varsNeeded.addAll(b.varsNeeded);
c.evaluate = function(c) {
var e = b.evaluate(c);
return 0 == e ? 0 : a.evaluate(c) / e;
};
return c;
};
pagespeed.statistics.percent_total = function(a, b) {
return pagespeed.statistics.percent(a, pagespeed.statistics.sum([a, b]));
};
pagespeed.startConsole = function() {
var a = new pagespeed.Console;
a.initGraphs();
a.startConsole();
return a;
};
goog.exportSymbol("pagespeed.startConsole", pagespeed.startConsole);
pagespeed.Console.prototype.initGraphs = function() {
var a = pagespeed.statistics.variable, b = pagespeed.statistics.sum, c = pagespeed.statistics.percent, d = pagespeed.statistics.percent_total;
this.addGraph("Resources not loaded because of fetch failures", "fetch-failure", c(a("serf_fetch_failure_count"), a("serf_fetch_request_count")));
this.addGraph("Resources not rewritten because domain wasn't authorized", "not-authorized", d(a("resource_url_domain_rejections"), a("resource_url_domain_acceptances")));
this.addGraph("Resources not rewritten because of restrictive Cache-Control headers", "cache-control", d(a("num_cache_control_not_rewritable_resources"), a("num_cache_control_rewritable_resources")));
var e = b([a("cache_backend_misses"), a("cache_backend_hits")]);
this.addGraph("Cache misses", "cache-miss", c(a("cache_backend_misses"), e));
this.addGraph("Cache lookups that were expired", "cache-expired", c(a("cache_expirations"), e));
this.addGraph("CSS files not rewritten because of parse errors", "css-error", d(a("css_filter_parse_failures"), a("css_filter_blocks_rewritten")));
this.addGraph("JavaScript minification failures", "js-error", d(a("javascript_minification_failures"), a("javascript_blocks_minified")));
c = b([a("image_rewrites"), a("image_rewrites_dropped_nosaving_resize"), a("image_rewrites_dropped_nosaving_noresize")]);
a = b([a("image_norewrites_high_resolution"), a("image_rewrites_dropped_decode_failure"), a("image_rewrites_dropped_due_to_load"), a("image_rewrites_dropped_mime_type_unknown"), a("image_rewrites_dropped_server_write_fail")]);
this.addGraph("Image rewrite failures", "image-error", d(a, c));
};
pagespeed.Console.prototype.addGraph = function(a, b, c) {
var d = {};
d.title = a;
d.docUrl = "https://developers.google.com/speed/pagespeed/module/console#" + b;
d.value = c;
d.num = this.graphs_.length;
d.overallPercent = null;
d.priority = null;
d.dataTable = null;
d.lineChart = null;
this.graphs_.push(d);
this.varsNeeded_.addAll(c.varsNeeded);
return d;
};
pagespeed.Console.prototype.startConsole = function() {
var a = new Date;
this.loadJsonData(new Date(a - 864E5), a, 6E4);
};
pagespeed.Console.prototype.createQueryUrl = function(a, b, c, d) {
var e = pagespeedStatisticsUrl + "?json", e = e + ("&start_time=" + b.getTime()), e = e + ("&end_time=" + c.getTime()), e = e + ("&granularity=" + d) + "&var_titles=";
for (b = 0;b < a.length;b++) {
e += a[b] + ",";
}
return e;
};
pagespeed.Console.prototype.loadJsonData = function(a, b, c) {
var d = new XMLHttpRequest, e = this;
a = this.createQueryUrl(this.varsNeeded_.getValues(), a, b, c);
d.onreadystatechange = function() {
if (4 == this.readyState) {
if (200 != this.status || 1 > this.responseText.length || "{" != this.responseText[0]) {
pagespeed.error("XHR request failed.");
} else {
var a = JSON.parse(this.responseText);
e.drawGraphsFromJsonData(a);
}
}
};
d.open("GET", a);
d.send();
};
pagespeed.Console.prototype.drawGraphsFromJsonData = function(a) {
this.variables_ = a.variables;
this.timestamps_ = a.timestamps;
this.checkDataValidity(this.timestamps_, this.variables_);
for (a = 0;a < this.graphs_.length;a++) {
for (var b = [], c = 0;c < this.timestamps_.length;c++) {
b.push(this.graphs_[a].value.evaluate(function(a) {
return function(b) {
if (b in a) {
return a[b][c];
}
pagespeed.error("JSON data missing required variable.");
return 0;
};
}(this.variables_)));
}
this.graphs_[a].overallPercent = b[b.length - 1];
this.graphs_[a].priority = this.graphs_[a].overallPercent;
this.graphs_[a].dataTable = this.buildDataTable(this.graphs_[a].title, this.timestamps_, b);
}
this.graphs_.sort(function(a, b) {
return b.priority - a.priority;
});
for (a = 0;a < this.graphs_.length;a++) {
this.drawGraph(this.graphs_[a]);
}
};
pagespeed.Console.prototype.checkDataValidity = function(a, b) {
for (var c in b) {
a.length != b[c].length && pagespeed.error("JSON response is malformed. (" + a.length + " != " + b[c].length + ")");
}
};
pagespeed.Console.prototype.buildDataTable = function(a, b, c) {
for (var d = this.createDataTable(a), e = 0;e < b.length;e++) {
d.addRow([new Date(b[e]), c[e]]);
}
0 == d.getNumberOfRows() && pagespeed.error("Data failed to load for graph " + a);
return d;
};
pagespeed.Console.prototype.createDataTable = function(a) {
var b = new google.visualization.DataTable;
b.addColumn("datetime", "Time");
b.addColumn("number", a);
return b;
};
pagespeed.Console.prototype.drawGraph = function(a) {
a.lineChart = new google.visualization.LineChart(pagespeed.createGraphDiv(a.title, a.overallPercent, a.docUrl, a.num));
a.lineChart.draw(a.dataTable, this.lineChartOptions_);
};
pagespeed.createGraphDiv = function(a, b, c, d) {
var e = document.createElement("div");
e.setAttribute("class", "pagespeed-widgets");
e.appendChild(pagespeed.createGraphTitleBar(a, b, c, d));
a = document.createElement("div");
a.setAttribute("class", "pagespeed-graph");
e.appendChild(a);
document.getElementById("pagespeed-graphs-container").appendChild(e);
return a;
};
pagespeed.createGraphTitleBar = function(a, b, c, d) {
var e = document.createElement("div");
e.setAttribute("class", "pagespeed-widgets-topbar");
var f = document.createElement("span");
f.setAttribute("class", "pagespeed-title");
f.setAttribute("id", "pagespeed-title" + d);
f.appendChild(document.createTextNode(a + ": " + (100 * b).toFixed(2) + "% ("));
a = document.createElement("a");
a.setAttribute("href", c);
a.appendChild(document.createTextNode("doc"));
f.appendChild(a);
f.appendChild(document.createTextNode(")"));
e.appendChild(f);
return e;
};
})();