selenium-webdriver 4.0.0.alpha6 → 4.0.0.alpha7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +41 -4
  3. data/lib/selenium/server.rb +22 -6
  4. data/lib/selenium/webdriver.rb +1 -1
  5. data/lib/selenium/webdriver/atoms/findElements.js +89 -90
  6. data/lib/selenium/webdriver/atoms/getAttribute.js +79 -59
  7. data/lib/selenium/webdriver/atoms/isDisplayed.js +72 -72
  8. data/lib/selenium/webdriver/atoms/mutationListener.js +38 -0
  9. data/lib/selenium/webdriver/chrome/driver.rb +8 -1
  10. data/lib/selenium/webdriver/chrome/options.rb +1 -1
  11. data/lib/selenium/webdriver/chrome/profile.rb +1 -1
  12. data/lib/selenium/webdriver/common.rb +3 -1
  13. data/lib/selenium/webdriver/common/driver.rb +5 -0
  14. data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +89 -0
  15. data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +2 -1
  16. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +143 -0
  17. data/lib/selenium/webdriver/common/element.rb +5 -0
  18. data/lib/selenium/webdriver/common/options.rb +3 -3
  19. data/lib/selenium/webdriver/common/platform.rb +1 -1
  20. data/lib/selenium/webdriver/common/takes_screenshot.rb +63 -0
  21. data/lib/selenium/webdriver/devtools.rb +18 -4
  22. data/lib/selenium/webdriver/devtools/console_event.rb +38 -0
  23. data/lib/selenium/webdriver/devtools/exception_event.rb +36 -0
  24. data/lib/selenium/webdriver/devtools/mutation_event.rb +37 -0
  25. data/lib/selenium/webdriver/devtools/v84/accessibility.rb +64 -0
  26. data/lib/selenium/webdriver/devtools/v84/animation.rb +100 -0
  27. data/lib/selenium/webdriver/devtools/v84/application_cache.rb +66 -0
  28. data/lib/selenium/webdriver/devtools/{audits.rb → v84/audits.rb} +33 -31
  29. data/lib/selenium/webdriver/devtools/v84/background_service.rb +69 -0
  30. data/lib/selenium/webdriver/devtools/v84/browser.rb +125 -0
  31. data/lib/selenium/webdriver/devtools/v84/cache_storage.rb +75 -0
  32. data/lib/selenium/webdriver/devtools/v84/cast.rb +72 -0
  33. data/lib/selenium/webdriver/devtools/v84/console.rb +59 -0
  34. data/lib/selenium/webdriver/devtools/v84/css.rb +167 -0
  35. data/lib/selenium/webdriver/devtools/v84/database.rb +66 -0
  36. data/lib/selenium/webdriver/devtools/v84/debugger.rb +231 -0
  37. data/lib/selenium/webdriver/devtools/{device_orientation.rb → v84/device_orientation.rb} +20 -18
  38. data/lib/selenium/webdriver/devtools/v84/dom.rb +322 -0
  39. data/lib/selenium/webdriver/devtools/v84/dom_debugger.rb +95 -0
  40. data/lib/selenium/webdriver/devtools/v84/dom_snapshot.rb +67 -0
  41. data/lib/selenium/webdriver/devtools/v84/dom_storage.rb +81 -0
  42. data/lib/selenium/webdriver/devtools/v84/emulation.rb +182 -0
  43. data/lib/selenium/webdriver/devtools/v84/fetch.rb +99 -0
  44. data/lib/selenium/webdriver/devtools/v84/headless_experimental.rb +63 -0
  45. data/lib/selenium/webdriver/devtools/v84/heap_profiler.rb +109 -0
  46. data/lib/selenium/webdriver/devtools/v84/indexed_db.rb +102 -0
  47. data/lib/selenium/webdriver/devtools/v84/input.rb +142 -0
  48. data/lib/selenium/webdriver/devtools/{inspector.rb → v84/inspector.rb} +22 -20
  49. data/lib/selenium/webdriver/devtools/{io.rb → v84/io.rb} +25 -23
  50. data/lib/selenium/webdriver/devtools/v84/layer_tree.rb +97 -0
  51. data/lib/selenium/webdriver/devtools/{database.rb → v84/log.rb} +33 -29
  52. data/lib/selenium/webdriver/devtools/{media.rb → v84/media.rb} +29 -27
  53. data/lib/selenium/webdriver/devtools/v84/memory.rb +88 -0
  54. data/lib/selenium/webdriver/devtools/v84/network.rb +230 -0
  55. data/lib/selenium/webdriver/devtools/v84/overlay.rb +159 -0
  56. data/lib/selenium/webdriver/devtools/v84/page.rb +376 -0
  57. data/lib/selenium/webdriver/devtools/{performance.rb → v84/performance.rb} +28 -26
  58. data/lib/selenium/webdriver/devtools/v84/profiler.rb +113 -0
  59. data/lib/selenium/webdriver/devtools/v84/runtime.rb +195 -0
  60. data/lib/selenium/webdriver/devtools/{schema.rb → v84/schema.rb} +14 -12
  61. data/lib/selenium/webdriver/devtools/v84/security.rb +73 -0
  62. data/lib/selenium/webdriver/devtools/v84/service_worker.rb +118 -0
  63. data/lib/selenium/webdriver/devtools/v84/storage.rb +97 -0
  64. data/lib/selenium/webdriver/devtools/{system_info.rb → v84/system_info.rb} +17 -15
  65. data/lib/selenium/webdriver/devtools/v84/target.rb +143 -0
  66. data/lib/selenium/webdriver/devtools/v84/tethering.rb +57 -0
  67. data/lib/selenium/webdriver/devtools/v84/tracing.rb +78 -0
  68. data/lib/selenium/webdriver/devtools/v84/web_audio.rb +72 -0
  69. data/lib/selenium/webdriver/devtools/v84/web_authn.rb +96 -0
  70. data/lib/selenium/webdriver/devtools/v85/accessibility.rb +64 -0
  71. data/lib/selenium/webdriver/devtools/v85/animation.rb +100 -0
  72. data/lib/selenium/webdriver/devtools/v85/application_cache.rb +66 -0
  73. data/lib/selenium/webdriver/devtools/v85/audits.rb +63 -0
  74. data/lib/selenium/webdriver/devtools/v85/background_service.rb +69 -0
  75. data/lib/selenium/webdriver/devtools/v85/browser.rb +125 -0
  76. data/lib/selenium/webdriver/devtools/v85/cache_storage.rb +75 -0
  77. data/lib/selenium/webdriver/devtools/v85/cast.rb +72 -0
  78. data/lib/selenium/webdriver/devtools/v85/console.rb +59 -0
  79. data/lib/selenium/webdriver/devtools/v85/css.rb +167 -0
  80. data/lib/selenium/webdriver/devtools/v85/database.rb +66 -0
  81. data/lib/selenium/webdriver/devtools/v85/debugger.rb +231 -0
  82. data/lib/selenium/webdriver/devtools/v85/device_orientation.rb +55 -0
  83. data/lib/selenium/webdriver/devtools/v85/dom.rb +322 -0
  84. data/lib/selenium/webdriver/devtools/v85/dom_debugger.rb +95 -0
  85. data/lib/selenium/webdriver/devtools/v85/dom_snapshot.rb +67 -0
  86. data/lib/selenium/webdriver/devtools/v85/dom_storage.rb +81 -0
  87. data/lib/selenium/webdriver/devtools/v85/emulation.rb +182 -0
  88. data/lib/selenium/webdriver/devtools/v85/fetch.rb +99 -0
  89. data/lib/selenium/webdriver/devtools/v85/headless_experimental.rb +63 -0
  90. data/lib/selenium/webdriver/devtools/v85/heap_profiler.rb +109 -0
  91. data/lib/selenium/webdriver/devtools/v85/indexed_db.rb +102 -0
  92. data/lib/selenium/webdriver/devtools/v85/input.rb +143 -0
  93. data/lib/selenium/webdriver/devtools/v85/inspector.rb +57 -0
  94. data/lib/selenium/webdriver/devtools/{log.rb → v85/io.rb} +33 -38
  95. data/lib/selenium/webdriver/devtools/v85/layer_tree.rb +97 -0
  96. data/lib/selenium/webdriver/devtools/v85/log.rb +68 -0
  97. data/lib/selenium/webdriver/devtools/v85/media.rb +59 -0
  98. data/lib/selenium/webdriver/devtools/v85/memory.rb +88 -0
  99. data/lib/selenium/webdriver/devtools/v85/network.rb +230 -0
  100. data/lib/selenium/webdriver/devtools/v85/overlay.rb +160 -0
  101. data/lib/selenium/webdriver/devtools/v85/page.rb +376 -0
  102. data/lib/selenium/webdriver/devtools/v85/performance.rb +65 -0
  103. data/lib/selenium/webdriver/devtools/v85/profiler.rb +113 -0
  104. data/lib/selenium/webdriver/devtools/v85/runtime.rb +196 -0
  105. data/lib/selenium/webdriver/devtools/v85/schema.rb +48 -0
  106. data/lib/selenium/webdriver/devtools/v85/security.rb +73 -0
  107. data/lib/selenium/webdriver/devtools/v85/service_worker.rb +118 -0
  108. data/lib/selenium/webdriver/devtools/v85/storage.rb +97 -0
  109. data/lib/selenium/webdriver/devtools/{console.rb → v85/system_info.rb} +19 -24
  110. data/lib/selenium/webdriver/devtools/v85/target.rb +145 -0
  111. data/lib/selenium/webdriver/devtools/v85/tethering.rb +57 -0
  112. data/lib/selenium/webdriver/devtools/v85/tracing.rb +78 -0
  113. data/lib/selenium/webdriver/devtools/v85/web_audio.rb +72 -0
  114. data/lib/selenium/webdriver/devtools/v85/web_authn.rb +96 -0
  115. data/lib/selenium/webdriver/devtools/v86/accessibility.rb +64 -0
  116. data/lib/selenium/webdriver/devtools/v86/animation.rb +100 -0
  117. data/lib/selenium/webdriver/devtools/v86/application_cache.rb +66 -0
  118. data/lib/selenium/webdriver/devtools/v86/audits.rb +63 -0
  119. data/lib/selenium/webdriver/devtools/v86/background_service.rb +69 -0
  120. data/lib/selenium/webdriver/devtools/v86/browser.rb +125 -0
  121. data/lib/selenium/webdriver/devtools/v86/cache_storage.rb +75 -0
  122. data/lib/selenium/webdriver/devtools/v86/cast.rb +72 -0
  123. data/lib/selenium/webdriver/devtools/v86/console.rb +59 -0
  124. data/lib/selenium/webdriver/devtools/v86/css.rb +181 -0
  125. data/lib/selenium/webdriver/devtools/v86/database.rb +66 -0
  126. data/lib/selenium/webdriver/devtools/v86/debugger.rb +233 -0
  127. data/lib/selenium/webdriver/devtools/v86/device_orientation.rb +55 -0
  128. data/lib/selenium/webdriver/devtools/v86/dom.rb +329 -0
  129. data/lib/selenium/webdriver/devtools/v86/dom_debugger.rb +95 -0
  130. data/lib/selenium/webdriver/devtools/v86/dom_snapshot.rb +67 -0
  131. data/lib/selenium/webdriver/devtools/v86/dom_storage.rb +81 -0
  132. data/lib/selenium/webdriver/devtools/v86/emulation.rb +193 -0
  133. data/lib/selenium/webdriver/devtools/v86/fetch.rb +99 -0
  134. data/lib/selenium/webdriver/devtools/v86/headless_experimental.rb +63 -0
  135. data/lib/selenium/webdriver/devtools/v86/heap_profiler.rb +109 -0
  136. data/lib/selenium/webdriver/devtools/v86/indexed_db.rb +102 -0
  137. data/lib/selenium/webdriver/devtools/v86/input.rb +143 -0
  138. data/lib/selenium/webdriver/devtools/v86/inspector.rb +57 -0
  139. data/lib/selenium/webdriver/devtools/v86/io.rb +61 -0
  140. data/lib/selenium/webdriver/devtools/v86/layer_tree.rb +97 -0
  141. data/lib/selenium/webdriver/devtools/v86/log.rb +68 -0
  142. data/lib/selenium/webdriver/devtools/v86/media.rb +59 -0
  143. data/lib/selenium/webdriver/devtools/v86/memory.rb +88 -0
  144. data/lib/selenium/webdriver/devtools/v86/network.rb +235 -0
  145. data/lib/selenium/webdriver/devtools/v86/overlay.rb +183 -0
  146. data/lib/selenium/webdriver/devtools/v86/page.rb +376 -0
  147. data/lib/selenium/webdriver/devtools/v86/performance.rb +65 -0
  148. data/lib/selenium/webdriver/devtools/v86/profiler.rb +113 -0
  149. data/lib/selenium/webdriver/devtools/v86/runtime.rb +196 -0
  150. data/lib/selenium/webdriver/devtools/v86/schema.rb +48 -0
  151. data/lib/selenium/webdriver/devtools/v86/security.rb +73 -0
  152. data/lib/selenium/webdriver/devtools/v86/service_worker.rb +118 -0
  153. data/lib/selenium/webdriver/devtools/v86/storage.rb +97 -0
  154. data/lib/selenium/webdriver/devtools/{tethering.rb → v86/system_info.rb} +19 -22
  155. data/lib/selenium/webdriver/devtools/v86/target.rb +145 -0
  156. data/lib/selenium/webdriver/devtools/v86/tethering.rb +57 -0
  157. data/lib/selenium/webdriver/devtools/v86/tracing.rb +78 -0
  158. data/lib/selenium/webdriver/devtools/v86/web_audio.rb +72 -0
  159. data/lib/selenium/webdriver/devtools/v86/web_authn.rb +102 -0
  160. data/lib/selenium/webdriver/devtools/v87/accessibility.rb +73 -0
  161. data/lib/selenium/webdriver/devtools/v87/animation.rb +100 -0
  162. data/lib/selenium/webdriver/devtools/v87/application_cache.rb +66 -0
  163. data/lib/selenium/webdriver/devtools/v87/audits.rb +63 -0
  164. data/lib/selenium/webdriver/devtools/v87/background_service.rb +69 -0
  165. data/lib/selenium/webdriver/devtools/v87/browser.rb +125 -0
  166. data/lib/selenium/webdriver/devtools/v87/cache_storage.rb +75 -0
  167. data/lib/selenium/webdriver/devtools/v87/cast.rb +72 -0
  168. data/lib/selenium/webdriver/devtools/v87/console.rb +59 -0
  169. data/lib/selenium/webdriver/devtools/v87/css.rb +181 -0
  170. data/lib/selenium/webdriver/devtools/v87/database.rb +66 -0
  171. data/lib/selenium/webdriver/devtools/v87/debugger.rb +233 -0
  172. data/lib/selenium/webdriver/devtools/v87/device_orientation.rb +55 -0
  173. data/lib/selenium/webdriver/devtools/v87/dom.rb +329 -0
  174. data/lib/selenium/webdriver/devtools/v87/dom_debugger.rb +95 -0
  175. data/lib/selenium/webdriver/devtools/v87/dom_snapshot.rb +67 -0
  176. data/lib/selenium/webdriver/devtools/v87/dom_storage.rb +81 -0
  177. data/lib/selenium/webdriver/devtools/v87/emulation.rb +193 -0
  178. data/lib/selenium/webdriver/devtools/v87/fetch.rb +99 -0
  179. data/lib/selenium/webdriver/devtools/v87/headless_experimental.rb +63 -0
  180. data/lib/selenium/webdriver/devtools/v87/heap_profiler.rb +109 -0
  181. data/lib/selenium/webdriver/devtools/v87/indexed_db.rb +102 -0
  182. data/lib/selenium/webdriver/devtools/v87/input.rb +143 -0
  183. data/lib/selenium/webdriver/devtools/v87/inspector.rb +57 -0
  184. data/lib/selenium/webdriver/devtools/v87/io.rb +61 -0
  185. data/lib/selenium/webdriver/devtools/v87/layer_tree.rb +97 -0
  186. data/lib/selenium/webdriver/devtools/v87/log.rb +68 -0
  187. data/lib/selenium/webdriver/devtools/v87/media.rb +59 -0
  188. data/lib/selenium/webdriver/devtools/v87/memory.rb +88 -0
  189. data/lib/selenium/webdriver/devtools/v87/network.rb +247 -0
  190. data/lib/selenium/webdriver/devtools/v87/overlay.rb +183 -0
  191. data/lib/selenium/webdriver/devtools/v87/page.rb +376 -0
  192. data/lib/selenium/webdriver/devtools/v87/performance.rb +65 -0
  193. data/lib/selenium/webdriver/devtools/v87/profiler.rb +125 -0
  194. data/lib/selenium/webdriver/devtools/v87/runtime.rb +196 -0
  195. data/lib/selenium/webdriver/devtools/v87/schema.rb +48 -0
  196. data/lib/selenium/webdriver/devtools/v87/security.rb +73 -0
  197. data/lib/selenium/webdriver/devtools/v87/service_worker.rb +118 -0
  198. data/lib/selenium/webdriver/devtools/v87/storage.rb +97 -0
  199. data/lib/selenium/webdriver/devtools/v87/system_info.rb +52 -0
  200. data/lib/selenium/webdriver/devtools/v87/target.rb +145 -0
  201. data/lib/selenium/webdriver/devtools/v87/tethering.rb +57 -0
  202. data/lib/selenium/webdriver/devtools/v87/tracing.rb +78 -0
  203. data/lib/selenium/webdriver/devtools/v87/web_audio.rb +72 -0
  204. data/lib/selenium/webdriver/devtools/v87/web_authn.rb +102 -0
  205. data/lib/selenium/webdriver/edge.rb +2 -2
  206. data/lib/selenium/webdriver/edge_chrome/driver.rb +6 -0
  207. data/lib/selenium/webdriver/edge_chrome/options.rb +2 -1
  208. data/lib/selenium/webdriver/edge_html/driver.rb +1 -2
  209. data/lib/selenium/webdriver/firefox/driver.rb +0 -1
  210. data/lib/selenium/webdriver/ie/driver.rb +0 -1
  211. data/lib/selenium/webdriver/ie/options.rb +1 -1
  212. data/lib/selenium/webdriver/remote/bridge.rb +4 -0
  213. data/lib/selenium/webdriver/remote/capabilities.rb +4 -2
  214. data/lib/selenium/webdriver/remote/driver.rb +0 -1
  215. data/lib/selenium/webdriver/remote/http/default.rb +1 -2
  216. data/lib/selenium/webdriver/safari.rb +7 -0
  217. data/lib/selenium/webdriver/safari/driver.rb +0 -1
  218. data/lib/selenium/webdriver/version.rb +1 -1
  219. data/selenium-webdriver.gemspec +3 -3
  220. metadata +193 -52
  221. data/lib/selenium/webdriver/devtools/accessibility.rb +0 -62
  222. data/lib/selenium/webdriver/devtools/animation.rb +0 -98
  223. data/lib/selenium/webdriver/devtools/application_cache.rb +0 -64
  224. data/lib/selenium/webdriver/devtools/background_service.rb +0 -67
  225. data/lib/selenium/webdriver/devtools/browser.rb +0 -123
  226. data/lib/selenium/webdriver/devtools/cache_storage.rb +0 -73
  227. data/lib/selenium/webdriver/devtools/cast.rb +0 -70
  228. data/lib/selenium/webdriver/devtools/css.rb +0 -165
  229. data/lib/selenium/webdriver/devtools/debugger.rb +0 -229
  230. data/lib/selenium/webdriver/devtools/dom.rb +0 -320
  231. data/lib/selenium/webdriver/devtools/domdebugger.rb +0 -93
  232. data/lib/selenium/webdriver/devtools/domsnapshot.rb +0 -65
  233. data/lib/selenium/webdriver/devtools/domstorage.rb +0 -79
  234. data/lib/selenium/webdriver/devtools/emulation.rb +0 -180
  235. data/lib/selenium/webdriver/devtools/fetch.rb +0 -97
  236. data/lib/selenium/webdriver/devtools/headless_experimental.rb +0 -61
  237. data/lib/selenium/webdriver/devtools/heap_profiler.rb +0 -107
  238. data/lib/selenium/webdriver/devtools/indexed_db.rb +0 -100
  239. data/lib/selenium/webdriver/devtools/input.rb +0 -140
  240. data/lib/selenium/webdriver/devtools/layer_tree.rb +0 -95
  241. data/lib/selenium/webdriver/devtools/memory.rb +0 -86
  242. data/lib/selenium/webdriver/devtools/network.rb +0 -228
  243. data/lib/selenium/webdriver/devtools/overlay.rb +0 -157
  244. data/lib/selenium/webdriver/devtools/page.rb +0 -374
  245. data/lib/selenium/webdriver/devtools/profiler.rb +0 -111
  246. data/lib/selenium/webdriver/devtools/runtime.rb +0 -193
  247. data/lib/selenium/webdriver/devtools/security.rb +0 -71
  248. data/lib/selenium/webdriver/devtools/service_worker.rb +0 -116
  249. data/lib/selenium/webdriver/devtools/storage.rb +0 -95
  250. data/lib/selenium/webdriver/devtools/target.rb +0 -141
  251. data/lib/selenium/webdriver/devtools/tracing.rb +0 -76
  252. data/lib/selenium/webdriver/devtools/web_audio.rb +0 -70
  253. data/lib/selenium/webdriver/devtools/web_authn.rb +0 -94
  254. data/lib/selenium/webdriver/support/cdp_client_generator.rb +0 -77
@@ -1,7 +1,7 @@
1
- function(){return (function(){var k=this;function l(a){return void 0!==a}function n(a){return"string"==typeof a}function aa(a,b){a=a.split(".");var c=k;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&l(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}}
2
- function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
3
- else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a,b,c){return a.call.apply(a.bind,arguments)}function da(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}
4
- function ea(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea=ca:ea=da;return ea.apply(null,arguments)}function fa(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};/*
1
+ function(){return (function(){var k=this||self;function aa(a){return"string"==typeof a}function ba(a,b){a=a.split(".");var c=k;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b}
2
+ function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
3
+ else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a,b,c){return a.call.apply(a.bind,arguments)}function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}
4
+ function fa(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa=da:fa=ea;return fa.apply(null,arguments)}function ha(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function l(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};/*
5
5
 
6
6
  The MIT License
7
7
 
@@ -26,75 +26,75 @@ function ea(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString
26
26
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
27
  IN THE SOFTWARE.
28
28
  */
29
- function ha(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var ia=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if(n(a))return n(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},u=Array.prototype.forEach?function(a,b){Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)},ja=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,b,void 0)}:function(a,
30
- b){for(var c=a.length,d=[],e=0,f=n(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d},ka=Array.prototype.reduce?function(a,b,c){return Array.prototype.reduce.call(a,b,c)}:function(a,b,c){var d=c;u(a,function(e,f){d=b.call(void 0,d,e,f,a)});return d},la=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1},ma=Array.prototype.every?
31
- function(a,b){return Array.prototype.every.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0};function na(a,b){a:{for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:n(a)?a.charAt(b):a[b]}function oa(a){return Array.prototype.concat.apply([],arguments)}
32
- function pa(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var qa=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};function ra(a,b){return a<b?-1:a>b?1:0};var v;a:{var sa=k.navigator;if(sa){var ta=sa.userAgent;if(ta){v=ta;break a}}v=""}function x(a){return-1!=v.indexOf(a)};function ua(){return x("Firefox")||x("FxiOS")}function va(){return(x("Chrome")||x("CriOS"))&&!x("Edge")};function wa(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function xa(){return x("iPhone")&&!x("iPod")&&!x("iPad")};function ya(a,b){var c=za;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var Aa=x("Opera"),y=x("Trident")||x("MSIE"),Ba=x("Edge"),Ca=x("Gecko")&&!(-1!=v.toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),Da=-1!=v.toLowerCase().indexOf("webkit")&&!x("Edge");function Ea(){var a=k.document;return a?a.documentMode:void 0}var Fa;
33
- a:{var Ga="",Ha=function(){var a=v;if(Ca)return/rv:([^\);]+)(\)|;)/.exec(a);if(Ba)return/Edge\/([\d\.]+)/.exec(a);if(y)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Da)return/WebKit\/(\S+)/.exec(a);if(Aa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Ha&&(Ga=Ha?Ha[1]:"");if(y){var Ia=Ea();if(null!=Ia&&Ia>parseFloat(Ga)){Fa=String(Ia);break a}}Fa=Ga}var za={};
34
- function Ja(a){return ya(a,function(){for(var b=0,c=qa(String(Fa)).split("."),d=qa(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",h=d[f]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==g[0].length&&0==h[0].length)break;b=ra(0==g[1].length?0:parseInt(g[1],10),0==h[1].length?0:parseInt(h[1],10))||ra(0==g[2].length,0==h[2].length)||ra(g[2],h[2]);g=g[3];h=h[3]}while(0==b)}return 0<=b})}var Ka;var La=k.document;
35
- Ka=La&&y?Ea()||("CSS1Compat"==La.compatMode?parseInt(Fa,10):5):void 0;var z=y&&!(9<=Number(Ka)),Ma=y&&!(8<=Number(Ka));function Na(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Oa(a,b){var c=Ma&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Na(b,a,b.nodeName,c)};function Pa(a){this.b=a;this.a=0}function Qa(a){a=a.match(Ra);for(var b=0;b<a.length;b++)Sa.test(a[b])&&a.splice(b,1);return new Pa(a)}var Ra=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,Sa=/^\s/;function A(a,b){return a.b[a.a+(b||0)]}function B(a){return a.b[a.a++]}function Ta(a){return a.b.length<=a.a};function Ua(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}Ua.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};Ua.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};Ua.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Va(a,b){this.width=a;this.height=b}Va.prototype.aspectRatio=function(){return this.width/this.height};Va.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Va.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Va.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Wa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
36
- function Xa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(y&&!(9<=Number(Ka))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ya(a,b):!c&&Wa(e,b)?-1*Za(a,b):!d&&Wa(f,a)?Za(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=C(a);c=d.createRange();
37
- c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b);a.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,a)}function Za(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return Ya(b,a)}function Ya(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function C(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function $a(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}
38
- function ab(a){this.a=a||k.document||document}ab.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(z&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;c=0;var d=[];for(b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),z&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return b}
39
- function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Ma&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function bb(a,b,c,d,e){return(z?cb:db).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new G)}
40
- function cb(a,b,c,d,e){if(a instanceof eb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=fb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)F(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||e.add(b);return e}gb(a,b,c,d,e);return e}
41
- function db(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!y?(b=b.getElementsByName(d),u(b,function(f){a.a(f)&&e.add(f)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),u(b,function(f){f.className==d&&a.a(f)&&e.add(f)})):a instanceof H?gb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),u(b,function(f){F(f,c,d)&&e.add(f)}));return e}
42
- function hb(a,b,c,d,e){var f;if((a instanceof eb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=fb(a);if("*"!=g&&(f=ja(f,function(h){return h.tagName&&h.tagName.toLowerCase()==g}),!f))return e;c&&(f=ja(f,function(h){return F(h,c,d)}));u(f,function(h){"*"==g&&("!"==h.tagName||"*"==g&&1!=h.nodeType)||e.add(h)});return e}return ib(a,b,c,d,e)}function ib(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&e.add(b);return e}
43
- function gb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&e.add(b),gb(a,b,c,d,e)}function fb(a){if(a instanceof H){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function G(){this.b=this.a=null;this.l=0}function jb(a){this.f=a;this.a=this.b=null}function lb(a,b){if(!a.a)return b;if(!b.a)return a;var c=a.a;b=b.a;for(var d=null,e,f=0;c&&b;){e=c.f;var g=b.f;e==g||e instanceof Na&&g instanceof Na&&e.a==g.a?(e=c,c=c.a,b=b.a):0<Xa(c.f,b.f)?(e=b,b=b.a):(e=c,c=c.a);(e.b=d)?d.a=e:a.a=e;d=e;f++}for(e=c||b;e;)e.b=d,d=d.a=e,f++,e=e.a;a.b=d;a.l=f;return a}function mb(a,b){b=new jb(b);b.a=a.a;a.b?a.a.b=b:a.a=a.b=b;a.a=b;a.l++}
44
- G.prototype.add=function(a){a=new jb(a);a.b=this.b;this.a?this.b.a=a:this.a=this.b=a;this.b=a;this.l++};function nb(a){return(a=a.a)?a.f:null}function ob(a){return(a=nb(a))?E(a):""}function I(a,b){return new pb(a,!!b)}function pb(a,b){this.f=a;this.b=(this.s=b)?a.b:a.a;this.a=null}function J(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.s?b.b:b.a;return c.f};function K(a){this.i=a;this.b=this.g=!1;this.f=null}function L(a){return"\n "+a.toString().split("\n").join("\n ")}function qb(a,b){a.g=b}function rb(a,b){a.b=b}function O(a,b){a=a.a(b);return a instanceof G?+ob(a):+a}function P(a,b){a=a.a(b);return a instanceof G?ob(a):""+a}function sb(a,b){a=a.a(b);return a instanceof G?!!a.l:!!a};function tb(a,b,c){K.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==ub&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,u:b}):this.f={name:b.f.name,u:c})}t(tb,K);
45
- function vb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=I(b);for(d=J(b);d;d=J(b))for(e=I(c),f=J(e);f;f=J(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=I(e);for(var g=typeof d,h=J(f);h;h=J(f)){switch(g){case "number":h=+E(h);break;case "boolean":h=!!E(h);break;case "string":h=E(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e?"boolean"==
46
- typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}tb.prototype.a=function(a){return this.c.m(this.h,this.o,a)};tb.prototype.toString=function(){var a="Binary Expression: "+this.c;a+=L(this.h);return a+=L(this.o)};function wb(a,b,c,d){this.H=a;this.C=b;this.i=c;this.m=d}wb.prototype.toString=function(){return this.H};var xb={};
47
- function Q(a,b,c,d){if(xb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new wb(a,b,c,d);return xb[a.toString()]=a}Q("div",6,1,function(a,b,c){return O(a,c)/O(b,c)});Q("mod",6,1,function(a,b,c){return O(a,c)%O(b,c)});Q("*",6,1,function(a,b,c){return O(a,c)*O(b,c)});Q("+",5,1,function(a,b,c){return O(a,c)+O(b,c)});Q("-",5,1,function(a,b,c){return O(a,c)-O(b,c)});Q("<",4,2,function(a,b,c){return vb(function(d,e){return d<e},a,b,c)});
48
- Q(">",4,2,function(a,b,c){return vb(function(d,e){return d>e},a,b,c)});Q("<=",4,2,function(a,b,c){return vb(function(d,e){return d<=e},a,b,c)});Q(">=",4,2,function(a,b,c){return vb(function(d,e){return d>=e},a,b,c)});var ub=Q("=",3,2,function(a,b,c){return vb(function(d,e){return d==e},a,b,c,!0)});Q("!=",3,2,function(a,b,c){return vb(function(d,e){return d!=e},a,b,c,!0)});Q("and",2,2,function(a,b,c){return sb(a,c)&&sb(b,c)});Q("or",1,2,function(a,b,c){return sb(a,c)||sb(b,c)});function yb(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}t(yb,K);yb.prototype.a=function(a){a=this.c.a(a);return zb(this.h,a)};yb.prototype.toString=function(){var a="Filter:"+L(this.c);return a+=L(this.h)};function Ab(a,b){if(b.length<a.B)throw Error("Function "+a.j+" expects at least"+a.B+" arguments, "+b.length+" given");if(null!==a.A&&b.length>a.A)throw Error("Function "+a.j+" expects at most "+a.A+" arguments, "+b.length+" given");a.G&&u(b,function(c,d){if(4!=c.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+c);});K.call(this,a.i);this.v=a;this.c=b;qb(this,a.g||la(b,function(c){return c.g}));rb(this,a.F&&!b.length||a.D&&!!b.length||la(b,function(c){return c.b}))}
49
- t(Ab,K);Ab.prototype.a=function(a){return this.v.m.apply(null,oa(a,this.c))};Ab.prototype.toString=function(){var a="Function: "+this.v;if(this.c.length){var b=ka(this.c,function(c,d){return c+L(d)},"Arguments:");a+=L(b)}return a};function Bb(a,b,c,d,e,f,g,h){this.j=a;this.i=b;this.g=c;this.F=d;this.D=!1;this.m=e;this.B=f;this.A=l(g)?g:f;this.G=!!h}Bb.prototype.toString=function(){return this.j};var Cb={};
50
- function R(a,b,c,d,e,f,g,h){if(Cb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Cb[a]=new Bb(a,b,c,d,e,f,g,h)}R("boolean",2,!1,!1,function(a,b){return sb(b,a)},1);R("ceiling",1,!1,!1,function(a,b){return Math.ceil(O(b,a))},1);R("concat",3,!1,!1,function(a,b){return ka(pa(arguments,1),function(c,d){return c+P(d,a)},"")},2,null);R("contains",2,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);return-1!=b.indexOf(a)},2);R("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0);
51
- R("false",2,!1,!1,function(){return!1},0);R("floor",1,!1,!1,function(a,b){return Math.floor(O(b,a))},1);R("id",4,!1,!1,function(a,b){function c(h){if(z){var m=e.all[h];if(m){if(m.nodeType&&h==m.id)return m;if(m.length)return na(m,function(w){return h==w.id})}return null}return e.getElementById(h)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument;a=P(b,a).split(/\s+/);var f=[];u(a,function(h){h=c(h);!h||0<=ia(f,h)||f.push(h)});f.sort(Xa);var g=new G;u(f,function(h){g.add(h)});return g},1);
52
- R("lang",2,!1,!1,function(){return!1},1);R("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);R("local-name",3,!1,!0,function(a,b){return(a=b?nb(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);R("name",3,!1,!0,function(a,b){return(a=b?nb(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);R("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
53
- R("normalize-space",3,!1,!0,function(a,b){return(b?P(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);R("not",2,!1,!1,function(a,b){return!sb(b,a)},1);R("number",1,!1,!0,function(a,b){return b?O(b,a):+E(a.a)},0,1);R("position",1,!0,!1,function(a){return a.b},0);R("round",1,!1,!1,function(a,b){return Math.round(O(b,a))},1);R("starts-with",2,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);return 0==b.lastIndexOf(a,0)},2);R("string",3,!1,!0,function(a,b){return b?P(b,a):E(a.a)},0,1);
54
- R("string-length",1,!1,!0,function(a,b){return(b?P(b,a):E(a.a)).length},0,1);R("substring",3,!1,!1,function(a,b,c,d){c=O(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?O(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=P(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);R("substring-after",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
55
- R("substring-before",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);R("sum",1,!1,!1,function(a,b){a=I(b.a(a));b=0;for(var c=J(a);c;c=J(a))b+=+E(c);return b},1,1,!0);R("translate",3,!1,!1,function(a,b,c,d){b=P(b,a);c=P(c,a);var e=P(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);R("true",2,!1,!1,function(){return!0},0);function H(a,b){this.h=a;this.c=l(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Db(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}H.prototype.a=function(a){return null===this.b||this.b==a.nodeType};H.prototype.f=function(){return this.h};
56
- H.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=L(this.c));return a};function Eb(a){K.call(this,3);this.c=a.substring(1,a.length-1)}t(Eb,K);Eb.prototype.a=function(){return this.c};Eb.prototype.toString=function(){return"Literal: "+this.c};function eb(a,b){this.j=a.toLowerCase();a="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():a}eb.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=l(a.localName)?a.localName:a.nodeName;return"*"!=this.j&&this.j!=b.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};eb.prototype.f=function(){return this.j};
57
- eb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function Fb(a){K.call(this,1);this.c=a}t(Fb,K);Fb.prototype.a=function(){return this.c};Fb.prototype.toString=function(){return"Number: "+this.c};function Gb(a,b){K.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;1==this.c.length&&(a=this.c[0],a.w||a.c!=Hb||(a=a.o,"*"!=a.f()&&(this.f={name:a.f(),u:null})))}t(Gb,K);function Ib(){K.call(this,4)}t(Ib,K);Ib.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};Ib.prototype.toString=function(){return"Root Helper Expression"};function Jb(){K.call(this,4)}t(Jb,K);Jb.prototype.a=function(a){var b=new G;b.add(a.a);return b};Jb.prototype.toString=function(){return"Context Helper Expression"};
58
- function Kb(a){return"/"==a||"//"==a}Gb.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=I(b,e.c.s);if(e.g||e.c!=Lb)if(e.g||e.c!=Mb){var g=J(f);for(b=e.a(new ha(g));null!=(g=J(f));)g=e.a(new ha(g)),b=lb(b,g)}else g=J(f),b=e.a(new ha(g));else{for(g=J(f);(b=J(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new ha(g))}}return b};
59
- Gb.prototype.toString=function(){var a="Path Expression:"+L(this.h);if(this.c.length){var b=ka(this.c,function(c,d){return c+L(d)},"Steps:");a+=L(b)}return a};function Nb(a,b){this.a=a;this.s=!!b}
60
- function zb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=I(b),f=b.l,g,h=0;g=J(e);h++){var m=a.s?f-h:h+1;g=d.a(new ha(g,m,f));if("number"==typeof g)m=m==g;else if("string"==typeof g||"boolean"==typeof g)m=!!g;else if(g instanceof G)m=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!m){m=e;g=m.f;var w=m.a;if(!w)throw Error("Next must be called at least once before remove.");var r=w.b;w=w.a;r?r.a=w:g.a=w;w?w.b=r:g.b=r;g.l--;m.a=null}}return b}
61
- Nb.prototype.toString=function(){return ka(this.a,function(a,b){return a+L(b)},"Predicates:")};function Ob(a,b,c,d){K.call(this,4);this.c=a;this.o=b;this.h=c||new Nb([]);this.w=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.I&&b&&(a=b.name,a=z?a.toLowerCase():a,this.f={name:a,u:b.u});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}t(Ob,K);
62
- Ob.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.u?P(c.u,a):null,f=1);if(this.w)if(this.g||this.c!=Pb)if(b=I((new Ob(Qb,new H("node"))).a(a)),c=J(b))for(a=this.m(c,d,e,f);null!=(c=J(b));)a=lb(a,this.m(c,d,e,f));else a=new G;else a=bb(this.o,b,d,e),a=zb(this.h,a,f);else a=this.m(a.a,d,e,f);return a};Ob.prototype.m=function(a,b,c,d){a=this.c.v(this.o,a,b,c);return a=zb(this.h,a,d)};
63
- Ob.prototype.toString=function(){var a="Step:"+L("Operator: "+(this.w?"//":"/"));this.c.j&&(a+=L("Axis: "+this.c));a+=L(this.o);if(this.h.a.length){var b=ka(this.h.a,function(c,d){return c+L(d)},"Predicates:");a+=L(b)}return a};function Rb(a,b,c,d){this.j=a;this.v=b;this.s=c;this.I=d}Rb.prototype.toString=function(){return this.j};var Sb={};function S(a,b,c,d){if(Sb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Rb(a,b,c,!!d);return Sb[a]=b}
64
- S("ancestor",function(a,b){for(var c=new G;b=b.parentNode;)a.a(b)&&mb(c,b);return c},!0);S("ancestor-or-self",function(a,b){var c=new G;do a.a(b)&&mb(c,b);while(b=b.parentNode);return c},!0);
65
- var Hb=S("attribute",function(a,b){var c=new G,d=a.f();if("style"==d&&z&&b.style)return c.add(new Na(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof H&&null===a.b||"*"==d)for(a=0;d=e[a];a++)z?d.nodeValue&&c.add(Oa(b,d)):c.add(d);else(d=e.getNamedItem(d))&&(z?d.nodeValue&&c.add(Oa(b,d)):c.add(d));return c},!1),Pb=S("child",function(a,b,c,d,e){return(z?hb:ib).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new G)},!1,!0);S("descendant",bb,!1,!0);
66
- var Qb=S("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&e.add(b);return bb(a,b,c,d,e)},!1,!0),Lb=S("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&e.add(f),e=bb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);S("following-sibling",function(a,b){for(var c=new G;b=b.nextSibling;)a.a(b)&&c.add(b);return c},!1);S("namespace",function(){return new G},!1);
67
- var Tb=S("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;b=b.parentNode;a.a(b)&&c.add(b);return c},!1),Mb=S("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var m=[];for(b=f[g];b=b.previousSibling;)m.unshift(b);for(var w=0,r=m.length;w<r;w++)b=m[w],F(b,c,d)&&a.a(b)&&e.add(b),e=bb(a,b,c,d,e)}return e},!0,!0);
68
- S("preceding-sibling",function(a,b){for(var c=new G;b=b.previousSibling;)a.a(b)&&mb(c,b);return c},!0);var Ub=S("self",function(a,b){var c=new G;a.a(b)&&c.add(b);return c},!1);function Vb(a){K.call(this,1);this.c=a;this.g=a.g;this.b=a.b}t(Vb,K);Vb.prototype.a=function(a){return-O(this.c,a)};Vb.prototype.toString=function(){return"Unary Expression: -"+L(this.c)};function Wb(a){K.call(this,4);this.c=a;qb(this,la(this.c,function(b){return b.g}));rb(this,la(this.c,function(b){return b.b}))}t(Wb,K);Wb.prototype.a=function(a){var b=new G;u(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=lb(b,c)});return b};Wb.prototype.toString=function(){return ka(this.c,function(a,b){return a+L(b)},"Union Expression:")};function Xb(a,b){this.a=a;this.b=b}function Yb(a){for(var b,c=[];;){T(a,"Missing right hand side of binary expression.");b=Zb(a);var d=B(a.a);if(!d)break;var e=(d=xb[d]||null)&&d.C;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].C;)b=new tb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new tb(c.pop(),c.pop(),b);return b}function T(a,b){if(Ta(a.a))throw Error(b);}function $b(a,b){a=B(a.a);if(a!=b)throw Error("Bad token, expected: "+b+" got: "+a);}
69
- function cc(a){a=B(a.a);if(")"!=a)throw Error("Bad token: "+a);}function dc(a){a=B(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Eb(a)}
70
- function ec(a){var b=[];if(Kb(A(a.a))){var c=B(a.a);var d=A(a.a);if("/"==c&&(Ta(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Ib;d=new Ib;T(a,"Missing next location step.");c=fc(a,c);b.push(c)}else{a:{c=A(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":B(a.a);c=Yb(a);T(a,'unclosed "("');$b(a,")");break;case '"':case "'":c=dc(a);break;default:if(isNaN(+c))if(!Db(c)&&/(?![0-9])[\w]/.test(d)&&"("==A(a.a,1)){c=B(a.a);
71
- c=Cb[c]||null;B(a.a);for(d=[];")"!=A(a.a);){T(a,"Missing function argument list.");d.push(Yb(a));if(","!=A(a.a))break;B(a.a)}T(a,"Unclosed function argument list.");cc(a);c=new Ab(c,d)}else{c=null;break a}else c=new Fb(+B(a.a))}"["==A(a.a)&&(d=new Nb(gc(a)),c=new yb(c,d))}if(c)if(Kb(A(a.a)))d=c;else return c;else c=fc(a,"/"),d=new Jb,b.push(c)}for(;Kb(A(a.a));)c=B(a.a),T(a,"Missing next location step."),c=fc(a,c),b.push(c);return new Gb(d,b)}
72
- function fc(a,b){if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==A(a.a)){var c=new Ob(Ub,new H("node"));B(a.a);return c}if(".."==A(a.a))return c=new Ob(Tb,new H("node")),B(a.a),c;if("@"==A(a.a)){var d=Hb;B(a.a);T(a,"Missing attribute name")}else if("::"==A(a.a,1)){if(!/(?![0-9])[\w]/.test(A(a.a).charAt(0)))throw Error("Bad token: "+B(a.a));var e=B(a.a);d=Sb[e]||null;if(!d)throw Error("No axis with name: "+e);B(a.a);T(a,"Missing node name")}else d=Pb;e=A(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==
73
- A(a.a,1)){if(!Db(e))throw Error("Invalid node type: "+e);e=B(a.a);if(!Db(e))throw Error("Invalid type name: "+e);$b(a,"(");T(a,"Bad nodetype");var f=A(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=dc(a);T(a,"Bad nodetype");cc(a);e=new H(e,g)}else if(e=B(a.a),f=e.indexOf(":"),-1==f)e=new eb(e);else{g=e.substring(0,f);if("*"==g)var h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);e=e.substr(f+1);e=new eb(e,h)}else throw Error("Bad token: "+B(a.a));a=new Nb(gc(a),d.s);return c||
74
- new Ob(d,e,a,"//"==b)}function gc(a){for(var b=[];"["==A(a.a);){B(a.a);T(a,"Missing predicate expression.");var c=Yb(a);b.push(c);T(a,"Unclosed predicate expression.");$b(a,"]")}return b}function Zb(a){if("-"==A(a.a))return B(a.a),new Vb(Zb(a));var b=ec(a);if("|"!=A(a.a))a=b;else{for(b=[b];"|"==B(a.a);)T(a,"Missing next union location path."),b.push(ec(a));a.a.a--;a=new Wb(b)}return a};function hc(a){switch(a.nodeType){case 1:return fa(ic,a);case 9:return hc(a.documentElement);case 11:case 10:case 6:case 12:return jc;default:return a.parentNode?hc(a.parentNode):jc}}function jc(){return null}function ic(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?ic(a.parentNode,b):null};function kc(a,b){if(!a.length)throw Error("Empty XPath expression.");a=Qa(a);if(Ta(a))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ea(b.lookupNamespaceURI,b)):b=function(){return null};var c=Yb(new Xb(a,b));if(!Ta(a))throw Error("Bad token: "+B(a));this.evaluate=function(d,e){d=c.a(new ha(d));return new U(d,e)}}
75
- function U(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof G?ob(a):""+a;break;case 1:this.numberValue=a instanceof G?+ob(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var c=
76
- I(a);var d=[];for(var e=J(c);e;e=J(c))d.push(e instanceof Na?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:a=nb(a);this.singleNodeValue=a instanceof Na?a.a:a;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=d.length?null:d[f++]};this.snapshotItem=function(g){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return g>=d.length||
77
- 0>g?null:d[g]}}U.ANY_TYPE=0;U.NUMBER_TYPE=1;U.STRING_TYPE=2;U.BOOLEAN_TYPE=3;U.UNORDERED_NODE_ITERATOR_TYPE=4;U.ORDERED_NODE_ITERATOR_TYPE=5;U.UNORDERED_NODE_SNAPSHOT_TYPE=6;U.ORDERED_NODE_SNAPSHOT_TYPE=7;U.ANY_UNORDERED_NODE_TYPE=8;U.FIRST_ORDERED_NODE_TYPE=9;function lc(a){this.lookupNamespaceURI=hc(a)}
78
- function mc(a,b){a=a||k;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=U,c.evaluate=function(d,e,f,g){return(new kc(d,f)).evaluate(e,g)},c.createExpression=function(d,e){return new kc(d,e)},c.createNSResolver=function(d){return new lc(d)}}aa("wgxpath.install",mc);aa("wgxpath.install",mc);var nc={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
29
+ function ia(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var ja=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},n=Array.prototype.forEach?function(a,b){Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)},ka=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,
30
+ b,void 0)}:function(a,b){for(var c=a.length,d=[],e=0,f="string"===typeof a?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d},la=Array.prototype.reduce?function(a,b,c){return Array.prototype.reduce.call(a,b,c)}:function(a,b,c){var d=c;n(a,function(e,f){d=b.call(void 0,d,e,f,a)});return d},ma=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in
31
+ d&&b.call(void 0,d[e],e,a))return!0;return!1},na=Array.prototype.every?function(a,b){return Array.prototype.every.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0};function oa(a,b){a:{for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:"string"===typeof a?a.charAt(b):a[b]}
32
+ function pa(a){return Array.prototype.concat.apply([],arguments)}function qa(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var ra=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};function sa(a,b){return a<b?-1:a>b?1:0};var t;a:{var ta=k.navigator;if(ta){var ua=ta.userAgent;if(ua){t=ua;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function va(){return u("Firefox")||u("FxiOS")}function wa(){return(u("Chrome")||u("CriOS"))&&!u("Edge")};function xa(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function ya(){return u("iPhone")&&!u("iPod")&&!u("iPad")};function za(a,b){var c=Aa;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var Ba=u("Opera"),v=u("Trident")||u("MSIE"),Ca=u("Edge"),Da=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ea=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge");function Fa(){var a=k.document;return a?a.documentMode:void 0}var Ga;
33
+ a:{var Ha="",Ia=function(){var a=t;if(Da)return/rv:([^\);]+)(\)|;)/.exec(a);if(Ca)return/Edge\/([\d\.]+)/.exec(a);if(v)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ea)return/WebKit\/(\S+)/.exec(a);if(Ba)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Ia&&(Ha=Ia?Ia[1]:"");if(v){var Ja=Fa();if(null!=Ja&&Ja>parseFloat(Ha)){Ga=String(Ja);break a}}Ga=Ha}var Aa={};
34
+ function Ka(a){return za(a,function(){for(var b=0,c=ra(String(Ga)).split("."),d=ra(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",h=d[f]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==g[0].length&&0==h[0].length)break;b=sa(0==g[1].length?0:parseInt(g[1],10),0==h[1].length?0:parseInt(h[1],10))||sa(0==g[2].length,0==h[2].length)||sa(g[2],h[2]);g=g[3];h=h[3]}while(0==b)}return 0<=b})}var La;
35
+ La=k.document&&v?Fa():void 0;var x=v&&!(9<=Number(La)),Ma=v&&!(8<=Number(La));function Na(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Oa(a,b){var c=Ma&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Na(b,a,b.nodeName,c)};function Pa(a){this.b=a;this.a=0}function Qa(a){a=a.match(Ra);for(var b=0;b<a.length;b++)Sa.test(a[b])&&a.splice(b,1);return new Pa(a)}var Ra=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,Sa=/^\s/;function y(a,b){return a.b[a.a+(b||0)]}function z(a){return a.b[a.a++]}function Ta(a){return a.b.length<=a.a};function Ua(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}Ua.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};Ua.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};Ua.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Va(a,b){this.width=a;this.height=b}Va.prototype.aspectRatio=function(){return this.width/this.height};Va.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Va.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Va.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Wa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
36
+ function Xa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(v&&!(9<=Number(La))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ya(a,b):!c&&Wa(e,b)?-1*Za(a,b):!d&&Wa(f,a)?Za(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=A(a);c=d.createRange();
37
+ c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b);a.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,a)}function Za(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return Ya(b,a)}function Ya(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function A(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function $a(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}
38
+ function ab(a){this.a=a||k.document||document}ab.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))};function B(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(x&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;c=0;var d=[];for(b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),x&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return b}
39
+ function C(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Ma&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function bb(a,b,c,d,e){return(x?cb:db).call(null,a,b,aa(c)?c:null,aa(d)?d:null,e||new E)}
40
+ function cb(a,b,c,d,e){if(a instanceof F||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=eb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)C(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||e.add(b);return e}fb(a,b,c,d,e);return e}
41
+ function db(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!v?(b=b.getElementsByName(d),n(b,function(f){a.a(f)&&e.add(f)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(f){f.className==d&&a.a(f)&&e.add(f)})):a instanceof G?fb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),n(b,function(f){C(f,c,d)&&e.add(f)}));return e}
42
+ function gb(a,b,c,d,e){var f;if((a instanceof F||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=eb(a);if("*"!=g&&(f=ka(f,function(h){return h.tagName&&h.tagName.toLowerCase()==g}),!f))return e;c&&(f=ka(f,function(h){return C(h,c,d)}));n(f,function(h){"*"==g&&("!"==h.tagName||"*"==g&&1!=h.nodeType)||e.add(h)});return e}return hb(a,b,c,d,e)}function hb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)C(b,c,d)&&a.a(b)&&e.add(b);return e}
43
+ function fb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)C(b,c,d)&&a.a(b)&&e.add(b),fb(a,b,c,d,e)}function eb(a){if(a instanceof G){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function E(){this.b=this.a=null;this.l=0}function ib(a){this.f=a;this.a=this.b=null}function kb(a,b){if(!a.a)return b;if(!b.a)return a;var c=a.a;b=b.a;for(var d=null,e,f=0;c&&b;){e=c.f;var g=b.f;e==g||e instanceof Na&&g instanceof Na&&e.a==g.a?(e=c,c=c.a,b=b.a):0<Xa(c.f,b.f)?(e=b,b=b.a):(e=c,c=c.a);(e.b=d)?d.a=e:a.a=e;d=e;f++}for(e=c||b;e;)e.b=d,d=d.a=e,f++,e=e.a;a.b=d;a.l=f;return a}function lb(a,b){b=new ib(b);b.a=a.a;a.b?a.a.b=b:a.a=a.b=b;a.a=b;a.l++}
44
+ E.prototype.add=function(a){a=new ib(a);a.b=this.b;this.a?this.b.a=a:this.a=this.b=a;this.b=a;this.l++};function mb(a){return(a=a.a)?a.f:null}function nb(a){return(a=mb(a))?B(a):""}function H(a,b){return new ob(a,!!b)}function ob(a,b){this.f=a;this.b=(this.s=b)?a.b:a.a;this.a=null}function I(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.s?b.b:b.a;return c.f};function J(a){this.i=a;this.b=this.g=!1;this.f=null}function K(a){return"\n "+a.toString().split("\n").join("\n ")}function pb(a,b){a.g=b}function qb(a,b){a.b=b}function N(a,b){a=a.a(b);return a instanceof E?+nb(a):+a}function O(a,b){a=a.a(b);return a instanceof E?nb(a):""+a}function rb(a,b){a=a.a(b);return a instanceof E?!!a.l:!!a};function sb(a,b,c){J.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==tb&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,u:b}):this.f={name:b.f.name,u:c})}l(sb,J);
45
+ function ub(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof E&&c instanceof E){b=H(b);for(d=I(b);d;d=I(b))for(e=H(c),f=I(e);f;f=I(e))if(a(B(d),B(f)))return!0;return!1}if(b instanceof E||c instanceof E){b instanceof E?(e=b,d=c):(e=c,d=b);f=H(e);for(var g=typeof d,h=I(f);h;h=I(f)){switch(g){case "number":h=+B(h);break;case "boolean":h=!!B(h);break;case "string":h=B(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e?"boolean"==
46
+ typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}sb.prototype.a=function(a){return this.c.m(this.h,this.o,a)};sb.prototype.toString=function(){var a="Binary Expression: "+this.c;a+=K(this.h);return a+=K(this.o)};function vb(a,b,c,d){this.I=a;this.D=b;this.i=c;this.m=d}vb.prototype.toString=function(){return this.I};var wb={};
47
+ function P(a,b,c,d){if(wb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new vb(a,b,c,d);return wb[a.toString()]=a}P("div",6,1,function(a,b,c){return N(a,c)/N(b,c)});P("mod",6,1,function(a,b,c){return N(a,c)%N(b,c)});P("*",6,1,function(a,b,c){return N(a,c)*N(b,c)});P("+",5,1,function(a,b,c){return N(a,c)+N(b,c)});P("-",5,1,function(a,b,c){return N(a,c)-N(b,c)});P("<",4,2,function(a,b,c){return ub(function(d,e){return d<e},a,b,c)});
48
+ P(">",4,2,function(a,b,c){return ub(function(d,e){return d>e},a,b,c)});P("<=",4,2,function(a,b,c){return ub(function(d,e){return d<=e},a,b,c)});P(">=",4,2,function(a,b,c){return ub(function(d,e){return d>=e},a,b,c)});var tb=P("=",3,2,function(a,b,c){return ub(function(d,e){return d==e},a,b,c,!0)});P("!=",3,2,function(a,b,c){return ub(function(d,e){return d!=e},a,b,c,!0)});P("and",2,2,function(a,b,c){return rb(a,c)&&rb(b,c)});P("or",1,2,function(a,b,c){return rb(a,c)||rb(b,c)});function xb(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");J.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}l(xb,J);xb.prototype.a=function(a){a=this.c.a(a);return yb(this.h,a)};xb.prototype.toString=function(){var a="Filter:"+K(this.c);return a+=K(this.h)};function zb(a,b){if(b.length<a.C)throw Error("Function "+a.j+" expects at least"+a.C+" arguments, "+b.length+" given");if(null!==a.B&&b.length>a.B)throw Error("Function "+a.j+" expects at most "+a.B+" arguments, "+b.length+" given");a.H&&n(b,function(c,d){if(4!=c.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+c);});J.call(this,a.i);this.v=a;this.c=b;pb(this,a.g||ma(b,function(c){return c.g}));qb(this,a.G&&!b.length||a.F&&!!b.length||ma(b,function(c){return c.b}))}
49
+ l(zb,J);zb.prototype.a=function(a){return this.v.m.apply(null,pa(a,this.c))};zb.prototype.toString=function(){var a="Function: "+this.v;if(this.c.length){var b=la(this.c,function(c,d){return c+K(d)},"Arguments:");a+=K(b)}return a};function Ab(a,b,c,d,e,f,g,h){this.j=a;this.i=b;this.g=c;this.G=d;this.F=!1;this.m=e;this.C=f;this.B=void 0!==g?g:f;this.H=!!h}Ab.prototype.toString=function(){return this.j};var Bb={};
50
+ function Q(a,b,c,d,e,f,g,h){if(Bb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Bb[a]=new Ab(a,b,c,d,e,f,g,h)}Q("boolean",2,!1,!1,function(a,b){return rb(b,a)},1);Q("ceiling",1,!1,!1,function(a,b){return Math.ceil(N(b,a))},1);Q("concat",3,!1,!1,function(a,b){return la(qa(arguments,1),function(c,d){return c+O(d,a)},"")},2,null);Q("contains",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return-1!=b.indexOf(a)},2);Q("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0);
51
+ Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){return Math.floor(N(b,a))},1);Q("id",4,!1,!1,function(a,b){function c(h){if(x){var m=e.all[h];if(m){if(m.nodeType&&h==m.id)return m;if(m.length)return oa(m,function(w){return h==w.id})}return null}return e.getElementById(h)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument;a=O(b,a).split(/\s+/);var f=[];n(a,function(h){h=c(h);!h||0<=ja(f,h)||f.push(h)});f.sort(Xa);var g=new E;n(f,function(h){g.add(h)});return g},1);
52
+ Q("lang",2,!1,!1,function(){return!1},1);Q("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);Q("local-name",3,!1,!0,function(a,b){return(a=b?mb(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);Q("name",3,!1,!0,function(a,b){return(a=b?mb(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);Q("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
53
+ Q("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):B(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);Q("not",2,!1,!1,function(a,b){return!rb(b,a)},1);Q("number",1,!1,!0,function(a,b){return b?N(b,a):+B(a.a)},0,1);Q("position",1,!0,!1,function(a){return a.b},0);Q("round",1,!1,!1,function(a,b){return Math.round(N(b,a))},1);Q("starts-with",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return 0==b.lastIndexOf(a,0)},2);Q("string",3,!1,!0,function(a,b){return b?O(b,a):B(a.a)},0,1);
54
+ Q("string-length",1,!1,!0,function(a,b){return(b?O(b,a):B(a.a)).length},0,1);Q("substring",3,!1,!1,function(a,b,c,d){c=N(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?N(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=O(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);Q("substring-after",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
55
+ Q("substring-before",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);Q("sum",1,!1,!1,function(a,b){a=H(b.a(a));b=0;for(var c=I(a);c;c=I(a))b+=+B(c);return b},1,1,!0);Q("translate",3,!1,!1,function(a,b,c,d){b=O(b,a);c=O(c,a);var e=O(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);Q("true",2,!1,!1,function(){return!0},0);function G(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Cb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}G.prototype.a=function(a){return null===this.b||this.b==a.nodeType};G.prototype.f=function(){return this.h};
56
+ G.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=K(this.c));return a};function Db(a){J.call(this,3);this.c=a.substring(1,a.length-1)}l(Db,J);Db.prototype.a=function(){return this.c};Db.prototype.toString=function(){return"Literal: "+this.c};function F(a,b){this.j=a.toLowerCase();a="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():a}F.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=void 0!==a.localName?a.localName:a.nodeName;return"*"!=this.j&&this.j!=b.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};F.prototype.f=function(){return this.j};
57
+ F.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function Eb(a){J.call(this,1);this.c=a}l(Eb,J);Eb.prototype.a=function(){return this.c};Eb.prototype.toString=function(){return"Number: "+this.c};function Fb(a,b){J.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;1==this.c.length&&(a=this.c[0],a.A||a.c!=Gb||(a=a.o,"*"!=a.f()&&(this.f={name:a.f(),u:null})))}l(Fb,J);function Hb(){J.call(this,4)}l(Hb,J);Hb.prototype.a=function(a){var b=new E;a=a.a;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};Hb.prototype.toString=function(){return"Root Helper Expression"};function Ib(){J.call(this,4)}l(Ib,J);Ib.prototype.a=function(a){var b=new E;b.add(a.a);return b};Ib.prototype.toString=function(){return"Context Helper Expression"};
58
+ function Jb(a){return"/"==a||"//"==a}Fb.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof E))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=H(b,e.c.s);if(e.g||e.c!=Kb)if(e.g||e.c!=Lb){var g=I(f);for(b=e.a(new ia(g));null!=(g=I(f));)g=e.a(new ia(g)),b=kb(b,g)}else g=I(f),b=e.a(new ia(g));else{for(g=I(f);(b=I(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new ia(g))}}return b};
59
+ Fb.prototype.toString=function(){var a="Path Expression:"+K(this.h);if(this.c.length){var b=la(this.c,function(c,d){return c+K(d)},"Steps:");a+=K(b)}return a};function Mb(a,b){this.a=a;this.s=!!b}
60
+ function yb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=H(b),f=b.l,g,h=0;g=I(e);h++){var m=a.s?f-h:h+1;g=d.a(new ia(g,m,f));if("number"==typeof g)m=m==g;else if("string"==typeof g||"boolean"==typeof g)m=!!g;else if(g instanceof E)m=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!m){m=e;g=m.f;var w=m.a;if(!w)throw Error("Next must be called at least once before remove.");var r=w.b;w=w.a;r?r.a=w:g.a=w;w?w.b=r:g.b=r;g.l--;m.a=null}}return b}
61
+ Mb.prototype.toString=function(){return la(this.a,function(a,b){return a+K(b)},"Predicates:")};function R(a,b,c,d){J.call(this,4);this.c=a;this.o=b;this.h=c||new Mb([]);this.A=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.J&&b&&(a=b.name,a=x?a.toLowerCase():a,this.f={name:a,u:b.u});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}l(R,J);
62
+ R.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.u?O(c.u,a):null,f=1);if(this.A)if(this.g||this.c!=Nb)if(b=H((new R(Ob,new G("node"))).a(a)),c=I(b))for(a=this.m(c,d,e,f);null!=(c=I(b));)a=kb(a,this.m(c,d,e,f));else a=new E;else a=bb(this.o,b,d,e),a=yb(this.h,a,f);else a=this.m(a.a,d,e,f);return a};R.prototype.m=function(a,b,c,d){a=this.c.v(this.o,a,b,c);return a=yb(this.h,a,d)};
63
+ R.prototype.toString=function(){var a="Step:"+K("Operator: "+(this.A?"//":"/"));this.c.j&&(a+=K("Axis: "+this.c));a+=K(this.o);if(this.h.a.length){var b=la(this.h.a,function(c,d){return c+K(d)},"Predicates:");a+=K(b)}return a};function Pb(a,b,c,d){this.j=a;this.v=b;this.s=c;this.J=d}Pb.prototype.toString=function(){return this.j};var Qb={};function S(a,b,c,d){if(Qb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Pb(a,b,c,!!d);return Qb[a]=b}
64
+ S("ancestor",function(a,b){for(var c=new E;b=b.parentNode;)a.a(b)&&lb(c,b);return c},!0);S("ancestor-or-self",function(a,b){var c=new E;do a.a(b)&&lb(c,b);while(b=b.parentNode);return c},!0);
65
+ var Gb=S("attribute",function(a,b){var c=new E,d=a.f();if("style"==d&&x&&b.style)return c.add(new Na(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof G&&null===a.b||"*"==d)for(a=0;d=e[a];a++)x?d.nodeValue&&c.add(Oa(b,d)):c.add(d);else(d=e.getNamedItem(d))&&(x?d.nodeValue&&c.add(Oa(b,d)):c.add(d));return c},!1),Nb=S("child",function(a,b,c,d,e){return(x?gb:hb).call(null,a,b,aa(c)?c:null,aa(d)?d:null,e||new E)},!1,!0);S("descendant",bb,!1,!0);
66
+ var Ob=S("descendant-or-self",function(a,b,c,d){var e=new E;C(b,c,d)&&a.a(b)&&e.add(b);return bb(a,b,c,d,e)},!1,!0),Kb=S("following",function(a,b,c,d){var e=new E;do for(var f=b;f=f.nextSibling;)C(f,c,d)&&a.a(f)&&e.add(f),e=bb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);S("following-sibling",function(a,b){for(var c=new E;b=b.nextSibling;)a.a(b)&&c.add(b);return c},!1);S("namespace",function(){return new E},!1);
67
+ var Rb=S("parent",function(a,b){var c=new E;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;b=b.parentNode;a.a(b)&&c.add(b);return c},!1),Lb=S("preceding",function(a,b,c,d){var e=new E,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var m=[];for(b=f[g];b=b.previousSibling;)m.unshift(b);for(var w=0,r=m.length;w<r;w++)b=m[w],C(b,c,d)&&a.a(b)&&e.add(b),e=bb(a,b,c,d,e)}return e},!0,!0);
68
+ S("preceding-sibling",function(a,b){for(var c=new E;b=b.previousSibling;)a.a(b)&&lb(c,b);return c},!0);var Sb=S("self",function(a,b){var c=new E;a.a(b)&&c.add(b);return c},!1);function Tb(a){J.call(this,1);this.c=a;this.g=a.g;this.b=a.b}l(Tb,J);Tb.prototype.a=function(a){return-N(this.c,a)};Tb.prototype.toString=function(){return"Unary Expression: -"+K(this.c)};function Ub(a){J.call(this,4);this.c=a;pb(this,ma(this.c,function(b){return b.g}));qb(this,ma(this.c,function(b){return b.b}))}l(Ub,J);Ub.prototype.a=function(a){var b=new E;n(this.c,function(c){c=c.a(a);if(!(c instanceof E))throw Error("Path expression must evaluate to NodeSet.");b=kb(b,c)});return b};Ub.prototype.toString=function(){return la(this.c,function(a,b){return a+K(b)},"Union Expression:")};function Vb(a,b){this.a=a;this.b=b}function Wb(a){for(var b,c=[];;){T(a,"Missing right hand side of binary expression.");b=Xb(a);var d=z(a.a);if(!d)break;var e=(d=wb[d]||null)&&d.D;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].D;)b=new sb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new sb(c.pop(),c.pop(),b);return b}function T(a,b){if(Ta(a.a))throw Error(b);}function Yb(a,b){a=z(a.a);if(a!=b)throw Error("Bad token, expected: "+b+" got: "+a);}
69
+ function ac(a){a=z(a.a);if(")"!=a)throw Error("Bad token: "+a);}function bc(a){a=z(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Db(a)}
70
+ function cc(a){var b=[];if(Jb(y(a.a))){var c=z(a.a);var d=y(a.a);if("/"==c&&(Ta(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Hb;d=new Hb;T(a,"Missing next location step.");c=dc(a,c);b.push(c)}else{a:{c=y(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":z(a.a);c=Wb(a);T(a,'unclosed "("');Yb(a,")");break;case '"':case "'":c=bc(a);break;default:if(isNaN(+c))if(!Cb(c)&&/(?![0-9])[\w]/.test(d)&&"("==y(a.a,1)){c=z(a.a);
71
+ c=Bb[c]||null;z(a.a);for(d=[];")"!=y(a.a);){T(a,"Missing function argument list.");d.push(Wb(a));if(","!=y(a.a))break;z(a.a)}T(a,"Unclosed function argument list.");ac(a);c=new zb(c,d)}else{c=null;break a}else c=new Eb(+z(a.a))}"["==y(a.a)&&(d=new Mb(ec(a)),c=new xb(c,d))}if(c)if(Jb(y(a.a)))d=c;else return c;else c=dc(a,"/"),d=new Ib,b.push(c)}for(;Jb(y(a.a));)c=z(a.a),T(a,"Missing next location step."),c=dc(a,c),b.push(c);return new Fb(d,b)}
72
+ function dc(a,b){if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==y(a.a)){var c=new R(Sb,new G("node"));z(a.a);return c}if(".."==y(a.a))return c=new R(Rb,new G("node")),z(a.a),c;if("@"==y(a.a)){var d=Gb;z(a.a);T(a,"Missing attribute name")}else if("::"==y(a.a,1)){if(!/(?![0-9])[\w]/.test(y(a.a).charAt(0)))throw Error("Bad token: "+z(a.a));var e=z(a.a);d=Qb[e]||null;if(!d)throw Error("No axis with name: "+e);z(a.a);T(a,"Missing node name")}else d=Nb;e=y(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==
73
+ y(a.a,1)){if(!Cb(e))throw Error("Invalid node type: "+e);e=z(a.a);if(!Cb(e))throw Error("Invalid type name: "+e);Yb(a,"(");T(a,"Bad nodetype");var f=y(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=bc(a);T(a,"Bad nodetype");ac(a);e=new G(e,g)}else if(e=z(a.a),f=e.indexOf(":"),-1==f)e=new F(e);else{g=e.substring(0,f);if("*"==g)var h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);e=e.substr(f+1);e=new F(e,h)}else throw Error("Bad token: "+z(a.a));a=new Mb(ec(a),d.s);return c||new R(d,
74
+ e,a,"//"==b)}function ec(a){for(var b=[];"["==y(a.a);){z(a.a);T(a,"Missing predicate expression.");var c=Wb(a);b.push(c);T(a,"Unclosed predicate expression.");Yb(a,"]")}return b}function Xb(a){if("-"==y(a.a))return z(a.a),new Tb(Xb(a));var b=cc(a);if("|"!=y(a.a))a=b;else{for(b=[b];"|"==z(a.a);)T(a,"Missing next union location path."),b.push(cc(a));a.a.a--;a=new Ub(b)}return a};function fc(a){switch(a.nodeType){case 1:return ha(gc,a);case 9:return fc(a.documentElement);case 11:case 10:case 6:case 12:return hc;default:return a.parentNode?fc(a.parentNode):hc}}function hc(){return null}function gc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?gc(a.parentNode,b):null};function ic(a,b){if(!a.length)throw Error("Empty XPath expression.");a=Qa(a);if(Ta(a))throw Error("Invalid XPath expression.");b?"function"==ca(b)||(b=fa(b.lookupNamespaceURI,b)):b=function(){return null};var c=Wb(new Vb(a,b));if(!Ta(a))throw Error("Bad token: "+z(a));this.evaluate=function(d,e){d=c.a(new ia(d));return new U(d,e)}}
75
+ function U(a,b){if(0==b)if(a instanceof E)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof E))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof E?nb(a):""+a;break;case 1:this.numberValue=a instanceof E?+nb(a):+a;break;case 3:this.booleanValue=a instanceof E?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var c=
76
+ H(a);var d=[];for(var e=I(c);e;e=I(c))d.push(e instanceof Na?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:a=mb(a);this.singleNodeValue=a instanceof Na?a.a:a;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=d.length?null:d[f++]};this.snapshotItem=function(g){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return g>=d.length||
77
+ 0>g?null:d[g]}}U.ANY_TYPE=0;U.NUMBER_TYPE=1;U.STRING_TYPE=2;U.BOOLEAN_TYPE=3;U.UNORDERED_NODE_ITERATOR_TYPE=4;U.ORDERED_NODE_ITERATOR_TYPE=5;U.UNORDERED_NODE_SNAPSHOT_TYPE=6;U.ORDERED_NODE_SNAPSHOT_TYPE=7;U.ANY_UNORDERED_NODE_TYPE=8;U.FIRST_ORDERED_NODE_TYPE=9;function jc(a){this.lookupNamespaceURI=fc(a)}
78
+ function kc(a,b){a=a||k;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=U,c.evaluate=function(d,e,f,g){return(new ic(d,f)).evaluate(e,g)},c.createExpression=function(d,e){return new ic(d,e)},c.createNSResolver=function(d){return new jc(d)}}ba("wgxpath.install",kc);ba("wgxpath.install",kc);var lc={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
79
79
  darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
80
80
  ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
81
81
  lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
82
82
  moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
83
- seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var oc="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),pc=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,qc=/^#(?:[0-9a-f]{3}){1,2}$/i,rc=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,sc=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function tc(a,b){this.code=a;this.a=V[a]||uc;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(c){return c.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}t(tc,Error);var uc="unknown error",V={15:"element not selectable",11:"element not visible"};V[31]=uc;V[30]=uc;V[24]="invalid cookie domain";V[29]="invalid element coordinates";V[12]="invalid element state";
84
- V[32]="invalid selector";V[51]="invalid selector";V[52]="invalid selector";V[17]="javascript error";V[405]="unsupported operation";V[34]="move target out of bounds";V[27]="no such alert";V[7]="no such element";V[8]="no such frame";V[23]="no such window";V[28]="script timeout";V[33]="session not created";V[10]="stale element reference";V[21]="timeout";V[25]="unable to set cookie";V[26]="unexpected alert open";V[13]=uc;V[9]="unknown command";var vc=ua(),wc=xa()||x("iPod"),xc=x("iPad"),yc=x("Android")&&!(va()||ua()||x("Opera")||x("Silk")),zc=va(),Ac=x("Safari")&&!(va()||x("Coast")||x("Opera")||x("Edge")||ua()||x("Silk")||x("Android"))&&!(xa()||x("iPad")||x("iPod"));function Bc(a){return(a=a.exec(v))?a[1]:""}(function(){if(vc)return Bc(/Firefox\/([0-9.]+)/);if(y||Ba||Aa)return Fa;if(zc)return xa()||x("iPad")||x("iPod")?Bc(/CriOS\/([0-9.]+)/):Bc(/Chrome\/([0-9.]+)/);if(Ac&&!(xa()||x("iPad")||x("iPod")))return Bc(/Version\/([0-9.]+)/);if(wc||xc){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(v);if(a)return a[1]+"."+a[2]}else if(yc)return(a=Bc(/Android\s+([0-9.]+)/))?a:Bc(/Version\/([0-9.]+)/);return""})();var Cc,Dc=function(){if(!Ca)return!1;var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(e){return!1}var b=a.classes;a=a.interfaces;var c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),d=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo).version;Cc=function(e){c.compare(d,""+e)};return!0}(),Ec=y&&!(9<=Number(Ka));yc&&Dc&&Cc(2.3);yc&&Dc&&Cc(4);Ac&&Dc&&Cc(6);function W(a,b){b&&"string"!==typeof b&&(b=b.toString());return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};var Fc=function(){var a={J:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
85
- function Gc(a,b){var c=C(a);if(!c.documentElement)return null;(y||yc)&&mc(c?c.parentWindow||c.defaultView:window);try{var d=c.createNSResolver?c.createNSResolver(c.documentElement):Fc;if(y&&!Ja(7))return c.evaluate.call(c,b,a,d,9,null);if(!y||9<=Number(Ka)){for(var e={},f=c.getElementsByTagName("*"),g=0;g<f.length;++g){var h=f[g],m=h.namespaceURI;if(m&&!e[m]){var w=h.lookupPrefix(m);if(!w){var r=m.match(".*/(\\w+)/?$");w=r?r[1]:"xhtml"}e[m]=w}}var D={},M;for(M in e)D[e[M]]=M;d=function(N){return D[N]||
86
- null}}try{return c.evaluate(b,a,d,9,null)}catch(N){if("TypeError"===N.name)return d=c.createNSResolver?c.createNSResolver(c.documentElement):Fc,c.evaluate(b,a,d,9,null);throw N;}}catch(N){if(!Ca||"NS_ERROR_ILLEGAL_VALUE"!=N.name)throw new tc(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+N);}}
87
- function Hc(a,b){var c=function(){var d=Gc(b,a);return d?d.singleNodeValue||null:b.selectSingleNode?(d=C(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();if(null!==c&&(!c||1!=c.nodeType))throw new tc(32,'The result of the xpath expression "'+a+'" is: '+c+". It should be an element.");return c};function Ic(a,b,c,d){this.c=a;this.a=b;this.b=c;this.f=d}Ic.prototype.ceil=function(){this.c=Math.ceil(this.c);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.f=Math.ceil(this.f);return this};Ic.prototype.floor=function(){this.c=Math.floor(this.c);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.f=Math.floor(this.f);return this};Ic.prototype.round=function(){this.c=Math.round(this.c);this.a=Math.round(this.a);this.b=Math.round(this.b);this.f=Math.round(this.f);return this};function X(a,b,c,d){this.a=a;this.b=b;this.width=c;this.height=d}X.prototype.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};X.prototype.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
88
- X.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var Jc="function"===typeof ShadowRoot;function Kc(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return W(a)?a:null}
89
- function Y(a,b){b=wa(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Ec?"styleFloat":"cssFloat";a:{var c=b;var d=C(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||Lc(a,b);if(null===a)a=null;else if(0<=ia(oc,b)){b:{var e=a.match(rc);if(e&&(b=Number(e[1]),c=Number(e[2]),d=Number(e[3]),e=Number(e[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(sc))if(b=
90
- Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=nc[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(pc,"#$1$1$2$2$3$3")),!qc.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a}
91
- function Lc(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(a=Kc(a))?Lc(a,b):null}
92
- function Mc(a,b,c){function d(g){var h=Nc(g);return 0<h.height&&0<h.width?!0:W(g,"PATH")&&(0<h.height||0<h.width)?(g=Y(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=Y(g,"overflow")&&la(g.childNodes,function(m){return 3==m.nodeType||W(m)&&d(m)})}function e(g){return Oc(g)==Z&&ma(g.childNodes,function(h){return!W(h)||e(h)||!d(h)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=$a(a,function(g){return W(g,"SELECT")}),
93
- !!a&&Mc(a,!0,c);var f=Pc(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&Mc(f.image,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=Y(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Qc(a))&&d(a)?!e(a):!1}var Z="hidden";
94
- function Oc(a){function b(p){function q(kb){if(kb==g)return!0;var ac=Y(kb,"display");return 0==ac.lastIndexOf("inline",0)||"contents"==ac||"absolute"==bc&&"static"==Y(kb,"position")?!1:!0}var bc=Y(p,"position");if("fixed"==bc)return w=!0,p==g?null:g;for(p=Kc(p);p&&!q(p);)p=Kc(p);return p}function c(p){var q=p;if("visible"==m)if(p==g&&h)q=h;else if(p==h)return{x:"visible",y:"visible"};q={x:Y(q,"overflow-x"),y:Y(q,"overflow-y")};p==g&&(q.x="visible"==q.x?"auto":q.x,q.y="visible"==q.y?"auto":q.y);return q}
95
- function d(p){if(p==g){var q=(new ab(f)).a;p=q.scrollingElement?q.scrollingElement:Da||"CSS1Compat"!=q.compatMode?q.body||q.documentElement:q.documentElement;q=q.parentWindow||q.defaultView;p=y&&Ja("10")&&q.pageYOffset!=p.scrollTop?new Ua(p.scrollLeft,p.scrollTop):new Ua(q.pageXOffset||p.scrollLeft,q.pageYOffset||p.scrollTop)}else p=new Ua(p.scrollLeft,p.scrollTop);return p}var e=Rc(a),f=C(a),g=f.documentElement,h=f.body,m=Y(g,"overflow"),w;for(a=b(a);a;a=b(a)){var r=c(a);if("visible"!=r.x||"visible"!=
96
- r.y){var D=Nc(a);if(0==D.width||0==D.height)return Z;var M=e.a<D.a,N=e.b<D.b;if(M&&"hidden"==r.x||N&&"hidden"==r.y)return Z;if(M&&"visible"!=r.x||N&&"visible"!=r.y){M=d(a);N=e.b<D.b-M.y;if(e.a<D.a-M.x&&"visible"!=r.x||N&&"visible"!=r.x)return Z;e=Oc(a);return e==Z?Z:"scroll"}M=e.f>=D.a+D.width;D=e.c>=D.b+D.height;if(M&&"hidden"==r.x||D&&"hidden"==r.y)return Z;if(M&&"visible"!=r.x||D&&"visible"!=r.y){if(w&&(r=d(a),e.f>=g.scrollWidth-r.x||e.a>=g.scrollHeight-r.y))return Z;e=Oc(a);return e==Z?Z:"scroll"}}}return"none"}
97
- function Nc(a){var b=Pc(a);if(b)return b.rect;if(W(a,"HTML"))return a=C(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Va(a.clientWidth,a.clientHeight),new X(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new X(0,0,0,0)}b=new X(c.left,c.top,c.right-c.left,c.bottom-c.top);y&&a.ownerDocument.body&&(a=C(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
98
- return b}function Pc(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=Hc('/descendant::*[@usemap = "#'+c.name+'"]',C(c)))&&(e=Nc(d),b||"default"==a.shape.toLowerCase()||(a=Sc(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new X(b+e.a,c+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{image:d,rect:e||new X(0,0,0,0)}}
99
- function Sc(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){b=a[0];var c=a[1];return new X(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new X(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){b=a[0];c=a[1];for(var d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new X(b,c,d-b,e-c)}return new X(0,0,0,0)}function Rc(a){a=Nc(a);return new Ic(a.b,a.a+a.width,a.b+a.height,a.a)}
100
- function Qc(a){if(Ec){if("relative"==Y(a,"position"))return 1;a=Y(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Tc(a)}function Tc(a){var b=1,c=Y(a,"opacity");c&&(b=Number(c));(a=Kc(a))&&(b*=Tc(a));return b};aa("_",function(a,b){function c(d){if(W(d)&&"none"==Y(d,"display"))return!1;var e;if((e=d.parentNode)&&e.shadowRoot&&void 0!==d.assignedSlot)e=d.assignedSlot?d.assignedSlot.parentNode:null;else if(d.getDestinationInsertionPoints){var f=d.getDestinationInsertionPoints();0<f.length&&(e=f[f.length-1])}if(Jc&&e instanceof ShadowRoot){if(e.host.shadowRoot!==e)return!1;e=e.host}return!e||9!=e.nodeType&&11!=e.nodeType?e&&W(e,"DETAILS")&&!e.open&&!W(d,"SUMMARY")?!1:e&&c(e):!0}return Mc(a,!!b,c)});; return this._.apply(null,arguments);}).apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);}
83
+ seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var mc="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),nc=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,oc=/^#(?:[0-9a-f]{3}){1,2}$/i,pc=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,qc=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function rc(a,b){this.code=a;this.a=V[a]||sc;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(c){return c.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}l(rc,Error);var sc="unknown error",V={15:"element not selectable",11:"element not visible"};V[31]=sc;V[30]=sc;V[24]="invalid cookie domain";V[29]="invalid element coordinates";V[12]="invalid element state";
84
+ V[32]="invalid selector";V[51]="invalid selector";V[52]="invalid selector";V[17]="javascript error";V[405]="unsupported operation";V[34]="move target out of bounds";V[27]="no such alert";V[7]="no such element";V[8]="no such frame";V[23]="no such window";V[28]="script timeout";V[33]="session not created";V[10]="stale element reference";V[21]="timeout";V[25]="unable to set cookie";V[26]="unexpected alert open";V[13]=sc;V[9]="unknown command";var tc=va(),uc=ya()||u("iPod"),vc=u("iPad"),wc=u("Android")&&!(wa()||va()||u("Opera")||u("Silk")),xc=wa(),yc=u("Safari")&&!(wa()||u("Coast")||u("Opera")||u("Edge")||u("Edg/")||u("OPR")||va()||u("Silk")||u("Android"))&&!(ya()||u("iPad")||u("iPod"));function zc(a){return(a=a.exec(t))?a[1]:""}(function(){if(tc)return zc(/Firefox\/([0-9.]+)/);if(v||Ca||Ba)return Ga;if(xc)return ya()||u("iPad")||u("iPod")?zc(/CriOS\/([0-9.]+)/):zc(/Chrome\/([0-9.]+)/);if(yc&&!(ya()||u("iPad")||u("iPod")))return zc(/Version\/([0-9.]+)/);if(uc||vc){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t);if(a)return a[1]+"."+a[2]}else if(wc)return(a=zc(/Android\s+([0-9.]+)/))?a:zc(/Version\/([0-9.]+)/);return""})();var Ac,Bc=function(){if(!Da)return!1;var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(e){return!1}var b=a.classes;a=a.interfaces;var c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),d=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo).version;Ac=function(e){c.compare(d,""+e)};return!0}(),Cc=v&&!(9<=Number(La));wc&&Bc&&Ac(2.3);wc&&Bc&&Ac(4);yc&&Bc&&Ac(6);function W(a,b){b&&"string"!==typeof b&&(b=b.toString());return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};var Dc=function(){var a={K:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
85
+ function Ec(a,b){var c=A(a);if(!c.documentElement)return null;(v||wc)&&kc(c?c.parentWindow||c.defaultView:window);try{var d=c.createNSResolver?c.createNSResolver(c.documentElement):Dc;if(v&&!Ka(7))return c.evaluate.call(c,b,a,d,9,null);if(!v||9<=Number(La)){for(var e={},f=c.getElementsByTagName("*"),g=0;g<f.length;++g){var h=f[g],m=h.namespaceURI;if(m&&!e[m]){var w=h.lookupPrefix(m);if(!w){var r=m.match(".*/(\\w+)/?$");w=r?r[1]:"xhtml"}e[m]=w}}var D={},L;for(L in e)D[e[L]]=L;d=function(M){return D[M]||
86
+ null}}try{return c.evaluate(b,a,d,9,null)}catch(M){if("TypeError"===M.name)return d=c.createNSResolver?c.createNSResolver(c.documentElement):Dc,c.evaluate(b,a,d,9,null);throw M;}}catch(M){if(!Da||"NS_ERROR_ILLEGAL_VALUE"!=M.name)throw new rc(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+M);}}
87
+ function Fc(a,b){var c=function(){var d=Ec(b,a);return d?d.singleNodeValue||null:b.selectSingleNode?(d=A(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();if(null!==c&&(!c||1!=c.nodeType))throw new rc(32,'The result of the xpath expression "'+a+'" is: '+c+". It should be an element.");return c};function Gc(a,b,c,d){this.c=a;this.a=b;this.b=c;this.f=d}Gc.prototype.ceil=function(){this.c=Math.ceil(this.c);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.f=Math.ceil(this.f);return this};Gc.prototype.floor=function(){this.c=Math.floor(this.c);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.f=Math.floor(this.f);return this};Gc.prototype.round=function(){this.c=Math.round(this.c);this.a=Math.round(this.a);this.b=Math.round(this.b);this.f=Math.round(this.f);return this};function X(a,b,c,d){this.a=a;this.b=b;this.width=c;this.height=d}X.prototype.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};X.prototype.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
88
+ X.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var Hc="function"===typeof ShadowRoot;function Ic(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return W(a)?a:null}
89
+ function Y(a,b){b=xa(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Cc?"styleFloat":"cssFloat";a:{var c=b;var d=A(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||Jc(a,b);if(null===a)a=null;else if(0<=ja(mc,b)){b:{var e=a.match(pc);if(e&&(b=Number(e[1]),c=Number(e[2]),d=Number(e[3]),e=Number(e[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(qc))if(b=
90
+ Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=lc[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(nc,"#$1$1$2$2$3$3")),!oc.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a}
91
+ function Jc(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==ca(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(a=Ic(a))?Jc(a,b):null}
92
+ function Kc(a,b,c){function d(g){var h=Lc(g);return 0<h.height&&0<h.width?!0:W(g,"PATH")&&(0<h.height||0<h.width)?(g=Y(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=Y(g,"overflow")&&ma(g.childNodes,function(m){return 3==m.nodeType||W(m)&&d(m)})}function e(g){return Mc(g)==Z&&na(g.childNodes,function(h){return!W(h)||e(h)||!d(h)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=$a(a,function(g){return W(g,"SELECT")}),
93
+ !!a&&Kc(a,!0,c);var f=Nc(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&Kc(f.image,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=Y(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Oc(a))&&d(a)?!e(a):!1}var Z="hidden";
94
+ function Mc(a){function b(p){function q(jb){if(jb==g)return!0;var Zb=Y(jb,"display");return 0==Zb.lastIndexOf("inline",0)||"contents"==Zb||"absolute"==$b&&"static"==Y(jb,"position")?!1:!0}var $b=Y(p,"position");if("fixed"==$b)return w=!0,p==g?null:g;for(p=Ic(p);p&&!q(p);)p=Ic(p);return p}function c(p){var q=p;if("visible"==m)if(p==g&&h)q=h;else if(p==h)return{x:"visible",y:"visible"};q={x:Y(q,"overflow-x"),y:Y(q,"overflow-y")};p==g&&(q.x="visible"==q.x?"auto":q.x,q.y="visible"==q.y?"auto":q.y);return q}
95
+ function d(p){if(p==g){var q=(new ab(f)).a;p=q.scrollingElement?q.scrollingElement:Ea||"CSS1Compat"!=q.compatMode?q.body||q.documentElement:q.documentElement;q=q.parentWindow||q.defaultView;p=v&&Ka("10")&&q.pageYOffset!=p.scrollTop?new Ua(p.scrollLeft,p.scrollTop):new Ua(q.pageXOffset||p.scrollLeft,q.pageYOffset||p.scrollTop)}else p=new Ua(p.scrollLeft,p.scrollTop);return p}var e=Pc(a),f=A(a),g=f.documentElement,h=f.body,m=Y(g,"overflow"),w;for(a=b(a);a;a=b(a)){var r=c(a);if("visible"!=r.x||"visible"!=
96
+ r.y){var D=Lc(a);if(0==D.width||0==D.height)return Z;var L=e.a<D.a,M=e.b<D.b;if(L&&"hidden"==r.x||M&&"hidden"==r.y)return Z;if(L&&"visible"!=r.x||M&&"visible"!=r.y){L=d(a);M=e.b<D.b-L.y;if(e.a<D.a-L.x&&"visible"!=r.x||M&&"visible"!=r.x)return Z;e=Mc(a);return e==Z?Z:"scroll"}L=e.f>=D.a+D.width;D=e.c>=D.b+D.height;if(L&&"hidden"==r.x||D&&"hidden"==r.y)return Z;if(L&&"visible"!=r.x||D&&"visible"!=r.y){if(w&&(r=d(a),e.f>=g.scrollWidth-r.x||e.a>=g.scrollHeight-r.y))return Z;e=Mc(a);return e==Z?Z:"scroll"}}}return"none"}
97
+ function Lc(a){var b=Nc(a);if(b)return b.rect;if(W(a,"HTML"))return a=A(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Va(a.clientWidth,a.clientHeight),new X(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new X(0,0,0,0)}b=new X(c.left,c.top,c.right-c.left,c.bottom-c.top);v&&a.ownerDocument.body&&(a=A(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
98
+ return b}function Nc(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=Fc('/descendant::*[@usemap = "#'+c.name+'"]',A(c)))&&(e=Lc(d),b||"default"==a.shape.toLowerCase()||(a=Qc(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new X(b+e.a,c+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{image:d,rect:e||new X(0,0,0,0)}}
99
+ function Qc(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){b=a[0];var c=a[1];return new X(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new X(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){b=a[0];c=a[1];for(var d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new X(b,c,d-b,e-c)}return new X(0,0,0,0)}function Pc(a){a=Lc(a);return new Gc(a.b,a.a+a.width,a.b+a.height,a.a)}
100
+ function Oc(a){if(Cc){if("relative"==Y(a,"position"))return 1;a=Y(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Rc(a)}function Rc(a){var b=1,c=Y(a,"opacity");c&&(b=Number(c));(a=Ic(a))&&(b*=Rc(a));return b};ba("_",function(a,b){function c(d){if(W(d)&&"none"==Y(d,"display"))return!1;var e;if((e=d.parentNode)&&e.shadowRoot&&void 0!==d.assignedSlot)e=d.assignedSlot?d.assignedSlot.parentNode:null;else if(d.getDestinationInsertionPoints){var f=d.getDestinationInsertionPoints();0<f.length&&(e=f[f.length-1])}if(Hc&&e instanceof ShadowRoot){if(e.host.shadowRoot!==e)return!1;e=e.host}return!e||9!=e.nodeType&&11!=e.nodeType?e&&W(e,"DETAILS")&&!e.open&&!W(d,"SUMMARY")?!1:!!e&&c(e):!0}return Kc(a,!!b,c)});; return this._.apply(null,arguments);}).apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);}
@@ -0,0 +1,38 @@
1
+ (function () {
2
+ const observer = new MutationObserver((mutations) => {
3
+ for (const mutation of mutations) {
4
+ switch (mutation.type) {
5
+ case 'attributes':
6
+ // Don't report our own attribute has changed.
7
+ if (mutation.attributeName === "data-__webdriver_id") {
8
+ break;
9
+ }
10
+ const curr = mutation.target.getAttribute(mutation.attributeName);
11
+ var id = mutation.target.dataset.__webdriver_id
12
+ if (!id) {
13
+ id = Math.random().toString(36).substring(2) + Date.now().toString(36);
14
+ mutation.target.dataset.__webdriver_id = id;
15
+ }
16
+ const json = JSON.stringify({
17
+ 'target': id,
18
+ 'name': mutation.attributeName,
19
+ 'value': curr,
20
+ 'oldValue': mutation.oldValue
21
+ });
22
+ __webdriver_attribute(json);
23
+ break;
24
+ default:
25
+ break;
26
+ }
27
+ }
28
+ });
29
+
30
+ observer.observe(document, {
31
+ 'attributes': true,
32
+ 'attributeOldValue': true,
33
+ 'characterData': true,
34
+ 'characterDataOldValue': true,
35
+ 'childList': true,
36
+ 'subtree': true
37
+ });
38
+ })();
@@ -30,9 +30,10 @@ module Selenium
30
30
  include DriverExtensions::HasNetworkConditions
31
31
  include DriverExtensions::HasWebStorage
32
32
  include DriverExtensions::HasLocation
33
- include DriverExtensions::TakesScreenshot
34
33
  include DriverExtensions::DownloadsFiles
35
34
  include DriverExtensions::HasDevTools
35
+ include DriverExtensions::HasAuthentication
36
+ include DriverExtensions::HasLogEvents
36
37
 
37
38
  def browser
38
39
  :chrome
@@ -45,6 +46,12 @@ module Selenium
45
46
  def execute_cdp(cmd, **params)
46
47
  @bridge.send_command(cmd: cmd, params: params)
47
48
  end
49
+
50
+ private
51
+
52
+ def debugger_address
53
+ capabilities['goog:chromeOptions']['debuggerAddress']
54
+ end
48
55
  end # Driver
49
56
  end # Chrome
50
57
  end # WebDriver
@@ -185,7 +185,7 @@ module Selenium
185
185
  def process_browser_options(browser_options)
186
186
  options = browser_options[KEY]
187
187
  options['binary'] ||= binary_path if binary_path
188
- (options['args'] || []) << "--user-data-dir=#{@profile[:directory]}" if @profile
188
+ (options['args'] || []) << "--user-data-dir=#{@profile.directory}" if @profile
189
189
  merge_extensions(options)
190
190
  end
191
191
 
@@ -48,7 +48,7 @@ module Selenium
48
48
  #
49
49
  # Set a preference in the profile.
50
50
  #
51
- # See https://src.chromium.org/svn/trunk/src/chrome/common/pref_names.cc
51
+ # See https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/pref_names.cc
52
52
  #
53
53
 
54
54
  def []=(key, value)
@@ -50,7 +50,6 @@ require 'selenium/webdriver/common/action_builder'
50
50
  require 'selenium/webdriver/common/html5/shared_web_storage'
51
51
  require 'selenium/webdriver/common/html5/local_storage'
52
52
  require 'selenium/webdriver/common/html5/session_storage'
53
- require 'selenium/webdriver/common/driver_extensions/takes_screenshot'
54
53
  require 'selenium/webdriver/common/driver_extensions/rotatable'
55
54
  require 'selenium/webdriver/common/driver_extensions/has_web_storage'
56
55
  require 'selenium/webdriver/common/driver_extensions/downloads_files'
@@ -64,8 +63,11 @@ require 'selenium/webdriver/common/driver_extensions/has_debugger'
64
63
  require 'selenium/webdriver/common/driver_extensions/uploads_files'
65
64
  require 'selenium/webdriver/common/driver_extensions/has_addons'
66
65
  require 'selenium/webdriver/common/driver_extensions/has_devtools'
66
+ require 'selenium/webdriver/common/driver_extensions/has_authentication'
67
+ require 'selenium/webdriver/common/driver_extensions/has_log_events'
67
68
  require 'selenium/webdriver/common/keys'
68
69
  require 'selenium/webdriver/common/profile_helper'
69
70
  require 'selenium/webdriver/common/options'
71
+ require 'selenium/webdriver/common/takes_screenshot'
70
72
  require 'selenium/webdriver/common/driver'
71
73
  require 'selenium/webdriver/common/element'
@@ -30,6 +30,7 @@ module Selenium
30
30
 
31
31
  class Driver
32
32
  include SearchContext
33
+ include TakesScreenshot
33
34
 
34
35
  class << self
35
36
  #
@@ -360,6 +361,10 @@ module Selenium
360
361
  @service = service_config.launch
361
362
  @service.uri
362
363
  end
364
+
365
+ def screenshot
366
+ bridge.screenshot
367
+ end
363
368
  end # Driver
364
369
  end # WebDriver
365
370
  end # Selenium
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
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 DriverExtensions
23
+ module HasAuthentication
24
+
25
+ #
26
+ # Registers basic authentication handler which is automatically
27
+ # used whenever browser gets an authentication required response.
28
+ # This currently relies on DevTools so is only supported in
29
+ # Chromium browsers.
30
+ #
31
+ # @example Authenticate any request
32
+ # driver.register(username: 'admin', password: '123456')
33
+ #
34
+ # @example Authenticate based on URL
35
+ # driver.register(username: 'admin1', password: '123456', uri: /mysite1\.com/)
36
+ # driver.register(username: 'admin2', password: '123456', uri: /mysite2\.com/)
37
+ #
38
+ # @param [String] username
39
+ # @param [String] password
40
+ # @param [Regexp] uri to associate the credentials with
41
+ #
42
+
43
+ def register(username:, password:, uri: //)
44
+ auth_handlers << {username: username, password: password, uri: uri}
45
+
46
+ devtools.network.set_cache_disabled(cache_disabled: true)
47
+ devtools.fetch.on(:auth_required) do |params|
48
+ authenticate(params['requestId'], params.dig('request', 'url'))
49
+ end
50
+ devtools.fetch.on(:request_paused) do |params|
51
+ devtools.fetch.continue_request(request_id: params['requestId'])
52
+ end
53
+ devtools.fetch.enable(handle_auth_requests: true)
54
+ end
55
+
56
+ private
57
+
58
+ def auth_handlers
59
+ @auth_handlers ||= []
60
+ end
61
+
62
+ def authenticate(request_id, url)
63
+ credentials = auth_handlers.find do |handler|
64
+ url.match?(handler[:uri])
65
+ end
66
+
67
+ if credentials
68
+ devtools.fetch.continue_with_auth(
69
+ request_id: request_id,
70
+ auth_challenge_response: {
71
+ response: 'ProvideCredentials',
72
+ username: credentials[:username],
73
+ password: credentials[:password]
74
+ }
75
+ )
76
+ else
77
+ devtools.fetch.continue_with_auth(
78
+ request_id: request_id,
79
+ auth_challenge_response: {
80
+ response: 'CancelAuth'
81
+ }
82
+ )
83
+ end
84
+ end
85
+
86
+ end # HasAuthentication
87
+ end # DriverExtensions
88
+ end # WebDriver
89
+ end # Selenium
@@ -29,7 +29,8 @@ module Selenium
29
29
  #
30
30
 
31
31
  def devtools
32
- @devtools ||= DevTools.new(capabilities['goog:chromeOptions']['debuggerAddress'])
32
+ version = Integer(capabilities.browser_version.split('.').first)
33
+ @devtools ||= DevTools.new(url: debugger_address, version: version)
33
34
  end
34
35
 
35
36
  end # HasDevTools
@@ -0,0 +1,143 @@
1
+ # frozen_string_literal: true
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 DriverExtensions
23
+ module HasLogEvents
24
+ include Atoms
25
+
26
+ KINDS = %i[console exception mutation].freeze
27
+
28
+ #
29
+ # Registers listener to be called whenever browser receives
30
+ # a new Console API message such as console.log() or an unhandled
31
+ # exception.
32
+ #
33
+ # This currently relies on DevTools so is only supported in
34
+ # Chromium browsers.
35
+ #
36
+ # @example Collect console messages
37
+ # logs = []
38
+ # driver.on_log_event(:console) do |event|
39
+ # logs.push(event)
40
+ # end
41
+ #
42
+ # @example Collect JavaScript exceptions
43
+ # exceptions = []
44
+ # driver.on_log_event(:exception) do |event|
45
+ # exceptions.push(event)
46
+ # end
47
+ #
48
+ # @example Collect DOM mutations
49
+ # mutations = []
50
+ # driver.on_log_event(:mutation) do |event|
51
+ # mutations.push(event)
52
+ # end
53
+ #
54
+ # @param [Symbol] kind :console, :exception or :mutation
55
+ # @param [#call] block which is called when event happens
56
+ # @yieldparam [DevTools::ConsoleEvent, DevTools::ExceptionEvent, DevTools::MutationEvent]
57
+ #
58
+
59
+ def on_log_event(kind, &block)
60
+ raise Error::WebDriverError, "Don't know how to handle #{kind} events" unless KINDS.include?(kind)
61
+
62
+ enabled = log_listeners[kind].any?
63
+ log_listeners[kind] << block
64
+ return if enabled
65
+
66
+ devtools.runtime.enable
67
+ __send__("log_#{kind}_events")
68
+ end
69
+
70
+ private
71
+
72
+ def log_listeners
73
+ @log_listeners ||= Hash.new { |listeners, kind| listeners[kind] = [] }
74
+ end
75
+
76
+ def log_console_events
77
+ devtools.runtime.on(:console_api_called) do |params|
78
+ event = DevTools::ConsoleEvent.new(
79
+ type: params['type'],
80
+ timestamp: params['timestamp'],
81
+ args: params['args']
82
+ )
83
+
84
+ log_listeners[:console].each do |listener|
85
+ listener.call(event)
86
+ end
87
+ end
88
+ end
89
+
90
+ def log_exception_events
91
+ devtools.runtime.on(:exception_thrown) do |params|
92
+ event = DevTools::ExceptionEvent.new(
93
+ description: params.dig('exceptionDetails', 'exception', 'description'),
94
+ timestamp: params['timestamp'],
95
+ stacktrace: params.dig('exceptionDetails', 'stackTrace', 'callFrames')
96
+ )
97
+
98
+ log_listeners[:exception].each do |listener|
99
+ listener.call(event)
100
+ end
101
+ end
102
+ end
103
+
104
+ def log_mutation_events
105
+ devtools.page.enable
106
+
107
+ devtools.runtime.add_binding(name: '__webdriver_attribute')
108
+ execute_script(mutation_listener)
109
+ script = devtools.page.add_script_to_evaluate_on_new_document(source: mutation_listener)
110
+ pinned_scripts[mutation_listener] = script['identifier']
111
+
112
+ devtools.runtime.on(:binding_called, &method(:log_mutation_event))
113
+ end
114
+
115
+ def log_mutation_event(params)
116
+ payload = JSON.parse(params['payload'])
117
+ elements = find_elements(css: "*[data-__webdriver_id='#{payload['target']}']")
118
+ return if elements.empty?
119
+
120
+ event = DevTools::MutationEvent.new(
121
+ element: elements.first,
122
+ attribute_name: payload['name'],
123
+ current_value: payload['value'],
124
+ old_value: payload['oldValue']
125
+ )
126
+
127
+ log_listeners[:mutation].each do |log_listener|
128
+ log_listener.call(event)
129
+ end
130
+ end
131
+
132
+ def mutation_listener
133
+ @mutation_listener ||= read_atom(:mutationListener)
134
+ end
135
+
136
+ def pinned_scripts
137
+ @pinned_scripts ||= {}
138
+ end
139
+
140
+ end # HasLogEvents
141
+ end # DriverExtensions
142
+ end # WebDriver
143
+ end # Selenium