selenium-webdriver 2.47.1 → 2.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. data/CHANGES +18 -0
  2. data/Gemfile.lock +1 -1
  3. data/lib/selenium/client/base.rb +3 -3
  4. data/lib/selenium/client/extensions.rb +15 -18
  5. data/lib/selenium/client/idiomatic.rb +26 -26
  6. data/lib/selenium/client/javascript_expression_builder.rb +8 -8
  7. data/lib/selenium/webdriver/common.rb +1 -1
  8. data/lib/selenium/webdriver/common/driver.rb +5 -1
  9. data/lib/selenium/webdriver/common/error.rb +5 -8
  10. data/lib/selenium/webdriver/common/search_context.rb +6 -0
  11. data/lib/selenium/webdriver/common/target_locator.rb +4 -0
  12. data/lib/selenium/webdriver/common/w3c_error.rb +194 -0
  13. data/lib/selenium/webdriver/firefox.rb +3 -0
  14. data/lib/selenium/webdriver/firefox/binary.rb +13 -0
  15. data/lib/selenium/webdriver/firefox/extension/prefs.json +2 -1
  16. data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
  17. data/lib/selenium/webdriver/firefox/service.rb +120 -0
  18. data/lib/selenium/webdriver/firefox/w3c_bridge.rb +97 -0
  19. data/lib/selenium/webdriver/remote.rb +3 -0
  20. data/lib/selenium/webdriver/remote/bridge.rb +17 -10
  21. data/lib/selenium/webdriver/remote/capabilities.rb +1 -2
  22. data/lib/selenium/webdriver/remote/commands.rb +5 -0
  23. data/lib/selenium/webdriver/remote/response.rb +5 -6
  24. data/lib/selenium/webdriver/remote/w3c_bridge.rb +676 -0
  25. data/lib/selenium/webdriver/remote/w3c_capabilities.rb +208 -0
  26. data/lib/selenium/webdriver/remote/w3c_commands.rb +133 -0
  27. data/lib/selenium/webdriver/safari/resources/client.js +653 -629
  28. data/selenium-webdriver.gemspec +1 -1
  29. metadata +8 -4
  30. data/lib/selenium/webdriver/common/core_ext/string.rb +0 -24
  31. data/lib/selenium/webdriver/safari/resources/SafariDriver.safariextz +0 -0
@@ -0,0 +1,208 @@
1
+ # encoding: utf-8
2
+ #
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ module Selenium
21
+ module WebDriver
22
+ module Remote
23
+ #
24
+ # Specification of the desired and/or actual capabilities of the browser that the
25
+ # server is being asked to create.
26
+ #
27
+ class W3CCapabilities
28
+
29
+ DEFAULTS = {
30
+ :browser_name => '',
31
+ :browser_version => '',
32
+ :platform_name => :any,
33
+ :platform_version => false,
34
+ :accept_ssl_certs => false,
35
+ :takes_screenshot => false,
36
+ :takes_element_screenshot => false,
37
+ :page_load_strategy => false,
38
+ :proxy => nil
39
+ }
40
+
41
+ DEFAULTS.each_key do |key|
42
+ define_method key do
43
+ @capabilities.fetch(key)
44
+ end
45
+
46
+ define_method "#{key}=" do |value|
47
+ @capabilities[key] = value
48
+ end
49
+ end
50
+
51
+ alias_method :version, :browser_version
52
+
53
+ #
54
+ # Convenience methods for the common choices.
55
+ #
56
+
57
+ class << self
58
+
59
+ def edge(opts = {})
60
+ new({
61
+ :browser_name => "MicrosoftEdge",
62
+ :platform => :windows,
63
+ }.merge(opts))
64
+ end
65
+
66
+ def firefox(opts = {})
67
+ new({
68
+ :browser_name => "firefox"
69
+ }.merge(opts))
70
+ end
71
+
72
+ alias_method :ff, :firefox
73
+
74
+ def w3c?(opts = {})
75
+ return false unless opts[:desired_capabilities].is_a?(W3CCapabilities) || opts.delete(:wires)
76
+ Firefox::Binary.path = ENV['MARIONETTE_PATH'] if ENV['MARIONETTE_PATH']
77
+ firefox_version = Firefox::Binary.version
78
+ raise ArgumentError, "Firefox Version #{firefox_version} does not support W3CCapabilities" if firefox_version < 43
79
+ true
80
+ end
81
+
82
+ #
83
+ # @api private
84
+ #
85
+
86
+ def json_create(data)
87
+ data = data.dup
88
+
89
+ caps = new
90
+ caps.browser_name = data.delete("browserName")
91
+ caps.browser_version = data.delete("browserVersion")
92
+ caps.platform_name = data.delete("platformName").downcase.to_sym if data.has_key?('platform')
93
+ caps.platform_version = data.delete("platformVersion")
94
+ caps.accept_ssl_certs = data.delete("acceptSslCerts")
95
+ caps.takes_screenshot = data.delete("takesScreenshot ")
96
+ caps.takes_element_screenshot = data.delete("takesElementScreenshot")
97
+ caps.page_load_strategy = data.delete("pageLoadStrategy")
98
+ caps.proxy = Proxy.json_create(data['proxy']) if data.has_key?('proxy')
99
+
100
+ # any remaining pairs will be added as is, with no conversion
101
+ caps.merge!(data)
102
+
103
+ caps
104
+ end
105
+ end
106
+
107
+ # @param [Hash] opts
108
+ # @option :browser_name [String] required browser name
109
+ # @option :browser_version [String] required browser version number
110
+ # @option :platform_name [Symbol] one of :any, :win, :mac, or :x
111
+ # @option :platform_version [String] required platform version number
112
+ # @option :accept_ssl_certs [Boolean] does the driver accept SSL Cerfifications?
113
+ # @option :takes_screenshot [Boolean] can this driver take screenshots?
114
+ # @option :takes_element_screenshot [Boolean] can this driver take element screenshots?
115
+ # @option :proxy [Selenium::WebDriver::Proxy, Hash] proxy configuration
116
+ #
117
+ # @api public
118
+ #
119
+
120
+ def initialize(opts = {})
121
+ @capabilities = DEFAULTS.merge(opts)
122
+ self.proxy = opts.delete(:proxy)
123
+ end
124
+
125
+ #
126
+ # Allows setting arbitrary capabilities.
127
+ #
128
+
129
+ def []=(key, value)
130
+ @capabilities[key] = value
131
+ end
132
+
133
+ def [](key)
134
+ @capabilities[key]
135
+ end
136
+
137
+ def merge!(other)
138
+ if other.respond_to?(:capabilities, true) && other.capabilities.kind_of?(Hash)
139
+ @capabilities.merge! other.capabilities
140
+ elsif other.kind_of? Hash
141
+ @capabilities.merge! other
142
+ else
143
+ raise ArgumentError, "argument should be a Hash or implement #capabilities"
144
+ end
145
+ end
146
+
147
+ def proxy=(proxy)
148
+ case proxy
149
+ when Hash
150
+ @capabilities[:proxy] = Proxy.new(proxy)
151
+ when Proxy, nil
152
+ @capabilities[:proxy] = proxy
153
+ else
154
+ raise TypeError, "expected Hash or #{Proxy.name}, got #{proxy.inspect}:#{proxy.class}"
155
+ end
156
+ end
157
+
158
+ # @api private
159
+ #
160
+
161
+ def as_json(opts = nil)
162
+ hash = {}
163
+
164
+ @capabilities.each do |key, value|
165
+ case key
166
+ when :platform
167
+ hash['platform'] = value.to_s.upcase
168
+ when :proxy
169
+ hash['proxy'] = value.as_json if value
170
+ when String, :firefox_binary
171
+ hash[key.to_s] = value
172
+ when Symbol
173
+ hash[camel_case(key.to_s)] = value
174
+ else
175
+ raise TypeError, "expected String or Symbol, got #{key.inspect}:#{key.class} / #{value.inspect}"
176
+ end
177
+ end
178
+
179
+ hash
180
+ end
181
+
182
+ def to_json(*args)
183
+ WebDriver.json_dump as_json
184
+ end
185
+
186
+ def ==(other)
187
+ return false unless other.kind_of? self.class
188
+ as_json == other.as_json
189
+ end
190
+
191
+ alias_method :eql?, :==
192
+
193
+ protected
194
+
195
+ def capabilities
196
+ @capabilities
197
+ end
198
+
199
+ private
200
+
201
+ def camel_case(str)
202
+ str.gsub(/_([a-z])/) { $1.upcase }
203
+ end
204
+
205
+ end # W3CCapabilities
206
+ end # Remote
207
+ end # WebDriver
208
+ end # Selenium
@@ -0,0 +1,133 @@
1
+ # encoding: utf-8
2
+ #
3
+ # Licensed to the Software Freedom Conservancy (SFC) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The SFC licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ class Selenium::WebDriver::Remote::W3CBridge
21
+
22
+ #
23
+ # http://www.w3.org/TR/2015/WD-webdriver-20150918/#list-of-endpoints
24
+ #
25
+
26
+ #
27
+ # session handling
28
+ #
29
+
30
+ command :newSession, :post, "session"
31
+ command :deleteSession, :delete, "session/:session_id"
32
+
33
+
34
+ #
35
+ # basic driver
36
+ #
37
+
38
+ command :get, :post, "session/:session_id/url"
39
+ command :getCurrentUrl, :get, "session/:session_id/url"
40
+ command :back, :post, "session/:session_id/back"
41
+ command :forward, :post, "session/:session_id/forward"
42
+ command :refresh, :post, "session/:session_id/refresh"
43
+ command :getTitle, :get, "session/:session_id/title"
44
+
45
+ #
46
+ # window and Frame handling
47
+ #
48
+
49
+ command :getWindowHandle, :get, "session/:session_id/window"
50
+ command :closeWindow, :delete, "session/:session_id/window"
51
+ command :switchToWindow, :post, "session/:session_id/window"
52
+ command :getWindowHandles, :get, "session/:session_id/window/handles"
53
+ command :fullscreenWindow, :post, "session/:session_id/window/window/fullscreen"
54
+ command :maximizeWindow, :post, "session/:session_id/window/maximize"
55
+ command :setWindowSize, :post, "session/:session_id/window/size"
56
+ command :getWindowSize, :get, "session/:session_id/window/size"
57
+ command :switchToFrame, :post, "session/:session_id/frame"
58
+ command :switchToParentFrame, :post, "session/:session_id/frame/parent"
59
+
60
+ #
61
+ # element
62
+ #
63
+
64
+ command :findElement, :post, "session/:session_id/element"
65
+ command :findElements, :post, "session/:session_id/elements"
66
+ command :findChildElement, :post, "session/:session_id/element/:id/element"
67
+ command :findChildElements, :post, "session/:session_id/element/:id/elements"
68
+ command :getActiveElement, :post, "session/:session_id/element/active"
69
+ command :isElementDisplayed, :get, "session/:session_id/element/:id/displayed"
70
+ command :isElementSelected, :get, "session/:session_id/element/:id/selected"
71
+ command :getElementAttribute, :get, "session/:session_id/element/:id/attribute/:name"
72
+ command :getElementProperty, :get, "session/:session_id/element/:id/property/:name"
73
+ command :getElementCssValue, :get, "session/:session_id/element/:id/css/:property_name"
74
+ command :getElementText, :get, "session/:session_id/element/:id/text"
75
+ command :getElementTagName, :get, "session/:session_id/element/:id/name"
76
+ command :getElementRect, :get, "session/:session_id/element/:id/rect"
77
+ command :isElementEnabled, :get, "session/:session_id/element/:id/enabled"
78
+
79
+ #
80
+ # script execution
81
+ #
82
+
83
+ command :executeScript, :post, "session/:session_id/execute/sync"
84
+ command :executeAsyncScript, :post, "session/:session_id/execute/async"
85
+
86
+ #
87
+ # cookies
88
+ #
89
+
90
+ command :getAllCookies, :get, "session/:session_id/cookie"
91
+ command :getCookie, :get, "session/:session_id/cookie/:name"
92
+ command :addCookie, :post, "session/:session_id/cookie"
93
+ command :deleteCookie, :delete, "session/:session_id/cookie/:name"
94
+
95
+ #
96
+ # timeouts
97
+ #
98
+
99
+ command :setTimeout, :post, "session/:session_id/timeouts"
100
+
101
+ #
102
+ # actions
103
+ #
104
+
105
+ command :actions, :post, "session/:session_id/actions"
106
+
107
+
108
+ #
109
+ # Element Operations
110
+ #
111
+
112
+ command :elementClick, :post, "session/:session_id/element/:id/click"
113
+ command :elementTap, :post, "session/:session_id/element/:id/tap"
114
+ command :elementClear, :post, "session/:session_id/element/:id/clear"
115
+ command :elementSendKeys, :post, "session/:session_id/element/:id/value"
116
+
117
+ #
118
+ # alerts
119
+ #
120
+
121
+ command :dismissAlert, :post, "session/:session_id/alert/dismiss"
122
+ command :acceptAlert, :post, "session/:session_id/alert/accept"
123
+ command :getAlertText, :get, "session/:session_id/alert/text"
124
+ command :sendAlertText, :post, "session/:session_id/alert/text"
125
+
126
+ #
127
+ # screenshot
128
+ #
129
+
130
+ command :takeScreenshot, :get, "session/:session_id/screenshot"
131
+ command :takeElementScreenshot, :get, "session/:session_id/element/:id/screenshot"
132
+
133
+ end
@@ -68,12 +68,6 @@ goog.moduleLoaderState_ = null;
68
68
  goog.isInModuleLoader_ = function() {
69
69
  return null != goog.moduleLoaderState_;
70
70
  };
71
- goog.module.declareTestMethods = function() {
72
- if (!goog.isInModuleLoader_()) {
73
- throw Error("goog.module.declareTestMethods must be called from within a goog.module");
74
- }
75
- goog.moduleLoaderState_.declareTestMethods = !0;
76
- };
77
71
  goog.module.declareLegacyNamespace = function() {
78
72
  if (!COMPILED && !goog.isInModuleLoader_()) {
79
73
  throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");
@@ -134,7 +128,7 @@ goog.require = function(a) {
134
128
  if (goog.ENABLE_DEBUG_LOADER) {
135
129
  var b = goog.getPathFromDeps_(a);
136
130
  if (b) {
137
- return goog.included_[b] = !0, goog.writeScripts_(), null;
131
+ return goog.writeScripts_(b), null;
138
132
  }
139
133
  }
140
134
  a = "goog.require could not find: " + a;
@@ -162,11 +156,11 @@ goog.LOAD_MODULE_USING_EVAL = !0;
162
156
  goog.SEAL_MODULE_EXPORTS = goog.DEBUG;
163
157
  goog.loadedModules_ = {};
164
158
  goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;
165
- goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathIsModule:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = function() {
159
+ goog.DEPENDENCIES_ENABLED && (goog.dependencies_ = {pathIsModule:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = function() {
166
160
  var a = goog.global.document;
167
161
  return "undefined" != typeof a && "write" in a;
168
162
  }, goog.findBasePath_ = function() {
169
- if (goog.global.CLOSURE_BASE_PATH) {
163
+ if (goog.isDef(goog.global.CLOSURE_BASE_PATH)) {
170
164
  goog.basePath = goog.global.CLOSURE_BASE_PATH;
171
165
  } else {
172
166
  if (goog.inHtmlDocument_()) {
@@ -181,7 +175,7 @@ goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathIsM
181
175
  }
182
176
  }, goog.importScript_ = function(a, b) {
183
177
  (goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_)(a, b) && (goog.dependencies_.written[a] = !0);
184
- }, goog.IS_OLD_IE_ = !goog.global.atob && goog.global.document && goog.global.document.all, goog.importModule_ = function(a) {
178
+ }, goog.IS_OLD_IE_ = !(goog.global.atob || !goog.global.document || !goog.global.document.all), goog.importModule_ = function(a) {
185
179
  goog.importScript_("", 'goog.retrieveAndExecModule_("' + a + '");') && (goog.dependencies_.written[a] = !0);
186
180
  }, goog.queuedModules_ = [], goog.wrapModule_ = function(a, b) {
187
181
  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";
@@ -216,7 +210,7 @@ goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathIsM
216
210
  }, goog.loadModule = function(a) {
217
211
  var b = goog.moduleLoaderState_;
218
212
  try {
219
- goog.moduleLoaderState_ = {moduleName:void 0, declareTestMethods:!1};
213
+ goog.moduleLoaderState_ = {moduleName:void 0};
220
214
  var c;
221
215
  if (goog.isFunction(a)) {
222
216
  c = a.call(goog.global, {});
@@ -233,13 +227,6 @@ goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathIsM
233
227
  }
234
228
  goog.moduleLoaderState_.declareLegacyNamespace ? goog.constructNamespace_(d, c) : goog.SEAL_MODULE_EXPORTS && Object.seal && Object.seal(c);
235
229
  goog.loadedModules_[d] = c;
236
- if (goog.moduleLoaderState_.declareTestMethods) {
237
- for (var e in c) {
238
- if (0 === e.indexOf("test", 0) || "tearDown" == e || "setUp" == e || "setUpPage" == e || "tearDownPage" == e) {
239
- goog.global[e] = c[e];
240
- }
241
- }
242
- }
243
230
  } finally {
244
231
  goog.moduleLoaderState_ = b;
245
232
  }
@@ -272,35 +259,35 @@ goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathIsM
272
259
  }, goog.lastNonModuleScriptIndex_ = 0, goog.onScriptLoad_ = function(a, b) {
273
260
  "complete" == a.readyState && goog.lastNonModuleScriptIndex_ == b && goog.loadQueuedModules_();
274
261
  return !0;
275
- }, goog.writeScripts_ = function() {
276
- function a(e) {
277
- if (!(e in d.written)) {
278
- if (!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) {
279
- for (var f in d.requires[e]) {
262
+ }, goog.writeScripts_ = function(a) {
263
+ function b(a) {
264
+ if (!(a in e.written || a in e.visited)) {
265
+ e.visited[a] = !0;
266
+ if (a in e.requires) {
267
+ for (var f in e.requires[a]) {
280
268
  if (!goog.isProvided_(f)) {
281
- if (f in d.nameToPath) {
282
- a(d.nameToPath[f]);
269
+ if (f in e.nameToPath) {
270
+ b(e.nameToPath[f]);
283
271
  } else {
284
272
  throw Error("Undefined nameToPath for " + f);
285
273
  }
286
274
  }
287
275
  }
288
276
  }
289
- e in c || (c[e] = !0, b.push(e));
277
+ a in d || (d[a] = !0, c.push(a));
290
278
  }
291
279
  }
292
- var b = [], c = {}, d = goog.dependencies_, e;
293
- for (e in goog.included_) {
294
- d.written[e] || a(e);
295
- }
296
- for (var f = 0;f < b.length;f++) {
297
- e = b[f], goog.dependencies_.written[e] = !0;
280
+ var c = [], d = {}, e = goog.dependencies_;
281
+ b(a);
282
+ for (a = 0;a < c.length;a++) {
283
+ var f = c[a];
284
+ goog.dependencies_.written[f] = !0;
298
285
  }
299
286
  var g = goog.moduleLoaderState_;
300
287
  goog.moduleLoaderState_ = null;
301
- for (f = 0;f < b.length;f++) {
302
- if (e = b[f]) {
303
- d.pathIsModule[e] ? goog.importModule_(goog.basePath + e) : goog.importScript_(goog.basePath + e);
288
+ for (a = 0;a < c.length;a++) {
289
+ if (f = c[a]) {
290
+ e.pathIsModule[f] ? goog.importModule_(goog.basePath + f) : goog.importScript_(goog.basePath + f);
304
291
  } else {
305
292
  throw goog.moduleLoaderState_ = g, Error("Undefined script input");
306
293
  }
@@ -474,15 +461,26 @@ goog.globalEval = function(a) {
474
461
  goog.global.execScript(a, "JavaScript");
475
462
  } else {
476
463
  if (goog.global.eval) {
477
- if (null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) {
464
+ if (null == goog.evalWorksForGlobals_) {
465
+ if (goog.global.eval("var _evalTest_ = 1;"), "undefined" != typeof goog.global._evalTest_) {
466
+ try {
467
+ delete goog.global._evalTest_;
468
+ } catch (b) {
469
+ }
470
+ goog.evalWorksForGlobals_ = !0;
471
+ } else {
472
+ goog.evalWorksForGlobals_ = !1;
473
+ }
474
+ }
475
+ if (goog.evalWorksForGlobals_) {
478
476
  goog.global.eval(a);
479
477
  } else {
480
- var b = goog.global.document, c = b.createElement("SCRIPT");
481
- c.type = "text/javascript";
482
- c.defer = !1;
483
- c.appendChild(b.createTextNode(a));
484
- b.body.appendChild(c);
485
- b.body.removeChild(c);
478
+ var c = goog.global.document, d = c.createElement("SCRIPT");
479
+ d.type = "text/javascript";
480
+ d.defer = !1;
481
+ d.appendChild(c.createTextNode(a));
482
+ c.body.appendChild(d);
483
+ c.body.removeChild(d);
486
484
  }
487
485
  } else {
488
486
  throw Error("goog.globalEval not available");
@@ -914,7 +912,9 @@ goog.string.removeAll = function(a, b) {
914
912
  goog.string.regExpEscape = function(a) {
915
913
  return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08");
916
914
  };
917
- goog.string.repeat = function(a, b) {
915
+ goog.string.repeat = String.prototype.repeat ? function(a, b) {
916
+ return a.repeat(b);
917
+ } : function(a, b) {
918
918
  return Array(b + 1).join(a);
919
919
  };
920
920
  goog.string.padNumber = function(a, b, c) {
@@ -948,10 +948,9 @@ goog.string.compareVersions = function(a, b) {
948
948
  goog.string.compareElements_ = function(a, b) {
949
949
  return a < b ? -1 : a > b ? 1 : 0;
950
950
  };
951
- goog.string.HASHCODE_MAX_ = 4294967296;
952
951
  goog.string.hashCode = function(a) {
953
952
  for (var b = 0, c = 0;c < a.length;++c) {
954
- b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_;
953
+ b = 31 * b + a.charCodeAt(c) >>> 0;
955
954
  }
956
955
  return b;
957
956
  };
@@ -1331,7 +1330,7 @@ goog.array.slice = function(a, b, c) {
1331
1330
  goog.array.removeDuplicates = function(a, b, c) {
1332
1331
  b = b || a;
1333
1332
  var d = function(a) {
1334
- return goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g;
1333
+ return goog.isObject(a) ? "o" + goog.getUid(a) : (typeof a).charAt(0) + a;
1335
1334
  };
1336
1335
  c = c || d;
1337
1336
  for (var d = {}, e = 0, f = 0;f < a.length;) {
@@ -1680,7 +1679,7 @@ goog.object.clone = function(a) {
1680
1679
  goog.object.unsafeClone = function(a) {
1681
1680
  var b = goog.typeOf(a);
1682
1681
  if ("object" == b || "array" == b) {
1683
- if (a.clone) {
1682
+ if (goog.isFunction(a.clone)) {
1684
1683
  return a.clone();
1685
1684
  }
1686
1685
  var b = "array" == b ? [] : {}, c;
@@ -1973,6 +1972,34 @@ goog.functions.cacheReturnValue = function(a) {
1973
1972
  return c;
1974
1973
  };
1975
1974
  };
1975
+ goog.functions.once = function(a) {
1976
+ var b = a;
1977
+ return function() {
1978
+ if (b) {
1979
+ var a = b;
1980
+ b = null;
1981
+ a();
1982
+ }
1983
+ };
1984
+ };
1985
+ goog.functions.debounce = function(a, b, c) {
1986
+ c && (a = goog.bind(a, c));
1987
+ var d = null;
1988
+ return function() {
1989
+ goog.global.clearTimeout(d);
1990
+ d = goog.global.setTimeout(a, b);
1991
+ };
1992
+ };
1993
+ goog.functions.throttle = function(a, b, c) {
1994
+ c && (a = goog.bind(a, c));
1995
+ var d = null, e = !1, f = function() {
1996
+ d = null;
1997
+ e && (e = !1, d = goog.global.setTimeout(f, b), a());
1998
+ };
1999
+ return function() {
2000
+ d ? e = !0 : (d = goog.global.setTimeout(f, b), a());
2001
+ };
2002
+ };
1976
2003
  goog.math = {};
1977
2004
  goog.math.randomInt = function(a) {
1978
2005
  return Math.floor(Math.random() * a);
@@ -2139,9 +2166,9 @@ goog.iter.forEach = function(a, b, c) {
2139
2166
  for (;;) {
2140
2167
  b.call(c, a.next(), void 0, a);
2141
2168
  }
2142
- } catch (e) {
2143
- if (e !== goog.iter.StopIteration) {
2144
- throw e;
2169
+ } catch (d) {
2170
+ if (d !== goog.iter.StopIteration) {
2171
+ throw d;
2145
2172
  }
2146
2173
  }
2147
2174
  }
@@ -2692,448 +2719,137 @@ goog.structs.Map.prototype.__iterator__ = function(a) {
2692
2719
  goog.structs.Map.hasKey_ = function(a, b) {
2693
2720
  return Object.prototype.hasOwnProperty.call(a, b);
2694
2721
  };
2695
- goog.labs = {};
2696
- goog.labs.userAgent = {};
2697
- goog.labs.userAgent.util = {};
2698
- goog.labs.userAgent.util.getNativeUserAgentString_ = function() {
2699
- var a = goog.labs.userAgent.util.getNavigator_();
2700
- return a && (a = a.userAgent) ? a : "";
2701
- };
2702
- goog.labs.userAgent.util.getNavigator_ = function() {
2703
- return goog.global.navigator;
2704
- };
2705
- goog.labs.userAgent.util.userAgent_ = goog.labs.userAgent.util.getNativeUserAgentString_();
2706
- goog.labs.userAgent.util.setUserAgent = function(a) {
2707
- goog.labs.userAgent.util.userAgent_ = a || goog.labs.userAgent.util.getNativeUserAgentString_();
2722
+ goog.uri = {};
2723
+ goog.uri.utils = {};
2724
+ goog.uri.utils.CharCode_ = {AMPERSAND:38, EQUAL:61, HASH:35, QUESTION:63};
2725
+ goog.uri.utils.buildFromEncodedParts = function(a, b, c, d, e, f, g) {
2726
+ var h = "";
2727
+ a && (h += a + ":");
2728
+ c && (h += "//", b && (h += b + "@"), h += c, d && (h += ":" + d));
2729
+ e && (h += e);
2730
+ f && (h += "?" + f);
2731
+ g && (h += "#" + g);
2732
+ return h;
2708
2733
  };
2709
- goog.labs.userAgent.util.getUserAgent = function() {
2710
- return goog.labs.userAgent.util.userAgent_;
2734
+ goog.uri.utils.splitRe_ = /^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;
2735
+ goog.uri.utils.ComponentIndex = {SCHEME:1, USER_INFO:2, DOMAIN:3, PORT:4, PATH:5, QUERY_DATA:6, FRAGMENT:7};
2736
+ goog.uri.utils.split = function(a) {
2737
+ return a.match(goog.uri.utils.splitRe_);
2711
2738
  };
2712
- goog.labs.userAgent.util.matchUserAgent = function(a) {
2713
- var b = goog.labs.userAgent.util.getUserAgent();
2714
- return goog.string.contains(b, a);
2739
+ goog.uri.utils.decodeIfPossible_ = function(a, b) {
2740
+ return a ? b ? decodeURI(a) : decodeURIComponent(a) : a;
2715
2741
  };
2716
- goog.labs.userAgent.util.matchUserAgentIgnoreCase = function(a) {
2717
- var b = goog.labs.userAgent.util.getUserAgent();
2718
- return goog.string.caseInsensitiveContains(b, a);
2742
+ goog.uri.utils.getComponentByIndex_ = function(a, b) {
2743
+ return goog.uri.utils.split(b)[a] || null;
2719
2744
  };
2720
- goog.labs.userAgent.util.extractVersionTuples = function(a) {
2721
- for (var b = RegExp("(\\w[\\w ]+)/([^\\s]+)\\s*(?:\\((.*?)\\))?", "g"), c = [], d;d = b.exec(a);) {
2722
- c.push([d[1], d[2], d[3] || void 0]);
2723
- }
2724
- return c;
2745
+ goog.uri.utils.getScheme = function(a) {
2746
+ return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME, a);
2725
2747
  };
2726
- goog.labs.userAgent.browser = {};
2727
- goog.labs.userAgent.browser.matchOpera_ = function() {
2728
- return goog.labs.userAgent.util.matchUserAgent("Opera") || goog.labs.userAgent.util.matchUserAgent("OPR");
2748
+ goog.uri.utils.getEffectiveScheme = function(a) {
2749
+ a = goog.uri.utils.getScheme(a);
2750
+ !a && goog.global.self && goog.global.self.location && (a = goog.global.self.location.protocol, a = a.substr(0, a.length - 1));
2751
+ return a ? a.toLowerCase() : "";
2729
2752
  };
2730
- goog.labs.userAgent.browser.matchIE_ = function() {
2731
- return goog.labs.userAgent.util.matchUserAgent("Edge") || goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE");
2753
+ goog.uri.utils.getUserInfoEncoded = function(a) {
2754
+ return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO, a);
2732
2755
  };
2733
- goog.labs.userAgent.browser.matchFirefox_ = function() {
2734
- return goog.labs.userAgent.util.matchUserAgent("Firefox");
2756
+ goog.uri.utils.getUserInfo = function(a) {
2757
+ return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(a));
2735
2758
  };
2736
- goog.labs.userAgent.browser.matchSafari_ = function() {
2737
- 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.matchIE_() || goog.labs.userAgent.browser.isSilk() || goog.labs.userAgent.util.matchUserAgent("Android"));
2759
+ goog.uri.utils.getDomainEncoded = function(a) {
2760
+ return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN, a);
2738
2761
  };
2739
- goog.labs.userAgent.browser.matchCoast_ = function() {
2740
- return goog.labs.userAgent.util.matchUserAgent("Coast");
2762
+ goog.uri.utils.getDomain = function(a) {
2763
+ return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(a), !0);
2741
2764
  };
2742
- goog.labs.userAgent.browser.matchIosWebview_ = function() {
2743
- 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");
2765
+ goog.uri.utils.getPort = function(a) {
2766
+ return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT, a)) || null;
2744
2767
  };
2745
- goog.labs.userAgent.browser.matchChrome_ = function() {
2746
- return (goog.labs.userAgent.util.matchUserAgent("Chrome") || goog.labs.userAgent.util.matchUserAgent("CriOS")) && !goog.labs.userAgent.browser.matchOpera_() && !goog.labs.userAgent.browser.matchIE_();
2768
+ goog.uri.utils.getPathEncoded = function(a) {
2769
+ return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH, a);
2747
2770
  };
2748
- goog.labs.userAgent.browser.matchAndroidBrowser_ = function() {
2749
- 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());
2771
+ goog.uri.utils.getPath = function(a) {
2772
+ return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(a), !0);
2750
2773
  };
2751
- goog.labs.userAgent.browser.isOpera = goog.labs.userAgent.browser.matchOpera_;
2752
- goog.labs.userAgent.browser.isIE = goog.labs.userAgent.browser.matchIE_;
2753
- goog.labs.userAgent.browser.isFirefox = goog.labs.userAgent.browser.matchFirefox_;
2754
- goog.labs.userAgent.browser.isSafari = goog.labs.userAgent.browser.matchSafari_;
2755
- goog.labs.userAgent.browser.isCoast = goog.labs.userAgent.browser.matchCoast_;
2756
- goog.labs.userAgent.browser.isIosWebview = goog.labs.userAgent.browser.matchIosWebview_;
2757
- goog.labs.userAgent.browser.isChrome = goog.labs.userAgent.browser.matchChrome_;
2758
- goog.labs.userAgent.browser.isAndroidBrowser = goog.labs.userAgent.browser.matchAndroidBrowser_;
2759
- goog.labs.userAgent.browser.isSilk = function() {
2760
- return goog.labs.userAgent.util.matchUserAgent("Silk");
2774
+ goog.uri.utils.getQueryData = function(a) {
2775
+ return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA, a);
2761
2776
  };
2762
- goog.labs.userAgent.browser.getVersion = function() {
2763
- function a(a) {
2764
- a = goog.array.find(a, d);
2765
- return c[a] || "";
2766
- }
2767
- var b = goog.labs.userAgent.util.getUserAgent();
2768
- if (goog.labs.userAgent.browser.isIE()) {
2769
- return goog.labs.userAgent.browser.getIEVersion_(b);
2770
- }
2771
- var b = goog.labs.userAgent.util.extractVersionTuples(b), c = {};
2772
- goog.array.forEach(b, function(a) {
2773
- c[a[0]] = a[1];
2774
- });
2775
- var d = goog.partial(goog.object.containsKey, c);
2776
- return goog.labs.userAgent.browser.isOpera() ? a(["Version", "Opera", "OPR"]) : goog.labs.userAgent.browser.isChrome() ? a(["Chrome", "CriOS"]) : (b = b[2]) && b[1] || "";
2777
+ goog.uri.utils.getFragmentEncoded = function(a) {
2778
+ var b = a.indexOf("#");
2779
+ return 0 > b ? null : a.substr(b + 1);
2777
2780
  };
2778
- goog.labs.userAgent.browser.isVersionOrHigher = function(a) {
2779
- return 0 <= goog.string.compareVersions(goog.labs.userAgent.browser.getVersion(), a);
2781
+ goog.uri.utils.setFragmentEncoded = function(a, b) {
2782
+ return goog.uri.utils.removeFragment(a) + (b ? "#" + b : "");
2780
2783
  };
2781
- goog.labs.userAgent.browser.getIEVersion_ = function(a) {
2782
- var b = /rv: *([\d\.]*)/.exec(a);
2783
- if (b && b[1] || (b = /Edge\/([\d\.]+)/.exec(a))) {
2784
- return b[1];
2785
- }
2786
- var b = "", c = /MSIE +([\d\.]+)/.exec(a);
2787
- if (c && c[1]) {
2788
- if (a = /Trident\/(\d.\d)/.exec(a), "7.0" == c[1]) {
2789
- if (a && a[1]) {
2790
- switch(a[1]) {
2791
- case "4.0":
2792
- b = "8.0";
2793
- break;
2794
- case "5.0":
2795
- b = "9.0";
2796
- break;
2797
- case "6.0":
2798
- b = "10.0";
2799
- break;
2800
- case "7.0":
2801
- b = "11.0";
2802
- }
2803
- } else {
2804
- b = "7.0";
2805
- }
2806
- } else {
2807
- b = c[1];
2808
- }
2809
- }
2810
- return b;
2784
+ goog.uri.utils.getFragment = function(a) {
2785
+ return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(a));
2811
2786
  };
2812
- goog.labs.userAgent.engine = {};
2813
- goog.labs.userAgent.engine.isPresto = function() {
2814
- return goog.labs.userAgent.util.matchUserAgent("Presto");
2787
+ goog.uri.utils.getHost = function(a) {
2788
+ a = goog.uri.utils.split(a);
2789
+ return goog.uri.utils.buildFromEncodedParts(a[goog.uri.utils.ComponentIndex.SCHEME], a[goog.uri.utils.ComponentIndex.USER_INFO], a[goog.uri.utils.ComponentIndex.DOMAIN], a[goog.uri.utils.ComponentIndex.PORT]);
2815
2790
  };
2816
- goog.labs.userAgent.engine.isTrident = function() {
2817
- return goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE");
2791
+ goog.uri.utils.getPathAndAfter = function(a) {
2792
+ a = goog.uri.utils.split(a);
2793
+ return goog.uri.utils.buildFromEncodedParts(null, null, null, null, a[goog.uri.utils.ComponentIndex.PATH], a[goog.uri.utils.ComponentIndex.QUERY_DATA], a[goog.uri.utils.ComponentIndex.FRAGMENT]);
2818
2794
  };
2819
- goog.labs.userAgent.engine.isEdge = function() {
2820
- return goog.labs.userAgent.util.matchUserAgent("Edge");
2795
+ goog.uri.utils.removeFragment = function(a) {
2796
+ var b = a.indexOf("#");
2797
+ return 0 > b ? a : a.substr(0, b);
2821
2798
  };
2822
- goog.labs.userAgent.engine.isWebKit = function() {
2823
- return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit") && !goog.labs.userAgent.engine.isEdge();
2799
+ goog.uri.utils.haveSameDomain = function(a, b) {
2800
+ var c = goog.uri.utils.split(a), d = goog.uri.utils.split(b);
2801
+ return c[goog.uri.utils.ComponentIndex.DOMAIN] == d[goog.uri.utils.ComponentIndex.DOMAIN] && c[goog.uri.utils.ComponentIndex.SCHEME] == d[goog.uri.utils.ComponentIndex.SCHEME] && c[goog.uri.utils.ComponentIndex.PORT] == d[goog.uri.utils.ComponentIndex.PORT];
2824
2802
  };
2825
- goog.labs.userAgent.engine.isGecko = function() {
2826
- return goog.labs.userAgent.util.matchUserAgent("Gecko") && !goog.labs.userAgent.engine.isWebKit() && !goog.labs.userAgent.engine.isTrident() && !goog.labs.userAgent.engine.isEdge();
2803
+ goog.uri.utils.assertNoFragmentsOrQueries_ = function(a) {
2804
+ if (goog.DEBUG && (0 <= a.indexOf("#") || 0 <= a.indexOf("?"))) {
2805
+ throw Error("goog.uri.utils: Fragment or query identifiers are not supported: [" + a + "]");
2806
+ }
2827
2807
  };
2828
- goog.labs.userAgent.engine.getVersion = function() {
2829
- var a = goog.labs.userAgent.util.getUserAgent();
2808
+ goog.uri.utils.parseQueryData = function(a, b) {
2830
2809
  if (a) {
2831
- var a = goog.labs.userAgent.util.extractVersionTuples(a), b = goog.labs.userAgent.engine.getEngineTuple_(a);
2832
- if (b) {
2833
- return "Gecko" == b[0] ? goog.labs.userAgent.engine.getVersionForKey_(a, "Firefox") : b[1];
2834
- }
2835
- var a = a[0], c;
2836
- if (a && (c = a[2]) && (c = /Trident\/([^\s;]+)/.exec(c))) {
2837
- return c[1];
2810
+ for (var c = a.split("&"), d = 0;d < c.length;d++) {
2811
+ var e = c[d].indexOf("="), f = null, g = null;
2812
+ 0 <= e ? (f = c[d].substring(0, e), g = c[d].substring(e + 1)) : f = c[d];
2813
+ b(f, g ? goog.string.urlDecode(g) : "");
2838
2814
  }
2839
2815
  }
2840
- return "";
2841
2816
  };
2842
- goog.labs.userAgent.engine.getEngineTuple_ = function(a) {
2843
- if (!goog.labs.userAgent.engine.isEdge()) {
2844
- return a[1];
2817
+ goog.uri.utils.appendQueryData_ = function(a) {
2818
+ if (a[1]) {
2819
+ var b = a[0], c = b.indexOf("#");
2820
+ 0 <= c && (a.push(b.substr(c)), a[0] = b = b.substr(0, c));
2821
+ c = b.indexOf("?");
2822
+ 0 > c ? a[1] = "?" : c == b.length - 1 && (a[1] = void 0);
2845
2823
  }
2846
- for (var b = 0;b < a.length;b++) {
2847
- var c = a[b];
2848
- if ("Edge" == c[0]) {
2849
- return c;
2824
+ return a.join("");
2825
+ };
2826
+ goog.uri.utils.appendKeyValuePairs_ = function(a, b, c) {
2827
+ if (goog.isArray(b)) {
2828
+ goog.asserts.assertArray(b);
2829
+ for (var d = 0;d < b.length;d++) {
2830
+ goog.uri.utils.appendKeyValuePairs_(a, String(b[d]), c);
2850
2831
  }
2832
+ } else {
2833
+ null != b && c.push("&", a, "" === b ? "" : "=", goog.string.urlEncode(b));
2851
2834
  }
2852
2835
  };
2853
- goog.labs.userAgent.engine.isVersionOrHigher = function(a) {
2854
- return 0 <= goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(), a);
2836
+ goog.uri.utils.buildQueryDataBuffer_ = function(a, b, c) {
2837
+ goog.asserts.assert(0 == Math.max(b.length - (c || 0), 0) % 2, "goog.uri.utils: Key/value lists must be even in length.");
2838
+ for (c = c || 0;c < b.length;c += 2) {
2839
+ goog.uri.utils.appendKeyValuePairs_(b[c], b[c + 1], a);
2840
+ }
2841
+ return a;
2855
2842
  };
2856
- goog.labs.userAgent.engine.getVersionForKey_ = function(a, b) {
2857
- var c = goog.array.find(a, function(a) {
2858
- return b == a[0];
2859
- });
2860
- return c && c[1] || "";
2843
+ goog.uri.utils.buildQueryData = function(a, b) {
2844
+ var c = goog.uri.utils.buildQueryDataBuffer_([], a, b);
2845
+ c[0] = "";
2846
+ return c.join("");
2861
2847
  };
2862
- goog.labs.userAgent.platform = {};
2863
- goog.labs.userAgent.platform.isAndroid = function() {
2864
- return goog.labs.userAgent.util.matchUserAgent("Android");
2865
- };
2866
- goog.labs.userAgent.platform.isIpod = function() {
2867
- return goog.labs.userAgent.util.matchUserAgent("iPod");
2868
- };
2869
- goog.labs.userAgent.platform.isIphone = function() {
2870
- return goog.labs.userAgent.util.matchUserAgent("iPhone") && !goog.labs.userAgent.util.matchUserAgent("iPod") && !goog.labs.userAgent.util.matchUserAgent("iPad");
2871
- };
2872
- goog.labs.userAgent.platform.isIpad = function() {
2873
- return goog.labs.userAgent.util.matchUserAgent("iPad");
2874
- };
2875
- goog.labs.userAgent.platform.isIos = function() {
2876
- return goog.labs.userAgent.platform.isIphone() || goog.labs.userAgent.platform.isIpad() || goog.labs.userAgent.platform.isIpod();
2877
- };
2878
- goog.labs.userAgent.platform.isMacintosh = function() {
2879
- return goog.labs.userAgent.util.matchUserAgent("Macintosh");
2880
- };
2881
- goog.labs.userAgent.platform.isLinux = function() {
2882
- return goog.labs.userAgent.util.matchUserAgent("Linux");
2883
- };
2884
- goog.labs.userAgent.platform.isWindows = function() {
2885
- return goog.labs.userAgent.util.matchUserAgent("Windows");
2886
- };
2887
- goog.labs.userAgent.platform.isChromeOS = function() {
2888
- return goog.labs.userAgent.util.matchUserAgent("CrOS");
2889
- };
2890
- goog.labs.userAgent.platform.getVersion = function() {
2891
- var a = goog.labs.userAgent.util.getUserAgent(), b = "";
2892
- 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() &&
2893
- (b = /(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/, b = (a = b.exec(a)) && a[1]);
2894
- return b || "";
2895
- };
2896
- goog.labs.userAgent.platform.isVersionOrHigher = function(a) {
2897
- return 0 <= goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(), a);
2898
- };
2899
- goog.userAgent = {};
2900
- goog.userAgent.ASSUME_IE = !1;
2901
- goog.userAgent.ASSUME_GECKO = !1;
2902
- goog.userAgent.ASSUME_WEBKIT = !0;
2903
- goog.userAgent.ASSUME_MOBILE_WEBKIT = !1;
2904
- goog.userAgent.ASSUME_OPERA = !1;
2905
- goog.userAgent.ASSUME_ANY_VERSION = !1;
2906
- goog.userAgent.BROWSER_KNOWN_ = goog.userAgent.ASSUME_IE || goog.userAgent.ASSUME_GECKO || goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_OPERA;
2907
- goog.userAgent.getUserAgentString = function() {
2908
- return goog.labs.userAgent.util.getUserAgent();
2909
- };
2910
- goog.userAgent.getNavigator = function() {
2911
- return goog.global.navigator || null;
2912
- };
2913
- goog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_OPERA : goog.labs.userAgent.browser.isOpera();
2914
- goog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_IE : goog.labs.userAgent.browser.isIE();
2915
- goog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_GECKO : goog.labs.userAgent.engine.isGecko();
2916
- goog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT : goog.labs.userAgent.engine.isWebKit();
2917
- goog.userAgent.isMobile_ = function() {
2918
- return goog.userAgent.WEBKIT && goog.labs.userAgent.util.matchUserAgent("Mobile");
2919
- };
2920
- goog.userAgent.MOBILE = goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_();
2921
- goog.userAgent.SAFARI = goog.userAgent.WEBKIT;
2922
- goog.userAgent.determinePlatform_ = function() {
2923
- var a = goog.userAgent.getNavigator();
2924
- return a && a.platform || "";
2925
- };
2926
- goog.userAgent.PLATFORM = goog.userAgent.determinePlatform_();
2927
- goog.userAgent.ASSUME_MAC = !1;
2928
- goog.userAgent.ASSUME_WINDOWS = !1;
2929
- goog.userAgent.ASSUME_LINUX = !1;
2930
- goog.userAgent.ASSUME_X11 = !1;
2931
- goog.userAgent.ASSUME_ANDROID = !1;
2932
- goog.userAgent.ASSUME_IPHONE = !1;
2933
- goog.userAgent.ASSUME_IPAD = !1;
2934
- 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;
2935
- goog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_MAC : goog.labs.userAgent.platform.isMacintosh();
2936
- goog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_WINDOWS : goog.labs.userAgent.platform.isWindows();
2937
- goog.userAgent.isLegacyLinux_ = function() {
2938
- return goog.labs.userAgent.platform.isLinux() || goog.labs.userAgent.platform.isChromeOS();
2939
- };
2940
- goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_LINUX : goog.userAgent.isLegacyLinux_();
2941
- goog.userAgent.isX11_ = function() {
2942
- var a = goog.userAgent.getNavigator();
2943
- return !!a && goog.string.contains(a.appVersion || "", "X11");
2944
- };
2945
- goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_X11 : goog.userAgent.isX11_();
2946
- goog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_ANDROID : goog.labs.userAgent.platform.isAndroid();
2947
- goog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPHONE : goog.labs.userAgent.platform.isIphone();
2948
- goog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPAD : goog.labs.userAgent.platform.isIpad();
2949
- goog.userAgent.determineVersion_ = function() {
2950
- if (goog.userAgent.OPERA && goog.global.opera) {
2951
- var a = goog.global.opera.version;
2952
- return goog.isFunction(a) ? a() : a;
2953
- }
2954
- var a = "", b = goog.userAgent.getVersionRegexResult_();
2955
- b && (a = b ? b[1] : "");
2956
- return goog.userAgent.IE && !goog.labs.userAgent.engine.isEdge() && (b = goog.userAgent.getDocumentMode_(), b > parseFloat(a)) ? String(b) : a;
2957
- };
2958
- goog.userAgent.getVersionRegexResult_ = function() {
2959
- var a = goog.userAgent.getUserAgentString();
2960
- if (goog.userAgent.GECKO) {
2961
- return /rv\:([^\);]+)(\)|;)/.exec(a);
2962
- }
2963
- if (goog.userAgent.IE && goog.labs.userAgent.engine.isEdge()) {
2964
- return /Edge\/([\d\.]+)/.exec(a);
2965
- }
2966
- if (goog.userAgent.IE) {
2967
- return /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);
2968
- }
2969
- if (goog.userAgent.WEBKIT) {
2970
- return /WebKit\/(\S+)/.exec(a);
2971
- }
2972
- };
2973
- goog.userAgent.getDocumentMode_ = function() {
2974
- var a = goog.global.document;
2975
- return a ? a.documentMode : void 0;
2976
- };
2977
- goog.userAgent.VERSION = goog.userAgent.determineVersion_();
2978
- goog.userAgent.compare = function(a, b) {
2979
- return goog.string.compareVersions(a, b);
2980
- };
2981
- goog.userAgent.isVersionOrHigherCache_ = {};
2982
- goog.userAgent.isVersionOrHigher = function(a) {
2983
- return goog.userAgent.ASSUME_ANY_VERSION || goog.userAgent.isVersionOrHigherCache_[a] || (goog.userAgent.isVersionOrHigherCache_[a] = 0 <= goog.string.compareVersions(goog.userAgent.VERSION, a));
2984
- };
2985
- goog.userAgent.isVersion = goog.userAgent.isVersionOrHigher;
2986
- goog.userAgent.isDocumentModeOrHigher = function(a) {
2987
- return goog.userAgent.IE && (goog.labs.userAgent.engine.isEdge() || goog.userAgent.DOCUMENT_MODE >= a);
2988
- };
2989
- goog.userAgent.isDocumentMode = goog.userAgent.isDocumentModeOrHigher;
2990
- goog.userAgent.DOCUMENT_MODE = function() {
2991
- var a = goog.global.document, b = goog.userAgent.getDocumentMode_();
2992
- return !a || !goog.userAgent.IE || !b && goog.labs.userAgent.engine.isEdge() ? void 0 : b || ("CSS1Compat" == a.compatMode ? parseInt(goog.userAgent.VERSION, 10) : 5);
2993
- }();
2994
- goog.uri = {};
2995
- goog.uri.utils = {};
2996
- goog.uri.utils.CharCode_ = {AMPERSAND:38, EQUAL:61, HASH:35, QUESTION:63};
2997
- goog.uri.utils.buildFromEncodedParts = function(a, b, c, d, e, f, g) {
2998
- var h = "";
2999
- a && (h += a + ":");
3000
- c && (h += "//", b && (h += b + "@"), h += c, d && (h += ":" + d));
3001
- e && (h += e);
3002
- f && (h += "?" + f);
3003
- g && (h += "#" + g);
3004
- return h;
3005
- };
3006
- goog.uri.utils.splitRe_ = /^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;
3007
- goog.uri.utils.ComponentIndex = {SCHEME:1, USER_INFO:2, DOMAIN:3, PORT:4, PATH:5, QUERY_DATA:6, FRAGMENT:7};
3008
- goog.uri.utils.split = function(a) {
3009
- goog.uri.utils.phishingProtection_();
3010
- return a.match(goog.uri.utils.splitRe_);
3011
- };
3012
- goog.uri.utils.needsPhishingProtection_ = goog.userAgent.WEBKIT;
3013
- goog.uri.utils.phishingProtection_ = function() {
3014
- if (goog.uri.utils.needsPhishingProtection_) {
3015
- goog.uri.utils.needsPhishingProtection_ = !1;
3016
- var a = goog.global.location;
3017
- if (a) {
3018
- var b = a.href;
3019
- if (b && (b = goog.uri.utils.getDomain(b)) && b != a.hostname) {
3020
- throw goog.uri.utils.needsPhishingProtection_ = !0, Error();
3021
- }
3022
- }
3023
- }
3024
- };
3025
- goog.uri.utils.decodeIfPossible_ = function(a, b) {
3026
- return a ? b ? decodeURI(a) : decodeURIComponent(a) : a;
3027
- };
3028
- goog.uri.utils.getComponentByIndex_ = function(a, b) {
3029
- return goog.uri.utils.split(b)[a] || null;
3030
- };
3031
- goog.uri.utils.getScheme = function(a) {
3032
- return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME, a);
3033
- };
3034
- goog.uri.utils.getEffectiveScheme = function(a) {
3035
- a = goog.uri.utils.getScheme(a);
3036
- !a && self.location && (a = self.location.protocol, a = a.substr(0, a.length - 1));
3037
- return a ? a.toLowerCase() : "";
3038
- };
3039
- goog.uri.utils.getUserInfoEncoded = function(a) {
3040
- return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO, a);
3041
- };
3042
- goog.uri.utils.getUserInfo = function(a) {
3043
- return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(a));
3044
- };
3045
- goog.uri.utils.getDomainEncoded = function(a) {
3046
- return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN, a);
3047
- };
3048
- goog.uri.utils.getDomain = function(a) {
3049
- return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(a), !0);
3050
- };
3051
- goog.uri.utils.getPort = function(a) {
3052
- return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT, a)) || null;
3053
- };
3054
- goog.uri.utils.getPathEncoded = function(a) {
3055
- return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH, a);
3056
- };
3057
- goog.uri.utils.getPath = function(a) {
3058
- return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(a), !0);
3059
- };
3060
- goog.uri.utils.getQueryData = function(a) {
3061
- return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA, a);
3062
- };
3063
- goog.uri.utils.getFragmentEncoded = function(a) {
3064
- var b = a.indexOf("#");
3065
- return 0 > b ? null : a.substr(b + 1);
3066
- };
3067
- goog.uri.utils.setFragmentEncoded = function(a, b) {
3068
- return goog.uri.utils.removeFragment(a) + (b ? "#" + b : "");
3069
- };
3070
- goog.uri.utils.getFragment = function(a) {
3071
- return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(a));
3072
- };
3073
- goog.uri.utils.getHost = function(a) {
3074
- a = goog.uri.utils.split(a);
3075
- return goog.uri.utils.buildFromEncodedParts(a[goog.uri.utils.ComponentIndex.SCHEME], a[goog.uri.utils.ComponentIndex.USER_INFO], a[goog.uri.utils.ComponentIndex.DOMAIN], a[goog.uri.utils.ComponentIndex.PORT]);
3076
- };
3077
- goog.uri.utils.getPathAndAfter = function(a) {
3078
- a = goog.uri.utils.split(a);
3079
- return goog.uri.utils.buildFromEncodedParts(null, null, null, null, a[goog.uri.utils.ComponentIndex.PATH], a[goog.uri.utils.ComponentIndex.QUERY_DATA], a[goog.uri.utils.ComponentIndex.FRAGMENT]);
3080
- };
3081
- goog.uri.utils.removeFragment = function(a) {
3082
- var b = a.indexOf("#");
3083
- return 0 > b ? a : a.substr(0, b);
3084
- };
3085
- goog.uri.utils.haveSameDomain = function(a, b) {
3086
- var c = goog.uri.utils.split(a), d = goog.uri.utils.split(b);
3087
- return c[goog.uri.utils.ComponentIndex.DOMAIN] == d[goog.uri.utils.ComponentIndex.DOMAIN] && c[goog.uri.utils.ComponentIndex.SCHEME] == d[goog.uri.utils.ComponentIndex.SCHEME] && c[goog.uri.utils.ComponentIndex.PORT] == d[goog.uri.utils.ComponentIndex.PORT];
3088
- };
3089
- goog.uri.utils.assertNoFragmentsOrQueries_ = function(a) {
3090
- if (goog.DEBUG && (0 <= a.indexOf("#") || 0 <= a.indexOf("?"))) {
3091
- throw Error("goog.uri.utils: Fragment or query identifiers are not supported: [" + a + "]");
3092
- }
3093
- };
3094
- goog.uri.utils.parseQueryData = function(a, b) {
3095
- for (var c = a.split("&"), d = 0;d < c.length;d++) {
3096
- var e = c[d].indexOf("="), f = null, g = null;
3097
- 0 <= e ? (f = c[d].substring(0, e), g = c[d].substring(e + 1)) : f = c[d];
3098
- b(f, g ? goog.string.urlDecode(g) : "");
3099
- }
3100
- };
3101
- goog.uri.utils.appendQueryData_ = function(a) {
3102
- if (a[1]) {
3103
- var b = a[0], c = b.indexOf("#");
3104
- 0 <= c && (a.push(b.substr(c)), a[0] = b = b.substr(0, c));
3105
- c = b.indexOf("?");
3106
- 0 > c ? a[1] = "?" : c == b.length - 1 && (a[1] = void 0);
3107
- }
3108
- return a.join("");
3109
- };
3110
- goog.uri.utils.appendKeyValuePairs_ = function(a, b, c) {
3111
- if (goog.isArray(b)) {
3112
- goog.asserts.assertArray(b);
3113
- for (var d = 0;d < b.length;d++) {
3114
- goog.uri.utils.appendKeyValuePairs_(a, String(b[d]), c);
3115
- }
3116
- } else {
3117
- null != b && c.push("&", a, "" === b ? "" : "=", goog.string.urlEncode(b));
3118
- }
3119
- };
3120
- goog.uri.utils.buildQueryDataBuffer_ = function(a, b, c) {
3121
- goog.asserts.assert(0 == Math.max(b.length - (c || 0), 0) % 2, "goog.uri.utils: Key/value lists must be even in length.");
3122
- for (c = c || 0;c < b.length;c += 2) {
3123
- goog.uri.utils.appendKeyValuePairs_(b[c], b[c + 1], a);
3124
- }
3125
- return a;
3126
- };
3127
- goog.uri.utils.buildQueryData = function(a, b) {
3128
- var c = goog.uri.utils.buildQueryDataBuffer_([], a, b);
3129
- c[0] = "";
3130
- return c.join("");
3131
- };
3132
- goog.uri.utils.buildQueryDataBufferFromMap_ = function(a, b) {
3133
- for (var c in b) {
3134
- goog.uri.utils.appendKeyValuePairs_(c, b[c], a);
3135
- }
3136
- return a;
2848
+ goog.uri.utils.buildQueryDataBufferFromMap_ = function(a, b) {
2849
+ for (var c in b) {
2850
+ goog.uri.utils.appendKeyValuePairs_(c, b[c], a);
2851
+ }
2852
+ return a;
3137
2853
  };
3138
2854
  goog.uri.utils.buildQueryDataFromMap = function(a) {
3139
2855
  a = goog.uri.utils.buildQueryDataBufferFromMap_([], a);
@@ -3230,19 +2946,15 @@ goog.Uri.RANDOM_PARAM = goog.uri.utils.StandardQueryParam.RANDOM;
3230
2946
  goog.Uri.prototype.toString = function() {
3231
2947
  var a = [], b = this.getScheme();
3232
2948
  b && a.push(goog.Uri.encodeSpecialChars_(b, goog.Uri.reDisallowedInSchemeOrUserInfo_, !0), ":");
3233
- if (b = this.getDomain()) {
3234
- a.push("//");
3235
- var c = this.getUserInfo();
3236
- c && a.push(goog.Uri.encodeSpecialChars_(c, goog.Uri.reDisallowedInSchemeOrUserInfo_, !0), "@");
3237
- a.push(goog.Uri.removeDoubleEncoding_(goog.string.urlEncode(b)));
3238
- b = this.getPort();
3239
- null != b && a.push(":", String(b));
3240
- }
3241
- if (b = this.getPath()) {
3242
- this.hasDomain() && "/" != b.charAt(0) && a.push("/"), a.push(goog.Uri.encodeSpecialChars_(b, "/" == b.charAt(0) ? goog.Uri.reDisallowedInAbsolutePath_ : goog.Uri.reDisallowedInRelativePath_, !0));
3243
- }
3244
- (b = this.getEncodedQuery()) && a.push("?", b);
3245
- (b = this.getFragment()) && a.push("#", goog.Uri.encodeSpecialChars_(b, goog.Uri.reDisallowedInFragment_));
2949
+ var c = this.getDomain();
2950
+ if (c || "file" == b) {
2951
+ a.push("//"), (b = this.getUserInfo()) && a.push(goog.Uri.encodeSpecialChars_(b, goog.Uri.reDisallowedInSchemeOrUserInfo_, !0), "@"), a.push(goog.Uri.removeDoubleEncoding_(goog.string.urlEncode(c))), c = this.getPort(), null != c && a.push(":", String(c));
2952
+ }
2953
+ if (c = this.getPath()) {
2954
+ this.hasDomain() && "/" != c.charAt(0) && a.push("/"), a.push(goog.Uri.encodeSpecialChars_(c, "/" == c.charAt(0) ? goog.Uri.reDisallowedInAbsolutePath_ : goog.Uri.reDisallowedInRelativePath_, !0));
2955
+ }
2956
+ (c = this.getEncodedQuery()) && a.push("?", c);
2957
+ (c = this.getFragment()) && a.push("#", goog.Uri.encodeSpecialChars_(c, goog.Uri.reDisallowedInFragment_));
3246
2958
  return a.join("");
3247
2959
  };
3248
2960
  goog.Uri.prototype.resolve = function(a) {
@@ -3650,7 +3362,7 @@ DIALOG:"DIALOG", DIR:"DIR", DIV:"DIV", DL:"DL", DT:"DT", EM:"EM", EMBED:"EMBED",
3650
3362
  MAP:"MAP", MARK:"MARK", MATH:"MATH", MENU:"MENU", META:"META", METER:"METER", NAV:"NAV", NOFRAMES:"NOFRAMES", NOSCRIPT:"NOSCRIPT", OBJECT:"OBJECT", OL:"OL", OPTGROUP:"OPTGROUP", OPTION:"OPTION", OUTPUT:"OUTPUT", P:"P", PARAM:"PARAM", PRE:"PRE", PROGRESS:"PROGRESS", Q:"Q", RP:"RP", RT:"RT", RUBY:"RUBY", S:"S", SAMP:"SAMP", SCRIPT:"SCRIPT", SECTION:"SECTION", SELECT:"SELECT", SMALL:"SMALL", SOURCE:"SOURCE", SPAN:"SPAN", STRIKE:"STRIKE", STRONG:"STRONG", STYLE:"STYLE", SUB:"SUB", SUMMARY:"SUMMARY",
3651
3363
  SUP:"SUP", SVG:"SVG", TABLE:"TABLE", TBODY:"TBODY", TD:"TD", TEMPLATE:"TEMPLATE", TEXTAREA:"TEXTAREA", TFOOT:"TFOOT", TH:"TH", THEAD:"THEAD", TIME:"TIME", TITLE:"TITLE", TR:"TR", TRACK:"TRACK", TT:"TT", U:"U", UL:"UL", VAR:"VAR", VIDEO:"VIDEO", WBR:"WBR"};
3652
3364
  goog.dom.tags = {};
3653
- goog.dom.tags.VOID_TAGS_ = goog.object.createSet("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));
3365
+ 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};
3654
3366
  goog.dom.tags.isVoidTag = function(a) {
3655
3367
  return !0 === goog.dom.tags.VOID_TAGS_[a];
3656
3368
  };
@@ -3977,32 +3689,25 @@ goog.html.SafeUrl.unwrap = function(a) {
3977
3689
  goog.html.SafeUrl.fromConstant = function(a) {
3978
3690
  return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a));
3979
3691
  };
3980
- goog.html.SAFE_BLOB_TYPE_PATTERN_ = /^image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)$/i;
3692
+ goog.html.SAFE_MIME_TYPE_PATTERN_ = /^(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm))$/i;
3981
3693
  goog.html.SafeUrl.fromBlob = function(a) {
3982
- a = goog.html.SAFE_BLOB_TYPE_PATTERN_.test(a.type) ? goog.fs.url.createObjectUrl(a) : goog.html.SafeUrl.INNOCUOUS_STRING;
3694
+ a = goog.html.SAFE_MIME_TYPE_PATTERN_.test(a.type) ? goog.fs.url.createObjectUrl(a) : goog.html.SafeUrl.INNOCUOUS_STRING;
3983
3695
  return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a);
3984
3696
  };
3697
+ goog.html.DATA_URL_PATTERN_ = /^data:([^;,]*);base64,[a-z0-9+\/]+=*$/i;
3698
+ goog.html.SafeUrl.fromDataUrl = function(a) {
3699
+ var b = a.match(goog.html.DATA_URL_PATTERN_), b = b && goog.html.SAFE_MIME_TYPE_PATTERN_.test(b[1]);
3700
+ return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(b ? a : goog.html.SafeUrl.INNOCUOUS_STRING);
3701
+ };
3985
3702
  goog.html.SAFE_URL_PATTERN_ = /^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/i;
3986
3703
  goog.html.SafeUrl.sanitize = function(a) {
3987
3704
  if (a instanceof goog.html.SafeUrl) {
3988
3705
  return a;
3989
3706
  }
3990
3707
  a = a.implementsGoogStringTypedString ? a.getTypedStringValue() : String(a);
3991
- a = goog.html.SAFE_URL_PATTERN_.test(a) ? goog.html.SafeUrl.normalize_(a) : goog.html.SafeUrl.INNOCUOUS_STRING;
3708
+ goog.html.SAFE_URL_PATTERN_.test(a) || (a = goog.html.SafeUrl.INNOCUOUS_STRING);
3992
3709
  return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a);
3993
3710
  };
3994
- goog.html.SafeUrl.normalize_ = function(a) {
3995
- try {
3996
- var b = encodeURI(a);
3997
- } catch (c) {
3998
- return goog.html.SafeUrl.INNOCUOUS_STRING;
3999
- }
4000
- return b.replace(goog.html.SafeUrl.NORMALIZE_MATCHER_, function(a) {
4001
- return goog.html.SafeUrl.NORMALIZE_REPLACER_MAP_[a];
4002
- });
4003
- };
4004
- goog.html.SafeUrl.NORMALIZE_MATCHER_ = /[()']|%5B|%5D|%25/g;
4005
- goog.html.SafeUrl.NORMALIZE_REPLACER_MAP_ = {"'":"%27", "(":"%28", ")":"%29", "%5B":"[", "%5D":"]", "%25":"%"};
4006
3711
  goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {};
4007
3712
  goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse = function(a) {
4008
3713
  var b = new goog.html.SafeUrl;
@@ -4132,7 +3837,11 @@ goog.html.SafeHtml.getAttrNameAndValue_ = function(a, b, c) {
4132
3837
  if (c instanceof goog.html.SafeUrl) {
4133
3838
  c = goog.html.SafeUrl.unwrap(c);
4134
3839
  } else {
4135
- throw Error('Attribute "' + b + '" on tag "' + a + '" requires goog.html.SafeUrl or goog.string.Const value, "' + c + '" given.');
3840
+ if (goog.isString(c)) {
3841
+ c = goog.html.SafeUrl.sanitize(c).getTypedStringValue();
3842
+ } else {
3843
+ throw Error('Attribute "' + b + '" on tag "' + a + '" requires goog.html.SafeUrl, goog.string.Const, or string, value "' + c + '" given.');
3844
+ }
4136
3845
  }
4137
3846
  }
4138
3847
  }
@@ -4209,149 +3918,462 @@ goog.html.SafeHtml.combineAttributes = function(a, b, c) {
4209
3918
  }
4210
3919
  return d;
4211
3920
  };
4212
- goog.html.SafeHtml.DOCTYPE_HTML = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>", goog.i18n.bidi.Dir.NEUTRAL);
4213
- goog.html.SafeHtml.EMPTY = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("", goog.i18n.bidi.Dir.NEUTRAL);
4214
- goog.html.SafeScript = function() {
4215
- this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = "";
4216
- this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_;
3921
+ goog.html.SafeHtml.DOCTYPE_HTML = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>", goog.i18n.bidi.Dir.NEUTRAL);
3922
+ goog.html.SafeHtml.EMPTY = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("", goog.i18n.bidi.Dir.NEUTRAL);
3923
+ goog.html.SafeScript = function() {
3924
+ this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = "";
3925
+ this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_;
3926
+ };
3927
+ goog.html.SafeScript.prototype.implementsGoogStringTypedString = !0;
3928
+ goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {};
3929
+ goog.html.SafeScript.fromConstant = function(a) {
3930
+ a = goog.string.Const.unwrap(a);
3931
+ return 0 === a.length ? goog.html.SafeScript.EMPTY : goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(a);
3932
+ };
3933
+ goog.html.SafeScript.prototype.getTypedStringValue = function() {
3934
+ return this.privateDoNotAccessOrElseSafeScriptWrappedValue_;
3935
+ };
3936
+ goog.DEBUG && (goog.html.SafeScript.prototype.toString = function() {
3937
+ return "SafeScript{" + this.privateDoNotAccessOrElseSafeScriptWrappedValue_ + "}";
3938
+ });
3939
+ goog.html.SafeScript.unwrap = function(a) {
3940
+ 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_) {
3941
+ return a.privateDoNotAccessOrElseSafeScriptWrappedValue_;
3942
+ }
3943
+ goog.asserts.fail("expected object of type SafeScript, got '" + a + "'");
3944
+ return "type_error:SafeScript";
3945
+ };
3946
+ goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse = function(a) {
3947
+ return (new goog.html.SafeScript).initSecurityPrivateDoNotAccessOrElse_(a);
3948
+ };
3949
+ goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_ = function(a) {
3950
+ this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = a;
3951
+ return this;
3952
+ };
3953
+ goog.html.SafeScript.EMPTY = goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("");
3954
+ goog.html.uncheckedconversions = {};
3955
+ goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract = function(a, b, c) {
3956
+ goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
3957
+ goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
3958
+ return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(b, c || null);
3959
+ };
3960
+ goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract = function(a, b) {
3961
+ goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
3962
+ goog.asserts.assert(!goog.string.isEmpty(goog.string.Const.unwrap(a)), "must provide non-empty justification");
3963
+ return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(b);
3964
+ };
3965
+ goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract = function(a, b) {
3966
+ goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
3967
+ goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
3968
+ return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b);
3969
+ };
3970
+ goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract = function(a, b) {
3971
+ goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
3972
+ goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
3973
+ return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(b);
3974
+ };
3975
+ goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract = function(a, b) {
3976
+ goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
3977
+ goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
3978
+ return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(b);
3979
+ };
3980
+ goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract = function(a, b) {
3981
+ goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
3982
+ goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
3983
+ return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b);
3984
+ };
3985
+ goog.structs.Collection = function() {
3986
+ };
3987
+ goog.structs.Set = function(a) {
3988
+ this.map_ = new goog.structs.Map;
3989
+ a && this.addAll(a);
3990
+ };
3991
+ goog.structs.Set.getKey_ = function(a) {
3992
+ var b = typeof a;
3993
+ return "object" == b && a || "function" == b ? "o" + goog.getUid(a) : b.substr(0, 1) + a;
3994
+ };
3995
+ goog.structs.Set.prototype.getCount = function() {
3996
+ return this.map_.getCount();
3997
+ };
3998
+ goog.structs.Set.prototype.add = function(a) {
3999
+ this.map_.set(goog.structs.Set.getKey_(a), a);
4000
+ };
4001
+ goog.structs.Set.prototype.addAll = function(a) {
4002
+ a = goog.structs.getValues(a);
4003
+ for (var b = a.length, c = 0;c < b;c++) {
4004
+ this.add(a[c]);
4005
+ }
4006
+ };
4007
+ goog.structs.Set.prototype.removeAll = function(a) {
4008
+ a = goog.structs.getValues(a);
4009
+ for (var b = a.length, c = 0;c < b;c++) {
4010
+ this.remove(a[c]);
4011
+ }
4012
+ };
4013
+ goog.structs.Set.prototype.remove = function(a) {
4014
+ return this.map_.remove(goog.structs.Set.getKey_(a));
4015
+ };
4016
+ goog.structs.Set.prototype.clear = function() {
4017
+ this.map_.clear();
4018
+ };
4019
+ goog.structs.Set.prototype.isEmpty = function() {
4020
+ return this.map_.isEmpty();
4021
+ };
4022
+ goog.structs.Set.prototype.contains = function(a) {
4023
+ return this.map_.containsKey(goog.structs.Set.getKey_(a));
4024
+ };
4025
+ goog.structs.Set.prototype.containsAll = function(a) {
4026
+ return goog.structs.every(a, this.contains, this);
4027
+ };
4028
+ goog.structs.Set.prototype.intersection = function(a) {
4029
+ var b = new goog.structs.Set;
4030
+ a = goog.structs.getValues(a);
4031
+ for (var c = 0;c < a.length;c++) {
4032
+ var d = a[c];
4033
+ this.contains(d) && b.add(d);
4034
+ }
4035
+ return b;
4036
+ };
4037
+ goog.structs.Set.prototype.difference = function(a) {
4038
+ var b = this.clone();
4039
+ b.removeAll(a);
4040
+ return b;
4041
+ };
4042
+ goog.structs.Set.prototype.getValues = function() {
4043
+ return this.map_.getValues();
4044
+ };
4045
+ goog.structs.Set.prototype.clone = function() {
4046
+ return new goog.structs.Set(this);
4047
+ };
4048
+ goog.structs.Set.prototype.equals = function(a) {
4049
+ return this.getCount() == goog.structs.getCount(a) && this.isSubsetOf(a);
4050
+ };
4051
+ goog.structs.Set.prototype.isSubsetOf = function(a) {
4052
+ var b = goog.structs.getCount(a);
4053
+ if (this.getCount() > b) {
4054
+ return !1;
4055
+ }
4056
+ !(a instanceof goog.structs.Set) && 5 < b && (a = new goog.structs.Set(a));
4057
+ return goog.structs.every(this, function(b) {
4058
+ return goog.structs.contains(a, b);
4059
+ });
4060
+ };
4061
+ goog.structs.Set.prototype.__iterator__ = function(a) {
4062
+ return this.map_.__iterator__(!1);
4063
+ };
4064
+ goog.labs = {};
4065
+ goog.labs.userAgent = {};
4066
+ goog.labs.userAgent.util = {};
4067
+ goog.labs.userAgent.util.getNativeUserAgentString_ = function() {
4068
+ var a = goog.labs.userAgent.util.getNavigator_();
4069
+ return a && (a = a.userAgent) ? a : "";
4070
+ };
4071
+ goog.labs.userAgent.util.getNavigator_ = function() {
4072
+ return goog.global.navigator;
4073
+ };
4074
+ goog.labs.userAgent.util.userAgent_ = goog.labs.userAgent.util.getNativeUserAgentString_();
4075
+ goog.labs.userAgent.util.setUserAgent = function(a) {
4076
+ goog.labs.userAgent.util.userAgent_ = a || goog.labs.userAgent.util.getNativeUserAgentString_();
4077
+ };
4078
+ goog.labs.userAgent.util.getUserAgent = function() {
4079
+ return goog.labs.userAgent.util.userAgent_;
4080
+ };
4081
+ goog.labs.userAgent.util.matchUserAgent = function(a) {
4082
+ var b = goog.labs.userAgent.util.getUserAgent();
4083
+ return goog.string.contains(b, a);
4084
+ };
4085
+ goog.labs.userAgent.util.matchUserAgentIgnoreCase = function(a) {
4086
+ var b = goog.labs.userAgent.util.getUserAgent();
4087
+ return goog.string.caseInsensitiveContains(b, a);
4088
+ };
4089
+ goog.labs.userAgent.util.extractVersionTuples = function(a) {
4090
+ for (var b = RegExp("(\\w[\\w ]+)/([^\\s]+)\\s*(?:\\((.*?)\\))?", "g"), c = [], d;d = b.exec(a);) {
4091
+ c.push([d[1], d[2], d[3] || void 0]);
4092
+ }
4093
+ return c;
4094
+ };
4095
+ goog.labs.userAgent.browser = {};
4096
+ goog.labs.userAgent.browser.matchOpera_ = function() {
4097
+ return goog.labs.userAgent.util.matchUserAgent("Opera") || goog.labs.userAgent.util.matchUserAgent("OPR");
4098
+ };
4099
+ goog.labs.userAgent.browser.matchIE_ = function() {
4100
+ return goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE");
4101
+ };
4102
+ goog.labs.userAgent.browser.matchEdge_ = function() {
4103
+ return goog.labs.userAgent.util.matchUserAgent("Edge");
4104
+ };
4105
+ goog.labs.userAgent.browser.matchFirefox_ = function() {
4106
+ return goog.labs.userAgent.util.matchUserAgent("Firefox");
4107
+ };
4108
+ goog.labs.userAgent.browser.matchSafari_ = function() {
4109
+ 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"));
4110
+ };
4111
+ goog.labs.userAgent.browser.matchCoast_ = function() {
4112
+ return goog.labs.userAgent.util.matchUserAgent("Coast");
4113
+ };
4114
+ goog.labs.userAgent.browser.matchIosWebview_ = function() {
4115
+ 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");
4116
+ };
4117
+ goog.labs.userAgent.browser.matchChrome_ = function() {
4118
+ return (goog.labs.userAgent.util.matchUserAgent("Chrome") || goog.labs.userAgent.util.matchUserAgent("CriOS")) && !goog.labs.userAgent.browser.matchOpera_() && !goog.labs.userAgent.browser.matchEdge_();
4119
+ };
4120
+ goog.labs.userAgent.browser.matchAndroidBrowser_ = function() {
4121
+ 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());
4122
+ };
4123
+ goog.labs.userAgent.browser.isOpera = goog.labs.userAgent.browser.matchOpera_;
4124
+ goog.labs.userAgent.browser.isIE = goog.labs.userAgent.browser.matchIE_;
4125
+ goog.labs.userAgent.browser.isEdge = goog.labs.userAgent.browser.matchEdge_;
4126
+ goog.labs.userAgent.browser.isFirefox = goog.labs.userAgent.browser.matchFirefox_;
4127
+ goog.labs.userAgent.browser.isSafari = goog.labs.userAgent.browser.matchSafari_;
4128
+ goog.labs.userAgent.browser.isCoast = goog.labs.userAgent.browser.matchCoast_;
4129
+ goog.labs.userAgent.browser.isIosWebview = goog.labs.userAgent.browser.matchIosWebview_;
4130
+ goog.labs.userAgent.browser.isChrome = goog.labs.userAgent.browser.matchChrome_;
4131
+ goog.labs.userAgent.browser.isAndroidBrowser = goog.labs.userAgent.browser.matchAndroidBrowser_;
4132
+ goog.labs.userAgent.browser.isSilk = function() {
4133
+ return goog.labs.userAgent.util.matchUserAgent("Silk");
4134
+ };
4135
+ goog.labs.userAgent.browser.getVersion = function() {
4136
+ function a(a) {
4137
+ a = goog.array.find(a, d);
4138
+ return c[a] || "";
4139
+ }
4140
+ var b = goog.labs.userAgent.util.getUserAgent();
4141
+ if (goog.labs.userAgent.browser.isIE()) {
4142
+ return goog.labs.userAgent.browser.getIEVersion_(b);
4143
+ }
4144
+ var b = goog.labs.userAgent.util.extractVersionTuples(b), c = {};
4145
+ goog.array.forEach(b, function(a) {
4146
+ c[a[0]] = a[1];
4147
+ });
4148
+ var d = goog.partial(goog.object.containsKey, c);
4149
+ return goog.labs.userAgent.browser.isOpera() ? a(["Version", "Opera", "OPR"]) : goog.labs.userAgent.browser.isEdge() ? a(["Edge"]) : goog.labs.userAgent.browser.isChrome() ? a(["Chrome", "CriOS"]) : (b = b[2]) && b[1] || "";
4150
+ };
4151
+ goog.labs.userAgent.browser.isVersionOrHigher = function(a) {
4152
+ return 0 <= goog.string.compareVersions(goog.labs.userAgent.browser.getVersion(), a);
4153
+ };
4154
+ goog.labs.userAgent.browser.getIEVersion_ = function(a) {
4155
+ var b = /rv: *([\d\.]*)/.exec(a);
4156
+ if (b && b[1]) {
4157
+ return b[1];
4158
+ }
4159
+ var b = "", c = /MSIE +([\d\.]+)/.exec(a);
4160
+ if (c && c[1]) {
4161
+ if (a = /Trident\/(\d.\d)/.exec(a), "7.0" == c[1]) {
4162
+ if (a && a[1]) {
4163
+ switch(a[1]) {
4164
+ case "4.0":
4165
+ b = "8.0";
4166
+ break;
4167
+ case "5.0":
4168
+ b = "9.0";
4169
+ break;
4170
+ case "6.0":
4171
+ b = "10.0";
4172
+ break;
4173
+ case "7.0":
4174
+ b = "11.0";
4175
+ }
4176
+ } else {
4177
+ b = "7.0";
4178
+ }
4179
+ } else {
4180
+ b = c[1];
4181
+ }
4182
+ }
4183
+ return b;
4184
+ };
4185
+ goog.labs.userAgent.engine = {};
4186
+ goog.labs.userAgent.engine.isPresto = function() {
4187
+ return goog.labs.userAgent.util.matchUserAgent("Presto");
4188
+ };
4189
+ goog.labs.userAgent.engine.isTrident = function() {
4190
+ return goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE");
4191
+ };
4192
+ goog.labs.userAgent.engine.isEdge = function() {
4193
+ return goog.labs.userAgent.util.matchUserAgent("Edge");
4217
4194
  };
4218
- goog.html.SafeScript.prototype.implementsGoogStringTypedString = !0;
4219
- goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {};
4220
- goog.html.SafeScript.fromConstant = function(a) {
4221
- a = goog.string.Const.unwrap(a);
4222
- return 0 === a.length ? goog.html.SafeScript.EMPTY : goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(a);
4195
+ goog.labs.userAgent.engine.isWebKit = function() {
4196
+ return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit") && !goog.labs.userAgent.engine.isEdge();
4223
4197
  };
4224
- goog.html.SafeScript.prototype.getTypedStringValue = function() {
4225
- return this.privateDoNotAccessOrElseSafeScriptWrappedValue_;
4198
+ goog.labs.userAgent.engine.isGecko = function() {
4199
+ return goog.labs.userAgent.util.matchUserAgent("Gecko") && !goog.labs.userAgent.engine.isWebKit() && !goog.labs.userAgent.engine.isTrident() && !goog.labs.userAgent.engine.isEdge();
4226
4200
  };
4227
- goog.DEBUG && (goog.html.SafeScript.prototype.toString = function() {
4228
- return "SafeScript{" + this.privateDoNotAccessOrElseSafeScriptWrappedValue_ + "}";
4229
- });
4230
- goog.html.SafeScript.unwrap = function(a) {
4231
- 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_) {
4232
- return a.privateDoNotAccessOrElseSafeScriptWrappedValue_;
4201
+ goog.labs.userAgent.engine.getVersion = function() {
4202
+ var a = goog.labs.userAgent.util.getUserAgent();
4203
+ if (a) {
4204
+ var a = goog.labs.userAgent.util.extractVersionTuples(a), b = goog.labs.userAgent.engine.getEngineTuple_(a);
4205
+ if (b) {
4206
+ return "Gecko" == b[0] ? goog.labs.userAgent.engine.getVersionForKey_(a, "Firefox") : b[1];
4207
+ }
4208
+ var a = a[0], c;
4209
+ if (a && (c = a[2]) && (c = /Trident\/([^\s;]+)/.exec(c))) {
4210
+ return c[1];
4211
+ }
4233
4212
  }
4234
- goog.asserts.fail("expected object of type SafeScript, got '" + a + "'");
4235
- return "type_error:SafeScript";
4213
+ return "";
4236
4214
  };
4237
- goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse = function(a) {
4238
- return (new goog.html.SafeScript).initSecurityPrivateDoNotAccessOrElse_(a);
4215
+ goog.labs.userAgent.engine.getEngineTuple_ = function(a) {
4216
+ if (!goog.labs.userAgent.engine.isEdge()) {
4217
+ return a[1];
4218
+ }
4219
+ for (var b = 0;b < a.length;b++) {
4220
+ var c = a[b];
4221
+ if ("Edge" == c[0]) {
4222
+ return c;
4223
+ }
4224
+ }
4239
4225
  };
4240
- goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_ = function(a) {
4241
- this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = a;
4242
- return this;
4226
+ goog.labs.userAgent.engine.isVersionOrHigher = function(a) {
4227
+ return 0 <= goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(), a);
4243
4228
  };
4244
- goog.html.SafeScript.EMPTY = goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("");
4245
- goog.html.uncheckedconversions = {};
4246
- goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract = function(a, b, c) {
4247
- goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
4248
- goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
4249
- return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(b, c || null);
4229
+ goog.labs.userAgent.engine.getVersionForKey_ = function(a, b) {
4230
+ var c = goog.array.find(a, function(a) {
4231
+ return b == a[0];
4232
+ });
4233
+ return c && c[1] || "";
4250
4234
  };
4251
- goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract = function(a, b) {
4252
- goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
4253
- goog.asserts.assert(!goog.string.isEmpty(goog.string.Const.unwrap(a)), "must provide non-empty justification");
4254
- return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(b);
4235
+ goog.labs.userAgent.platform = {};
4236
+ goog.labs.userAgent.platform.isAndroid = function() {
4237
+ return goog.labs.userAgent.util.matchUserAgent("Android");
4255
4238
  };
4256
- goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract = function(a, b) {
4257
- goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
4258
- goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
4259
- return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b);
4239
+ goog.labs.userAgent.platform.isIpod = function() {
4240
+ return goog.labs.userAgent.util.matchUserAgent("iPod");
4260
4241
  };
4261
- goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract = function(a, b) {
4262
- goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
4263
- goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
4264
- return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(b);
4242
+ goog.labs.userAgent.platform.isIphone = function() {
4243
+ return goog.labs.userAgent.util.matchUserAgent("iPhone") && !goog.labs.userAgent.util.matchUserAgent("iPod") && !goog.labs.userAgent.util.matchUserAgent("iPad");
4265
4244
  };
4266
- goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract = function(a, b) {
4267
- goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
4268
- goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
4269
- return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(b);
4245
+ goog.labs.userAgent.platform.isIpad = function() {
4246
+ return goog.labs.userAgent.util.matchUserAgent("iPad");
4270
4247
  };
4271
- goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract = function(a, b) {
4272
- goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification");
4273
- goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification");
4274
- return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b);
4248
+ goog.labs.userAgent.platform.isIos = function() {
4249
+ return goog.labs.userAgent.platform.isIphone() || goog.labs.userAgent.platform.isIpad() || goog.labs.userAgent.platform.isIpod();
4275
4250
  };
4276
- goog.structs.Collection = function() {
4251
+ goog.labs.userAgent.platform.isMacintosh = function() {
4252
+ return goog.labs.userAgent.util.matchUserAgent("Macintosh");
4277
4253
  };
4278
- goog.structs.Set = function(a) {
4279
- this.map_ = new goog.structs.Map;
4280
- a && this.addAll(a);
4254
+ goog.labs.userAgent.platform.isLinux = function() {
4255
+ return goog.labs.userAgent.util.matchUserAgent("Linux");
4281
4256
  };
4282
- goog.structs.Set.getKey_ = function(a) {
4283
- var b = typeof a;
4284
- return "object" == b && a || "function" == b ? "o" + goog.getUid(a) : b.substr(0, 1) + a;
4257
+ goog.labs.userAgent.platform.isWindows = function() {
4258
+ return goog.labs.userAgent.util.matchUserAgent("Windows");
4285
4259
  };
4286
- goog.structs.Set.prototype.getCount = function() {
4287
- return this.map_.getCount();
4260
+ goog.labs.userAgent.platform.isChromeOS = function() {
4261
+ return goog.labs.userAgent.util.matchUserAgent("CrOS");
4288
4262
  };
4289
- goog.structs.Set.prototype.add = function(a) {
4290
- this.map_.set(goog.structs.Set.getKey_(a), a);
4263
+ goog.labs.userAgent.platform.getVersion = function() {
4264
+ var a = goog.labs.userAgent.util.getUserAgent(), b = "";
4265
+ 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() &&
4266
+ (b = /(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/, b = (a = b.exec(a)) && a[1]);
4267
+ return b || "";
4291
4268
  };
4292
- goog.structs.Set.prototype.addAll = function(a) {
4293
- a = goog.structs.getValues(a);
4294
- for (var b = a.length, c = 0;c < b;c++) {
4295
- this.add(a[c]);
4296
- }
4269
+ goog.labs.userAgent.platform.isVersionOrHigher = function(a) {
4270
+ return 0 <= goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(), a);
4297
4271
  };
4298
- goog.structs.Set.prototype.removeAll = function(a) {
4299
- a = goog.structs.getValues(a);
4300
- for (var b = a.length, c = 0;c < b;c++) {
4301
- this.remove(a[c]);
4302
- }
4272
+ goog.userAgent = {};
4273
+ goog.userAgent.ASSUME_IE = !1;
4274
+ goog.userAgent.ASSUME_EDGE = !1;
4275
+ goog.userAgent.ASSUME_GECKO = !1;
4276
+ goog.userAgent.ASSUME_WEBKIT = !0;
4277
+ goog.userAgent.ASSUME_MOBILE_WEBKIT = !1;
4278
+ goog.userAgent.ASSUME_OPERA = !1;
4279
+ goog.userAgent.ASSUME_ANY_VERSION = !1;
4280
+ 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;
4281
+ goog.userAgent.getUserAgentString = function() {
4282
+ return goog.labs.userAgent.util.getUserAgent();
4303
4283
  };
4304
- goog.structs.Set.prototype.remove = function(a) {
4305
- return this.map_.remove(goog.structs.Set.getKey_(a));
4284
+ goog.userAgent.getNavigator = function() {
4285
+ return goog.global.navigator || null;
4306
4286
  };
4307
- goog.structs.Set.prototype.clear = function() {
4308
- this.map_.clear();
4287
+ goog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_OPERA : goog.labs.userAgent.browser.isOpera();
4288
+ goog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_IE : goog.labs.userAgent.browser.isIE();
4289
+ goog.userAgent.EDGE = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_EDGE : goog.labs.userAgent.engine.isEdge();
4290
+ goog.userAgent.EDGE_OR_IE = goog.userAgent.EDGE || goog.userAgent.IE;
4291
+ goog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_GECKO : goog.labs.userAgent.engine.isGecko();
4292
+ goog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT : goog.labs.userAgent.engine.isWebKit();
4293
+ goog.userAgent.isMobile_ = function() {
4294
+ return goog.userAgent.WEBKIT && goog.labs.userAgent.util.matchUserAgent("Mobile");
4309
4295
  };
4310
- goog.structs.Set.prototype.isEmpty = function() {
4311
- return this.map_.isEmpty();
4296
+ goog.userAgent.MOBILE = goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_();
4297
+ goog.userAgent.SAFARI = goog.userAgent.WEBKIT;
4298
+ goog.userAgent.determinePlatform_ = function() {
4299
+ var a = goog.userAgent.getNavigator();
4300
+ return a && a.platform || "";
4312
4301
  };
4313
- goog.structs.Set.prototype.contains = function(a) {
4314
- return this.map_.containsKey(goog.structs.Set.getKey_(a));
4302
+ goog.userAgent.PLATFORM = goog.userAgent.determinePlatform_();
4303
+ goog.userAgent.ASSUME_MAC = !1;
4304
+ goog.userAgent.ASSUME_WINDOWS = !1;
4305
+ goog.userAgent.ASSUME_LINUX = !1;
4306
+ goog.userAgent.ASSUME_X11 = !1;
4307
+ goog.userAgent.ASSUME_ANDROID = !1;
4308
+ goog.userAgent.ASSUME_IPHONE = !1;
4309
+ goog.userAgent.ASSUME_IPAD = !1;
4310
+ 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;
4311
+ goog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_MAC : goog.labs.userAgent.platform.isMacintosh();
4312
+ goog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_WINDOWS : goog.labs.userAgent.platform.isWindows();
4313
+ goog.userAgent.isLegacyLinux_ = function() {
4314
+ return goog.labs.userAgent.platform.isLinux() || goog.labs.userAgent.platform.isChromeOS();
4315
4315
  };
4316
- goog.structs.Set.prototype.containsAll = function(a) {
4317
- return goog.structs.every(a, this.contains, this);
4316
+ goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_LINUX : goog.userAgent.isLegacyLinux_();
4317
+ goog.userAgent.isX11_ = function() {
4318
+ var a = goog.userAgent.getNavigator();
4319
+ return !!a && goog.string.contains(a.appVersion || "", "X11");
4318
4320
  };
4319
- goog.structs.Set.prototype.intersection = function(a) {
4320
- var b = new goog.structs.Set;
4321
- a = goog.structs.getValues(a);
4322
- for (var c = 0;c < a.length;c++) {
4323
- var d = a[c];
4324
- this.contains(d) && b.add(d);
4321
+ goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_X11 : goog.userAgent.isX11_();
4322
+ goog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_ANDROID : goog.labs.userAgent.platform.isAndroid();
4323
+ goog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPHONE : goog.labs.userAgent.platform.isIphone();
4324
+ goog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPAD : goog.labs.userAgent.platform.isIpad();
4325
+ goog.userAgent.operaVersion_ = function() {
4326
+ var a = goog.global.opera.version;
4327
+ try {
4328
+ return a();
4329
+ } catch (b) {
4330
+ return a;
4325
4331
  }
4326
- return b;
4327
4332
  };
4328
- goog.structs.Set.prototype.difference = function(a) {
4329
- var b = this.clone();
4330
- b.removeAll(a);
4331
- return b;
4333
+ goog.userAgent.determineVersion_ = function() {
4334
+ if (goog.userAgent.OPERA && goog.global.opera) {
4335
+ return goog.userAgent.operaVersion_();
4336
+ }
4337
+ var a = "", b = goog.userAgent.getVersionRegexResult_();
4338
+ b && (a = b ? b[1] : "");
4339
+ return goog.userAgent.IE && (b = goog.userAgent.getDocumentMode_(), b > parseFloat(a)) ? String(b) : a;
4332
4340
  };
4333
- goog.structs.Set.prototype.getValues = function() {
4334
- return this.map_.getValues();
4341
+ goog.userAgent.getVersionRegexResult_ = function() {
4342
+ var a = goog.userAgent.getUserAgentString();
4343
+ if (goog.userAgent.GECKO) {
4344
+ return /rv\:([^\);]+)(\)|;)/.exec(a);
4345
+ }
4346
+ if (goog.userAgent.EDGE) {
4347
+ return /Edge\/([\d\.]+)/.exec(a);
4348
+ }
4349
+ if (goog.userAgent.IE) {
4350
+ return /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);
4351
+ }
4352
+ if (goog.userAgent.WEBKIT) {
4353
+ return /WebKit\/(\S+)/.exec(a);
4354
+ }
4335
4355
  };
4336
- goog.structs.Set.prototype.clone = function() {
4337
- return new goog.structs.Set(this);
4356
+ goog.userAgent.getDocumentMode_ = function() {
4357
+ var a = goog.global.document;
4358
+ return a ? a.documentMode : void 0;
4338
4359
  };
4339
- goog.structs.Set.prototype.equals = function(a) {
4340
- return this.getCount() == goog.structs.getCount(a) && this.isSubsetOf(a);
4360
+ goog.userAgent.VERSION = goog.userAgent.determineVersion_();
4361
+ goog.userAgent.compare = function(a, b) {
4362
+ return goog.string.compareVersions(a, b);
4341
4363
  };
4342
- goog.structs.Set.prototype.isSubsetOf = function(a) {
4343
- var b = goog.structs.getCount(a);
4344
- if (this.getCount() > b) {
4345
- return !1;
4346
- }
4347
- !(a instanceof goog.structs.Set) && 5 < b && (a = new goog.structs.Set(a));
4348
- return goog.structs.every(this, function(b) {
4349
- return goog.structs.contains(a, b);
4350
- });
4364
+ goog.userAgent.isVersionOrHigherCache_ = {};
4365
+ goog.userAgent.isVersionOrHigher = function(a) {
4366
+ return goog.userAgent.ASSUME_ANY_VERSION || goog.userAgent.isVersionOrHigherCache_[a] || (goog.userAgent.isVersionOrHigherCache_[a] = 0 <= goog.string.compareVersions(goog.userAgent.VERSION, a));
4351
4367
  };
4352
- goog.structs.Set.prototype.__iterator__ = function(a) {
4353
- return this.map_.__iterator__(!1);
4368
+ goog.userAgent.isVersion = goog.userAgent.isVersionOrHigher;
4369
+ goog.userAgent.isDocumentModeOrHigher = function(a) {
4370
+ return goog.userAgent.DOCUMENT_MODE >= a;
4354
4371
  };
4372
+ goog.userAgent.isDocumentMode = goog.userAgent.isDocumentModeOrHigher;
4373
+ goog.userAgent.DOCUMENT_MODE = function() {
4374
+ var a = goog.global.document, b = goog.userAgent.getDocumentMode_();
4375
+ return a && goog.userAgent.IE ? b || ("CSS1Compat" == a.compatMode ? parseInt(goog.userAgent.VERSION, 10) : 5) : void 0;
4376
+ }();
4355
4377
  goog.debug.LOGGING_ENABLED = goog.DEBUG;
4356
4378
  goog.debug.catchErrors = function(a, b, c) {
4357
4379
  c = c || goog.global;
@@ -4467,7 +4489,7 @@ goog.debug.normalizeErrorObject = function(a) {
4467
4489
  }
4468
4490
  try {
4469
4491
  d = a.fileName || a.filename || a.sourceURL || goog.global.$googDebugFname || b;
4470
- } catch (g) {
4492
+ } catch (f) {
4471
4493
  d = "Not available", e = !0;
4472
4494
  }
4473
4495
  return !e && a.lineNumber && a.fileName && a.stack && a.message && a.name ? a : {message:a.message || "Not available", name:a.name || "UnknownError", lineNumber:c, fileName:d, stack:a.stack || "Not available"};
@@ -5240,7 +5262,7 @@ goog.dom.getElementsByTagNameAndClass_ = function(a, b, c, d) {
5240
5262
  goog.dom.$$ = goog.dom.getElementsByTagNameAndClass;
5241
5263
  goog.dom.setProperties = function(a, b) {
5242
5264
  goog.object.forEach(b, function(b, d) {
5243
- "style" == d ? a.style.cssText = b : "class" == d ? a.className = b : "for" == d ? a.htmlFor = b : d in goog.dom.DIRECT_ATTRIBUTE_MAP_ ? 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;
5265
+ "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;
5244
5266
  });
5245
5267
  };
5246
5268
  goog.dom.DIRECT_ATTRIBUTE_MAP_ = {cellpadding:"cellPadding", cellspacing:"cellSpacing", colspan:"colSpan", frameborder:"frameBorder", height:"height", maxlength:"maxLength", role:"role", rowspan:"rowSpan", type:"type", usemap:"useMap", valign:"vAlign", width:"width"};
@@ -5483,16 +5505,16 @@ goog.dom.getChildren = function(a) {
5483
5505
  });
5484
5506
  };
5485
5507
  goog.dom.getFirstElementChild = function(a) {
5486
- return void 0 != a.firstElementChild ? a.firstElementChild : goog.dom.getNextElementNode_(a.firstChild, !0);
5508
+ return goog.isDef(a.firstElementChild) ? a.firstElementChild : goog.dom.getNextElementNode_(a.firstChild, !0);
5487
5509
  };
5488
5510
  goog.dom.getLastElementChild = function(a) {
5489
- return void 0 != a.lastElementChild ? a.lastElementChild : goog.dom.getNextElementNode_(a.lastChild, !1);
5511
+ return goog.isDef(a.lastElementChild) ? a.lastElementChild : goog.dom.getNextElementNode_(a.lastChild, !1);
5490
5512
  };
5491
5513
  goog.dom.getNextElementSibling = function(a) {
5492
- return void 0 != a.nextElementSibling ? a.nextElementSibling : goog.dom.getNextElementNode_(a.nextSibling, !0);
5514
+ return goog.isDef(a.nextElementSibling) ? a.nextElementSibling : goog.dom.getNextElementNode_(a.nextSibling, !0);
5493
5515
  };
5494
5516
  goog.dom.getPreviousElementSibling = function(a) {
5495
- return void 0 != a.previousElementSibling ? a.previousElementSibling : goog.dom.getNextElementNode_(a.previousSibling, !1);
5517
+ return goog.isDef(a.previousElementSibling) ? a.previousElementSibling : goog.dom.getNextElementNode_(a.previousSibling, !1);
5496
5518
  };
5497
5519
  goog.dom.getNextElementNode_ = function(a, b) {
5498
5520
  for (;a && a.nodeType != goog.dom.NodeType.ELEMENT;) {
@@ -5826,8 +5848,8 @@ goog.dom.getActiveElement = function(a) {
5826
5848
  return null;
5827
5849
  };
5828
5850
  goog.dom.getPixelRatio = function() {
5829
- var a = goog.dom.getWindow(), b = goog.userAgent.GECKO && goog.userAgent.MOBILE;
5830
- return goog.isDef(a.devicePixelRatio) && !b ? a.devicePixelRatio : a.matchMedia ? goog.dom.matchesPixelRatio_(.75) || goog.dom.matchesPixelRatio_(1.5) || goog.dom.matchesPixelRatio_(2) || goog.dom.matchesPixelRatio_(3) || 1 : 1;
5851
+ var a = goog.dom.getWindow();
5852
+ return goog.isDef(a.devicePixelRatio) ? a.devicePixelRatio : a.matchMedia ? goog.dom.matchesPixelRatio_(.75) || goog.dom.matchesPixelRatio_(1.5) || goog.dom.matchesPixelRatio_(2) || goog.dom.matchesPixelRatio_(3) || 1 : 1;
5831
5853
  };
5832
5854
  goog.dom.matchesPixelRatio_ = function(a) {
5833
5855
  return goog.dom.getWindow().matchMedia("(-webkit-min-device-pixel-ratio: " + a + "),(min--moz-device-pixel-ratio: " + a + "),(min-resolution: " + a + "dppx)").matches ? a : 0;
@@ -5970,11 +5992,7 @@ goog.math.Box = function(a, b, c, d) {
5970
5992
  };
5971
5993
  goog.math.Box.boundingBox = function(a) {
5972
5994
  for (var b = new goog.math.Box(arguments[0].y, arguments[0].x, arguments[0].y, arguments[0].x), c = 1;c < arguments.length;c++) {
5973
- var d = arguments[c];
5974
- b.top = Math.min(b.top, d.y);
5975
- b.right = Math.max(b.right, d.x);
5976
- b.bottom = Math.max(b.bottom, d.y);
5977
- b.left = Math.min(b.left, d.x);
5995
+ b.expandToIncludeCoordinate(arguments[c]);
5978
5996
  }
5979
5997
  return b;
5980
5998
  };
@@ -6003,6 +6021,12 @@ goog.math.Box.prototype.expandToInclude = function(a) {
6003
6021
  this.right = Math.max(this.right, a.right);
6004
6022
  this.bottom = Math.max(this.bottom, a.bottom);
6005
6023
  };
6024
+ goog.math.Box.prototype.expandToIncludeCoordinate = function(a) {
6025
+ this.top = Math.min(this.top, a.y);
6026
+ this.right = Math.max(this.right, a.x);
6027
+ this.bottom = Math.max(this.bottom, a.y);
6028
+ this.left = Math.min(this.left, a.x);
6029
+ };
6006
6030
  goog.math.Box.equals = function(a, b) {
6007
6031
  return a == b ? !0 : a && b ? a.top == b.top && a.right == b.right && a.bottom == b.bottom && a.left == b.left : !1;
6008
6032
  };
@@ -6326,16 +6350,17 @@ goog.style.getVisibleRectForElement = function(a) {
6326
6350
  return 0 <= b.top && 0 <= b.left && b.bottom > b.top && b.right > b.left ? b : null;
6327
6351
  };
6328
6352
  goog.style.getContainerOffsetToScrollInto = function(a, b, c) {
6329
- var d = goog.style.getPageOffset(a), e = goog.style.getPageOffset(b), f = goog.style.getBorderBox(b), g = d.x - e.x - f.left, d = d.y - e.y - f.top, h = b.clientWidth - a.offsetWidth;
6330
- a = b.clientHeight - a.offsetHeight;
6331
- var k = b.scrollLeft, l = b.scrollTop;
6332
- if (b == goog.dom.getDocument().body || b == goog.dom.getDocument().documentElement) {
6333
- k = e.x + f.left, l = e.y + f.top, goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(10) && (k += f.left, l += f.top);
6334
- }
6335
- c ? (k += g - h / 2, l += d - a / 2) : (k += Math.min(g, Math.max(g - h, 0)), l += Math.min(d, Math.max(d - a, 0)));
6336
- return new goog.math.Coordinate(k, l);
6353
+ var d = b || goog.dom.getDocumentScrollElement(), e = goog.style.getPageOffset(a), f = goog.style.getPageOffset(d), g = goog.style.getBorderBox(d);
6354
+ d == goog.dom.getDocumentScrollElement() ? (b = e.x - d.scrollLeft, e = e.y - d.scrollTop, goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(10) && (b += g.left, e += g.top)) : (b = e.x - f.x - g.left, e = e.y - f.y - g.top);
6355
+ g = d.clientWidth - a.offsetWidth;
6356
+ a = d.clientHeight - a.offsetHeight;
6357
+ f = d.scrollLeft;
6358
+ d = d.scrollTop;
6359
+ c ? (f += b - g / 2, d += e - a / 2) : (f += Math.min(b, Math.max(b - g, 0)), d += Math.min(e, Math.max(e - a, 0)));
6360
+ return new goog.math.Coordinate(f, d);
6337
6361
  };
6338
6362
  goog.style.scrollIntoContainerView = function(a, b, c) {
6363
+ b = b || goog.dom.getDocumentScrollElement();
6339
6364
  a = goog.style.getContainerOffsetToScrollInto(a, b, c);
6340
6365
  b.scrollLeft = a.x;
6341
6366
  b.scrollTop = a.y;
@@ -6394,9 +6419,8 @@ goog.style.getClientPosition = function(a) {
6394
6419
  if (a.nodeType == goog.dom.NodeType.ELEMENT) {
6395
6420
  return goog.style.getClientPositionForElement_(a);
6396
6421
  }
6397
- var b = goog.isFunction(a.getBrowserEvent), c = a;
6398
- a.targetTouches && a.targetTouches.length ? c = a.targetTouches[0] : b && a.getBrowserEvent().targetTouches && a.getBrowserEvent().targetTouches.length && (c = a.getBrowserEvent().targetTouches[0]);
6399
- return new goog.math.Coordinate(c.clientX, c.clientY);
6422
+ a = a.changedTouches ? a.changedTouches[0] : a;
6423
+ return new goog.math.Coordinate(a.clientX, a.clientY);
6400
6424
  };
6401
6425
  goog.style.setPageOffset = function(a, b, c) {
6402
6426
  var d = goog.style.getPageOffset(a);
@@ -6681,8 +6705,8 @@ goog.style.getFontSize = function(a) {
6681
6705
  goog.style.parseStyleAttribute = function(a) {
6682
6706
  var b = {};
6683
6707
  goog.array.forEach(a.split(/\s*;\s*/), function(a) {
6684
- a = a.split(/\s*:\s*/);
6685
- 2 == a.length && (b[goog.string.toCamelCase(a[0].toLowerCase())] = a[1]);
6708
+ var d = a.match(/\s*([\w-]+)\s*\:(.+)/);
6709
+ d && (a = d[1], d = goog.string.trim(d[2]), b[goog.string.toCamelCase(a.toLowerCase())] = d);
6686
6710
  });
6687
6711
  return b;
6688
6712
  };
@@ -6693,12 +6717,11 @@ goog.style.toStyleAttribute = function(a) {
6693
6717
  });
6694
6718
  return b.join("");
6695
6719
  };
6696
- goog.style.FLOAT_CSS_PROPERTY_NAME_ = goog.userAgent.IE && !goog.userAgent.isVersionOrHigher(12) ? "styleFloat" : "cssFloat";
6697
6720
  goog.style.setFloat = function(a, b) {
6698
- a.style[goog.style.FLOAT_CSS_PROPERTY_NAME_] = b;
6721
+ a.style[goog.userAgent.IE ? "styleFloat" : "cssFloat"] = b;
6699
6722
  };
6700
6723
  goog.style.getFloat = function(a) {
6701
- return a.style[goog.style.FLOAT_CSS_PROPERTY_NAME_] || "";
6724
+ return a.style[goog.userAgent.IE ? "styleFloat" : "cssFloat"] || "";
6702
6725
  };
6703
6726
  goog.style.getScrollbarWidth = function(a) {
6704
6727
  var b = goog.dom.createElement(goog.dom.TagName.DIV);
@@ -6956,6 +6979,7 @@ goog.json.Serializer.prototype.serializeInternal = function(a, b) {
6956
6979
  b.push(a);
6957
6980
  break;
6958
6981
  case "function":
6982
+ b.push("null");
6959
6983
  break;
6960
6984
  default:
6961
6985
  throw Error("Unknown type: " + typeof a);;