Created
February 23, 2021 11:09
-
-
Save benjaminadk/205e5fae50cfe54ea9ad2af73f3c8268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script data-pagespeed-no-defer> | |
;(function () { | |
var $jscomp = { | |
scope: {}, | |
checkStringArgs: function (a, b, c) { | |
if (null == a) { | |
throw new TypeError( | |
"The 'this' value for String.prototype." + | |
c + | |
' must not be null or undefined' | |
) | |
} | |
if (b instanceof RegExp) { | |
throw new TypeError( | |
'First argument to String.prototype.' + | |
c + | |
' must not be a regular expression' | |
) | |
} | |
return a + '' | |
}, | |
} | |
$jscomp.defineProperty = | |
'function' == typeof Object.defineProperties | |
? Object.defineProperty | |
: function (a, b, c) { | |
if (c.get || c.set) { | |
throw new TypeError('ES3 does not support getters and setters.') | |
} | |
a != Array.prototype && a != Object.prototype && (a[b] = c.value) | |
} | |
$jscomp.getGlobal = function (a) { | |
return 'undefined' != typeof window && window === a | |
? a | |
: 'undefined' != typeof global && null != global | |
? global | |
: a | |
} | |
$jscomp.global = $jscomp.getGlobal(this) | |
$jscomp.polyfill = function (a, b, c, d) { | |
if (b) { | |
c = $jscomp.global | |
a = a.split('.') | |
for (d = 0; d < a.length - 1; d++) { | |
var e = a[d] | |
e in c || (c[e] = {}) | |
c = c[e] | |
} | |
a = a[a.length - 1] | |
d = c[a] | |
b = b(d) | |
b != d && | |
null != b && | |
$jscomp.defineProperty(c, a, { | |
configurable: !0, | |
writable: !0, | |
value: b, | |
}) | |
} | |
} | |
$jscomp.polyfill( | |
'String.prototype.repeat', | |
function (a) { | |
return a | |
? a | |
: function (a) { | |
var b = $jscomp.checkStringArgs(this, null, 'repeat') | |
if (0 > a || 1342177279 < a) { | |
throw new RangeError('Invalid count value') | |
} | |
a |= 0 | |
for (var d = ''; a; ) { | |
if ((a & 1 && (d += b), (a >>>= 1))) { | |
b += b | |
} | |
} | |
return d | |
} | |
}, | |
'es6-impl', | |
'es3' | |
) | |
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.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING = !1 | |
goog.provide = function (a) { | |
if (goog.isInModuleLoader_()) { | |
throw Error('goog.provide can not be used within a goog.module.') | |
} | |
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. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide." | |
) | |
} | |
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.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, '/') | |
var f = goog.dependencies_ | |
;(d && 'boolean' !== typeof d) || (d = d ? { module: 'goog' } : {}) | |
for (var g = 0; (e = b[g]); g++) { | |
;(f.nameToPath[e] = a), (f.loadFlags[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)) { | |
if (goog.isInModuleLoader_()) { | |
return goog.module.getInternal_(a) | |
} | |
} else { | |
if (goog.ENABLE_DEBUG_LOADER) { | |
var b = goog.getPathFromDeps_(a) | |
if (b) { | |
goog.writeScripts_(b) | |
} else { | |
throw ( | |
((a = 'goog.require could not find: ' + a), | |
goog.logToConsole_(a), | |
Error(a)) | |
) | |
} | |
} | |
} | |
return null | |
} | |
} | |
goog.basePath = '' | |
goog.nullFunction = function () {} | |
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.TRANSPILE = 'detect' | |
goog.TRANSPILER = 'transpile.js' | |
goog.DEPENDENCIES_ENABLED && | |
((goog.dependencies_ = { | |
loadFlags: {}, | |
nameToPath: {}, | |
requires: {}, | |
visited: {}, | |
written: {}, | |
deferred: {}, | |
}), | |
(goog.inHtmlDocument_ = function () { | |
var a = goog.global.document | |
return null != a && 'write' in a | |
}), | |
(goog.findBasePath_ = function () { | |
if (goog.isDef(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.importProcessedScript_ = function (a, b, c) { | |
goog.importScript_( | |
'', | |
'goog.retrieveAndExec_("' + a + '", ' + b + ', ' + c + ');' | |
) | |
}), | |
(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) { | |
var b = | |
((a = goog.getPathFromDeps_(a)) && | |
goog.dependencies_.loadFlags[a]) || | |
{}, | |
c = b.lang || 'es3' | |
return a && ('goog' == b.module || goog.needsTranspile_(c)) | |
? 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.loadModuleFromUrl = function (a) { | |
goog.retrieveAndExec_(a, !0, !1) | |
}), | |
(goog.writeScriptSrcNode_ = function (a) { | |
goog.global.document.write( | |
'<script type="text/javascript" src="' + a + '">\x3c/script>' | |
) | |
}), | |
(goog.appendScriptSrcNode_ = function (a) { | |
var b = goog.global.document, | |
c = b.createElement('script') | |
c.type = 'text/javascript' | |
c.src = a | |
c.defer = !1 | |
c.async = !1 | |
b.head.appendChild(c) | |
}), | |
(goog.writeScriptTag_ = function (a, b) { | |
if (goog.inHtmlDocument_()) { | |
var c = goog.global.document | |
if ( | |
!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING && | |
'complete' == c.readyState | |
) { | |
if (/\bdeps.js$/.test(a)) { | |
return !1 | |
} | |
throw Error('Cannot write "' + a + '" after document load') | |
} | |
if (void 0 === b) { | |
if (goog.IS_OLD_IE_) { | |
var d = | |
" onreadystatechange='goog.onScriptLoad_(this, " + | |
++goog.lastNonModuleScriptIndex_ + | |
")' " | |
c.write( | |
'<script type="text/javascript" src="' + | |
a + | |
'"' + | |
d + | |
'>\x3c/script>' | |
) | |
} else { | |
goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING | |
? goog.appendScriptSrcNode_(a) | |
: goog.writeScriptSrcNode_(a) | |
} | |
} else { | |
c.write('<script type="text/javascript">' + b + '\x3c/script>') | |
} | |
return !0 | |
} | |
return !1 | |
}), | |
(goog.needsTranspile_ = function (a) { | |
if ('always' == goog.TRANSPILE) { | |
return !0 | |
} | |
if ('never' == goog.TRANSPILE) { | |
return !1 | |
} | |
goog.requiresTranspilation_ || | |
(goog.requiresTranspilation_ = goog.createRequiresTranspilation_()) | |
if (a in goog.requiresTranspilation_) { | |
return goog.requiresTranspilation_[a] | |
} | |
throw Error('Unknown language mode: ' + a) | |
}), | |
(goog.createRequiresTranspilation_ = function () { | |
function a(a, b) { | |
d ? (c[a] = !0) : b() ? (c[a] = !1) : (d = c[a] = !0) | |
} | |
function b(a) { | |
try { | |
return !!eval(a) | |
} catch (f) { | |
return !1 | |
} | |
} | |
var c = { es3: !1 }, | |
d = !1 | |
a('es5', function () { | |
return b('[1,].length==1') | |
}) | |
a('es6', function () { | |
return b( | |
'(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()' | |
) | |
}) | |
a('es6-impl', function () { | |
return !0 | |
}) | |
a('es7', function () { | |
return b('2 ** 2 == 4') | |
}) | |
a('es8', function () { | |
return b('async () => 1, true') | |
}) | |
return c | |
}), | |
(goog.requiresTranspilation_ = null), | |
(goog.lastNonModuleScriptIndex_ = 0), | |
(goog.onScriptLoad_ = function (a, b) { | |
'complete' == a.readyState && | |
goog.lastNonModuleScriptIndex_ == b && | |
goog.loadQueuedModules_() | |
return !0 | |
}), | |
(goog.writeScripts_ = function (a) { | |
function b(a) { | |
if (!(a in e.written || a in e.visited)) { | |
e.visited[a] = !0 | |
if (a in e.requires) { | |
for (var f in e.requires[a]) { | |
if (!goog.isProvided_(f)) { | |
if (f in e.nameToPath) { | |
b(e.nameToPath[f]) | |
} else { | |
throw Error('Undefined nameToPath for ' + f) | |
} | |
} | |
} | |
} | |
a in d || ((d[a] = !0), c.push(a)) | |
} | |
} | |
var c = [], | |
d = {}, | |
e = goog.dependencies_ | |
b(a) | |
for (a = 0; a < c.length; a++) { | |
var f = c[a] | |
goog.dependencies_.written[f] = !0 | |
} | |
var g = goog.moduleLoaderState_ | |
goog.moduleLoaderState_ = null | |
for (a = 0; a < c.length; a++) { | |
if ((f = c[a])) { | |
var h = e.loadFlags[f] || {}, | |
k = goog.needsTranspile_(h.lang || 'es3') | |
'goog' == h.module || k | |
? goog.importProcessedScript_( | |
goog.basePath + f, | |
'goog' == h.module, | |
k | |
) | |
: goog.importScript_(goog.basePath + f) | |
} 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.loadModule = function (a) { | |
var b = goog.moduleLoaderState_ | |
try { | |
goog.moduleLoaderState_ = { | |
moduleName: void 0, | |
declareLegacyNamespace: !1, | |
} | |
var c | |
if (goog.isFunction(a)) { | |
c = a.call(void 0, {}) | |
} else { | |
if (goog.isString(a)) { | |
c = goog.loadModuleFromSource_.call(void 0, 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 && | |
goog.isObject(c) && | |
Object.seal(c) | |
goog.loadedModules_[d] = c | |
} finally { | |
goog.moduleLoaderState_ = b | |
} | |
} | |
goog.loadModuleFromSource_ = function (a) { | |
eval(a) | |
return {} | |
} | |
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.loadFileSync_ = function (a) { | |
if (goog.global.CLOSURE_LOAD_FILE_SYNC) { | |
return goog.global.CLOSURE_LOAD_FILE_SYNC(a) | |
} | |
try { | |
var b = new goog.global.XMLHttpRequest() | |
b.open('get', a, !1) | |
b.send() | |
return 0 == b.status || 200 == b.status ? b.responseText : null | |
} catch (c) { | |
return null | |
} | |
} | |
goog.retrieveAndExec_ = function (a, b, c) { | |
if (!COMPILED) { | |
var d = a | |
a = goog.normalizePath_(a) | |
var e = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_, | |
f = goog.loadFileSync_(a) | |
if (null == f) { | |
throw Error('Load of "' + a + '" failed') | |
} | |
c && (f = goog.transpile_.call(goog.global, f, a)) | |
f = b ? goog.wrapModule_(a, f) : f + ('\n//# sourceURL=' + a) | |
goog.IS_OLD_IE_ | |
? ((goog.dependencies_.deferred[d] = f), goog.queuedModules_.push(d)) | |
: e(a, f) | |
} | |
} | |
goog.transpile_ = function (a, b) { | |
var c = goog.global.$jscomp | |
c || (goog.global.$jscomp = c = {}) | |
var d = c.transpile | |
if (!d) { | |
var e = goog.basePath + goog.TRANSPILER, | |
f = goog.loadFileSync_(e) | |
if (f) { | |
eval(f + '\n//# sourceURL=' + e) | |
if ( | |
goog.global.$gwtExport && | |
goog.global.$gwtExport.$jscomp && | |
!goog.global.$gwtExport.$jscomp.transpile | |
) { | |
throw Error( | |
'The transpiler did not properly export the "transpile" method. $gwtExport: ' + | |
JSON.stringify(goog.global.$gwtExport) | |
) | |
} | |
goog.global.$jscomp.transpile = | |
goog.global.$gwtExport.$jscomp.transpile | |
c = goog.global.$jscomp | |
d = c.transpile | |
} | |
} | |
d || | |
(d = c.transpile = function (a, b) { | |
goog.logToConsole_( | |
b + ' requires transpilation but no transpiler was found.' | |
) | |
return a | |
}) | |
return d(a, b) | |
} | |
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) { | |
null !== 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_) { | |
if ( | |
(goog.global.eval('var _evalTest_ = 1;'), | |
'undefined' != typeof goog.global._evalTest_) | |
) { | |
try { | |
delete goog.global._evalTest_ | |
} catch (d) {} | |
goog.evalWorksForGlobals_ = !0 | |
} else { | |
goog.evalWorksForGlobals_ = !1 | |
} | |
} | |
if (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) { | |
if ('.' == String(a).charAt(0)) { | |
throw Error( | |
'className passed in goog.getCssName must not start with ".". You passed: ' + | |
a | |
) | |
} | |
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 | |
}, | |
d = b ? a + '-' + d(b) : d(a) | |
return goog.global.CLOSURE_CSS_NAME_MAP_FN | |
? goog.global.CLOSURE_CSS_NAME_MAP_FN(d) | |
: d | |
} | |
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 null != b && 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 d = Array(arguments.length - 2), e = 2; | |
e < arguments.length; | |
e++ | |
) { | |
d[e - 2] = arguments[e] | |
} | |
return b.prototype[c].apply(a, d) | |
} | |
} | |
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) { | |
if (goog.isInModuleLoader_()) { | |
throw Error('goog.scope is not supported within a goog.module.') | |
} | |
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) { | |
return a | |
} | |
var c = !goog.defineClass.isUnsealable_(b), | |
d = function () { | |
var b = a.apply(this, arguments) || this | |
b[goog.UID_PROPERTY_] = b[goog.UID_PROPERTY_] | |
this.constructor === d && | |
c && | |
Object.seal instanceof Function && | |
Object.seal(b) | |
return b | |
} | |
return d | |
} | |
goog.defineClass.isUnsealable_ = function (a) { | |
return ( | |
a && a.prototype && a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_] | |
) | |
} | |
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)) | |
this.reportErrorToServer = !0 | |
} | |
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.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.numberAwareCompare_ = function (a, b, c) { | |
if (a == b) { | |
return 0 | |
} | |
if (!a) { | |
return -1 | |
} | |
if (!b) { | |
return 1 | |
} | |
for ( | |
var d = a.toLowerCase().match(c), | |
e = b.toLowerCase().match(c), | |
f = Math.min(d.length, e.length), | |
g = 0; | |
g < f; | |
g++ | |
) { | |
c = d[g] | |
var h = e[g] | |
if (c != h) { | |
return ( | |
(a = parseInt(c, 10)), | |
!isNaN(a) && ((b = parseInt(h, 10)), !isNaN(b) && a - b) | |
? a - b | |
: c < h | |
? -1 | |
: 1 | |
) | |
} | |
} | |
return d.length != e.length ? d.length - e.length : a < b ? -1 : 1 | |
} | |
goog.string.intAwareCompare = function (a, b) { | |
return goog.string.numberAwareCompare_(a, b, /\d+|\D+/g) | |
} | |
goog.string.floatAwareCompare = function (a, b) { | |
return goog.string.numberAwareCompare_(a, b, /\d+|\.\d+|\D+/g) | |
} | |
goog.string.numerateCompare = goog.string.floatAwareCompare | |
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_, '&') | |
.replace(goog.string.LT_RE_, '<') | |
.replace(goog.string.GT_RE_, '>') | |
.replace(goog.string.QUOT_RE_, '"') | |
.replace(goog.string.SINGLE_QUOTE_RE_, ''') | |
.replace(goog.string.NULL_RE_, '�')), | |
goog.string.DETECT_DOUBLE_ESCAPING && | |
(a = a.replace(goog.string.E_RE_, 'e')) | |
} else { | |
if (!goog.string.ALL_RE_.test(a)) { | |
return a | |
} | |
;-1 != a.indexOf('&') && (a = a.replace(goog.string.AMP_RE_, '&')) | |
;-1 != a.indexOf('<') && (a = a.replace(goog.string.LT_RE_, '<')) | |
;-1 != a.indexOf('>') && (a = a.replace(goog.string.GT_RE_, '>')) | |
;-1 != a.indexOf('"') && (a = a.replace(goog.string.QUOT_RE_, '"')) | |
;-1 != a.indexOf("'") && | |
(a = a.replace(goog.string.SINGLE_QUOTE_RE_, ''')) | |
;-1 != a.indexOf('\x00') && | |
(a = a.replace(goog.string.NULL_RE_, '�')) | |
goog.string.DETECT_DOUBLE_ESCAPING && | |
-1 != a.indexOf('e') && | |
(a = a.replace(goog.string.E_RE_, 'e')) | |
} | |
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 = { '&': '&', '<': '<', '>': '>', '"': '"' }, | |
d | |
d = b ? b.createElement('div') : goog.global.document.createElement('div') | |
return a.replace(goog.string.HTML_ENTITY_PATTERN_, function (a, b) { | |
var e = c[a] | |
if (e) { | |
return e | |
} | |
if ('#' == b.charAt(0)) { | |
var f = Number('0' + b.substr(1)) | |
isNaN(f) || (e = String.fromCharCode(f)) | |
} | |
e || | |
((d.innerHTML = a + ' '), (e = d.firstChild.nodeValue.slice(0, -1))) | |
return (c[a] = e) | |
}) | |
} | |
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 b = Number('0' + c.substr(1)) | |
if (!isNaN(b)) { | |
return String.fromCharCode(b) | |
} | |
} | |
return a | |
} | |
}) | |
} | |
goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g | |
goog.string.whitespaceEscape = function (a, b) { | |
return goog.string.newLineToBr(a.replace(/ /g, '  '), 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) | |
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, | |
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) { | |
return a.replace(b, '') | |
} | |
goog.string.removeAll = function (a, b) { | |
var c = new RegExp(goog.string.regExpEscape(b), 'g') | |
return a.replace(c, '') | |
} | |
goog.string.replaceAll = function (a, b, c) { | |
b = new RegExp(goog.string.regExpEscape(b), 'g') | |
return a.replace(b, c.replace(/\$/g, '$$$$')) | |
} | |
goog.string.regExpEscape = function (a) { | |
return String(a) | |
.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1') | |
.replace(/\x08/g, '\\x08') | |
} | |
goog.string.repeat = String.prototype.repeat | |
? function (a, b) { | |
return a.repeat(b) | |
} | |
: 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] || '' | |
do { | |
h = /(\d*)(\D*)(.*)/.exec(h) || ['', '', '', ''] | |
k = /(\d*)(\D*)(.*)/.exec(k) || ['', '', '', ''] | |
if (0 == h[0].length && 0 == k[0].length) { | |
break | |
} | |
var c = 0 == h[1].length ? 0 : parseInt(h[1], 10), | |
l = 0 == k[1].length ? 0 : parseInt(k[1], 10), | |
c = | |
goog.string.compareElements_(c, l) || | |
goog.string.compareElements_( | |
0 == h[2].length, | |
0 == k[2].length | |
) || | |
goog.string.compareElements_(h[2], k[2]), | |
h = h[3], | |
k = k[3] | |
} while (0 == c) | |
} | |
return c | |
} | |
goog.string.compareElements_ = function (a, b) { | |
return a < b ? -1 : a > b ? 1 : 0 | |
} | |
goog.string.hashCode = function (a) { | |
for (var b = 0, c = 0; c < a.length; ++c) { | |
b = (31 * b + a.charCodeAt(c)) >>> 0 | |
} | |
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.lastComponent = function (a, b) { | |
if (b) { | |
'string' == typeof b && (b = [b]) | |
} else { | |
return a | |
} | |
for (var c = -1, d = 0; d < b.length; d++) { | |
if ('' != b[d]) { | |
var e = a.lastIndexOf(b[d]) | |
e > c && (c = e) | |
} | |
} | |
return -1 == c ? a : a.slice(c + 1) | |
} | |
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] + Number(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.indexOf = | |
goog.NATIVE_ARRAY_PROTOTYPES && | |
(goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.indexOf) | |
? function (a, b, c) { | |
goog.asserts.assert(null != a.length) | |
return 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 || Array.prototype.lastIndexOf) | |
? function (a, b, c) { | |
goog.asserts.assert(null != a.length) | |
return 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 || Array.prototype.forEach) | |
? function (a, b, c) { | |
goog.asserts.assert(null != a.length) | |
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 || Array.prototype.filter) | |
? function (a, b, c) { | |
goog.asserts.assert(null != a.length) | |
return 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 || Array.prototype.map) | |
? function (a, b, c) { | |
goog.asserts.assert(null != a.length) | |
return 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 || Array.prototype.reduce) | |
? function (a, b, c, d) { | |
goog.asserts.assert(null != a.length) | |
d && (b = goog.bind(b, d)) | |
return Array.prototype.reduce.call(a, b, c) | |
} | |
: 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 || Array.prototype.reduceRight) | |
? function (a, b, c, d) { | |
goog.asserts.assert(null != a.length) | |
goog.asserts.assert(null != b) | |
d && (b = goog.bind(b, d)) | |
return 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 || Array.prototype.some) | |
? function (a, b, c) { | |
goog.asserts.assert(null != a.length) | |
return 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 || Array.prototype.every) | |
? function (a, b, c) { | |
goog.asserts.assert(null != a.length) | |
return 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.removeLast = function (a, b) { | |
var c = goog.array.lastIndexOf(a, b) | |
return 0 <= c ? (goog.array.removeAt(a, c), !0) : !1 | |
} | |
goog.array.removeAt = function (a, b) { | |
goog.asserts.assert(null != a.length) | |
return 1 == 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 Array.prototype.concat.apply(Array.prototype, arguments) | |
} | |
goog.array.join = function (a) { | |
return Array.prototype.concat.apply(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 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 | |
? Array.prototype.slice.call(a, b) | |
: Array.prototype.slice.call(a, b, c) | |
} | |
goog.array.removeDuplicates = function (a, b, c) { | |
b = b || a | |
var d = function (a) { | |
return goog.isObject(a) | |
? 'o' + goog.getUid(a) | |
: (typeof a).charAt(0) + a | |
} | |
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 = Array(a.length), d = 0; d < a.length; d++) { | |
c[d] = { index: d, value: a[d] } | |
} | |
var e = b || goog.array.defaultCompare | |
goog.array.sort(c, function (a, b) { | |
return e(a.value, b.value) || a.index - b.index | |
}) | |
for (d = 0; d < a.length; d++) { | |
a[d] = c[d].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 | |
? Array.prototype.unshift.apply(a, a.splice(-b, b)) | |
: 0 > b && 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 = Array.prototype.splice.call(a, b, 1) | |
Array.prototype.splice.call(a, c, 0, b[0]) | |
} | |
goog.array.zip = function (a) { | |
if (!arguments.length) { | |
return [] | |
} | |
for ( | |
var b = [], c = arguments[0].length, d = 1; | |
d < arguments.length; | |
d++ | |
) { | |
arguments[d].length < c && (c = arguments[d].length) | |
} | |
for (d = 0; d < c; d++) { | |
for (var e = [], f = 0; f < arguments.length; f++) { | |
e.push(arguments[f][d]) | |
} | |
b.push(e) | |
} | |
return b | |
} | |
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.array.concatMap = function (a, b, c) { | |
return goog.array.concat.apply([], goog.array.map(a, b, c)) | |
} | |
goog.labs = {} | |
goog.labs.userAgent = {} | |
goog.labs.userAgent.util = {} | |
goog.labs.userAgent.util.getNativeUserAgentString_ = function () { | |
var a = goog.labs.userAgent.util.getNavigator_() | |
return a && (a = a.userAgent) ? a : '' | |
} | |
goog.labs.userAgent.util.getNavigator_ = function () { | |
return goog.global.navigator | |
} | |
goog.labs.userAgent.util.userAgent_ = goog.labs.userAgent.util.getNativeUserAgentString_() | |
goog.labs.userAgent.util.setUserAgent = function (a) { | |
goog.labs.userAgent.util.userAgent_ = | |
a || goog.labs.userAgent.util.getNativeUserAgentString_() | |
} | |
goog.labs.userAgent.util.getUserAgent = function () { | |
return goog.labs.userAgent.util.userAgent_ | |
} | |
goog.labs.userAgent.util.matchUserAgent = function (a) { | |
var b = goog.labs.userAgent.util.getUserAgent() | |
return goog.string.contains(b, a) | |
} | |
goog.labs.userAgent.util.matchUserAgentIgnoreCase = function (a) { | |
var b = goog.labs.userAgent.util.getUserAgent() | |
return goog.string.caseInsensitiveContains(b, a) | |
} | |
goog.labs.userAgent.util.extractVersionTuples = function (a) { | |
for ( | |
var b = RegExp('(\\w[\\w ]+)/([^\\s]+)\\s*(?:\\((.*?)\\))?', 'g'), | |
c = [], | |
d; | |
(d = b.exec(a)); | |
) { | |
c.push([d[1], d[2], d[3] || void 0]) | |
} | |
return c | |
} | |
goog.object = {} | |
goog.object.is = function (a, b) { | |
return a === b ? 0 !== a || 1 / a === 1 / b : a !== a && b !== b | |
} | |
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 null !== a && 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 (null !== a && 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 null !== a && 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 (goog.isFunction(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.labs.userAgent.browser = {} | |
goog.labs.userAgent.browser.matchOpera_ = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Opera') | |
} | |
goog.labs.userAgent.browser.matchIE_ = function () { | |
return ( | |
goog.labs.userAgent.util.matchUserAgent('Trident') || | |
goog.labs.userAgent.util.matchUserAgent('MSIE') | |
) | |
} | |
goog.labs.userAgent.browser.matchEdge_ = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Edge') | |
} | |
goog.labs.userAgent.browser.matchFirefox_ = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Firefox') | |
} | |
goog.labs.userAgent.browser.matchSafari_ = function () { | |
return ( | |
goog.labs.userAgent.util.matchUserAgent('Safari') && | |
!( | |
goog.labs.userAgent.browser.matchChrome_() || | |
goog.labs.userAgent.browser.matchCoast_() || | |
goog.labs.userAgent.browser.matchOpera_() || | |
goog.labs.userAgent.browser.matchEdge_() || | |
goog.labs.userAgent.browser.isSilk() || | |
goog.labs.userAgent.util.matchUserAgent('Android') | |
) | |
) | |
} | |
goog.labs.userAgent.browser.matchCoast_ = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Coast') | |
} | |
goog.labs.userAgent.browser.matchIosWebview_ = function () { | |
return ( | |
(goog.labs.userAgent.util.matchUserAgent('iPad') || | |
goog.labs.userAgent.util.matchUserAgent('iPhone')) && | |
!goog.labs.userAgent.browser.matchSafari_() && | |
!goog.labs.userAgent.browser.matchChrome_() && | |
!goog.labs.userAgent.browser.matchCoast_() && | |
goog.labs.userAgent.util.matchUserAgent('AppleWebKit') | |
) | |
} | |
goog.labs.userAgent.browser.matchChrome_ = function () { | |
return ( | |
(goog.labs.userAgent.util.matchUserAgent('Chrome') || | |
goog.labs.userAgent.util.matchUserAgent('CriOS')) && | |
!goog.labs.userAgent.browser.matchEdge_() | |
) | |
} | |
goog.labs.userAgent.browser.matchAndroidBrowser_ = function () { | |
return ( | |
goog.labs.userAgent.util.matchUserAgent('Android') && | |
!( | |
goog.labs.userAgent.browser.isChrome() || | |
goog.labs.userAgent.browser.isFirefox() || | |
goog.labs.userAgent.browser.isOpera() || | |
goog.labs.userAgent.browser.isSilk() | |
) | |
) | |
} | |
goog.labs.userAgent.browser.isOpera = | |
goog.labs.userAgent.browser.matchOpera_ | |
goog.labs.userAgent.browser.isIE = goog.labs.userAgent.browser.matchIE_ | |
goog.labs.userAgent.browser.isEdge = goog.labs.userAgent.browser.matchEdge_ | |
goog.labs.userAgent.browser.isFirefox = | |
goog.labs.userAgent.browser.matchFirefox_ | |
goog.labs.userAgent.browser.isSafari = | |
goog.labs.userAgent.browser.matchSafari_ | |
goog.labs.userAgent.browser.isCoast = | |
goog.labs.userAgent.browser.matchCoast_ | |
goog.labs.userAgent.browser.isIosWebview = | |
goog.labs.userAgent.browser.matchIosWebview_ | |
goog.labs.userAgent.browser.isChrome = | |
goog.labs.userAgent.browser.matchChrome_ | |
goog.labs.userAgent.browser.isAndroidBrowser = | |
goog.labs.userAgent.browser.matchAndroidBrowser_ | |
goog.labs.userAgent.browser.isSilk = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Silk') | |
} | |
goog.labs.userAgent.browser.getVersion = function () { | |
function a(a) { | |
a = goog.array.find(a, d) | |
return c[a] || '' | |
} | |
var b = goog.labs.userAgent.util.getUserAgent() | |
if (goog.labs.userAgent.browser.isIE()) { | |
return goog.labs.userAgent.browser.getIEVersion_(b) | |
} | |
var b = goog.labs.userAgent.util.extractVersionTuples(b), | |
c = {} | |
goog.array.forEach(b, function (a) { | |
c[a[0]] = a[1] | |
}) | |
var d = goog.partial(goog.object.containsKey, c) | |
return goog.labs.userAgent.browser.isOpera() | |
? a(['Version', 'Opera']) | |
: goog.labs.userAgent.browser.isEdge() | |
? a(['Edge']) | |
: goog.labs.userAgent.browser.isChrome() | |
? a(['Chrome', 'CriOS']) | |
: ((b = b[2]) && b[1]) || '' | |
} | |
goog.labs.userAgent.browser.isVersionOrHigher = function (a) { | |
return ( | |
0 <= | |
goog.string.compareVersions(goog.labs.userAgent.browser.getVersion(), a) | |
) | |
} | |
goog.labs.userAgent.browser.getIEVersion_ = function (a) { | |
var b = /rv: *([\d\.]*)/.exec(a) | |
if (b && b[1]) { | |
return b[1] | |
} | |
var b = '', | |
c = /MSIE +([\d\.]+)/.exec(a) | |
if (c && c[1]) { | |
if (((a = /Trident\/(\d.\d)/.exec(a)), '7.0' == c[1])) { | |
if (a && a[1]) { | |
switch (a[1]) { | |
case '4.0': | |
b = '8.0' | |
break | |
case '5.0': | |
b = '9.0' | |
break | |
case '6.0': | |
b = '10.0' | |
break | |
case '7.0': | |
b = '11.0' | |
} | |
} else { | |
b = '7.0' | |
} | |
} else { | |
b = c[1] | |
} | |
} | |
return b | |
} | |
goog.labs.userAgent.engine = {} | |
goog.labs.userAgent.engine.isPresto = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Presto') | |
} | |
goog.labs.userAgent.engine.isTrident = function () { | |
return ( | |
goog.labs.userAgent.util.matchUserAgent('Trident') || | |
goog.labs.userAgent.util.matchUserAgent('MSIE') | |
) | |
} | |
goog.labs.userAgent.engine.isEdge = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Edge') | |
} | |
goog.labs.userAgent.engine.isWebKit = function () { | |
return ( | |
goog.labs.userAgent.util.matchUserAgentIgnoreCase('WebKit') && | |
!goog.labs.userAgent.engine.isEdge() | |
) | |
} | |
goog.labs.userAgent.engine.isGecko = function () { | |
return ( | |
goog.labs.userAgent.util.matchUserAgent('Gecko') && | |
!goog.labs.userAgent.engine.isWebKit() && | |
!goog.labs.userAgent.engine.isTrident() && | |
!goog.labs.userAgent.engine.isEdge() | |
) | |
} | |
goog.labs.userAgent.engine.getVersion = function () { | |
var a = goog.labs.userAgent.util.getUserAgent() | |
if (a) { | |
var a = goog.labs.userAgent.util.extractVersionTuples(a), | |
b = goog.labs.userAgent.engine.getEngineTuple_(a) | |
if (b) { | |
return 'Gecko' == b[0] | |
? goog.labs.userAgent.engine.getVersionForKey_(a, 'Firefox') | |
: b[1] | |
} | |
var a = a[0], | |
c | |
if (a && (c = a[2]) && (c = /Trident\/([^\s;]+)/.exec(c))) { | |
return c[1] | |
} | |
} | |
return '' | |
} | |
goog.labs.userAgent.engine.getEngineTuple_ = function (a) { | |
if (!goog.labs.userAgent.engine.isEdge()) { | |
return a[1] | |
} | |
for (var b = 0; b < a.length; b++) { | |
var c = a[b] | |
if ('Edge' == c[0]) { | |
return c | |
} | |
} | |
} | |
goog.labs.userAgent.engine.isVersionOrHigher = function (a) { | |
return ( | |
0 <= | |
goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(), a) | |
) | |
} | |
goog.labs.userAgent.engine.getVersionForKey_ = function (a, b) { | |
var c = goog.array.find(a, function (a) { | |
return b == a[0] | |
}) | |
return (c && c[1]) || '' | |
} | |
goog.labs.userAgent.platform = {} | |
goog.labs.userAgent.platform.isAndroid = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Android') | |
} | |
goog.labs.userAgent.platform.isIpod = function () { | |
return goog.labs.userAgent.util.matchUserAgent('iPod') | |
} | |
goog.labs.userAgent.platform.isIphone = function () { | |
return ( | |
goog.labs.userAgent.util.matchUserAgent('iPhone') && | |
!goog.labs.userAgent.util.matchUserAgent('iPod') && | |
!goog.labs.userAgent.util.matchUserAgent('iPad') | |
) | |
} | |
goog.labs.userAgent.platform.isIpad = function () { | |
return goog.labs.userAgent.util.matchUserAgent('iPad') | |
} | |
goog.labs.userAgent.platform.isIos = function () { | |
return ( | |
goog.labs.userAgent.platform.isIphone() || | |
goog.labs.userAgent.platform.isIpad() || | |
goog.labs.userAgent.platform.isIpod() | |
) | |
} | |
goog.labs.userAgent.platform.isMacintosh = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Macintosh') | |
} | |
goog.labs.userAgent.platform.isLinux = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Linux') | |
} | |
goog.labs.userAgent.platform.isWindows = function () { | |
return goog.labs.userAgent.util.matchUserAgent('Windows') | |
} | |
goog.labs.userAgent.platform.isChromeOS = function () { | |
return goog.labs.userAgent.util.matchUserAgent('CrOS') | |
} | |
goog.labs.userAgent.platform.getVersion = function () { | |
var a = goog.labs.userAgent.util.getUserAgent(), | |
b = '' | |
goog.labs.userAgent.platform.isWindows() | |
? ((b = /Windows (?:NT|Phone) ([0-9.]+)/), | |
(b = (a = b.exec(a)) ? a[1] : '0.0')) | |
: goog.labs.userAgent.platform.isIos() | |
? ((b = /(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/), | |
(b = (a = b.exec(a)) && a[1].replace(/_/g, '.'))) | |
: goog.labs.userAgent.platform.isMacintosh() | |
? ((b = /Mac OS X ([0-9_.]+)/), | |
(b = (a = b.exec(a)) ? a[1].replace(/_/g, '.') : '10')) | |
: goog.labs.userAgent.platform.isAndroid() | |
? ((b = /Android\s+([^\);]+)(\)|;)/), (b = (a = b.exec(a)) && a[1])) | |
: goog.labs.userAgent.platform.isChromeOS() && | |
((b = /(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/), | |
(b = (a = b.exec(a)) && a[1])) | |
return b || '' | |
} | |
goog.labs.userAgent.platform.isVersionOrHigher = function (a) { | |
return ( | |
0 <= | |
goog.string.compareVersions( | |
goog.labs.userAgent.platform.getVersion(), | |
a | |
) | |
) | |
} | |
goog.reflect = {} | |
goog.reflect.object = function (a, b) { | |
return b | |
} | |
goog.reflect.objectProperty = function (a, b) { | |
return a | |
} | |
goog.reflect.sinkValue = function (a) { | |
goog.reflect.sinkValue[' '](a) | |
return a | |
} | |
goog.reflect.sinkValue[' '] = goog.nullFunction | |
goog.reflect.canAccessProperty = function (a, b) { | |
try { | |
return goog.reflect.sinkValue(a[b]), !0 | |
} catch (c) {} | |
return !1 | |
} | |
goog.reflect.cache = function (a, b, c, d) { | |
d = d ? d(b) : b | |
return Object.prototype.hasOwnProperty.call(a, d) ? a[d] : (a[d] = c(b)) | |
} | |
goog.userAgent = {} | |
goog.userAgent.ASSUME_IE = !1 | |
goog.userAgent.ASSUME_EDGE = !1 | |
goog.userAgent.ASSUME_GECKO = !1 | |
goog.userAgent.ASSUME_WEBKIT = !1 | |
goog.userAgent.ASSUME_MOBILE_WEBKIT = !1 | |
goog.userAgent.ASSUME_OPERA = !1 | |
goog.userAgent.ASSUME_ANY_VERSION = !1 | |
goog.userAgent.BROWSER_KNOWN_ = | |
goog.userAgent.ASSUME_IE || | |
goog.userAgent.ASSUME_EDGE || | |
goog.userAgent.ASSUME_GECKO || | |
goog.userAgent.ASSUME_MOBILE_WEBKIT || | |
goog.userAgent.ASSUME_WEBKIT || | |
goog.userAgent.ASSUME_OPERA | |
goog.userAgent.getUserAgentString = function () { | |
return goog.labs.userAgent.util.getUserAgent() | |
} | |
goog.userAgent.getNavigator = function () { | |
return goog.global.navigator || null | |
} | |
goog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ | |
? goog.userAgent.ASSUME_OPERA | |
: goog.labs.userAgent.browser.isOpera() | |
goog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ | |
? goog.userAgent.ASSUME_IE | |
: goog.labs.userAgent.browser.isIE() | |
goog.userAgent.EDGE = goog.userAgent.BROWSER_KNOWN_ | |
? goog.userAgent.ASSUME_EDGE | |
: goog.labs.userAgent.engine.isEdge() | |
goog.userAgent.EDGE_OR_IE = goog.userAgent.EDGE || goog.userAgent.IE | |
goog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ | |
? goog.userAgent.ASSUME_GECKO | |
: goog.labs.userAgent.engine.isGecko() | |
goog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ | |
? goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT | |
: goog.labs.userAgent.engine.isWebKit() | |
goog.userAgent.isMobile_ = function () { | |
return ( | |
goog.userAgent.WEBKIT && | |
goog.labs.userAgent.util.matchUserAgent('Mobile') | |
) | |
} | |
goog.userAgent.MOBILE = | |
goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_() | |
goog.userAgent.SAFARI = goog.userAgent.WEBKIT | |
goog.userAgent.determinePlatform_ = function () { | |
var a = goog.userAgent.getNavigator() | |
return (a && a.platform) || '' | |
} | |
goog.userAgent.PLATFORM = goog.userAgent.determinePlatform_() | |
goog.userAgent.ASSUME_MAC = !1 | |
goog.userAgent.ASSUME_WINDOWS = !1 | |
goog.userAgent.ASSUME_LINUX = !1 | |
goog.userAgent.ASSUME_X11 = !1 | |
goog.userAgent.ASSUME_ANDROID = !1 | |
goog.userAgent.ASSUME_IPHONE = !1 | |
goog.userAgent.ASSUME_IPAD = !1 | |
goog.userAgent.ASSUME_IPOD = !1 | |
goog.userAgent.PLATFORM_KNOWN_ = | |
goog.userAgent.ASSUME_MAC || | |
goog.userAgent.ASSUME_WINDOWS || | |
goog.userAgent.ASSUME_LINUX || | |
goog.userAgent.ASSUME_X11 || | |
goog.userAgent.ASSUME_ANDROID || | |
goog.userAgent.ASSUME_IPHONE || | |
goog.userAgent.ASSUME_IPAD || | |
goog.userAgent.ASSUME_IPOD | |
goog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_MAC | |
: goog.labs.userAgent.platform.isMacintosh() | |
goog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_WINDOWS | |
: goog.labs.userAgent.platform.isWindows() | |
goog.userAgent.isLegacyLinux_ = function () { | |
return ( | |
goog.labs.userAgent.platform.isLinux() || | |
goog.labs.userAgent.platform.isChromeOS() | |
) | |
} | |
goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_LINUX | |
: goog.userAgent.isLegacyLinux_() | |
goog.userAgent.isX11_ = function () { | |
var a = goog.userAgent.getNavigator() | |
return !!a && goog.string.contains(a.appVersion || '', 'X11') | |
} | |
goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_X11 | |
: goog.userAgent.isX11_() | |
goog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_ANDROID | |
: goog.labs.userAgent.platform.isAndroid() | |
goog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_IPHONE | |
: goog.labs.userAgent.platform.isIphone() | |
goog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_IPAD | |
: goog.labs.userAgent.platform.isIpad() | |
goog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_IPOD | |
: goog.labs.userAgent.platform.isIpod() | |
goog.userAgent.IOS = goog.userAgent.PLATFORM_KNOWN_ | |
? goog.userAgent.ASSUME_IPHONE || | |
goog.userAgent.ASSUME_IPAD || | |
goog.userAgent.ASSUME_IPOD | |
: goog.labs.userAgent.platform.isIos() | |
goog.userAgent.determineVersion_ = function () { | |
var a = '', | |
b = goog.userAgent.getVersionRegexResult_() | |
b && (a = b ? b[1] : '') | |
return goog.userAgent.IE && | |
((b = goog.userAgent.getDocumentMode_()), | |
null != b && b > parseFloat(a)) | |
? String(b) | |
: a | |
} | |
goog.userAgent.getVersionRegexResult_ = function () { | |
var a = goog.userAgent.getUserAgentString() | |
if (goog.userAgent.GECKO) { | |
return /rv\:([^\);]+)(\)|;)/.exec(a) | |
} | |
if (goog.userAgent.EDGE) { | |
return /Edge\/([\d\.]+)/.exec(a) | |
} | |
if (goog.userAgent.IE) { | |
return /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a) | |
} | |
if (goog.userAgent.WEBKIT) { | |
return /WebKit\/(\S+)/.exec(a) | |
} | |
if (goog.userAgent.OPERA) { | |
return /(?:Version)[ \/]?(\S+)/.exec(a) | |
} | |
} | |
goog.userAgent.getDocumentMode_ = function () { | |
var a = goog.global.document | |
return a ? a.documentMode : void 0 | |
} | |
goog.userAgent.VERSION = goog.userAgent.determineVersion_() | |
goog.userAgent.compare = function (a, b) { | |
return goog.string.compareVersions(a, b) | |
} | |
goog.userAgent.isVersionOrHigherCache_ = {} | |
goog.userAgent.isVersionOrHigher = function (a) { | |
return ( | |
goog.userAgent.ASSUME_ANY_VERSION || | |
goog.reflect.cache( | |
goog.userAgent.isVersionOrHigherCache_, | |
a, | |
function () { | |
return 0 <= goog.string.compareVersions(goog.userAgent.VERSION, a) | |
} | |
) | |
) | |
} | |
goog.userAgent.isVersion = goog.userAgent.isVersionOrHigher | |
goog.userAgent.isDocumentModeOrHigher = function (a) { | |
return Number(goog.userAgent.DOCUMENT_MODE) >= a | |
} | |
goog.userAgent.isDocumentMode = goog.userAgent.isDocumentModeOrHigher | |
goog.userAgent.DOCUMENT_MODE = (function () { | |
var a = goog.global.document, | |
b = goog.userAgent.getDocumentMode_() | |
if (a && goog.userAgent.IE) { | |
return ( | |
b || | |
('CSS1Compat' == a.compatMode | |
? parseInt(goog.userAgent.VERSION, 10) | |
: 5) | |
) | |
} | |
})() | |
goog.dom.BrowserFeature = { | |
CAN_ADD_NAME_OR_TYPE_ATTRIBUTES: | |
!goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(9), | |
CAN_USE_CHILDREN_ATTRIBUTE: | |
(!goog.userAgent.GECKO && !goog.userAgent.IE) || | |
(goog.userAgent.IE && goog.userAgent.isDocumentModeOrHigher(9)) || | |
(goog.userAgent.GECKO && goog.userAgent.isVersionOrHigher('1.9.1')), | |
CAN_USE_INNER_TEXT: | |
goog.userAgent.IE && !goog.userAgent.isVersionOrHigher('9'), | |
CAN_USE_PARENT_ELEMENT_PROPERTY: | |
goog.userAgent.IE || goog.userAgent.OPERA || goog.userAgent.WEBKIT, | |
INNER_HTML_NEEDS_SCOPED_ELEMENT: goog.userAgent.IE, | |
LEGACY_IE_RANGES: | |
goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9), | |
} | |
goog.dom.TagName = function (a) { | |
this.tagName_ = a | |
} | |
goog.dom.TagName.prototype.toString = function () { | |
return this.tagName_ | |
} | |
goog.dom.TagName.A = new goog.dom.TagName('A') | |
goog.dom.TagName.ABBR = new goog.dom.TagName('ABBR') | |
goog.dom.TagName.ACRONYM = new goog.dom.TagName('ACRONYM') | |
goog.dom.TagName.ADDRESS = new goog.dom.TagName('ADDRESS') | |
goog.dom.TagName.APPLET = new goog.dom.TagName('APPLET') | |
goog.dom.TagName.AREA = new goog.dom.TagName('AREA') | |
goog.dom.TagName.ARTICLE = new goog.dom.TagName('ARTICLE') | |
goog.dom.TagName.ASIDE = new goog.dom.TagName('ASIDE') | |
goog.dom.TagName.AUDIO = new goog.dom.TagName('AUDIO') | |
goog.dom.TagName.B = new goog.dom.TagName('B') | |
goog.dom.TagName.BASE = new goog.dom.TagName('BASE') | |
goog.dom.TagName.BASEFONT = new goog.dom.TagName('BASEFONT') | |
goog.dom.TagName.BDI = new goog.dom.TagName('BDI') | |
goog.dom.TagName.BDO = new goog.dom.TagName('BDO') | |
goog.dom.TagName.BIG = new goog.dom.TagName('BIG') | |
goog.dom.TagName.BLOCKQUOTE = new goog.dom.TagName('BLOCKQUOTE') | |
goog.dom.TagName.BODY = new goog.dom.TagName('BODY') | |
goog.dom.TagName.BR = new goog.dom.TagName('BR') | |
goog.dom.TagName.BUTTON = new goog.dom.TagName('BUTTON') | |
goog.dom.TagName.CANVAS = new goog.dom.TagName('CANVAS') | |
goog.dom.TagName.CAPTION = new goog.dom.TagName('CAPTION') | |
goog.dom.TagName.CENTER = new goog.dom.TagName('CENTER') | |
goog.dom.TagName.CITE = new goog.dom.TagName('CITE') | |
goog.dom.TagName.CODE = new goog.dom.TagName('CODE') | |
goog.dom.TagName.COL = new goog.dom.TagName('COL') | |
goog.dom.TagName.COLGROUP = new goog.dom.TagName('COLGROUP') | |
goog.dom.TagName.COMMAND = new goog.dom.TagName('COMMAND') | |
goog.dom.TagName.DATA = new goog.dom.TagName('DATA') | |
goog.dom.TagName.DATALIST = new goog.dom.TagName('DATALIST') | |
goog.dom.TagName.DD = new goog.dom.TagName('DD') | |
goog.dom.TagName.DEL = new goog.dom.TagName('DEL') | |
goog.dom.TagName.DETAILS = new goog.dom.TagName('DETAILS') | |
goog.dom.TagName.DFN = new goog.dom.TagName('DFN') | |
goog.dom.TagName.DIALOG = new goog.dom.TagName('DIALOG') | |
goog.dom.TagName.DIR = new goog.dom.TagName('DIR') | |
goog.dom.TagName.DIV = new goog.dom.TagName('DIV') | |
goog.dom.TagName.DL = new goog.dom.TagName('DL') | |
goog.dom.TagName.DT = new goog.dom.TagName('DT') | |
goog.dom.TagName.EM = new goog.dom.TagName('EM') | |
goog.dom.TagName.EMBED = new goog.dom.TagName('EMBED') | |
goog.dom.TagName.FIELDSET = new goog.dom.TagName('FIELDSET') | |
goog.dom.TagName.FIGCAPTION = new goog.dom.TagName('FIGCAPTION') | |
goog.dom.TagName.FIGURE = new goog.dom.TagName('FIGURE') | |
goog.dom.TagName.FONT = new goog.dom.TagName('FONT') | |
goog.dom.TagName.FOOTER = new goog.dom.TagName('FOOTER') | |
goog.dom.TagName.FORM = new goog.dom.TagName('FORM') | |
goog.dom.TagName.FRAME = new goog.dom.TagName('FRAME') | |
goog.dom.TagName.FRAMESET = new goog.dom.TagName('FRAMESET') | |
goog.dom.TagName.H1 = new goog.dom.TagName('H1') | |
goog.dom.TagName.H2 = new goog.dom.TagName('H2') | |
goog.dom.TagName.H3 = new goog.dom.TagName('H3') | |
goog.dom.TagName.H4 = new goog.dom.TagName('H4') | |
goog.dom.TagName.H5 = new goog.dom.TagName('H5') | |
goog.dom.TagName.H6 = new goog.dom.TagName('H6') | |
goog.dom.TagName.HEAD = new goog.dom.TagName('HEAD') | |
goog.dom.TagName.HEADER = new goog.dom.TagName('HEADER') | |
goog.dom.TagName.HGROUP = new goog.dom.TagName('HGROUP') | |
goog.dom.TagName.HR = new goog.dom.TagName('HR') | |
goog.dom.TagName.HTML = new goog.dom.TagName('HTML') | |
goog.dom.TagName.I = new goog.dom.TagName('I') | |
goog.dom.TagName.IFRAME = new goog.dom.TagName('IFRAME') | |
goog.dom.TagName.IMG = new goog.dom.TagName('IMG') | |
goog.dom.TagName.INPUT = new goog.dom.TagName('INPUT') | |
goog.dom.TagName.INS = new goog.dom.TagName('INS') | |
goog.dom.TagName.ISINDEX = new goog.dom.TagName('ISINDEX') | |
goog.dom.TagName.KBD = new goog.dom.TagName('KBD') | |
goog.dom.TagName.KEYGEN = new goog.dom.TagName('KEYGEN') | |
goog.dom.TagName.LABEL = new goog.dom.TagName('LABEL') | |
goog.dom.TagName.LEGEND = new goog.dom.TagName('LEGEND') | |
goog.dom.TagName.LI = new goog.dom.TagName('LI') | |
goog.dom.TagName.LINK = new goog.dom.TagName('LINK') | |
goog.dom.TagName.MAP = new goog.dom.TagName('MAP') | |
goog.dom.TagName.MARK = new goog.dom.TagName('MARK') | |
goog.dom.TagName.MATH = new goog.dom.TagName('MATH') | |
goog.dom.TagName.MENU = new goog.dom.TagName('MENU') | |
goog.dom.TagName.META = new goog.dom.TagName('META') | |
goog.dom.TagName.METER = new goog.dom.TagName('METER') | |
goog.dom.TagName.NAV = new goog.dom.TagName('NAV') | |
goog.dom.TagName.NOFRAMES = new goog.dom.TagName('NOFRAMES') | |
goog.dom.TagName.NOSCRIPT = new goog.dom.TagName('NOSCRIPT') | |
goog.dom.TagName.OBJECT = new goog.dom.TagName('OBJECT') | |
goog.dom.TagName.OL = new goog.dom.TagName('OL') | |
goog.dom.TagName.OPTGROUP = new goog.dom.TagName('OPTGROUP') | |
goog.dom.TagName.OPTION = new goog.dom.TagName('OPTION') | |
goog.dom.TagName.OUTPUT = new goog.dom.TagName('OUTPUT') | |
goog.dom.TagName.P = new goog.dom.TagName('P') | |
goog.dom.TagName.PARAM = new goog.dom.TagName('PARAM') | |
goog.dom.TagName.PRE = new goog.dom.TagName('PRE') | |
goog.dom.TagName.PROGRESS = new goog.dom.TagName('PROGRESS') | |
goog.dom.TagName.Q = new goog.dom.TagName('Q') | |
goog.dom.TagName.RP = new goog.dom.TagName('RP') | |
goog.dom.TagName.RT = new goog.dom.TagName('RT') | |
goog.dom.TagName.RUBY = new goog.dom.TagName('RUBY') | |
goog.dom.TagName.S = new goog.dom.TagName('S') | |
goog.dom.TagName.SAMP = new goog.dom.TagName('SAMP') | |
goog.dom.TagName.SCRIPT = new goog.dom.TagName('SCRIPT') | |
goog.dom.TagName.SECTION = new goog.dom.TagName('SECTION') | |
goog.dom.TagName.SELECT = new goog.dom.TagName('SELECT') | |
goog.dom.TagName.SMALL = new goog.dom.TagName('SMALL') | |
goog.dom.TagName.SOURCE = new goog.dom.TagName('SOURCE') | |
goog.dom.TagName.SPAN = new goog.dom.TagName('SPAN') | |
goog.dom.TagName.STRIKE = new goog.dom.TagName('STRIKE') | |
goog.dom.TagName.STRONG = new goog.dom.TagName('STRONG') | |
goog.dom.TagName.STYLE = new goog.dom.TagName('STYLE') | |
goog.dom.TagName.SUB = new goog.dom.TagName('SUB') | |
goog.dom.TagName.SUMMARY = new goog.dom.TagName('SUMMARY') | |
goog.dom.TagName.SUP = new goog.dom.TagName('SUP') | |
goog.dom.TagName.SVG = new goog.dom.TagName('SVG') | |
goog.dom.TagName.TABLE = new goog.dom.TagName('TABLE') | |
goog.dom.TagName.TBODY = new goog.dom.TagName('TBODY') | |
goog.dom.TagName.TD = new goog.dom.TagName('TD') | |
goog.dom.TagName.TEMPLATE = new goog.dom.TagName('TEMPLATE') | |
goog.dom.TagName.TEXTAREA = new goog.dom.TagName('TEXTAREA') | |
goog.dom.TagName.TFOOT = new goog.dom.TagName('TFOOT') | |
goog.dom.TagName.TH = new goog.dom.TagName('TH') | |
goog.dom.TagName.THEAD = new goog.dom.TagName('THEAD') | |
goog.dom.TagName.TIME = new goog.dom.TagName('TIME') | |
goog.dom.TagName.TITLE = new goog.dom.TagName('TITLE') | |
goog.dom.TagName.TR = new goog.dom.TagName('TR') | |
goog.dom.TagName.TRACK = new goog.dom.TagName('TRACK') | |
goog.dom.TagName.TT = new goog.dom.TagName('TT') | |
goog.dom.TagName.U = new goog.dom.TagName('U') | |
goog.dom.TagName.UL = new goog.dom.TagName('UL') | |
goog.dom.TagName.VAR = new goog.dom.TagName('VAR') | |
goog.dom.TagName.VIDEO = new goog.dom.TagName('VIDEO') | |
goog.dom.TagName.WBR = new goog.dom.TagName('WBR') | |
goog.dom.tags = {} | |
goog.dom.tags.VOID_TAGS_ = { | |
area: !0, | |
base: !0, | |
br: !0, | |
col: !0, | |
command: !0, | |
embed: !0, | |
hr: !0, | |
img: !0, | |
input: !0, | |
keygen: !0, | |
link: !0, | |
meta: !0, | |
param: !0, | |
source: !0, | |
track: !0, | |
wbr: !0, | |
} | |
goog.dom.tags.isVoidTag = function (a) { | |
return !0 === goog.dom.tags.VOID_TAGS_[a] | |
} | |
goog.string.TypedString = function () {} | |
goog.string.Const = function () { | |
this.stringConstValueWithSecurityContract__googStringSecurityPrivate_ = '' | |
this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_ = | |
goog.string.Const.TYPE_MARKER_ | |
} | |
goog.string.Const.prototype.implementsGoogStringTypedString = !0 | |
goog.string.Const.prototype.getTypedStringValue = function () { | |
return this | |
.stringConstValueWithSecurityContract__googStringSecurityPrivate_ | |
} | |
goog.string.Const.prototype.toString = function () { | |
return ( | |
'Const{' + | |
this.stringConstValueWithSecurityContract__googStringSecurityPrivate_ + | |
'}' | |
) | |
} | |
goog.string.Const.unwrap = function (a) { | |
if ( | |
a instanceof goog.string.Const && | |
a.constructor === goog.string.Const && | |
a.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_ === | |
goog.string.Const.TYPE_MARKER_ | |
) { | |
return a.stringConstValueWithSecurityContract__googStringSecurityPrivate_ | |
} | |
goog.asserts.fail("expected object of type Const, got '" + a + "'") | |
return 'type_error:Const' | |
} | |
goog.string.Const.from = function (a) { | |
return goog.string.Const.create__googStringSecurityPrivate_(a) | |
} | |
goog.string.Const.TYPE_MARKER_ = {} | |
goog.string.Const.create__googStringSecurityPrivate_ = function (a) { | |
var b = new goog.string.Const() | |
b.stringConstValueWithSecurityContract__googStringSecurityPrivate_ = a | |
return b | |
} | |
goog.string.Const.EMPTY = goog.string.Const.from('') | |
goog.html = {} | |
goog.html.SafeStyle = function () { | |
this.privateDoNotAccessOrElseSafeStyleWrappedValue_ = '' | |
this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = | |
goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
} | |
goog.html.SafeStyle.prototype.implementsGoogStringTypedString = !0 | |
goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {} | |
goog.html.SafeStyle.fromConstant = function (a) { | |
a = goog.string.Const.unwrap(a) | |
if (0 === a.length) { | |
return goog.html.SafeStyle.EMPTY | |
} | |
goog.html.SafeStyle.checkStyle_(a) | |
goog.asserts.assert( | |
goog.string.endsWith(a, ';'), | |
"Last character of style string is not ';': " + a | |
) | |
goog.asserts.assert( | |
goog.string.contains(a, ':'), | |
'Style string must contain at least one \':\', to specify a "name: value" pair: ' + | |
a | |
) | |
return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse( | |
a | |
) | |
} | |
goog.html.SafeStyle.checkStyle_ = function (a) { | |
goog.asserts.assert( | |
!/[<>]/.test(a), | |
'Forbidden characters in style string: ' + a | |
) | |
} | |
goog.html.SafeStyle.prototype.getTypedStringValue = function () { | |
return this.privateDoNotAccessOrElseSafeStyleWrappedValue_ | |
} | |
goog.DEBUG && | |
(goog.html.SafeStyle.prototype.toString = function () { | |
return ( | |
'SafeStyle{' + | |
this.privateDoNotAccessOrElseSafeStyleWrappedValue_ + | |
'}' | |
) | |
}) | |
goog.html.SafeStyle.unwrap = function (a) { | |
if ( | |
a instanceof goog.html.SafeStyle && | |
a.constructor === goog.html.SafeStyle && | |
a.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === | |
goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
) { | |
return a.privateDoNotAccessOrElseSafeStyleWrappedValue_ | |
} | |
goog.asserts.fail( | |
"expected object of type SafeStyle, got '" + | |
a + | |
"' of type " + | |
goog.typeOf(a) | |
) | |
return 'type_error:SafeStyle' | |
} | |
goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse = function ( | |
a | |
) { | |
return new goog.html.SafeStyle().initSecurityPrivateDoNotAccessOrElse_(a) | |
} | |
goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_ = function ( | |
a | |
) { | |
this.privateDoNotAccessOrElseSafeStyleWrappedValue_ = a | |
return this | |
} | |
goog.html.SafeStyle.EMPTY = goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse( | |
'' | |
) | |
goog.html.SafeStyle.INNOCUOUS_STRING = 'zClosurez' | |
goog.html.SafeStyle.create = function (a) { | |
var b = '', | |
c | |
for (c in a) { | |
if (!/^[-_a-zA-Z0-9]+$/.test(c)) { | |
throw Error('Name allows only [-_a-zA-Z0-9], got: ' + c) | |
} | |
var d = a[c] | |
null != d && | |
(d instanceof goog.string.Const | |
? ((d = goog.string.Const.unwrap(d)), | |
goog.asserts.assert( | |
!/[{;}]/.test(d), | |
'Value does not allow [{;}].' | |
)) | |
: goog.html.SafeStyle.VALUE_RE_.test(d) | |
? goog.html.SafeStyle.hasBalancedQuotes_(d) || | |
(goog.asserts.fail( | |
'String value requires balanced quotes, got: ' + d | |
), | |
(d = goog.html.SafeStyle.INNOCUOUS_STRING)) | |
: (goog.asserts.fail( | |
'String value allows only [-,."\'%_!# a-zA-Z0-9], rgb() and rgba(), got: ' + | |
d | |
), | |
(d = goog.html.SafeStyle.INNOCUOUS_STRING)), | |
(b += c + ':' + d + ';')) | |
} | |
if (!b) { | |
return goog.html.SafeStyle.EMPTY | |
} | |
goog.html.SafeStyle.checkStyle_(b) | |
return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse( | |
b | |
) | |
} | |
goog.html.SafeStyle.hasBalancedQuotes_ = function (a) { | |
for (var b = !0, c = !0, d = 0; d < a.length; d++) { | |
var e = a.charAt(d) | |
"'" == e && c ? (b = !b) : '"' == e && b && (c = !c) | |
} | |
return b && c | |
} | |
goog.html.SafeStyle.VALUE_RE_ = /^([-,."'%_!# a-zA-Z0-9]+|(?:rgb|hsl)a?\([0-9.%, ]+\))$/ | |
goog.html.SafeStyle.concat = function (a) { | |
var b = '', | |
c = function (a) { | |
goog.isArray(a) | |
? goog.array.forEach(a, c) | |
: (b += goog.html.SafeStyle.unwrap(a)) | |
} | |
goog.array.forEach(arguments, c) | |
return b | |
? goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b) | |
: goog.html.SafeStyle.EMPTY | |
} | |
goog.html.SafeStyleSheet = function () { | |
this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ = '' | |
this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = | |
goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
} | |
goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString = !0 | |
goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {} | |
goog.html.SafeStyleSheet.concat = function (a) { | |
var b = '', | |
c = function (a) { | |
goog.isArray(a) | |
? goog.array.forEach(a, c) | |
: (b += goog.html.SafeStyleSheet.unwrap(a)) | |
} | |
goog.array.forEach(arguments, c) | |
return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse( | |
b | |
) | |
} | |
goog.html.SafeStyleSheet.fromConstant = function (a) { | |
a = goog.string.Const.unwrap(a) | |
if (0 === a.length) { | |
return goog.html.SafeStyleSheet.EMPTY | |
} | |
goog.asserts.assert( | |
!goog.string.contains(a, '<'), | |
"Forbidden '<' character in style sheet string: " + a | |
) | |
return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse( | |
a | |
) | |
} | |
goog.html.SafeStyleSheet.prototype.getTypedStringValue = function () { | |
return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ | |
} | |
goog.DEBUG && | |
(goog.html.SafeStyleSheet.prototype.toString = function () { | |
return ( | |
'SafeStyleSheet{' + | |
this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ + | |
'}' | |
) | |
}) | |
goog.html.SafeStyleSheet.unwrap = function (a) { | |
if ( | |
a instanceof goog.html.SafeStyleSheet && | |
a.constructor === goog.html.SafeStyleSheet && | |
a.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === | |
goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
) { | |
return a.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ | |
} | |
goog.asserts.fail( | |
"expected object of type SafeStyleSheet, got '" + | |
a + | |
"' of type " + | |
goog.typeOf(a) | |
) | |
return 'type_error:SafeStyleSheet' | |
} | |
goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse = function ( | |
a | |
) { | |
return new goog.html.SafeStyleSheet().initSecurityPrivateDoNotAccessOrElse_( | |
a | |
) | |
} | |
goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_ = function ( | |
a | |
) { | |
this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ = a | |
return this | |
} | |
goog.html.SafeStyleSheet.EMPTY = goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse( | |
'' | |
) | |
goog.fs = {} | |
goog.fs.url = {} | |
goog.fs.url.createObjectUrl = function (a) { | |
return goog.fs.url.getUrlObject_().createObjectURL(a) | |
} | |
goog.fs.url.revokeObjectUrl = function (a) { | |
goog.fs.url.getUrlObject_().revokeObjectURL(a) | |
} | |
goog.fs.url.getUrlObject_ = function () { | |
var a = goog.fs.url.findUrlObject_() | |
if (null != a) { | |
return a | |
} | |
throw Error("This browser doesn't seem to support blob URLs") | |
} | |
goog.fs.url.findUrlObject_ = function () { | |
return goog.isDef(goog.global.URL) && | |
goog.isDef(goog.global.URL.createObjectURL) | |
? goog.global.URL | |
: goog.isDef(goog.global.webkitURL) && | |
goog.isDef(goog.global.webkitURL.createObjectURL) | |
? goog.global.webkitURL | |
: goog.isDef(goog.global.createObjectURL) | |
? goog.global | |
: null | |
} | |
goog.fs.url.browserSupportsObjectUrls = function () { | |
return null != goog.fs.url.findUrlObject_() | |
} | |
goog.i18n = {} | |
goog.i18n.bidi = {} | |
goog.i18n.bidi.FORCE_RTL = !1 | |
goog.i18n.bidi.IS_RTL = | |
goog.i18n.bidi.FORCE_RTL || | |
(('ar' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'fa' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'he' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'iw' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'ps' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'sd' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'ug' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'ur' == goog.LOCALE.substring(0, 2).toLowerCase() || | |
'yi' == goog.LOCALE.substring(0, 2).toLowerCase()) && | |
(2 == goog.LOCALE.length || | |
'-' == goog.LOCALE.substring(2, 3) || | |
'_' == goog.LOCALE.substring(2, 3))) || | |
(3 <= goog.LOCALE.length && | |
'ckb' == goog.LOCALE.substring(0, 3).toLowerCase() && | |
(3 == goog.LOCALE.length || | |
'-' == goog.LOCALE.substring(3, 4) || | |
'_' == goog.LOCALE.substring(3, 4))) | |
goog.i18n.bidi.Format = { | |
LRE: '\u202a', | |
RLE: '\u202b', | |
PDF: '\u202c', | |
LRM: '\u200e', | |
RLM: '\u200f', | |
} | |
goog.i18n.bidi.Dir = { LTR: 1, RTL: -1, NEUTRAL: 0 } | |
goog.i18n.bidi.RIGHT = 'right' | |
goog.i18n.bidi.LEFT = 'left' | |
goog.i18n.bidi.I18N_RIGHT = goog.i18n.bidi.IS_RTL | |
? goog.i18n.bidi.LEFT | |
: goog.i18n.bidi.RIGHT | |
goog.i18n.bidi.I18N_LEFT = goog.i18n.bidi.IS_RTL | |
? goog.i18n.bidi.RIGHT | |
: goog.i18n.bidi.LEFT | |
goog.i18n.bidi.toDir = function (a, b) { | |
return 'number' == typeof a | |
? 0 < a | |
? goog.i18n.bidi.Dir.LTR | |
: 0 > a | |
? goog.i18n.bidi.Dir.RTL | |
: b | |
? null | |
: goog.i18n.bidi.Dir.NEUTRAL | |
: null == a | |
? null | |
: a | |
? goog.i18n.bidi.Dir.RTL | |
: goog.i18n.bidi.Dir.LTR | |
} | |
goog.i18n.bidi.ltrChars_ = | |
'A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff' | |
goog.i18n.bidi.rtlChars_ = | |
'\u0591-\u06ef\u06fa-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc' | |
goog.i18n.bidi.htmlSkipReg_ = /<[^>]*>|&[^;]+;/g | |
goog.i18n.bidi.stripHtmlIfNeeded_ = function (a, b) { | |
return b ? a.replace(goog.i18n.bidi.htmlSkipReg_, '') : a | |
} | |
goog.i18n.bidi.rtlCharReg_ = new RegExp( | |
'[' + goog.i18n.bidi.rtlChars_ + ']' | |
) | |
goog.i18n.bidi.ltrCharReg_ = new RegExp( | |
'[' + goog.i18n.bidi.ltrChars_ + ']' | |
) | |
goog.i18n.bidi.hasAnyRtl = function (a, b) { | |
return goog.i18n.bidi.rtlCharReg_.test( | |
goog.i18n.bidi.stripHtmlIfNeeded_(a, b) | |
) | |
} | |
goog.i18n.bidi.hasRtlChar = goog.i18n.bidi.hasAnyRtl | |
goog.i18n.bidi.hasAnyLtr = function (a, b) { | |
return goog.i18n.bidi.ltrCharReg_.test( | |
goog.i18n.bidi.stripHtmlIfNeeded_(a, b) | |
) | |
} | |
goog.i18n.bidi.ltrRe_ = new RegExp('^[' + goog.i18n.bidi.ltrChars_ + ']') | |
goog.i18n.bidi.rtlRe_ = new RegExp('^[' + goog.i18n.bidi.rtlChars_ + ']') | |
goog.i18n.bidi.isRtlChar = function (a) { | |
return goog.i18n.bidi.rtlRe_.test(a) | |
} | |
goog.i18n.bidi.isLtrChar = function (a) { | |
return goog.i18n.bidi.ltrRe_.test(a) | |
} | |
goog.i18n.bidi.isNeutralChar = function (a) { | |
return !goog.i18n.bidi.isLtrChar(a) && !goog.i18n.bidi.isRtlChar(a) | |
} | |
goog.i18n.bidi.ltrDirCheckRe_ = new RegExp( | |
'^[^' + goog.i18n.bidi.rtlChars_ + ']*[' + goog.i18n.bidi.ltrChars_ + ']' | |
) | |
goog.i18n.bidi.rtlDirCheckRe_ = new RegExp( | |
'^[^' + goog.i18n.bidi.ltrChars_ + ']*[' + goog.i18n.bidi.rtlChars_ + ']' | |
) | |
goog.i18n.bidi.startsWithRtl = function (a, b) { | |
return goog.i18n.bidi.rtlDirCheckRe_.test( | |
goog.i18n.bidi.stripHtmlIfNeeded_(a, b) | |
) | |
} | |
goog.i18n.bidi.isRtlText = goog.i18n.bidi.startsWithRtl | |
goog.i18n.bidi.startsWithLtr = function (a, b) { | |
return goog.i18n.bidi.ltrDirCheckRe_.test( | |
goog.i18n.bidi.stripHtmlIfNeeded_(a, b) | |
) | |
} | |
goog.i18n.bidi.isLtrText = goog.i18n.bidi.startsWithLtr | |
goog.i18n.bidi.isRequiredLtrRe_ = /^http:\/\/.*/ | |
goog.i18n.bidi.isNeutralText = function (a, b) { | |
a = goog.i18n.bidi.stripHtmlIfNeeded_(a, b) | |
return ( | |
goog.i18n.bidi.isRequiredLtrRe_.test(a) || | |
(!goog.i18n.bidi.hasAnyLtr(a) && !goog.i18n.bidi.hasAnyRtl(a)) | |
) | |
} | |
goog.i18n.bidi.ltrExitDirCheckRe_ = new RegExp( | |
'[' + goog.i18n.bidi.ltrChars_ + '][^' + goog.i18n.bidi.rtlChars_ + ']*$' | |
) | |
goog.i18n.bidi.rtlExitDirCheckRe_ = new RegExp( | |
'[' + goog.i18n.bidi.rtlChars_ + '][^' + goog.i18n.bidi.ltrChars_ + ']*$' | |
) | |
goog.i18n.bidi.endsWithLtr = function (a, b) { | |
return goog.i18n.bidi.ltrExitDirCheckRe_.test( | |
goog.i18n.bidi.stripHtmlIfNeeded_(a, b) | |
) | |
} | |
goog.i18n.bidi.isLtrExitText = goog.i18n.bidi.endsWithLtr | |
goog.i18n.bidi.endsWithRtl = function (a, b) { | |
return goog.i18n.bidi.rtlExitDirCheckRe_.test( | |
goog.i18n.bidi.stripHtmlIfNeeded_(a, b) | |
) | |
} | |
goog.i18n.bidi.isRtlExitText = goog.i18n.bidi.endsWithRtl | |
goog.i18n.bidi.rtlLocalesRe_ = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i | |
goog.i18n.bidi.isRtlLanguage = function (a) { | |
return goog.i18n.bidi.rtlLocalesRe_.test(a) | |
} | |
goog.i18n.bidi.bracketGuardTextRe_ = /(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g | |
goog.i18n.bidi.guardBracketInText = function (a, b) { | |
var c = (void 0 === b ? goog.i18n.bidi.hasAnyRtl(a) : b) | |
? goog.i18n.bidi.Format.RLM | |
: goog.i18n.bidi.Format.LRM | |
return a.replace(goog.i18n.bidi.bracketGuardTextRe_, c + '$&' + c) | |
} | |
goog.i18n.bidi.enforceRtlInHtml = function (a) { | |
return '<' == a.charAt(0) | |
? a.replace(/<\w+/, '$& dir=rtl') | |
: '\n<span dir=rtl>' + a + '</span>' | |
} | |
goog.i18n.bidi.enforceRtlInText = function (a) { | |
return goog.i18n.bidi.Format.RLE + a + goog.i18n.bidi.Format.PDF | |
} | |
goog.i18n.bidi.enforceLtrInHtml = function (a) { | |
return '<' == a.charAt(0) | |
? a.replace(/<\w+/, '$& dir=ltr') | |
: '\n<span dir=ltr>' + a + '</span>' | |
} | |
goog.i18n.bidi.enforceLtrInText = function (a) { | |
return goog.i18n.bidi.Format.LRE + a + goog.i18n.bidi.Format.PDF | |
} | |
goog.i18n.bidi.dimensionsRe_ = /:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g | |
goog.i18n.bidi.leftRe_ = /left/gi | |
goog.i18n.bidi.rightRe_ = /right/gi | |
goog.i18n.bidi.tempRe_ = /%%%%/g | |
goog.i18n.bidi.mirrorCSS = function (a) { | |
return a | |
.replace(goog.i18n.bidi.dimensionsRe_, ':$1 $4 $3 $2') | |
.replace(goog.i18n.bidi.leftRe_, '%%%%') | |
.replace(goog.i18n.bidi.rightRe_, goog.i18n.bidi.LEFT) | |
.replace(goog.i18n.bidi.tempRe_, goog.i18n.bidi.RIGHT) | |
} | |
goog.i18n.bidi.doubleQuoteSubstituteRe_ = /([\u0591-\u05f2])"/g | |
goog.i18n.bidi.singleQuoteSubstituteRe_ = /([\u0591-\u05f2])'/g | |
goog.i18n.bidi.normalizeHebrewQuote = function (a) { | |
return a | |
.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_, '$1\u05f4') | |
.replace(goog.i18n.bidi.singleQuoteSubstituteRe_, '$1\u05f3') | |
} | |
goog.i18n.bidi.wordSeparatorRe_ = /\s+/ | |
goog.i18n.bidi.hasNumeralsRe_ = /[\d\u06f0-\u06f9]/ | |
goog.i18n.bidi.rtlDetectionThreshold_ = 0.4 | |
goog.i18n.bidi.estimateDirection = function (a, b) { | |
for ( | |
var c = 0, | |
d = 0, | |
e = !1, | |
f = goog.i18n.bidi | |
.stripHtmlIfNeeded_(a, b) | |
.split(goog.i18n.bidi.wordSeparatorRe_), | |
g = 0; | |
g < f.length; | |
g++ | |
) { | |
var h = f[g] | |
goog.i18n.bidi.startsWithRtl(h) | |
? (c++, d++) | |
: goog.i18n.bidi.isRequiredLtrRe_.test(h) | |
? (e = !0) | |
: goog.i18n.bidi.hasAnyLtr(h) | |
? d++ | |
: goog.i18n.bidi.hasNumeralsRe_.test(h) && (e = !0) | |
} | |
return 0 == d | |
? e | |
? goog.i18n.bidi.Dir.LTR | |
: goog.i18n.bidi.Dir.NEUTRAL | |
: c / d > goog.i18n.bidi.rtlDetectionThreshold_ | |
? goog.i18n.bidi.Dir.RTL | |
: goog.i18n.bidi.Dir.LTR | |
} | |
goog.i18n.bidi.detectRtlDirectionality = function (a, b) { | |
return goog.i18n.bidi.estimateDirection(a, b) == goog.i18n.bidi.Dir.RTL | |
} | |
goog.i18n.bidi.setElementDirAndAlign = function (a, b) { | |
a && | |
(b = goog.i18n.bidi.toDir(b)) && | |
((a.style.textAlign = | |
b == goog.i18n.bidi.Dir.RTL | |
? goog.i18n.bidi.RIGHT | |
: goog.i18n.bidi.LEFT), | |
(a.dir = b == goog.i18n.bidi.Dir.RTL ? 'rtl' : 'ltr')) | |
} | |
goog.i18n.bidi.setElementDirByTextDirectionality = function (a, b) { | |
switch (goog.i18n.bidi.estimateDirection(b)) { | |
case goog.i18n.bidi.Dir.LTR: | |
a.dir = 'ltr' | |
break | |
case goog.i18n.bidi.Dir.RTL: | |
a.dir = 'rtl' | |
break | |
default: | |
a.removeAttribute('dir') | |
} | |
} | |
goog.i18n.bidi.DirectionalString = function () {} | |
goog.html.SafeUrl = function () { | |
this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = '' | |
this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = | |
goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
} | |
goog.html.SafeUrl.INNOCUOUS_STRING = 'about:invalid#zClosurez' | |
goog.html.SafeUrl.prototype.implementsGoogStringTypedString = !0 | |
goog.html.SafeUrl.prototype.getTypedStringValue = function () { | |
return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ | |
} | |
goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString = !0 | |
goog.html.SafeUrl.prototype.getDirection = function () { | |
return goog.i18n.bidi.Dir.LTR | |
} | |
goog.DEBUG && | |
(goog.html.SafeUrl.prototype.toString = function () { | |
return ( | |
'SafeUrl{' + this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ + '}' | |
) | |
}) | |
goog.html.SafeUrl.unwrap = function (a) { | |
if ( | |
a instanceof goog.html.SafeUrl && | |
a.constructor === goog.html.SafeUrl && | |
a.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === | |
goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
) { | |
return a.privateDoNotAccessOrElseSafeHtmlWrappedValue_ | |
} | |
goog.asserts.fail( | |
"expected object of type SafeUrl, got '" + | |
a + | |
"' of type " + | |
goog.typeOf(a) | |
) | |
return 'type_error:SafeUrl' | |
} | |
goog.html.SafeUrl.fromConstant = function (a) { | |
return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse( | |
goog.string.Const.unwrap(a) | |
) | |
} | |
goog.html.SAFE_MIME_TYPE_PATTERN_ = /^(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm))$/i | |
goog.html.SafeUrl.fromBlob = function (a) { | |
a = goog.html.SAFE_MIME_TYPE_PATTERN_.test(a.type) | |
? goog.fs.url.createObjectUrl(a) | |
: goog.html.SafeUrl.INNOCUOUS_STRING | |
return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a) | |
} | |
goog.html.DATA_URL_PATTERN_ = /^data:([^;,]*);base64,[a-z0-9+\/]+=*$/i | |
goog.html.SafeUrl.fromDataUrl = function (a) { | |
var b = a.match(goog.html.DATA_URL_PATTERN_), | |
b = b && goog.html.SAFE_MIME_TYPE_PATTERN_.test(b[1]) | |
return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse( | |
b ? a : goog.html.SafeUrl.INNOCUOUS_STRING | |
) | |
} | |
goog.html.SafeUrl.fromTelUrl = function (a) { | |
goog.string.caseInsensitiveStartsWith(a, 'tel:') || | |
(a = goog.html.SafeUrl.INNOCUOUS_STRING) | |
return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a) | |
} | |
goog.html.SAFE_URL_PATTERN_ = /^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/i | |
goog.html.SafeUrl.sanitize = function (a) { | |
if (a instanceof goog.html.SafeUrl) { | |
return a | |
} | |
a = a.implementsGoogStringTypedString | |
? a.getTypedStringValue() | |
: String(a) | |
goog.html.SAFE_URL_PATTERN_.test(a) || | |
(a = goog.html.SafeUrl.INNOCUOUS_STRING) | |
return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a) | |
} | |
goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {} | |
goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse = function ( | |
a | |
) { | |
var b = new goog.html.SafeUrl() | |
b.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = a | |
return b | |
} | |
goog.html.SafeUrl.ABOUT_BLANK = goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse( | |
'about:blank' | |
) | |
goog.html.TrustedResourceUrl = function () { | |
this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ = '' | |
this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = | |
goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
} | |
goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString = !0 | |
goog.html.TrustedResourceUrl.prototype.getTypedStringValue = function () { | |
return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ | |
} | |
goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString = !0 | |
goog.html.TrustedResourceUrl.prototype.getDirection = function () { | |
return goog.i18n.bidi.Dir.LTR | |
} | |
goog.DEBUG && | |
(goog.html.TrustedResourceUrl.prototype.toString = function () { | |
return ( | |
'TrustedResourceUrl{' + | |
this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ + | |
'}' | |
) | |
}) | |
goog.html.TrustedResourceUrl.unwrap = function (a) { | |
if ( | |
a instanceof goog.html.TrustedResourceUrl && | |
a.constructor === goog.html.TrustedResourceUrl && | |
a.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === | |
goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
) { | |
return a.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ | |
} | |
goog.asserts.fail( | |
"expected object of type TrustedResourceUrl, got '" + | |
a + | |
"' of type " + | |
goog.typeOf(a) | |
) | |
return 'type_error:TrustedResourceUrl' | |
} | |
goog.html.TrustedResourceUrl.format = function (a, b) { | |
var c = goog.string.Const.unwrap(a) | |
if (!goog.html.TrustedResourceUrl.BASE_URL_.test(c)) { | |
throw Error('Invalid TrustedResourceUrl format: ' + c) | |
} | |
var d = c.replace( | |
goog.html.TrustedResourceUrl.FORMAT_MARKER_, | |
function (a, d) { | |
if (!Object.prototype.hasOwnProperty.call(b, d)) { | |
throw Error( | |
'Found marker, "' + | |
d + | |
'", in format string, "' + | |
c + | |
'", but no valid label mapping found in args: ' + | |
JSON.stringify(b) | |
) | |
} | |
var e = b[d] | |
return e instanceof goog.string.Const | |
? goog.string.Const.unwrap(e) | |
: encodeURIComponent(String(e)) | |
} | |
) | |
return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse( | |
d | |
) | |
} | |
goog.html.TrustedResourceUrl.FORMAT_MARKER_ = /%{(\w+)}/g | |
goog.html.TrustedResourceUrl.SCHEME_AND_ORIGIN_ = | |
'(?:(?:https:)?//[0-9a-z.:[\\]-]+)?' | |
goog.html.TrustedResourceUrl.BASE_ABSOLUTE_PATH_ = | |
'(?:/[0-9a-z_~-]+(?:[/#?]|$))' | |
goog.html.TrustedResourceUrl.BASE_URL_ = new RegExp( | |
'^' + | |
goog.html.TrustedResourceUrl.SCHEME_AND_ORIGIN_ + | |
goog.html.TrustedResourceUrl.BASE_ABSOLUTE_PATH_, | |
'i' | |
) | |
goog.html.TrustedResourceUrl.fromConstant = function (a) { | |
return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse( | |
goog.string.Const.unwrap(a) | |
) | |
} | |
goog.html.TrustedResourceUrl.fromConstants = function (a) { | |
for (var b = '', c = 0; c < a.length; c++) { | |
b += goog.string.Const.unwrap(a[c]) | |
} | |
return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse( | |
b | |
) | |
} | |
goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {} | |
goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse = function ( | |
a | |
) { | |
var b = new goog.html.TrustedResourceUrl() | |
b.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ = a | |
return b | |
} | |
goog.html.SafeHtml = function () { | |
this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = '' | |
this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = | |
goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
this.dir_ = null | |
} | |
goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString = !0 | |
goog.html.SafeHtml.prototype.getDirection = function () { | |
return this.dir_ | |
} | |
goog.html.SafeHtml.prototype.implementsGoogStringTypedString = !0 | |
goog.html.SafeHtml.prototype.getTypedStringValue = function () { | |
return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ | |
} | |
goog.DEBUG && | |
(goog.html.SafeHtml.prototype.toString = function () { | |
return ( | |
'SafeHtml{' + this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ + '}' | |
) | |
}) | |
goog.html.SafeHtml.unwrap = function (a) { | |
if ( | |
a instanceof goog.html.SafeHtml && | |
a.constructor === goog.html.SafeHtml && | |
a.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === | |
goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
) { | |
return a.privateDoNotAccessOrElseSafeHtmlWrappedValue_ | |
} | |
goog.asserts.fail( | |
"expected object of type SafeHtml, got '" + | |
a + | |
"' of type " + | |
goog.typeOf(a) | |
) | |
return 'type_error:SafeHtml' | |
} | |
goog.html.SafeHtml.htmlEscape = function (a) { | |
if (a instanceof goog.html.SafeHtml) { | |
return a | |
} | |
var b = null | |
a.implementsGoogI18nBidiDirectionalString && (b = a.getDirection()) | |
a = a.implementsGoogStringTypedString | |
? a.getTypedStringValue() | |
: String(a) | |
return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
goog.string.htmlEscape(a), | |
b | |
) | |
} | |
goog.html.SafeHtml.htmlEscapePreservingNewlines = function (a) { | |
if (a instanceof goog.html.SafeHtml) { | |
return a | |
} | |
a = goog.html.SafeHtml.htmlEscape(a) | |
return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
goog.string.newLineToBr(goog.html.SafeHtml.unwrap(a)), | |
a.getDirection() | |
) | |
} | |
goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces = function (a) { | |
if (a instanceof goog.html.SafeHtml) { | |
return a | |
} | |
a = goog.html.SafeHtml.htmlEscape(a) | |
return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
goog.string.whitespaceEscape(goog.html.SafeHtml.unwrap(a)), | |
a.getDirection() | |
) | |
} | |
goog.html.SafeHtml.from = goog.html.SafeHtml.htmlEscape | |
goog.html.SafeHtml.VALID_NAMES_IN_TAG_ = /^[a-zA-Z0-9-]+$/ | |
goog.html.SafeHtml.URL_ATTRIBUTES_ = { | |
action: !0, | |
cite: !0, | |
data: !0, | |
formaction: !0, | |
href: !0, | |
manifest: !0, | |
poster: !0, | |
src: !0, | |
} | |
goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_ = { | |
APPLET: !0, | |
BASE: !0, | |
EMBED: !0, | |
IFRAME: !0, | |
LINK: !0, | |
MATH: !0, | |
META: !0, | |
OBJECT: !0, | |
SCRIPT: !0, | |
STYLE: !0, | |
SVG: !0, | |
TEMPLATE: !0, | |
} | |
goog.html.SafeHtml.create = function (a, b, c) { | |
goog.html.SafeHtml.verifyTagName(String(a)) | |
return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse( | |
String(a), | |
b, | |
c | |
) | |
} | |
goog.html.SafeHtml.verifyTagName = function (a) { | |
if (!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(a)) { | |
throw Error('Invalid tag name <' + a + '>.') | |
} | |
if (a.toUpperCase() in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_) { | |
throw Error('Tag name <' + a + '> is not allowed for SafeHtml.') | |
} | |
} | |
goog.html.SafeHtml.createIframe = function (a, b, c, d) { | |
a && goog.html.TrustedResourceUrl.unwrap(a) | |
var e = {} | |
e.src = a || null | |
e.srcdoc = b && goog.html.SafeHtml.unwrap(b) | |
a = goog.html.SafeHtml.combineAttributes(e, { sandbox: '' }, c) | |
return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse( | |
'iframe', | |
a, | |
d | |
) | |
} | |
goog.html.SafeHtml.createSandboxIframe = function (a, b, c, d) { | |
if (!goog.html.SafeHtml.canUseSandboxIframe()) { | |
throw Error('The browser does not support sandboxed iframes.') | |
} | |
var e = {} | |
e.src = a ? goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(a)) : null | |
e.srcdoc = b || null | |
e.sandbox = '' | |
a = goog.html.SafeHtml.combineAttributes(e, {}, c) | |
return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse( | |
'iframe', | |
a, | |
d | |
) | |
} | |
goog.html.SafeHtml.canUseSandboxIframe = function () { | |
return ( | |
goog.global.HTMLIFrameElement && | |
'sandbox' in goog.global.HTMLIFrameElement.prototype | |
) | |
} | |
goog.html.SafeHtml.createScriptSrc = function (a, b) { | |
goog.html.TrustedResourceUrl.unwrap(a) | |
var c = goog.html.SafeHtml.combineAttributes({ src: a }, {}, b) | |
return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse( | |
'script', | |
c | |
) | |
} | |
goog.html.SafeHtml.createStyle = function (a, b) { | |
var c = goog.html.SafeHtml.combineAttributes({ type: 'text/css' }, {}, b), | |
d = '' | |
a = goog.array.concat(a) | |
for (var e = 0; e < a.length; e++) { | |
d += goog.html.SafeStyleSheet.unwrap(a[e]) | |
} | |
d = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
d, | |
goog.i18n.bidi.Dir.NEUTRAL | |
) | |
return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse( | |
'style', | |
c, | |
d | |
) | |
} | |
goog.html.SafeHtml.createMetaRefresh = function (a, b) { | |
var c = goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(a)) | |
;(goog.labs.userAgent.browser.isIE() || | |
goog.labs.userAgent.browser.isEdge()) && | |
goog.string.contains(c, ';') && | |
(c = "'" + c.replace(/'/g, '%27') + "'") | |
return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse( | |
'meta', | |
{ 'http-equiv': 'refresh', content: (b || 0) + '; url=' + c } | |
) | |
} | |
goog.html.SafeHtml.getAttrNameAndValue_ = function (a, b, c) { | |
if (c instanceof goog.string.Const) { | |
c = goog.string.Const.unwrap(c) | |
} else { | |
if ('style' == b.toLowerCase()) { | |
c = goog.html.SafeHtml.getStyleValue_(c) | |
} else { | |
if (/^on/i.test(b)) { | |
throw Error( | |
'Attribute "' + | |
b + | |
'" requires goog.string.Const value, "' + | |
c + | |
'" given.' | |
) | |
} | |
if (b.toLowerCase() in goog.html.SafeHtml.URL_ATTRIBUTES_) { | |
if (c instanceof goog.html.TrustedResourceUrl) { | |
c = goog.html.TrustedResourceUrl.unwrap(c) | |
} else { | |
if (c instanceof goog.html.SafeUrl) { | |
c = goog.html.SafeUrl.unwrap(c) | |
} else { | |
if (goog.isString(c)) { | |
c = goog.html.SafeUrl.sanitize(c).getTypedStringValue() | |
} else { | |
throw Error( | |
'Attribute "' + | |
b + | |
'" on tag "' + | |
a + | |
'" requires goog.html.SafeUrl, goog.string.Const, or string, value "' + | |
c + | |
'" given.' | |
) | |
} | |
} | |
} | |
} | |
} | |
} | |
c.implementsGoogStringTypedString && (c = c.getTypedStringValue()) | |
goog.asserts.assert( | |
goog.isString(c) || goog.isNumber(c), | |
'String or number value expected, got ' + typeof c + ' with value: ' + c | |
) | |
return b + '="' + goog.string.htmlEscape(String(c)) + '"' | |
} | |
goog.html.SafeHtml.getStyleValue_ = function (a) { | |
if (!goog.isObject(a)) { | |
throw Error( | |
'The "style" attribute requires goog.html.SafeStyle or map of style properties, ' + | |
typeof a + | |
' given: ' + | |
a | |
) | |
} | |
a instanceof goog.html.SafeStyle || (a = goog.html.SafeStyle.create(a)) | |
return goog.html.SafeStyle.unwrap(a) | |
} | |
goog.html.SafeHtml.createWithDir = function (a, b, c, d) { | |
b = goog.html.SafeHtml.create(b, c, d) | |
b.dir_ = a | |
return b | |
} | |
goog.html.SafeHtml.concat = function (a) { | |
var b = goog.i18n.bidi.Dir.NEUTRAL, | |
c = '', | |
d = function (a) { | |
goog.isArray(a) | |
? goog.array.forEach(a, d) | |
: ((a = goog.html.SafeHtml.htmlEscape(a)), | |
(c += goog.html.SafeHtml.unwrap(a)), | |
(a = a.getDirection()), | |
b == goog.i18n.bidi.Dir.NEUTRAL | |
? (b = a) | |
: a != goog.i18n.bidi.Dir.NEUTRAL && b != a && (b = null)) | |
} | |
goog.array.forEach(arguments, d) | |
return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
c, | |
b | |
) | |
} | |
goog.html.SafeHtml.concatWithDir = function (a, b) { | |
var c = goog.html.SafeHtml.concat(goog.array.slice(arguments, 1)) | |
c.dir_ = a | |
return c | |
} | |
goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {} | |
goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse = function ( | |
a, | |
b | |
) { | |
return new goog.html.SafeHtml().initSecurityPrivateDoNotAccessOrElse_( | |
a, | |
b | |
) | |
} | |
goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_ = function ( | |
a, | |
b | |
) { | |
this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = a | |
this.dir_ = b | |
return this | |
} | |
goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse = function ( | |
a, | |
b, | |
c | |
) { | |
var d = null, | |
e | |
e = '<' + a + goog.html.SafeHtml.stringifyAttributes(a, b) | |
goog.isDefAndNotNull(c) ? goog.isArray(c) || (c = [c]) : (c = []) | |
goog.dom.tags.isVoidTag(a.toLowerCase()) | |
? (goog.asserts.assert( | |
!c.length, | |
'Void tag <' + a + '> does not allow content.' | |
), | |
(e += '>')) | |
: ((d = goog.html.SafeHtml.concat(c)), | |
(e += '>' + goog.html.SafeHtml.unwrap(d) + '</' + a + '>'), | |
(d = d.getDirection())) | |
;(a = b && b.dir) && | |
(d = /^(ltr|rtl|auto)$/i.test(a) ? goog.i18n.bidi.Dir.NEUTRAL : null) | |
return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
e, | |
d | |
) | |
} | |
goog.html.SafeHtml.stringifyAttributes = function (a, b) { | |
var c = '' | |
if (b) { | |
for (var d in b) { | |
if (!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(d)) { | |
throw Error('Invalid attribute name "' + d + '".') | |
} | |
var e = b[d] | |
goog.isDefAndNotNull(e) && | |
(c += ' ' + goog.html.SafeHtml.getAttrNameAndValue_(a, d, e)) | |
} | |
} | |
return c | |
} | |
goog.html.SafeHtml.combineAttributes = function (a, b, c) { | |
var d = {}, | |
e | |
for (e in a) { | |
goog.asserts.assert(e.toLowerCase() == e, 'Must be lower case'), | |
(d[e] = a[e]) | |
} | |
for (e in b) { | |
goog.asserts.assert(e.toLowerCase() == e, 'Must be lower case'), | |
(d[e] = b[e]) | |
} | |
for (e in c) { | |
var f = e.toLowerCase() | |
if (f in a) { | |
throw Error( | |
'Cannot override "' + | |
f + | |
'" attribute, got "' + | |
e + | |
'" with value "' + | |
c[e] + | |
'"' | |
) | |
} | |
f in b && delete d[f] | |
d[e] = c[e] | |
} | |
return d | |
} | |
goog.html.SafeHtml.DOCTYPE_HTML = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
'<!DOCTYPE html>', | |
goog.i18n.bidi.Dir.NEUTRAL | |
) | |
goog.html.SafeHtml.EMPTY = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
'', | |
goog.i18n.bidi.Dir.NEUTRAL | |
) | |
goog.html.SafeHtml.BR = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
'<br>', | |
goog.i18n.bidi.Dir.NEUTRAL | |
) | |
goog.dom.safe = {} | |
goog.dom.safe.InsertAdjacentHtmlPosition = { | |
AFTERBEGIN: 'afterbegin', | |
AFTEREND: 'afterend', | |
BEFOREBEGIN: 'beforebegin', | |
BEFOREEND: 'beforeend', | |
} | |
goog.dom.safe.insertAdjacentHtml = function (a, b, c) { | |
a.insertAdjacentHTML(b, goog.html.SafeHtml.unwrap(c)) | |
} | |
goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_ = { | |
MATH: !0, | |
SCRIPT: !0, | |
STYLE: !0, | |
SVG: !0, | |
TEMPLATE: !0, | |
} | |
goog.dom.safe.setInnerHtml = function (a, b) { | |
if (goog.asserts.ENABLE_ASSERTS) { | |
var c = a.tagName.toUpperCase() | |
if (goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[c]) { | |
throw Error( | |
'goog.dom.safe.setInnerHtml cannot be used to set content of ' + | |
a.tagName + | |
'.' | |
) | |
} | |
} | |
a.innerHTML = goog.html.SafeHtml.unwrap(b) | |
} | |
goog.dom.safe.setOuterHtml = function (a, b) { | |
a.outerHTML = goog.html.SafeHtml.unwrap(b) | |
} | |
goog.dom.safe.setStyle = function (a, b) { | |
a.style.cssText = goog.html.SafeStyle.unwrap(b) | |
} | |
goog.dom.safe.documentWrite = function (a, b) { | |
a.write(goog.html.SafeHtml.unwrap(b)) | |
} | |
goog.dom.safe.setAnchorHref = function (a, b) { | |
goog.dom.safe.assertIsHTMLAnchorElement_(a) | |
var c | |
c = b instanceof goog.html.SafeUrl ? b : goog.html.SafeUrl.sanitize(b) | |
a.href = goog.html.SafeUrl.unwrap(c) | |
} | |
goog.dom.safe.setImageSrc = function (a, b) { | |
goog.dom.safe.assertIsHTMLImageElement_(a) | |
var c | |
c = b instanceof goog.html.SafeUrl ? b : goog.html.SafeUrl.sanitize(b) | |
a.src = goog.html.SafeUrl.unwrap(c) | |
} | |
goog.dom.safe.setEmbedSrc = function (a, b) { | |
goog.dom.safe.assertIsHTMLEmbedElement_(a) | |
a.src = goog.html.TrustedResourceUrl.unwrap(b) | |
} | |
goog.dom.safe.setFrameSrc = function (a, b) { | |
goog.dom.safe.assertIsHTMLFrameElement_(a) | |
a.src = goog.html.TrustedResourceUrl.unwrap(b) | |
} | |
goog.dom.safe.setIframeSrc = function (a, b) { | |
goog.dom.safe.assertIsHTMLIFrameElement_(a) | |
a.src = goog.html.TrustedResourceUrl.unwrap(b) | |
} | |
goog.dom.safe.setLinkHrefAndRel = function (a, b, c) { | |
goog.dom.safe.assertIsHTMLLinkElement_(a) | |
a.rel = c | |
goog.string.caseInsensitiveContains(c, 'stylesheet') | |
? (goog.asserts.assert( | |
b instanceof goog.html.TrustedResourceUrl, | |
'URL must be TrustedResourceUrl because "rel" contains "stylesheet"' | |
), | |
(a.href = goog.html.TrustedResourceUrl.unwrap(b))) | |
: (a.href = | |
b instanceof goog.html.TrustedResourceUrl | |
? goog.html.TrustedResourceUrl.unwrap(b) | |
: b instanceof goog.html.SafeUrl | |
? goog.html.SafeUrl.unwrap(b) | |
: goog.html.SafeUrl.sanitize(b).getTypedStringValue()) | |
} | |
goog.dom.safe.setObjectData = function (a, b) { | |
goog.dom.safe.assertIsHTMLObjectElement_(a) | |
a.data = goog.html.TrustedResourceUrl.unwrap(b) | |
} | |
goog.dom.safe.setScriptSrc = function (a, b) { | |
goog.dom.safe.assertIsHTMLScriptElement_(a) | |
a.src = goog.html.TrustedResourceUrl.unwrap(b) | |
} | |
goog.dom.safe.setLocationHref = function (a, b) { | |
goog.dom.safe.assertIsLocation_(a) | |
var c | |
c = b instanceof goog.html.SafeUrl ? b : goog.html.SafeUrl.sanitize(b) | |
a.href = goog.html.SafeUrl.unwrap(c) | |
} | |
goog.dom.safe.openInWindow = function (a, b, c, d, e) { | |
a = a instanceof goog.html.SafeUrl ? a : goog.html.SafeUrl.sanitize(a) | |
return (b || window).open( | |
goog.html.SafeUrl.unwrap(a), | |
c ? goog.string.Const.unwrap(c) : '', | |
d, | |
e | |
) | |
} | |
goog.dom.safe.assertIsLocation_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof Location && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && (a instanceof Location || !(a instanceof Element)), | |
'Argument is not a Location (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLAnchorElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLAnchorElement && | |
'undefined' != typeof Location && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && | |
(a instanceof HTMLAnchorElement || | |
!(a instanceof Location || a instanceof Element)), | |
'Argument is not a HTMLAnchorElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLLinkElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLLinkElement && | |
'undefined' != typeof Location && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && | |
(a instanceof HTMLLinkElement || | |
!(a instanceof Location || a instanceof Element)), | |
'Argument is not a HTMLLinkElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLImageElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLImageElement && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && (a instanceof HTMLImageElement || !(a instanceof Element)), | |
'Argument is not a HTMLImageElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLEmbedElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLEmbedElement && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && (a instanceof HTMLEmbedElement || !(a instanceof Element)), | |
'Argument is not a HTMLEmbedElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLFrameElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLFrameElement && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && (a instanceof HTMLFrameElement || !(a instanceof Element)), | |
'Argument is not a HTMLFrameElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLIFrameElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLIFrameElement && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && (a instanceof HTMLIFrameElement || !(a instanceof Element)), | |
'Argument is not a HTMLIFrameElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLObjectElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLObjectElement && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && (a instanceof HTMLObjectElement || !(a instanceof Element)), | |
'Argument is not a HTMLObjectElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.assertIsHTMLScriptElement_ = function (a) { | |
goog.asserts.ENABLE_ASSERTS && | |
'undefined' != typeof HTMLScriptElement && | |
'undefined' != typeof Element && | |
goog.asserts.assert( | |
a && (a instanceof HTMLScriptElement || !(a instanceof Element)), | |
'Argument is not a HTMLScriptElement (or a non-Element mock); got: %s', | |
goog.dom.safe.debugStringForType_(a) | |
) | |
return a | |
} | |
goog.dom.safe.debugStringForType_ = function (a) { | |
return goog.isObject(a) | |
? a.constructor.displayName || | |
a.constructor.name || | |
Object.prototype.toString.call(a) | |
: void 0 === a | |
? 'undefined' | |
: null === a | |
? 'null' | |
: typeof a | |
} | |
goog.html.SafeScript = function () { | |
this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = '' | |
this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = | |
goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
} | |
goog.html.SafeScript.prototype.implementsGoogStringTypedString = !0 | |
goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {} | |
goog.html.SafeScript.fromConstant = function (a) { | |
a = goog.string.Const.unwrap(a) | |
return 0 === a.length | |
? goog.html.SafeScript.EMPTY | |
: goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse( | |
a | |
) | |
} | |
goog.html.SafeScript.prototype.getTypedStringValue = function () { | |
return this.privateDoNotAccessOrElseSafeScriptWrappedValue_ | |
} | |
goog.DEBUG && | |
(goog.html.SafeScript.prototype.toString = function () { | |
return ( | |
'SafeScript{' + | |
this.privateDoNotAccessOrElseSafeScriptWrappedValue_ + | |
'}' | |
) | |
}) | |
goog.html.SafeScript.unwrap = function (a) { | |
if ( | |
a instanceof goog.html.SafeScript && | |
a.constructor === goog.html.SafeScript && | |
a.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === | |
goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ | |
) { | |
return a.privateDoNotAccessOrElseSafeScriptWrappedValue_ | |
} | |
goog.asserts.fail( | |
"expected object of type SafeScript, got '" + | |
a + | |
"' of type " + | |
goog.typeOf(a) | |
) | |
return 'type_error:SafeScript' | |
} | |
goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse = function ( | |
a | |
) { | |
return new goog.html.SafeScript().initSecurityPrivateDoNotAccessOrElse_(a) | |
} | |
goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_ = function ( | |
a | |
) { | |
this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = a | |
return this | |
} | |
goog.html.SafeScript.EMPTY = goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse( | |
'' | |
) | |
goog.html.uncheckedconversions = {} | |
goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract = function ( | |
a, | |
b, | |
c | |
) { | |
goog.asserts.assertString( | |
goog.string.Const.unwrap(a), | |
'must provide justification' | |
) | |
goog.asserts.assert( | |
!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), | |
'must provide non-empty justification' | |
) | |
return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse( | |
b, | |
c || null | |
) | |
} | |
goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract = function ( | |
a, | |
b | |
) { | |
goog.asserts.assertString( | |
goog.string.Const.unwrap(a), | |
'must provide justification' | |
) | |
goog.asserts.assert( | |
!goog.string.isEmpty(goog.string.Const.unwrap(a)), | |
'must provide non-empty justification' | |
) | |
return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse( | |
b | |
) | |
} | |
goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract = function ( | |
a, | |
b | |
) { | |
goog.asserts.assertString( | |
goog.string.Const.unwrap(a), | |
'must provide justification' | |
) | |
goog.asserts.assert( | |
!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), | |
'must provide non-empty justification' | |
) | |
return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse( | |
b | |
) | |
} | |
goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract = function ( | |
a, | |
b | |
) { | |
goog.asserts.assertString( | |
goog.string.Const.unwrap(a), | |
'must provide justification' | |
) | |
goog.asserts.assert( | |
!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), | |
'must provide non-empty justification' | |
) | |
return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse( | |
b | |
) | |
} | |
goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract = function ( | |
a, | |
b | |
) { | |
goog.asserts.assertString( | |
goog.string.Const.unwrap(a), | |
'must provide justification' | |
) | |
goog.asserts.assert( | |
!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), | |
'must provide non-empty justification' | |
) | |
return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(b) | |
} | |
goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract = function ( | |
a, | |
b | |
) { | |
goog.asserts.assertString( | |
goog.string.Const.unwrap(a), | |
'must provide justification' | |
) | |
goog.asserts.assert( | |
!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), | |
'must provide non-empty justification' | |
) | |
return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse( | |
b | |
) | |
} | |
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 ? 1 : 0 > a ? -1 : a | |
} | |
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.isNegativeZero = function (a) { | |
return 0 == a && 0 > 1 / a | |
} | |
goog.math.log10Floor = function (a) { | |
if (0 < a) { | |
var b = Math.round(Math.log(a) * Math.LOG10E) | |
return b - (parseFloat('1e' + b) > a ? 1 : 0) | |
} | |
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.math.Coordinate = function (a, b) { | |
this.x = goog.isDef(a) ? a : 0 | |
this.y = goog.isDef(b) ? b : 0 | |
} | |
goog.math.Coordinate.prototype.clone = function () { | |
return new goog.math.Coordinate(this.x, this.y) | |
} | |
goog.DEBUG && | |
(goog.math.Coordinate.prototype.toString = function () { | |
return '(' + this.x + ', ' + this.y + ')' | |
}) | |
goog.math.Coordinate.prototype.equals = function (a) { | |
return ( | |
a instanceof goog.math.Coordinate && | |
goog.math.Coordinate.equals(this, a) | |
) | |
} | |
goog.math.Coordinate.equals = function (a, b) { | |
return a == b ? !0 : a && b ? a.x == b.x && a.y == b.y : !1 | |
} | |
goog.math.Coordinate.distance = function (a, b) { | |
var c = a.x - b.x, | |
d = a.y - b.y | |
return Math.sqrt(c * c + d * d) | |
} | |
goog.math.Coordinate.magnitude = function (a) { | |
return Math.sqrt(a.x * a.x + a.y * a.y) | |
} | |
goog.math.Coordinate.azimuth = function (a) { | |
return goog.math.angle(0, 0, a.x, a.y) | |
} | |
goog.math.Coordinate.squaredDistance = function (a, b) { | |
var c = a.x - b.x, | |
d = a.y - b.y | |
return c * c + d * d | |
} | |
goog.math.Coordinate.difference = function (a, b) { | |
return new goog.math.Coordinate(a.x - b.x, a.y - b.y) | |
} | |
goog.math.Coordinate.sum = function (a, b) { | |
return new goog.math.Coordinate(a.x + b.x, a.y + b.y) | |
} | |
goog.math.Coordinate.prototype.ceil = function () { | |
this.x = Math.ceil(this.x) | |
this.y = Math.ceil(this.y) | |
return this | |
} | |
goog.math.Coordinate.prototype.floor = function () { | |
this.x = Math.floor(this.x) | |
this.y = Math.floor(this.y) | |
return this | |
} | |
goog.math.Coordinate.prototype.round = function () { | |
this.x = Math.round(this.x) | |
this.y = Math.round(this.y) | |
return this | |
} | |
goog.math.Coordinate.prototype.translate = function (a, b) { | |
a instanceof goog.math.Coordinate | |
? ((this.x += a.x), (this.y += a.y)) | |
: ((this.x += Number(a)), goog.isNumber(b) && (this.y += b)) | |
return this | |
} | |
goog.math.Coordinate.prototype.scale = function (a, b) { | |
var c = goog.isNumber(b) ? b : a | |
this.x *= a | |
this.y *= c | |
return this | |
} | |
goog.math.Coordinate.prototype.rotateRadians = function (a, b) { | |
var c = b || new goog.math.Coordinate(0, 0), | |
d = this.x, | |
e = this.y, | |
f = Math.cos(a), | |
g = Math.sin(a) | |
this.x = (d - c.x) * f - (e - c.y) * g + c.x | |
this.y = (d - c.x) * g + (e - c.y) * f + c.y | |
} | |
goog.math.Coordinate.prototype.rotateDegrees = function (a, b) { | |
this.rotateRadians(goog.math.toRadians(a), b) | |
} | |
goog.math.Size = function (a, b) { | |
this.width = a | |
this.height = b | |
} | |
goog.math.Size.equals = function (a, b) { | |
return a == b | |
? !0 | |
: a && b | |
? a.width == b.width && a.height == b.height | |
: !1 | |
} | |
goog.math.Size.prototype.clone = function () { | |
return new goog.math.Size(this.width, this.height) | |
} | |
goog.DEBUG && | |
(goog.math.Size.prototype.toString = function () { | |
return '(' + this.width + ' x ' + this.height + ')' | |
}) | |
goog.math.Size.prototype.getLongest = function () { | |
return Math.max(this.width, this.height) | |
} | |
goog.math.Size.prototype.getShortest = function () { | |
return Math.min(this.width, this.height) | |
} | |
goog.math.Size.prototype.area = function () { | |
return this.width * this.height | |
} | |
goog.math.Size.prototype.perimeter = function () { | |
return 2 * (this.width + this.height) | |
} | |
goog.math.Size.prototype.aspectRatio = function () { | |
return this.width / this.height | |
} | |
goog.math.Size.prototype.isEmpty = function () { | |
return !this.area() | |
} | |
goog.math.Size.prototype.ceil = function () { | |
this.width = Math.ceil(this.width) | |
this.height = Math.ceil(this.height) | |
return this | |
} | |
goog.math.Size.prototype.fitsInside = function (a) { | |
return this.width <= a.width && this.height <= a.height | |
} | |
goog.math.Size.prototype.floor = function () { | |
this.width = Math.floor(this.width) | |
this.height = Math.floor(this.height) | |
return this | |
} | |
goog.math.Size.prototype.round = function () { | |
this.width = Math.round(this.width) | |
this.height = Math.round(this.height) | |
return this | |
} | |
goog.math.Size.prototype.scale = function (a, b) { | |
var c = goog.isNumber(b) ? b : a | |
this.width *= a | |
this.height *= c | |
return this | |
} | |
goog.math.Size.prototype.scaleToCover = function (a) { | |
a = | |
this.aspectRatio() <= a.aspectRatio() | |
? a.width / this.width | |
: a.height / this.height | |
return this.scale(a) | |
} | |
goog.math.Size.prototype.scaleToFit = function (a) { | |
a = | |
this.aspectRatio() > a.aspectRatio() | |
? a.width / this.width | |
: a.height / this.height | |
return this.scale(a) | |
} | |
goog.dom.ASSUME_QUIRKS_MODE = !1 | |
goog.dom.ASSUME_STANDARDS_MODE = !1 | |
goog.dom.COMPAT_MODE_KNOWN_ = | |
goog.dom.ASSUME_QUIRKS_MODE || goog.dom.ASSUME_STANDARDS_MODE | |
goog.dom.getDomHelper = function (a) { | |
return a | |
? new goog.dom.DomHelper(goog.dom.getOwnerDocument(a)) | |
: goog.dom.defaultDomHelper_ || | |
(goog.dom.defaultDomHelper_ = new goog.dom.DomHelper()) | |
} | |
goog.dom.getDocument = function () { | |
return document | |
} | |
goog.dom.getElement = function (a) { | |
return goog.dom.getElementHelper_(document, a) | |
} | |
goog.dom.getElementHelper_ = function (a, b) { | |
return goog.isString(b) ? a.getElementById(b) : b | |
} | |
goog.dom.getRequiredElement = function (a) { | |
return goog.dom.getRequiredElementHelper_(document, a) | |
} | |
goog.dom.getRequiredElementHelper_ = function (a, b) { | |
goog.asserts.assertString(b) | |
var c = goog.dom.getElementHelper_(a, b) | |
return (c = goog.asserts.assertElement( | |
c, | |
'No element found with id: ' + b | |
)) | |
} | |
goog.dom.$ = goog.dom.getElement | |
goog.dom.getElementsByTagName = function (a, b) { | |
return (b || document).getElementsByTagName(String(a)) | |
} | |
goog.dom.getElementsByTagNameAndClass = function (a, b, c) { | |
return goog.dom.getElementsByTagNameAndClass_(document, a, b, c) | |
} | |
goog.dom.getElementsByClass = function (a, b) { | |
var c = b || document | |
return goog.dom.canUseQuerySelector_(c) | |
? c.querySelectorAll('.' + a) | |
: goog.dom.getElementsByTagNameAndClass_(document, '*', a, b) | |
} | |
goog.dom.getElementByClass = function (a, b) { | |
var c = b || document | |
return ( | |
(c.getElementsByClassName | |
? c.getElementsByClassName(a)[0] | |
: goog.dom.canUseQuerySelector_(c) | |
? c.querySelector('.' + a) | |
: goog.dom.getElementsByTagNameAndClass_(document, '*', a, b)[0]) || | |
null | |
) | |
} | |
goog.dom.getRequiredElementByClass = function (a, b) { | |
var c = goog.dom.getElementByClass(a, b) | |
return goog.asserts.assert(c, 'No element found with className: ' + a) | |
} | |
goog.dom.canUseQuerySelector_ = function (a) { | |
return !(!a.querySelectorAll || !a.querySelector) | |
} | |
goog.dom.getElementsByTagNameAndClass_ = function (a, b, c, d) { | |
a = d || a | |
b = b && '*' != b ? String(b).toUpperCase() : '' | |
if (goog.dom.canUseQuerySelector_(a) && (b || c)) { | |
return a.querySelectorAll(b + (c ? '.' + c : '')) | |
} | |
if (c && a.getElementsByClassName) { | |
a = a.getElementsByClassName(c) | |
if (b) { | |
d = {} | |
for (var e = 0, f = 0, g; (g = a[f]); f++) { | |
b == g.nodeName && (d[e++] = g) | |
} | |
d.length = e | |
return d | |
} | |
return a | |
} | |
a = a.getElementsByTagName(b || '*') | |
if (c) { | |
d = {} | |
for (f = e = 0; (g = a[f]); f++) { | |
;(b = g.className), | |
'function' == typeof b.split && | |
goog.array.contains(b.split(/\s+/), c) && | |
(d[e++] = g) | |
} | |
d.length = e | |
return d | |
} | |
return a | |
} | |
goog.dom.$$ = goog.dom.getElementsByTagNameAndClass | |
goog.dom.setProperties = function (a, b) { | |
goog.object.forEach(b, function (b, d) { | |
'style' == d | |
? (a.style.cssText = b) | |
: 'class' == d | |
? (a.className = b) | |
: 'for' == d | |
? (a.htmlFor = b) | |
: goog.dom.DIRECT_ATTRIBUTE_MAP_.hasOwnProperty(d) | |
? a.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[d], b) | |
: goog.string.startsWith(d, 'aria-') || | |
goog.string.startsWith(d, 'data-') | |
? a.setAttribute(d, b) | |
: (a[d] = b) | |
}) | |
} | |
goog.dom.DIRECT_ATTRIBUTE_MAP_ = { | |
cellpadding: 'cellPadding', | |
cellspacing: 'cellSpacing', | |
colspan: 'colSpan', | |
frameborder: 'frameBorder', | |
height: 'height', | |
maxlength: 'maxLength', | |
nonce: 'nonce', | |
role: 'role', | |
rowspan: 'rowSpan', | |
type: 'type', | |
usemap: 'useMap', | |
valign: 'vAlign', | |
width: 'width', | |
} | |
goog.dom.getViewportSize = function (a) { | |
return goog.dom.getViewportSize_(a || window) | |
} | |
goog.dom.getViewportSize_ = function (a) { | |
a = a.document | |
a = goog.dom.isCss1CompatMode_(a) ? a.documentElement : a.body | |
return new goog.math.Size(a.clientWidth, a.clientHeight) | |
} | |
goog.dom.getDocumentHeight = function () { | |
return goog.dom.getDocumentHeight_(window) | |
} | |
goog.dom.getDocumentHeightForWindow = function (a) { | |
return goog.dom.getDocumentHeight_(a) | |
} | |
goog.dom.getDocumentHeight_ = function (a) { | |
var b = a.document, | |
c = 0 | |
if (b) { | |
var c = b.body, | |
d = b.documentElement | |
if (!d || !c) { | |
return 0 | |
} | |
a = goog.dom.getViewportSize_(a).height | |
if (goog.dom.isCss1CompatMode_(b) && d.scrollHeight) { | |
c = d.scrollHeight != a ? d.scrollHeight : d.offsetHeight | |
} else { | |
var b = d.scrollHeight, | |
e = d.offsetHeight | |
d.clientHeight != e && ((b = c.scrollHeight), (e = c.offsetHeight)) | |
c = b > a ? (b > e ? b : e) : b < e ? b : e | |
} | |
} | |
return c | |
} | |
goog.dom.getPageScroll = function (a) { | |
return goog.dom | |
.getDomHelper((a || goog.global || window).document) | |
.getDocumentScroll() | |
} | |
goog.dom.getDocumentScroll = function () { | |
return goog.dom.getDocumentScroll_(document) | |
} | |
goog.dom.getDocumentScroll_ = function (a) { | |
var b = goog.dom.getDocumentScrollElement_(a) | |
a = goog.dom.getWindow_(a) | |
return goog.userAgent.IE && | |
goog.userAgent.isVersionOrHigher('10') && | |
a.pageYOffset != b.scrollTop | |
? new goog.math.Coordinate(b.scrollLeft, b.scrollTop) | |
: new goog.math.Coordinate( | |
a.pageXOffset || b.scrollLeft, | |
a.pageYOffset || b.scrollTop | |
) | |
} | |
goog.dom.getDocumentScrollElement = function () { | |
return goog.dom.getDocumentScrollElement_(document) | |
} | |
goog.dom.getDocumentScrollElement_ = function (a) { | |
return a.scrollingElement | |
? a.scrollingElement | |
: !goog.userAgent.WEBKIT && goog.dom.isCss1CompatMode_(a) | |
? a.documentElement | |
: a.body || a.documentElement | |
} | |
goog.dom.getWindow = function (a) { | |
return a ? goog.dom.getWindow_(a) : window | |
} | |
goog.dom.getWindow_ = function (a) { | |
return a.parentWindow || a.defaultView | |
} | |
goog.dom.createDom = function (a, b, c) { | |
return goog.dom.createDom_(document, arguments) | |
} | |
goog.dom.createDom_ = function (a, b) { | |
var c = String(b[0]), | |
d = b[1] | |
if ( | |
!goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES && | |
d && | |
(d.name || d.type) | |
) { | |
c = ['<', c] | |
d.name && c.push(' name="', goog.string.htmlEscape(d.name), '"') | |
if (d.type) { | |
c.push(' type="', goog.string.htmlEscape(d.type), '"') | |
var e = {} | |
goog.object.extend(e, d) | |
delete e.type | |
d = e | |
} | |
c.push('>') | |
c = c.join('') | |
} | |
c = a.createElement(c) | |
d && | |
(goog.isString(d) | |
? (c.className = d) | |
: goog.isArray(d) | |
? (c.className = d.join(' ')) | |
: goog.dom.setProperties(c, d)) | |
2 < b.length && goog.dom.append_(a, c, b, 2) | |
return c | |
} | |
goog.dom.append_ = function (a, b, c, d) { | |
function e(c) { | |
c && b.appendChild(goog.isString(c) ? a.createTextNode(c) : c) | |
} | |
for (; d < c.length; d++) { | |
var f = c[d] | |
goog.isArrayLike(f) && !goog.dom.isNodeLike(f) | |
? goog.array.forEach( | |
goog.dom.isNodeList(f) ? goog.array.toArray(f) : f, | |
e | |
) | |
: e(f) | |
} | |
} | |
goog.dom.$dom = goog.dom.createDom | |
goog.dom.createElement = function (a) { | |
return goog.dom.createElement_(document, a) | |
} | |
goog.dom.createElement_ = function (a, b) { | |
return a.createElement(String(b)) | |
} | |
goog.dom.createTextNode = function (a) { | |
return document.createTextNode(String(a)) | |
} | |
goog.dom.createTable = function (a, b, c) { | |
return goog.dom.createTable_(document, a, b, !!c) | |
} | |
goog.dom.createTable_ = function (a, b, c, d) { | |
for ( | |
var e = goog.dom.createElement_(a, 'TABLE'), | |
f = e.appendChild(goog.dom.createElement_(a, 'TBODY')), | |
g = 0; | |
g < b; | |
g++ | |
) { | |
for (var h = goog.dom.createElement_(a, 'TR'), k = 0; k < c; k++) { | |
var l = goog.dom.createElement_(a, 'TD') | |
d && goog.dom.setTextContent(l, goog.string.Unicode.NBSP) | |
h.appendChild(l) | |
} | |
f.appendChild(h) | |
} | |
return e | |
} | |
goog.dom.constHtmlToNode = function (a) { | |
var b = goog.array.map(arguments, goog.string.Const.unwrap), | |
b = goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract( | |
goog.string.Const.from( | |
'Constant HTML string, that gets turned into a Node later, so it will be automatically balanced.' | |
), | |
b.join('') | |
) | |
return goog.dom.safeHtmlToNode(b) | |
} | |
goog.dom.safeHtmlToNode = function (a) { | |
return goog.dom.safeHtmlToNode_(document, a) | |
} | |
goog.dom.safeHtmlToNode_ = function (a, b) { | |
var c = goog.dom.createElement_(a, 'DIV') | |
goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT | |
? (goog.dom.safe.setInnerHtml( | |
c, | |
goog.html.SafeHtml.concat(goog.html.SafeHtml.BR, b) | |
), | |
c.removeChild(c.firstChild)) | |
: goog.dom.safe.setInnerHtml(c, b) | |
return goog.dom.childrenToNode_(a, c) | |
} | |
goog.dom.childrenToNode_ = function (a, b) { | |
if (1 == b.childNodes.length) { | |
return b.removeChild(b.firstChild) | |
} | |
for (var c = a.createDocumentFragment(); b.firstChild; ) { | |
c.appendChild(b.firstChild) | |
} | |
return c | |
} | |
goog.dom.isCss1CompatMode = function () { | |
return goog.dom.isCss1CompatMode_(document) | |
} | |
goog.dom.isCss1CompatMode_ = function (a) { | |
return goog.dom.COMPAT_MODE_KNOWN_ | |
? goog.dom.ASSUME_STANDARDS_MODE | |
: 'CSS1Compat' == a.compatMode | |
} | |
goog.dom.canHaveChildren = function (a) { | |
if (a.nodeType != goog.dom.NodeType.ELEMENT) { | |
return !1 | |
} | |
switch (a.tagName) { | |
case 'APPLET': | |
case 'AREA': | |
case 'BASE': | |
case 'BR': | |
case 'COL': | |
case 'COMMAND': | |
case 'EMBED': | |
case 'FRAME': | |
case 'HR': | |
case 'IMG': | |
case 'INPUT': | |
case 'IFRAME': | |
case 'ISINDEX': | |
case 'KEYGEN': | |
case 'LINK': | |
case 'NOFRAMES': | |
case 'NOSCRIPT': | |
case 'META': | |
case 'OBJECT': | |
case 'PARAM': | |
case 'SCRIPT': | |
case 'SOURCE': | |
case 'STYLE': | |
case 'TRACK': | |
case 'WBR': | |
return !1 | |
} | |
return !0 | |
} | |
goog.dom.appendChild = function (a, b) { | |
a.appendChild(b) | |
} | |
goog.dom.append = function (a, b) { | |
goog.dom.append_(goog.dom.getOwnerDocument(a), a, arguments, 1) | |
} | |
goog.dom.removeChildren = function (a) { | |
for (var b; (b = a.firstChild); ) { | |
a.removeChild(b) | |
} | |
} | |
goog.dom.insertSiblingBefore = function (a, b) { | |
b.parentNode && b.parentNode.insertBefore(a, b) | |
} | |
goog.dom.insertSiblingAfter = function (a, b) { | |
b.parentNode && b.parentNode.insertBefore(a, b.nextSibling) | |
} | |
goog.dom.insertChildAt = function (a, b, c) { | |
a.insertBefore(b, a.childNodes[c] || null) | |
} | |
goog.dom.removeNode = function (a) { | |
return a && a.parentNode ? a.parentNode.removeChild(a) : null | |
} | |
goog.dom.replaceNode = function (a, b) { | |
var c = b.parentNode | |
c && c.replaceChild(a, b) | |
} | |
goog.dom.flattenElement = function (a) { | |
var b, | |
c = a.parentNode | |
if (c && c.nodeType != goog.dom.NodeType.DOCUMENT_FRAGMENT) { | |
if (a.removeNode) { | |
return a.removeNode(!1) | |
} | |
for (; (b = a.firstChild); ) { | |
c.insertBefore(b, a) | |
} | |
return goog.dom.removeNode(a) | |
} | |
} | |
goog.dom.getChildren = function (a) { | |
return goog.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE && | |
void 0 != a.children | |
? a.children | |
: goog.array.filter(a.childNodes, function (a) { | |
return a.nodeType == goog.dom.NodeType.ELEMENT | |
}) | |
} | |
goog.dom.getFirstElementChild = function (a) { | |
return goog.isDef(a.firstElementChild) | |
? a.firstElementChild | |
: goog.dom.getNextElementNode_(a.firstChild, !0) | |
} | |
goog.dom.getLastElementChild = function (a) { | |
return goog.isDef(a.lastElementChild) | |
? a.lastElementChild | |
: goog.dom.getNextElementNode_(a.lastChild, !1) | |
} | |
goog.dom.getNextElementSibling = function (a) { | |
return goog.isDef(a.nextElementSibling) | |
? a.nextElementSibling | |
: goog.dom.getNextElementNode_(a.nextSibling, !0) | |
} | |
goog.dom.getPreviousElementSibling = function (a) { | |
return goog.isDef(a.previousElementSibling) | |
? a.previousElementSibling | |
: goog.dom.getNextElementNode_(a.previousSibling, !1) | |
} | |
goog.dom.getNextElementNode_ = function (a, b) { | |
for (; a && a.nodeType != goog.dom.NodeType.ELEMENT; ) { | |
a = b ? a.nextSibling : a.previousSibling | |
} | |
return a | |
} | |
goog.dom.getNextNode = function (a) { | |
if (!a) { | |
return null | |
} | |
if (a.firstChild) { | |
return a.firstChild | |
} | |
for (; a && !a.nextSibling; ) { | |
a = a.parentNode | |
} | |
return a ? a.nextSibling : null | |
} | |
goog.dom.getPreviousNode = function (a) { | |
if (!a) { | |
return null | |
} | |
if (!a.previousSibling) { | |
return a.parentNode | |
} | |
for (a = a.previousSibling; a && a.lastChild; ) { | |
a = a.lastChild | |
} | |
return a | |
} | |
goog.dom.isNodeLike = function (a) { | |
return goog.isObject(a) && 0 < a.nodeType | |
} | |
goog.dom.isElement = function (a) { | |
return goog.isObject(a) && a.nodeType == goog.dom.NodeType.ELEMENT | |
} | |
goog.dom.isWindow = function (a) { | |
return goog.isObject(a) && a.window == a | |
} | |
goog.dom.getParentElement = function (a) { | |
var b | |
if ( | |
goog.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY && | |
!( | |
goog.userAgent.IE && | |
goog.userAgent.isVersionOrHigher('9') && | |
!goog.userAgent.isVersionOrHigher('10') && | |
goog.global.SVGElement && | |
a instanceof goog.global.SVGElement | |
) && | |
(b = a.parentElement) | |
) { | |
return b | |
} | |
b = a.parentNode | |
return goog.dom.isElement(b) ? b : null | |
} | |
goog.dom.contains = function (a, b) { | |
if (!a || !b) { | |
return !1 | |
} | |
if (a.contains && b.nodeType == goog.dom.NodeType.ELEMENT) { | |
return a == b || a.contains(b) | |
} | |
if ('undefined' != typeof a.compareDocumentPosition) { | |
return a == b || !!(a.compareDocumentPosition(b) & 16) | |
} | |
for (; b && a != b; ) { | |
b = b.parentNode | |
} | |
return b == a | |
} | |
goog.dom.compareNodeOrder = function (a, b) { | |
if (a == b) { | |
return 0 | |
} | |
if (a.compareDocumentPosition) { | |
return a.compareDocumentPosition(b) & 2 ? 1 : -1 | |
} | |
if (goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(9)) { | |
if (a.nodeType == goog.dom.NodeType.DOCUMENT) { | |
return -1 | |
} | |
if (b.nodeType == goog.dom.NodeType.DOCUMENT) { | |
return 1 | |
} | |
} | |
if ( | |
'sourceIndex' in a || | |
(a.parentNode && 'sourceIndex' in a.parentNode) | |
) { | |
var c = a.nodeType == goog.dom.NodeType.ELEMENT, | |
d = b.nodeType == goog.dom.NodeType.ELEMENT | |
if (c && d) { | |
return a.sourceIndex - b.sourceIndex | |
} | |
var e = a.parentNode, | |
f = b.parentNode | |
return e == f | |
? goog.dom.compareSiblingOrder_(a, b) | |
: !c && goog.dom.contains(e, b) | |
? -1 * goog.dom.compareParentsDescendantNodeIe_(a, b) | |
: !d && goog.dom.contains(f, a) | |
? goog.dom.compareParentsDescendantNodeIe_(b, a) | |
: (c ? a.sourceIndex : e.sourceIndex) - | |
(d ? b.sourceIndex : f.sourceIndex) | |
} | |
d = goog.dom.getOwnerDocument(a) | |
c = d.createRange() | |
c.selectNode(a) | |
c.collapse(!0) | |
d = d.createRange() | |
d.selectNode(b) | |
d.collapse(!0) | |
return c.compareBoundaryPoints(goog.global.Range.START_TO_END, d) | |
} | |
goog.dom.compareParentsDescendantNodeIe_ = function (a, b) { | |
var c = a.parentNode | |
if (c == b) { | |
return -1 | |
} | |
for (var d = b; d.parentNode != c; ) { | |
d = d.parentNode | |
} | |
return goog.dom.compareSiblingOrder_(d, a) | |
} | |
goog.dom.compareSiblingOrder_ = function (a, b) { | |
for (var c = b; (c = c.previousSibling); ) { | |
if (c == a) { | |
return -1 | |
} | |
} | |
return 1 | |
} | |
goog.dom.findCommonAncestor = function (a) { | |
var b, | |
c = arguments.length | |
if (!c) { | |
return null | |
} | |
if (1 == c) { | |
return arguments[0] | |
} | |
var d = [], | |
e = Infinity | |
for (b = 0; b < c; b++) { | |
for (var f = [], g = arguments[b]; g; ) { | |
f.unshift(g), (g = g.parentNode) | |
} | |
d.push(f) | |
e = Math.min(e, f.length) | |
} | |
f = null | |
for (b = 0; b < e; b++) { | |
for (var g = d[0][b], h = 1; h < c; h++) { | |
if (g != d[h][b]) { | |
return f | |
} | |
} | |
f = g | |
} | |
return f | |
} | |
goog.dom.getOwnerDocument = function (a) { | |
goog.asserts.assert(a, 'Node cannot be null or undefined.') | |
return a.nodeType == goog.dom.NodeType.DOCUMENT | |
? a | |
: a.ownerDocument || a.document | |
} | |
goog.dom.getFrameContentDocument = function (a) { | |
return a.contentDocument || a.contentWindow.document | |
} | |
goog.dom.getFrameContentWindow = function (a) { | |
try { | |
return ( | |
a.contentWindow || | |
(a.contentDocument ? goog.dom.getWindow(a.contentDocument) : null) | |
) | |
} catch (b) {} | |
return null | |
} | |
goog.dom.setTextContent = function (a, b) { | |
goog.asserts.assert( | |
null != a, | |
'goog.dom.setTextContent expects a non-null value for node' | |
) | |
if ('textContent' in a) { | |
a.textContent = b | |
} else { | |
if (a.nodeType == goog.dom.NodeType.TEXT) { | |
a.data = b | |
} else { | |
if (a.firstChild && a.firstChild.nodeType == goog.dom.NodeType.TEXT) { | |
for (; a.lastChild != a.firstChild; ) { | |
a.removeChild(a.lastChild) | |
} | |
a.firstChild.data = b | |
} else { | |
goog.dom.removeChildren(a) | |
var c = goog.dom.getOwnerDocument(a) | |
a.appendChild(c.createTextNode(String(b))) | |
} | |
} | |
} | |
} | |
goog.dom.getOuterHtml = function (a) { | |
goog.asserts.assert( | |
null !== a, | |
'goog.dom.getOuterHtml expects a non-null value for element' | |
) | |
if ('outerHTML' in a) { | |
return a.outerHTML | |
} | |
var b = goog.dom.getOwnerDocument(a), | |
b = goog.dom.createElement_(b, 'DIV') | |
b.appendChild(a.cloneNode(!0)) | |
return b.innerHTML | |
} | |
goog.dom.findNode = function (a, b) { | |
var c = [] | |
return goog.dom.findNodes_(a, b, c, !0) ? c[0] : void 0 | |
} | |
goog.dom.findNodes = function (a, b) { | |
var c = [] | |
goog.dom.findNodes_(a, b, c, !1) | |
return c | |
} | |
goog.dom.findNodes_ = function (a, b, c, d) { | |
if (null != a) { | |
for (a = a.firstChild; a; ) { | |
if ((b(a) && (c.push(a), d)) || goog.dom.findNodes_(a, b, c, d)) { | |
return !0 | |
} | |
a = a.nextSibling | |
} | |
} | |
return !1 | |
} | |
goog.dom.TAGS_TO_IGNORE_ = { | |
SCRIPT: 1, | |
STYLE: 1, | |
HEAD: 1, | |
IFRAME: 1, | |
OBJECT: 1, | |
} | |
goog.dom.PREDEFINED_TAG_VALUES_ = { IMG: ' ', BR: '\n' } | |
goog.dom.isFocusableTabIndex = function (a) { | |
return ( | |
goog.dom.hasSpecifiedTabIndex_(a) && goog.dom.isTabIndexFocusable_(a) | |
) | |
} | |
goog.dom.setFocusableTabIndex = function (a, b) { | |
b ? (a.tabIndex = 0) : ((a.tabIndex = -1), a.removeAttribute('tabIndex')) | |
} | |
goog.dom.isFocusable = function (a) { | |
var b | |
return (b = goog.dom.nativelySupportsFocus_(a) | |
? !a.disabled && | |
(!goog.dom.hasSpecifiedTabIndex_(a) || | |
goog.dom.isTabIndexFocusable_(a)) | |
: goog.dom.isFocusableTabIndex(a)) && goog.userAgent.IE | |
? goog.dom.hasNonZeroBoundingRect_(a) | |
: b | |
} | |
goog.dom.hasSpecifiedTabIndex_ = function (a) { | |
return goog.userAgent.IE && !goog.userAgent.isVersionOrHigher('9') | |
? ((a = a.getAttributeNode('tabindex')), | |
goog.isDefAndNotNull(a) && a.specified) | |
: a.hasAttribute('tabindex') | |
} | |
goog.dom.isTabIndexFocusable_ = function (a) { | |
a = a.tabIndex | |
return goog.isNumber(a) && 0 <= a && 32768 > a | |
} | |
goog.dom.nativelySupportsFocus_ = function (a) { | |
return ( | |
'A' == a.tagName || | |
'INPUT' == a.tagName || | |
'TEXTAREA' == a.tagName || | |
'SELECT' == a.tagName || | |
'BUTTON' == a.tagName | |
) | |
} | |
goog.dom.hasNonZeroBoundingRect_ = function (a) { | |
a = | |
!goog.isFunction(a.getBoundingClientRect) || | |
(goog.userAgent.IE && null == a.parentElement) | |
? { height: a.offsetHeight, width: a.offsetWidth } | |
: a.getBoundingClientRect() | |
return goog.isDefAndNotNull(a) && 0 < a.height && 0 < a.width | |
} | |
goog.dom.getTextContent = function (a) { | |
if ( | |
goog.dom.BrowserFeature.CAN_USE_INNER_TEXT && | |
null !== a && | |
'innerText' in a | |
) { | |
a = goog.string.canonicalizeNewlines(a.innerText) | |
} else { | |
var b = [] | |
goog.dom.getTextContent_(a, b, !0) | |
a = b.join('') | |
} | |
a = a.replace(/ \xAD /g, ' ').replace(/\xAD/g, '') | |
a = a.replace(/\u200B/g, '') | |
goog.dom.BrowserFeature.CAN_USE_INNER_TEXT || (a = a.replace(/ +/g, ' ')) | |
' ' != a && (a = a.replace(/^\s*/, '')) | |
return a | |
} | |
goog.dom.getRawTextContent = function (a) { | |
var b = [] | |
goog.dom.getTextContent_(a, b, !1) | |
return b.join('') | |
} | |
goog.dom.getTextContent_ = function (a, b, c) { | |
if (!(a.nodeName in goog.dom.TAGS_TO_IGNORE_)) { | |
if (a.nodeType == goog.dom.NodeType.TEXT) { | |
c | |
? b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g, '')) | |
: b.push(a.nodeValue) | |
} else { | |
if (a.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) { | |
b.push(goog.dom.PREDEFINED_TAG_VALUES_[a.nodeName]) | |
} else { | |
for (a = a.firstChild; a; ) { | |
goog.dom.getTextContent_(a, b, c), (a = a.nextSibling) | |
} | |
} | |
} | |
} | |
} | |
goog.dom.getNodeTextLength = function (a) { | |
return goog.dom.getTextContent(a).length | |
} | |
goog.dom.getNodeTextOffset = function (a, b) { | |
for ( | |
var c = b || goog.dom.getOwnerDocument(a).body, d = []; | |
a && a != c; | |
) { | |
for (var e = a; (e = e.previousSibling); ) { | |
d.unshift(goog.dom.getTextContent(e)) | |
} | |
a = a.parentNode | |
} | |
return goog.string.trimLeft(d.join('')).replace(/ +/g, ' ').length | |
} | |
goog.dom.getNodeAtOffset = function (a, b, c) { | |
a = [a] | |
for (var d = 0, e = null; 0 < a.length && d < b; ) { | |
if (((e = a.pop()), !(e.nodeName in goog.dom.TAGS_TO_IGNORE_))) { | |
if (e.nodeType == goog.dom.NodeType.TEXT) { | |
var f = e.nodeValue | |
.replace(/(\r\n|\r|\n)/g, '') | |
.replace(/ +/g, ' '), | |
d = d + f.length | |
} else { | |
if (e.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) { | |
d += goog.dom.PREDEFINED_TAG_VALUES_[e.nodeName].length | |
} else { | |
for (f = e.childNodes.length - 1; 0 <= f; f--) { | |
a.push(e.childNodes[f]) | |
} | |
} | |
} | |
} | |
} | |
goog.isObject(c) && | |
((c.remainder = e ? e.nodeValue.length + b - d - 1 : 0), (c.node = e)) | |
return e | |
} | |
goog.dom.isNodeList = function (a) { | |
if (a && 'number' == typeof a.length) { | |
if (goog.isObject(a)) { | |
return 'function' == typeof a.item || 'string' == typeof a.item | |
} | |
if (goog.isFunction(a)) { | |
return 'function' == typeof a.item | |
} | |
} | |
return !1 | |
} | |
goog.dom.getAncestorByTagNameAndClass = function (a, b, c, d) { | |
if (!b && !c) { | |
return null | |
} | |
var e = b ? String(b).toUpperCase() : null | |
return goog.dom.getAncestor( | |
a, | |
function (a) { | |
return ( | |
(!e || a.nodeName == e) && | |
(!c || | |
(goog.isString(a.className) && | |
goog.array.contains(a.className.split(/\s+/), c))) | |
) | |
}, | |
!0, | |
d | |
) | |
} | |
goog.dom.getAncestorByClass = function (a, b, c) { | |
return goog.dom.getAncestorByTagNameAndClass(a, null, b, c) | |
} | |
goog.dom.getAncestor = function (a, b, c, d) { | |
c || (a = a.parentNode) | |
for (c = 0; a && (null == d || c <= d); ) { | |
goog.asserts.assert('parentNode' != a.name) | |
if (b(a)) { | |
return a | |
} | |
a = a.parentNode | |
c++ | |
} | |
return null | |
} | |
goog.dom.getActiveElement = function (a) { | |
try { | |
return a && a.activeElement | |
} catch (b) {} | |
return null | |
} | |
goog.dom.getPixelRatio = function () { | |
var a = goog.dom.getWindow() | |
return goog.isDef(a.devicePixelRatio) | |
? a.devicePixelRatio | |
: a.matchMedia | |
? goog.dom.matchesPixelRatio_(3) || | |
goog.dom.matchesPixelRatio_(2) || | |
goog.dom.matchesPixelRatio_(1.5) || | |
goog.dom.matchesPixelRatio_(1) || | |
0.75 | |
: 1 | |
} | |
goog.dom.matchesPixelRatio_ = function (a) { | |
return goog.dom | |
.getWindow() | |
.matchMedia( | |
'(min-resolution: ' + | |
a + | |
'dppx),(min--moz-device-pixel-ratio: ' + | |
a + | |
'),(min-resolution: ' + | |
96 * a + | |
'dpi)' | |
).matches | |
? a | |
: 0 | |
} | |
goog.dom.getCanvasContext2D = function (a) { | |
return a.getContext('2d') | |
} | |
goog.dom.DomHelper = function (a) { | |
this.document_ = a || goog.global.document || document | |
} | |
goog.dom.DomHelper.prototype.getDomHelper = goog.dom.getDomHelper | |
goog.dom.DomHelper.prototype.setDocument = function (a) { | |
this.document_ = a | |
} | |
goog.dom.DomHelper.prototype.getDocument = function () { | |
return this.document_ | |
} | |
goog.dom.DomHelper.prototype.getElement = function (a) { | |
return goog.dom.getElementHelper_(this.document_, a) | |
} | |
goog.dom.DomHelper.prototype.getRequiredElement = function (a) { | |
return goog.dom.getRequiredElementHelper_(this.document_, a) | |
} | |
goog.dom.DomHelper.prototype.$ = goog.dom.DomHelper.prototype.getElement | |
goog.dom.DomHelper.prototype.getElementsByTagName = function (a, b) { | |
return (b || this.document_).getElementsByTagName(String(a)) | |
} | |
goog.dom.DomHelper.prototype.getElementsByTagNameAndClass = function ( | |
a, | |
b, | |
c | |
) { | |
return goog.dom.getElementsByTagNameAndClass_(this.document_, a, b, c) | |
} | |
goog.dom.DomHelper.prototype.getElementsByClass = function (a, b) { | |
return goog.dom.getElementsByClass(a, b || this.document_) | |
} | |
goog.dom.DomHelper.prototype.getElementByClass = function (a, b) { | |
return goog.dom.getElementByClass(a, b || this.document_) | |
} | |
goog.dom.DomHelper.prototype.getRequiredElementByClass = function (a, b) { | |
return goog.dom.getRequiredElementByClass(a, b || this.document_) | |
} | |
goog.dom.DomHelper.prototype.$$ = | |
goog.dom.DomHelper.prototype.getElementsByTagNameAndClass | |
goog.dom.DomHelper.prototype.setProperties = goog.dom.setProperties | |
goog.dom.DomHelper.prototype.getViewportSize = function (a) { | |
return goog.dom.getViewportSize(a || this.getWindow()) | |
} | |
goog.dom.DomHelper.prototype.getDocumentHeight = function () { | |
return goog.dom.getDocumentHeight_(this.getWindow()) | |
} | |
goog.dom.DomHelper.prototype.createDom = function (a, b, c) { | |
return goog.dom.createDom_(this.document_, arguments) | |
} | |
goog.dom.DomHelper.prototype.$dom = goog.dom.DomHelper.prototype.createDom | |
goog.dom.DomHelper.prototype.createElement = function (a) { | |
return goog.dom.createElement_(this.document_, a) | |
} | |
goog.dom.DomHelper.prototype.createTextNode = function (a) { | |
return this.document_.createTextNode(String(a)) | |
} | |
goog.dom.DomHelper.prototype.createTable = function (a, b, c) { | |
return goog.dom.createTable_(this.document_, a, b, !!c) | |
} | |
goog.dom.DomHelper.prototype.safeHtmlToNode = function (a) { | |
return goog.dom.safeHtmlToNode_(this.document_, a) | |
} | |
goog.dom.DomHelper.prototype.isCss1CompatMode = function () { | |
return goog.dom.isCss1CompatMode_(this.document_) | |
} | |
goog.dom.DomHelper.prototype.getWindow = function () { | |
return goog.dom.getWindow_(this.document_) | |
} | |
goog.dom.DomHelper.prototype.getDocumentScrollElement = function () { | |
return goog.dom.getDocumentScrollElement_(this.document_) | |
} | |
goog.dom.DomHelper.prototype.getDocumentScroll = function () { | |
return goog.dom.getDocumentScroll_(this.document_) | |
} | |
goog.dom.DomHelper.prototype.getActiveElement = function (a) { | |
return goog.dom.getActiveElement(a || this.document_) | |
} | |
goog.dom.DomHelper.prototype.appendChild = goog.dom.appendChild | |
goog.dom.DomHelper.prototype.append = goog.dom.append | |
goog.dom.DomHelper.prototype.canHaveChildren = goog.dom.canHaveChildren | |
goog.dom.DomHelper.prototype.removeChildren = goog.dom.removeChildren | |
goog.dom.DomHelper.prototype.insertSiblingBefore = | |
goog.dom.insertSiblingBefore | |
goog.dom.DomHelper.prototype.insertSiblingAfter = | |
goog.dom.insertSiblingAfter | |
goog.dom.DomHelper.prototype.insertChildAt = goog.dom.insertChildAt | |
goog.dom.DomHelper.prototype.removeNode = goog.dom.removeNode | |
goog.dom.DomHelper.prototype.replaceNode = goog.dom.replaceNode | |
goog.dom.DomHelper.prototype.flattenElement = goog.dom.flattenElement | |
goog.dom.DomHelper.prototype.getChildren = goog.dom.getChildren | |
goog.dom.DomHelper.prototype.getFirstElementChild = | |
goog.dom.getFirstElementChild | |
goog.dom.DomHelper.prototype.getLastElementChild = | |
goog.dom.getLastElementChild | |
goog.dom.DomHelper.prototype.getNextElementSibling = | |
goog.dom.getNextElementSibling | |
goog.dom.DomHelper.prototype.getPreviousElementSibling = | |
goog.dom.getPreviousElementSibling | |
goog.dom.DomHelper.prototype.getNextNode = goog.dom.getNextNode | |
goog.dom.DomHelper.prototype.getPreviousNode = goog.dom.getPreviousNode | |
goog.dom.DomHelper.prototype.isNodeLike = goog.dom.isNodeLike | |
goog.dom.DomHelper.prototype.isElement = goog.dom.isElement | |
goog.dom.DomHelper.prototype.isWindow = goog.dom.isWindow | |
goog.dom.DomHelper.prototype.getParentElement = goog.dom.getParentElement | |
goog.dom.DomHelper.prototype.contains = goog.dom.contains | |
goog.dom.DomHelper.prototype.compareNodeOrder = goog.dom.compareNodeOrder | |
goog.dom.DomHelper.prototype.findCommonAncestor = | |
goog.dom.findCommonAncestor | |
goog.dom.DomHelper.prototype.getOwnerDocument = goog.dom.getOwnerDocument | |
goog.dom.DomHelper.prototype.getFrameContentDocument = | |
goog.dom.getFrameContentDocument | |
goog.dom.DomHelper.prototype.getFrameContentWindow = | |
goog.dom.getFrameContentWindow | |
goog.dom.DomHelper.prototype.setTextContent = goog.dom.setTextContent | |
goog.dom.DomHelper.prototype.getOuterHtml = goog.dom.getOuterHtml | |
goog.dom.DomHelper.prototype.findNode = goog.dom.findNode | |
goog.dom.DomHelper.prototype.findNodes = goog.dom.findNodes | |
goog.dom.DomHelper.prototype.isFocusableTabIndex = | |
goog.dom.isFocusableTabIndex | |
goog.dom.DomHelper.prototype.setFocusableTabIndex = | |
goog.dom.setFocusableTabIndex | |
goog.dom.DomHelper.prototype.isFocusable = goog.dom.isFocusable | |
goog.dom.DomHelper.prototype.getTextContent = goog.dom.getTextContent | |
goog.dom.DomHelper.prototype.getNodeTextLength = goog.dom.getNodeTextLength | |
goog.dom.DomHelper.prototype.getNodeTextOffset = goog.dom.getNodeTextOffset | |
goog.dom.DomHelper.prototype.getNodeAtOffset = goog.dom.getNodeAtOffset | |
goog.dom.DomHelper.prototype.isNodeList = goog.dom.isNodeList | |
goog.dom.DomHelper.prototype.getAncestorByTagNameAndClass = | |
goog.dom.getAncestorByTagNameAndClass | |
goog.dom.DomHelper.prototype.getAncestorByClass = | |
goog.dom.getAncestorByClass | |
goog.dom.DomHelper.prototype.getAncestor = goog.dom.getAncestor | |
goog.dom.DomHelper.prototype.getCanvasContext2D = | |
goog.dom.getCanvasContext2D | |
var pagespeedutils = { | |
MAX_POST_SIZE: 131072, | |
sendBeacon: function (a, b, c) { | |
var d | |
if (window.XMLHttpRequest) { | |
d = new XMLHttpRequest() | |
} else { | |
if (window.ActiveXObject) { | |
try { | |
d = new ActiveXObject('Msxml2.XMLHTTP') | |
} catch (f) { | |
try { | |
d = new ActiveXObject('Microsoft.XMLHTTP') | |
} catch (g) {} | |
} | |
} | |
} | |
if (!d) { | |
return !1 | |
} | |
var e = -1 == a.indexOf('?') ? '?' : '&' | |
a = a + e + 'url=' + encodeURIComponent(b) | |
d.open('POST', a) | |
d.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') | |
d.send(c) | |
return !0 | |
}, | |
addHandler: function (a, b, c) { | |
if (a.addEventListener) { | |
a.addEventListener(b, c, !1) | |
} else { | |
if (a.attachEvent) { | |
a.attachEvent('on' + b, c) | |
} else { | |
var d = a['on' + b] | |
a['on' + b] = function () { | |
c.call(this) | |
d && d.call(this) | |
} | |
} | |
} | |
}, | |
getPosition: function (a) { | |
for (var b = a.offsetTop, c = a.offsetLeft; a.offsetParent; ) { | |
;(a = a.offsetParent), (b += a.offsetTop), (c += a.offsetLeft) | |
} | |
return { top: b, left: c } | |
}, | |
getWindowSize: function () { | |
return { | |
height: | |
window.innerHeight || | |
document.documentElement.clientHeight || | |
document.body.clientHeight, | |
width: | |
window.innerWidth || | |
document.documentElement.clientWidth || | |
document.body.clientWidth, | |
} | |
}, | |
inViewport: function (a, b) { | |
var c = pagespeedutils.getPosition(a) | |
return pagespeedutils.positionInViewport(c, b) | |
}, | |
positionInViewport: function (a, b) { | |
return a.top < b.height && a.left < b.width | |
}, | |
getRequestAnimationFrame: function () { | |
return ( | |
window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
null | |
) | |
}, | |
} | |
pagespeedutils.now = | |
Date.now || | |
function () { | |
return +new Date() | |
} | |
var pagespeed = { CriticalImages: {} } | |
pagespeed.CriticalImages.Beacon_ = function (a, b, c, d, e) { | |
this.beaconUrl_ = a | |
this.htmlUrl_ = b | |
this.optionsHash_ = c | |
this.nonce_ = e | |
this.windowSize_ = pagespeedutils.getWindowSize() | |
this.checkRenderedImageSizes_ = d | |
this.imgLocations_ = {} | |
this.criticalImages_ = [] | |
this.criticalImagesKeys_ = {} | |
} | |
pagespeed.CriticalImages.Beacon_.prototype.elLocation_ = function (a) { | |
a = a.getBoundingClientRect() | |
var b = document.body | |
return { | |
top: | |
a.top + | |
('pageYOffset' in window | |
? window.pageYOffset | |
: (document.documentElement || b.parentNode || b).scrollTop), | |
left: | |
a.left + | |
('pageXOffset' in window | |
? window.pageXOffset | |
: (document.documentElement || b.parentNode || b).scrollLeft), | |
} | |
} | |
pagespeed.CriticalImages.Beacon_.prototype.isCritical_ = function (a) { | |
if (0 >= a.offsetWidth && 0 >= a.offsetHeight) { | |
return !1 | |
} | |
a = this.elLocation_(a) | |
var b = a.top.toString() + ',' + a.left | |
if (this.imgLocations_.hasOwnProperty(b)) { | |
return !1 | |
} | |
this.imgLocations_[b] = !0 | |
return ( | |
a.top <= this.windowSize_.height && a.left <= this.windowSize_.width | |
) | |
} | |
pagespeed.CriticalImages.Beacon_.prototype.insertIfImageIsCritical_ = function ( | |
a | |
) { | |
var b = a.getAttribute('data-pagespeed-url-hash') | |
!b || | |
b in this.criticalImagesKeys_ || | |
!this.isCritical_(a) || | |
(this.criticalImages_.push(b), (this.criticalImagesKeys_[b] = !0)) | |
} | |
pagespeed.CriticalImages.Beacon_.prototype.checkImageForCriticality = function ( | |
a | |
) { | |
a.getBoundingClientRect && this.insertIfImageIsCritical_(a) | |
} | |
pagespeed.CriticalImages.checkImageForCriticality = function (a) { | |
pagespeed.CriticalImages.beaconObj_.checkImageForCriticality(a) | |
} | |
goog.exportSymbol( | |
'pagespeed.CriticalImages.checkImageForCriticality', | |
pagespeed.CriticalImages.checkImageForCriticality | |
) | |
pagespeed.CriticalImages.checkCriticalImages = function () { | |
pagespeed.CriticalImages.beaconObj_.checkCriticalImages_() | |
} | |
goog.exportSymbol( | |
'pagespeed.CriticalImages.checkCriticalImages', | |
pagespeed.CriticalImages.checkCriticalImages | |
) | |
pagespeed.CriticalImages.Beacon_.prototype.checkCriticalImages_ = function () { | |
this.imgLocations_ = {} | |
for (var a = ['IMG', 'INPUT'], b = [], c = 0; c < a.length; ++c) { | |
b = b.concat(goog.array.toArray(document.getElementsByTagName(a[c]))) | |
} | |
if (0 != b.length && b[0].getBoundingClientRect) { | |
for (c = 0; (a = b[c]); ++c) { | |
this.insertIfImageIsCritical_(a) | |
} | |
b = 'oh=' + this.optionsHash_ | |
this.nonce_ && (b += '&n=' + this.nonce_) | |
if ((a = 0 != this.criticalImages_.length)) { | |
for ( | |
b += '&ci=' + encodeURIComponent(this.criticalImages_[0]), c = 1; | |
c < this.criticalImages_.length; | |
++c | |
) { | |
var d = ',' + encodeURIComponent(this.criticalImages_[c]) | |
b.length + d.length <= pagespeedutils.MAX_POST_SIZE && (b += d) | |
} | |
} | |
this.checkRenderedImageSizes_ && | |
((d = | |
'&rd=' + | |
encodeURIComponent(JSON.stringify(this.getImageRenderedMap()))), | |
b.length + d.length <= pagespeedutils.MAX_POST_SIZE && (b += d), | |
(a = !0)) | |
pagespeed.CriticalImages.beaconData_ = b | |
a && pagespeedutils.sendBeacon(this.beaconUrl_, this.htmlUrl_, b) | |
} | |
} | |
pagespeed.CriticalImages.Beacon_.prototype.getImageRenderedMap = function () { | |
var a = {}, | |
b = goog.dom.getElementsByTagName('IMG') | |
if (0 == b.length) { | |
return {} | |
} | |
var c = b[0] | |
if (!('naturalWidth' in c && 'naturalHeight' in c)) { | |
return {} | |
} | |
for (var d = 0; (c = b[d]); ++d) { | |
var e = c.getAttribute('data-pagespeed-url-hash') | |
e && | |
((!(e in a) && | |
0 < c.width && | |
0 < c.height && | |
0 < c.naturalWidth && | |
0 < c.naturalHeight) || | |
(e in a && c.width >= a[e].rw && c.height >= a[e].rh)) && | |
(a[e] = { | |
rw: c.width, | |
rh: c.height, | |
ow: c.naturalWidth, | |
oh: c.naturalHeight, | |
}) | |
} | |
return a | |
} | |
pagespeed.CriticalImages.beaconData_ = '' | |
pagespeed.CriticalImages.getBeaconData = function () { | |
return pagespeed.CriticalImages.beaconData_ | |
} | |
goog.exportSymbol( | |
'pagespeed.CriticalImages.getBeaconData', | |
pagespeed.CriticalImages.getBeaconData | |
) | |
pagespeed.CriticalImages.Run = function (a, b, c, d, e, f) { | |
var g = new pagespeed.CriticalImages.Beacon_(a, b, c, e, f) | |
pagespeed.CriticalImages.beaconObj_ = g | |
d && | |
pagespeedutils.addHandler(window, 'load', function () { | |
window.setTimeout(function () { | |
g.checkCriticalImages_() | |
}, 0) | |
}) | |
} | |
goog.exportSymbol( | |
'pagespeed.CriticalImages.Run', | |
pagespeed.CriticalImages.Run | |
) | |
})() | |
pagespeed.CriticalImages.Run( | |
'/ngx_pagespeed_beacon', | |
'http://ladesignconcepts.com/', | |
'9nHg8PY_8X', | |
true, | |
false, | |
'CgxJf5Np6NQ' | |
) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment