selenium-webdriver 4.35.0 → 4.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES +111 -0
  3. data/Gemfile +1 -4
  4. data/LICENSE +1 -1
  5. data/NOTICE +1 -1
  6. data/README.md +43 -23
  7. data/bin/linux/selenium-manager +0 -0
  8. data/bin/macos/selenium-manager +0 -0
  9. data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +5971 -0
  10. data/bin/selenium-manager.cdx.json +11629 -0
  11. data/bin/windows/selenium-manager.exe +0 -0
  12. data/lib/selenium/server.rb +30 -5
  13. data/lib/selenium/webdriver/atoms/findElements.js +272 -54
  14. data/lib/selenium/webdriver/atoms/getAttribute.js +152 -6
  15. data/lib/selenium/webdriver/atoms/isDisplayed.js +385 -28
  16. data/lib/selenium/webdriver/bidi/browser.rb +71 -0
  17. data/lib/selenium/webdriver/bidi/browsing_context.rb +3 -2
  18. data/lib/selenium/webdriver/bidi/{log/filter_by.rb → error.rb} +20 -16
  19. data/lib/selenium/webdriver/bidi/log_handler.rb +5 -0
  20. data/lib/selenium/webdriver/bidi/network/cookies.rb +13 -9
  21. data/lib/selenium/webdriver/bidi/network/credentials.rb +4 -0
  22. data/lib/selenium/webdriver/bidi/network/headers.rb +4 -0
  23. data/lib/selenium/webdriver/bidi/network/intercepted_auth.rb +4 -0
  24. data/lib/selenium/webdriver/bidi/network/intercepted_item.rb +4 -0
  25. data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +20 -4
  26. data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +24 -6
  27. data/lib/selenium/webdriver/bidi/network/url_pattern.rb +4 -0
  28. data/lib/selenium/webdriver/bidi/network.rb +18 -9
  29. data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +495 -0
  30. data/lib/selenium/webdriver/bidi/protocol/browser.rb +250 -0
  31. data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +798 -0
  32. data/lib/selenium/webdriver/bidi/{log/base_log_entry.rb → protocol/domain.rb} +22 -11
  33. data/lib/selenium/webdriver/bidi/protocol/emulation.rb +448 -0
  34. data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
  35. data/lib/selenium/webdriver/bidi/protocol/input.rb +354 -0
  36. data/lib/selenium/webdriver/bidi/protocol/log.rb +115 -0
  37. data/lib/selenium/webdriver/bidi/protocol/network.rb +720 -0
  38. data/lib/selenium/webdriver/bidi/protocol/permissions.rb +75 -0
  39. data/lib/selenium/webdriver/bidi/protocol/script.rb +1052 -0
  40. data/lib/selenium/webdriver/bidi/protocol/session.rb +286 -0
  41. data/lib/selenium/webdriver/bidi/protocol/speculation.rb +58 -0
  42. data/lib/selenium/webdriver/bidi/protocol/storage.rb +183 -0
  43. data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +88 -0
  44. data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +132 -0
  45. data/lib/selenium/webdriver/bidi/protocol.rb +42 -0
  46. data/lib/selenium/webdriver/bidi/serialization/record.rb +402 -0
  47. data/lib/selenium/webdriver/bidi/serialization/union.rb +156 -0
  48. data/lib/selenium/webdriver/bidi/serialization.rb +90 -0
  49. data/lib/selenium/webdriver/bidi/session.rb +4 -0
  50. data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +1420 -0
  51. data/lib/selenium/webdriver/bidi/support/check_generated.rb +63 -0
  52. data/lib/selenium/webdriver/bidi/transport.rb +57 -0
  53. data/lib/selenium/webdriver/bidi.rb +4 -1
  54. data/lib/selenium/webdriver/chrome/driver.rb +4 -3
  55. data/lib/selenium/webdriver/chrome/service.rb +13 -0
  56. data/lib/selenium/webdriver/chromium/driver.rb +0 -1
  57. data/lib/selenium/webdriver/chromium/options.rb +23 -1
  58. data/lib/selenium/webdriver/chromium/profile.rb +6 -0
  59. data/lib/selenium/webdriver/common/child_process.rb +2 -1
  60. data/lib/selenium/webdriver/common/client_config.rb +97 -0
  61. data/lib/selenium/webdriver/common/driver.rb +13 -7
  62. data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
  63. data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
  64. data/lib/selenium/webdriver/common/driver_extensions/{has_bidi.rb → has_session_events.rb} +19 -7
  65. data/lib/selenium/webdriver/common/driver_finder.rb +35 -25
  66. data/lib/selenium/webdriver/common/error.rb +10 -3
  67. data/lib/selenium/webdriver/common/local_driver.rb +29 -12
  68. data/lib/selenium/webdriver/common/logger.rb +28 -0
  69. data/lib/selenium/webdriver/common/manager.rb +2 -0
  70. data/lib/selenium/webdriver/common/options.rb +41 -2
  71. data/lib/selenium/webdriver/common/platform.rb +1 -3
  72. data/lib/selenium/webdriver/common/proxy.rb +1 -9
  73. data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
  74. data/lib/selenium/webdriver/common/service.rb +4 -8
  75. data/lib/selenium/webdriver/common/service_manager.rb +36 -4
  76. data/lib/selenium/webdriver/common/socket_poller.rb +1 -1
  77. data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
  78. data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +1 -1
  79. data/lib/selenium/webdriver/common/wait.rb +4 -1
  80. data/lib/selenium/webdriver/common/websocket_connection.rb +73 -37
  81. data/lib/selenium/webdriver/common.rb +2 -1
  82. data/lib/selenium/webdriver/devtools/response.rb +3 -3
  83. data/lib/selenium/webdriver/devtools.rb +1 -1
  84. data/lib/selenium/webdriver/edge/driver.rb +4 -3
  85. data/lib/selenium/webdriver/edge/service.rb +14 -0
  86. data/lib/selenium/webdriver/firefox/driver.rb +4 -6
  87. data/lib/selenium/webdriver/firefox/options.rb +19 -0
  88. data/lib/selenium/webdriver/firefox/profile.rb +13 -6
  89. data/lib/selenium/webdriver/firefox/service.rb +31 -2
  90. data/lib/selenium/webdriver/ie/driver.rb +4 -3
  91. data/lib/selenium/webdriver/ie/service.rb +10 -0
  92. data/lib/selenium/webdriver/remote/bidi_bridge.rb +44 -10
  93. data/lib/selenium/webdriver/remote/bridge.rb +20 -14
  94. data/lib/selenium/webdriver/remote/driver.rb +15 -4
  95. data/lib/selenium/webdriver/remote/features.rb +26 -1
  96. data/lib/selenium/webdriver/remote/http/common.rb +57 -12
  97. data/lib/selenium/webdriver/remote/http/curb.rb +6 -8
  98. data/lib/selenium/webdriver/remote/http/default.rb +56 -39
  99. data/lib/selenium/webdriver/safari/driver.rb +4 -3
  100. data/lib/selenium/webdriver/safari/options.rb +23 -4
  101. data/lib/selenium/webdriver/safari.rb +1 -6
  102. data/lib/selenium/webdriver/support/block_event_listener.rb +5 -1
  103. data/lib/selenium/webdriver/support/color.rb +14 -14
  104. data/lib/selenium/webdriver/support/event_firing_bridge.rb +5 -1
  105. data/lib/selenium/webdriver/support/guards/guard.rb +30 -14
  106. data/lib/selenium/webdriver/support/guards.rb +11 -4
  107. data/lib/selenium/webdriver/version.rb +1 -1
  108. data/lib/selenium/webdriver.rb +7 -2
  109. data/selenium-webdriver.gemspec +1 -1
  110. metadata +33 -11
  111. data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
  112. data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +0 -33
  113. data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +0 -33
  114. data/lib/selenium/webdriver/bidi/log_inspector.rb +0 -147
Binary file
@@ -21,6 +21,7 @@ require 'selenium/webdriver/common/child_process'
21
21
  require 'selenium/webdriver/common/port_prober'
22
22
  require 'selenium/webdriver/common/socket_poller'
23
23
  require 'net/http'
24
+ require 'json'
24
25
 
25
26
  module Selenium
26
27
  #
@@ -118,7 +119,7 @@ module Selenium
118
119
  json = http.get('/repos/seleniumhq/selenium/releases').body
119
120
  all_assets = JSON.parse(json).map { |release| release['assets'] }.flatten
120
121
  server_assets = all_assets.select { |asset| asset['name'].match(/selenium-server-(\d+\.\d+\.\d+)\.jar/) }
121
- server_assets.each_with_object({}) { |asset, hash| hash[asset.delete('name')] = asset }
122
+ server_assets.to_h { |asset| [asset.delete('name'), asset] }
122
123
  end
123
124
  end
124
125
 
@@ -203,7 +204,7 @@ module Selenium
203
204
 
204
205
  def start
205
206
  process.start
206
- poll_for_service
207
+ poll_for_ready
207
208
 
208
209
  process.wait unless @background
209
210
  end
@@ -219,6 +220,20 @@ module Selenium
219
220
  "http://#{@host}:#{@port}/wd/hub"
220
221
  end
221
222
 
223
+ def status_ok?
224
+ return false unless @process&.alive? && socket_connected?
225
+
226
+ Net::HTTP.start(@host, @port, open_timeout: 2, read_timeout: 2) do |http|
227
+ response = http.get('/status')
228
+ return false unless response.is_a?(Net::HTTPSuccess)
229
+
230
+ status = JSON.parse(response.body)
231
+ status.dig('value', 'ready') == true
232
+ end
233
+ rescue StandardError
234
+ false
235
+ end
236
+
222
237
  def <<(arg)
223
238
  if arg.is_a?(Array)
224
239
  @additional_args += arg
@@ -257,10 +272,20 @@ module Selenium
257
272
  end
258
273
  end
259
274
 
260
- def poll_for_service
261
- return if socket.connected?
275
+ def poll_for_ready
276
+ start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
277
+ loop do
278
+ return if status_ok?
279
+
280
+ elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time
281
+ raise Error, "remote server not ready in #{@timeout} seconds" if elapsed > @timeout
282
+
283
+ sleep 0.5
284
+ end
285
+ end
262
286
 
263
- raise Error, "remote server not launched in #{@timeout} seconds"
287
+ def socket_connected?
288
+ @socket_connected ||= socket.connected?
264
289
  end
265
290
 
266
291
  def poll_for_shutdown
@@ -1,54 +1,272 @@
1
- function(){return (function(){var h=this||self;
2
- function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
3
- b&&"undefined"==typeof a.call)return"object";return b}function k(a){return"function"==aa(a)}function n(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var ca=window;function q(a,b){this.code=a;this.a=r[a]||u;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||""}ba(q,Error);var u="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=u;r[30]=u;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state";
4
- r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=u;r[9]="unknown command";var da;var ea=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},w=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e="string"===typeof a?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},fa=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,
5
- 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 l=f[g];b.call(void 0,l,g,a)&&(d[e++]=l)}return d},ha=Array.prototype.map?function(a,b){return Array.prototype.map.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=Array(c),e="string"===typeof a?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d},ia=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,
6
- 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!0;return!1},ja=Array.prototype.every?function(a,b,c){return Array.prototype.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e="string"===typeof a?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};
7
- function ka(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]}function la(a,b){a.sort(b||ma)}function ma(a,b){return a>b?1:a<b?-1:0};function na(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var x=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};
8
- function oa(a,b){var c=0;a=x(String(a)).split(".");b=x(String(b)).split(".");for(var d=Math.max(a.length,b.length),e=0;0==c&&e<d;e++){var f=a[e]||"",g=b[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==f[0].length&&0==g[0].length)break;c=pa(0==f[1].length?0:parseInt(f[1],10),0==g[1].length?0:parseInt(g[1],10))||pa(0==f[2].length,0==g[2].length)||pa(f[2],g[2]);f=f[3];g=g[3]}while(0==c)}return c}function pa(a,b){return a<b?-1:a>b?1:0};var y;a:{var qa=h.navigator;if(qa){var ra=qa.userAgent;if(ra){y=ra;break a}}y=""}function C(a){return-1!=y.indexOf(a)};function sa(){return C("Firefox")||C("FxiOS")}function ta(){return(C("Chrome")||C("CriOS"))&&!C("Edge")};function ua(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function D(){return C("iPhone")&&!C("iPod")&&!C("iPad")};function va(a,b){var c=xa;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var ya=C("Opera"),E=C("Trident")||C("MSIE"),za=C("Edge"),Aa=C("Gecko")&&!(-1!=y.toLowerCase().indexOf("webkit")&&!C("Edge"))&&!(C("Trident")||C("MSIE"))&&!C("Edge"),Ba=-1!=y.toLowerCase().indexOf("webkit")&&!C("Edge");function Ca(){var a=h.document;return a?a.documentMode:void 0}var Da;
9
- a:{var Ea="",Fa=function(){var a=y;if(Aa)return/rv:([^\);]+)(\)|;)/.exec(a);if(za)return/Edge\/([\d\.]+)/.exec(a);if(E)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ba)return/WebKit\/(\S+)/.exec(a);if(ya)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Fa&&(Ea=Fa?Fa[1]:"");if(E){var Ga=Ca();if(null!=Ga&&Ga>parseFloat(Ea)){Da=String(Ga);break a}}Da=Ea}var xa={};function Ha(a){return va(a,function(){return 0<=oa(Da,a)})}var F;F=h.document&&E?Ca():void 0;function G(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}G.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};G.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};G.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function H(a,b){this.width=a;this.height=b}H.prototype.aspectRatio=function(){return this.width/this.height};H.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};H.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};H.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function I(a){return a?new Ia(J(a)):da||(da=new Ia)}function Ja(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function Ka(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}function J(a){return 9==a.nodeType?a:a.ownerDocument||a.document}
10
- function La(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function Ia(a){this.a=a||h.document||document}
11
- function L(a,b,c,d){a=d||a.a;var e=b&&"*"!=b?String(b).toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(e||c))c=a.querySelectorAll(e+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(b=a.getElementsByClassName(c),e){a={};for(var f=d=0,g;g=b[f];f++)e==g.nodeName&&(a[d++]=g);a.length=d;c=a}else c=b;else if(b=a.getElementsByTagName(e||"*"),c){a={};for(f=d=0;g=b[f];f++){e=g.className;var l;if(l="function"==typeof e.split)l=0<=ea(e.split(/\s+/),c);l&&(a[d++]=g)}a.length=d;c=a}else c=b;return c}
12
- ;var Ma={l:function(a){return!(!a.querySelectorAll||!a.querySelector)},g:function(a,b){if(!a)throw new q(32,"No class name specified");a=x(a);if(-1!==a.indexOf(" "))throw new q(32,"Compound class names not permitted");if(Ma.l(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(c){throw new q(32,"An invalid or illegal class name was specified");}a=L(I(b),"*",a,b);return a.length?a[0]:null},c:function(a,b){if(!a)throw new q(32,"No class name specified");a=x(a);if(-1!==a.indexOf(" "))throw new q(32,
13
- "Compound class names not permitted");if(Ma.l(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new q(32,"An invalid or illegal class name was specified");}return L(I(b),"*",a,b)}};var Na=sa(),Oa=D()||C("iPod"),Ra=C("iPad"),Sa=C("Android")&&!(ta()||sa()||C("Opera")||C("Silk")),Ta=ta(),Ua=C("Safari")&&!(ta()||C("Coast")||C("Opera")||C("Edge")||C("Edg/")||C("OPR")||sa()||C("Silk")||C("Android"))&&!(D()||C("iPad")||C("iPod"));function M(a){return(a=a.exec(y))?a[1]:""}(function(){if(Na)return M(/Firefox\/([0-9.]+)/);if(E||za||ya)return Da;if(Ta)return D()||C("iPad")||C("iPod")?M(/CriOS\/([0-9.]+)/):M(/Chrome\/([0-9.]+)/);if(Ua&&!(D()||C("iPad")||C("iPod")))return M(/Version\/([0-9.]+)/);if(Oa||Ra){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(y);if(a)return a[1]+"."+a[2]}else if(Sa)return(a=M(/Android\s+([0-9.]+)/))?a:M(/Version\/([0-9.]+)/);return""})();var Va=E&&!(8<=Number(F)),Wa=E&&!(9<=Number(F));var N={g:function(a,b){if(!k(b.querySelector)&&E&&(E?0<=oa(F,8):Ha(8))&&!n(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new q(32,"No selector specified");a=x(a);try{var c=b.querySelector(a)}catch(d){throw new q(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},c:function(a,b){if(!k(b.querySelectorAll)&&E&&(E?0<=oa(F,8):Ha(8))&&!n(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new q(32,"No selector specified");
14
- a=x(a);try{return b.querySelectorAll(a)}catch(c){throw new q(32,"An invalid or illegal selector was specified");}}};var Xa={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",
15
- 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",
16
- 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",
17
- 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",
18
- 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",
19
- 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 Ya="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Za=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,$a=/^#(?:[0-9a-f]{3}){1,2}$/i,ab=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,bb=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function O(a,b){b=b.toLowerCase();return"style"==b?cb(a.style.cssText):Va&&"value"==b&&P(a,"INPUT")?a.value:Wa&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var db=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;
20
- function cb(a){var b=[];w(a.split(db),function(c){var d=c.indexOf(":");0<d&&(c=[c.slice(0,d),c.slice(d+1)],2==c.length&&b.push(c[0].toLowerCase(),":",c[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function P(a,b){b&&"string"!==typeof b&&(b=b.toString());return a instanceof HTMLFormElement?!!a&&1==a.nodeType&&(!b||"FORM"==b):!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};function eb(a,b,c,d){this.j=a;this.a=b;this.b=c;this.h=d}eb.prototype.ceil=function(){this.j=Math.ceil(this.j);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.h=Math.ceil(this.h);return this};eb.prototype.floor=function(){this.j=Math.floor(this.j);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.h=Math.floor(this.h);return this};eb.prototype.round=function(){this.j=Math.round(this.j);this.a=Math.round(this.a);this.b=Math.round(this.b);this.h=Math.round(this.h);return this};function Q(a,b,c,d){this.a=a;this.b=b;this.width=c;this.height=d}Q.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};Q.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};
21
- Q.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 fb="function"===typeof ShadowRoot;function gb(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return P(a)?a:null}
22
- function R(a,b){b=ua(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Wa?"styleFloat":"cssFloat";a:{var c=b;var d=J(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||hb(a,b);if(null===a)a=null;else if(0<=ea(Ya,b)){b:{var e=a.match(ab);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(bb))if(b=
23
- 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=Xa[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(Za,"#$1$1$2$2$3$3")),!$a.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}
24
- function hb(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&k(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(a=gb(a))?hb(a,b):null}
25
- function ib(a,b,c){function d(g){var l=S(g);return 0<l.height&&0<l.width?!0:P(g,"PATH")&&(0<l.height||0<l.width)?(g=R(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=R(g,"overflow")&&ia(g.childNodes,function(z){return 3==z.nodeType||P(z)&&d(z)})}function e(g){return jb(g)==T&&ja(g.childNodes,function(l){return!P(l)||e(l)||!d(l)})}if(!P(a))throw Error("Argument to isShown must be of type Element");if(P(a,"BODY"))return!0;if(P(a,"OPTION")||P(a,"OPTGROUP"))return a=La(a,function(g){return P(g,"SELECT")}),
26
- !!a&&ib(a,!0,c);var f=kb(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&ib(f.image,b,c);if(P(a,"INPUT")&&"hidden"==a.type.toLowerCase()||P(a,"NOSCRIPT"))return!1;f=R(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=lb(a))&&d(a)?!e(a):!1}
27
- function mb(a){function b(c){if(P(c)&&("none"==R(c,"display")||"hidden"==R(c,"content-visibility")))return!1;var d;if((d=c.parentNode)&&d.shadowRoot&&void 0!==c.assignedSlot)d=c.assignedSlot?c.assignedSlot.parentNode:null;else if(c.getDestinationInsertionPoints){var e=c.getDestinationInsertionPoints();0<e.length&&(d=e[e.length-1])}if(fb&&d instanceof ShadowRoot){if(d.host.shadowRoot&&d.host.shadowRoot!==d)return!1;d=d.host}return!d||9!=d.nodeType&&11!=d.nodeType?d&&P(d,"DETAILS")&&!d.open&&!P(c,"SUMMARY")?
28
- !1:!!d&&b(d):!0}return ib(a,!1,b)}var T="hidden";
29
- function jb(a){function b(m){function p(wa){if(wa==g)return!0;var Pa=R(wa,"display");return 0==Pa.lastIndexOf("inline",0)||"contents"==Pa||"absolute"==Qa&&"static"==R(wa,"position")?!1:!0}var Qa=R(m,"position");if("fixed"==Qa)return A=!0,m==g?null:g;for(m=gb(m);m&&!p(m);)m=gb(m);return m}function c(m){var p=m;if("visible"==z)if(m==g&&l)p=l;else if(m==l)return{x:"visible",y:"visible"};p={x:R(p,"overflow-x"),y:R(p,"overflow-y")};m==g&&(p.x="visible"==p.x?"auto":p.x,p.y="visible"==p.y?"auto":p.y);return p}
30
- function d(m){if(m==g){var p=(new Ia(f)).a;m=p.scrollingElement?p.scrollingElement:Ba||"CSS1Compat"!=p.compatMode?p.body||p.documentElement:p.documentElement;p=p.parentWindow||p.defaultView;m=E&&Ha("10")&&p.pageYOffset!=m.scrollTop?new G(m.scrollLeft,m.scrollTop):new G(p.pageXOffset||m.scrollLeft,p.pageYOffset||m.scrollTop)}else m=new G(m.scrollLeft,m.scrollTop);return m}var e=nb(a),f=J(a),g=f.documentElement,l=f.body,z=R(g,"overflow"),A;for(a=b(a);a;a=b(a)){var t=c(a);if("visible"!=t.x||"visible"!=
31
- t.y){var v=S(a);if(0==v.width||0==v.height)return T;var B=e.a<v.a,K=e.b<v.b;if(B&&"hidden"==t.x||K&&"hidden"==t.y)return T;if(B&&"visible"!=t.x||K&&"visible"!=t.y){B=d(a);K=e.b<v.b-B.y;if(e.a<v.a-B.x&&"visible"!=t.x||K&&"visible"!=t.x)return T;e=jb(a);return e==T?T:"scroll"}B=e.h>=v.a+v.width;v=e.j>=v.b+v.height;if(B&&"hidden"==t.x||v&&"hidden"==t.y)return T;if(B&&"visible"!=t.x||v&&"visible"!=t.y){if(A&&(t=d(a),e.h>=g.scrollWidth-t.x||e.a>=g.scrollHeight-t.y))return T;e=jb(a);return e==T?T:"scroll"}}}return"none"}
32
- function S(a){var b=kb(a);if(b)return b.rect;if(P(a,"HTML"))return a=J(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new H(a.clientWidth,a.clientHeight),new Q(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new Q(0,0,0,0)}b=new Q(c.left,c.top,c.right-c.left,c.bottom-c.top);E&&a.ownerDocument.body&&(a=J(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
33
- return b}function kb(a){var b=P(a,"MAP");if(!b&&!P(a,"AREA"))return null;var c=b?a:P(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=N.g('*[usemap="#'+c.name+'"]',J(c)))&&(e=S(d),b||"default"==a.shape.toLowerCase()||(a=ob(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new Q(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 Q(0,0,0,0)}}
34
- function ob(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 Q(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new Q(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 Q(b,c,d-b,e-c)}return new Q(0,0,0,0)}function nb(a){a=S(a);return new eb(a.b,a.a+a.width,a.b+a.height,a.a)}
35
- function pb(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function qb(a){var b=[];fb?rb(a,b):sb(a,b);a=ha(b,pb);return pb(a.join("\n")).replace(/\xa0/g," ")}
36
- function tb(a,b,c){if(P(a,"BR"))b.push("");else{var d=P(a,"TD"),e=R(a,"display"),f=!d&&!(0<=ea(ub,e)),g=void 0!==a.previousElementSibling?a.previousElementSibling:Ja(a.previousSibling);g=g?R(g,"display"):"";var l=R(a,"float")||R(a,"cssFloat")||R(a,"styleFloat");!f||"run-in"==g&&"none"==l||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var z=mb(a),A=null,t=null;z&&(A=R(a,"white-space"),t=R(a,"text-transform"));w(a.childNodes,function(v){c(v,b,z,A,t)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||
37
- na(a)||(b[b.length-1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function sb(a,b){tb(a,b,function(c,d,e,f,g){3==c.nodeType&&e?vb(c,d,f,g):P(c)&&sb(c,d)})}var ub="inline inline-block inline-table none table-cell table-column table-column-group".split(" ");
38
- function vb(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(E?/(^|\s|\b)(\S)/g:/(^|\s|\b)(\S)/gu,function(e,f,g){return f+g.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";na(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));
39
- b.push(c+a)}function lb(a){if(Wa){if("relative"==R(a,"position"))return 1;a=R(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return wb(a)}function wb(a){var b=1,c=R(a,"opacity");c&&(b=Number(c));(a=gb(a))&&(b*=wb(a));return b}
40
- function xb(a,b,c,d,e){if(3==a.nodeType&&c)vb(a,b,d,e);else if(P(a))if(P(a,"CONTENT")||P(a,"SLOT")){for(var f=a;f.parentNode;)f=f.parentNode;f instanceof ShadowRoot?(f=P(a,"CONTENT")?a.getDistributedNodes():a.assignedNodes(),w(0<f.length?f:a.childNodes,function(g){xb(g,b,c,d,e)})):rb(a,b)}else if(P(a,"SHADOW")){for(f=a;f.parentNode;)f=f.parentNode;if(f instanceof ShadowRoot&&(a=f))for(a=a.olderShadowRoot;a;)w(a.childNodes,function(g){xb(g,b,c,d,e)}),a=a.olderShadowRoot}else rb(a,b)}
41
- function rb(a,b){a.shadowRoot&&w(a.shadowRoot.childNodes,function(c){xb(c,b,!0,null,null)});tb(a,b,function(c,d,e,f,g){var l=null;1==c.nodeType?l=c:3==c.nodeType&&(l=c);null!=l&&(null!=l.assignedSlot||l.getDestinationInsertionPoints&&0<l.getDestinationInsertionPoints().length)||xb(c,d,e,f,g)})};var yb={l:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},g:function(a,b){var c=I(b),d="string"===typeof a?c.a.getElementById(a):a;return d?O(d,"id")==a&&b!=d&&Ka(b,d)?d:ka(L(c,"*"),function(e){return O(e,"id")==a&&b!=e&&Ka(b,e)}):null},c:function(a,b){if(!a)return[];if(yb.l(b,a))try{return b.querySelectorAll("#"+yb.F(a))}catch(c){return[]}b=L(I(b),"*",null,b);return fa(b,function(c){return O(c,"id")==a})},F:function(a){return a.replace(/([\s'"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g,
42
- "\\$1")}};var U={},zb={};U.v=function(a,b,c){try{var d=N.c("a",b)}catch(e){d=L(I(b),"A",null,b)}return ka(d,function(e){e=qb(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};U.u=function(a,b,c){try{var d=N.c("a",b)}catch(e){d=L(I(b),"A",null,b)}return fa(d,function(e){e=qb(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};U.g=function(a,b){return U.v(a,b,!1)};U.c=function(a,b){return U.u(a,b,!1)};zb.g=function(a,b){return U.v(a,b,!0)};
43
- zb.c=function(a,b){return U.u(a,b,!0)};var V={i:function(a,b){return function(c){var d=V.f(a);d=S(d);c=S(c);return b.call(null,d,c)}},C:function(a){return V.i(a,function(b,c){return c.b+c.height<=b.b})},D:function(a){return V.i(a,function(b,c){return c.b>=b.b+b.height})},H:function(a){return V.i(a,function(b,c){return c.a+c.width<=b.a})},J:function(a){return V.i(a,function(b,c){return c.a>=b.a+b.width})},L:function(a){return V.i(a,function(b,c){return c.a<b.a+b.width&&c.a+c.width>b.a&&c.b+c.height<=b.b})},M:function(a){return V.i(a,function(b,
44
- c){return c.a<b.a+b.width&&c.a+c.width>b.a&&c.b>=b.b+b.height})},N:function(a){return V.i(a,function(b,c){return c.b<b.b+b.height&&c.b+c.height>b.b&&c.a+c.width<=b.a})},O:function(a){return V.i(a,function(b,c){return c.b<b.b+b.height&&c.b+c.height>b.b&&c.a>=b.a+b.width})},I:function(a,b){var c;b?c=b:"number"==typeof a.distance&&(c=a.distance);c||(c=50);return function(d){var e=V.f(a);if(e===d)return!1;e=S(e);d=S(d);e=new Q(e.a-c,e.b-c,e.width+2*c,e.height+2*c);return e.a<=d.a+d.width&&d.a<=e.a+e.width&&
45
- e.b<=d.b+d.height&&d.b<=e.b+e.height}},f:function(a){if(n(a)&&1==a.nodeType)return a;if(k(a))return V.f(a.call(null));if(n(a)){var b;a:{if(b=Ab(a)){var c=Bb[b];if(c&&k(c.g)){b=c.g(a[b],ca.document);break a}}throw new q(61,"Unsupported locator strategy: "+b);}if(!b)throw new q(7,"No element has been found by "+JSON.stringify(a));return b}throw new q(61,"Selector is of wrong type: "+JSON.stringify(a));}};
46
- V.B={above:V.C,below:V.D,left:V.H,near:V.I,right:V.J,straightAbove:V.L,straightBelow:V.M,straightLeft:V.N,straightRight:V.O};V.A={above:V.f,below:V.f,left:V.f,near:V.f,right:V.f,straightAbove:V.f,straightBelow:V.f,straightLeft:V.f,straightRight:V.f};
47
- V.G=function(a,b){var c=[];w(a,function(e){e&&ja(b,function(f){var g=f.kind,l=V.B[g];if(!l)throw new q(61,"Cannot find filter suitable for "+g);return l.apply(null,f.args)(e)},null)&&c.push(e)},null);a=b[b.length-1];var d=V.A[a?a.kind:"unknown"];return d?(a=d.apply(null,a.args))?V.K(a,c):c:c};
48
- V.K=function(a,b){function c(f){f=S(f);return Math.sqrt(Math.pow(d-(f.a+Math.max(1,f.width)/2),2)+Math.pow(e-(f.b+Math.max(1,f.height)/2),2))}a=S(a);var d=a.a+Math.max(1,a.width)/2,e=a.b+Math.max(1,a.height)/2;la(b,function(f,g){return c(f)-c(g)});return b};V.g=function(a,b){a=V.c(a,b);return 0==a.length?null:a[0]};
49
- V.c=function(a,b){if(!a.hasOwnProperty("root")||!a.hasOwnProperty("filters"))throw new q(61,"Locator not suitable for relative locators: "+JSON.stringify(a));var c=a.filters,d=aa(c);if("array"!=d&&("object"!=d||"number"!=typeof c.length))throw new q(61,"Targets should be an array: "+JSON.stringify(a));var e;P(a.root)?e=[a.root]:e=Cb(a.root,b);return 0==e.length?[]:V.G(e,a.filters)};var Db={g:function(a,b){if(""===a)throw new q(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},c:function(a,b){if(""===a)throw new q(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var W={};W.m=function(){var a={P:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
50
- W.s=function(a,b,c){var d=J(a);if(!d.documentElement)return null;try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):W.m;if(E&&!Ha(7))return d.evaluate.call(d,b,a,e,c,null);if(!E||9<=Number(F)){for(var f={},g=d.getElementsByTagName("*"),l=0;l<g.length;++l){var z=g[l],A=z.namespaceURI;if(A&&!f[A]){var t=z.lookupPrefix(A);if(!t){var v=A.match(".*/(\\w+)/?$");t=v?v[1]:"xhtml"}f[A]=t}}var B={},K;for(K in f)B[f[K]]=K;e=function(m){return B[m]||null}}try{return d.evaluate(b,a,e,c,null)}catch(m){if("TypeError"===
51
- m.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):W.m,d.evaluate(b,a,e,c,null);throw m;}}catch(m){if(!Aa||"NS_ERROR_ILLEGAL_VALUE"!=m.name)throw new q(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+m);}};W.o=function(a,b){if(!a||1!=a.nodeType)throw new q(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
52
- W.g=function(a,b){var c=function(){var d=W.s(b,a,9);return d?d.singleNodeValue||null:b.selectSingleNode?(d=J(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||W.o(c,a);return c};
53
- W.c=function(a,b){var c=function(){var d=W.s(b,a,7);if(d){for(var e=d.snapshotLength,f=[],g=0;g<e;++g)f.push(d.snapshotItem(g));return f}return b.selectNodes?(d=J(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();w(c,function(d){W.o(d,a)});return c};var Bb={className:Ma,"class name":Ma,css:N,"css selector":N,relative:V,id:yb,linkText:U,"link text":U,name:{g:function(a,b){b=L(I(b),"*",null,b);return ka(b,function(c){return O(c,"name")==a})},c:function(a,b){b=L(I(b),"*",null,b);return fa(b,function(c){return O(c,"name")==a})}},partialLinkText:zb,"partial link text":zb,tagName:Db,"tag name":Db,xpath:W};function Ab(a){for(var b in a)if(a.hasOwnProperty(b))return b;return null}
54
- function Cb(a,b){var c=Ab(a);if(c){var d=Bb[c];if(d&&k(d.c))return d.c(a[c],b||ca.document)}throw new q(61,"Unsupported locator strategy: "+c);};var Eb=Cb,X=["se_exportedFunctionSymbol"],Y=h;X[0]in Y||"undefined"==typeof Y.execScript||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===Eb?Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=Eb;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}
1
+ (function findElements(target, root) {
2
+ const INVALID_SELECTOR = 'invalid selector';
3
+ const INVALID_ARGUMENT = 'invalid argument';
4
+ const NO_SUCH_ELEMENT = 'no such element';
5
+ function botError(code, message) {
6
+ const err = new Error(message);
7
+ err['code'] = code;
8
+ return err;
9
+ }
10
+ function cssEscapeId(s) {
11
+ return s.replace(/[\s'"\\#.:;,!?+<>=~*^$|%&@`{}\-/\[\]()]/g, (c) => '\\' + c);
12
+ }
13
+ function classNameMany(target, root) {
14
+ if (!target) {
15
+ throw botError(INVALID_SELECTOR, 'No class name specified');
16
+ }
17
+ target = target.trim();
18
+ if (target.indexOf(' ') !== -1) {
19
+ throw botError(INVALID_SELECTOR, 'Compound class names not permitted');
20
+ }
21
+ try {
22
+ return Array.from(root.querySelectorAll('.' + target.replace(/\\/g, '\\\\').replace(/\./g, '\\.')));
23
+ }
24
+ catch (_e) {
25
+ throw botError(INVALID_SELECTOR, 'An invalid or illegal class name was specified');
26
+ }
27
+ }
28
+ function cssMany(target, root) {
29
+ try {
30
+ return Array.from(root.querySelectorAll(target));
31
+ }
32
+ catch (_e) {
33
+ throw botError(INVALID_SELECTOR, 'An invalid or illegal CSS selector was specified: ' + target);
34
+ }
35
+ }
36
+ function idMany(target, root) {
37
+ if (!target) {
38
+ return [];
39
+ }
40
+ if (!/^\d/.test(target)) {
41
+ try {
42
+ return Array.from(root.querySelectorAll('#' + cssEscapeId(target)));
43
+ }
44
+ catch (_e) {
45
+ return [];
46
+ }
47
+ }
48
+ return Array.from(root.querySelectorAll('*')).filter(el => el.getAttribute('id') === target);
49
+ }
50
+ function getLinkText(el) {
51
+ const text = el.innerText !== undefined ? el.innerText : el.textContent || '';
52
+ return text.replace(/^[\s]+|[\s]+$/g, '');
53
+ }
54
+ function linkTextMany(target, root, partial) {
55
+ return Array.from(root.querySelectorAll('a')).filter(el => {
56
+ const text = getLinkText(el);
57
+ return partial ? text.indexOf(target) !== -1 : text === target;
58
+ });
59
+ }
60
+ function nameMany(target, root) {
61
+ return Array.from(root.querySelectorAll('[name="' + target.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"]'));
62
+ }
63
+ function tagNameMany(target, root) {
64
+ if (target === '') {
65
+ throw botError(INVALID_SELECTOR, 'Unable to locate an element with the tagName ""');
66
+ }
67
+ return Array.from(root.getElementsByTagName(target));
68
+ }
69
+ const DEFAULT_NS_RESOLVER = (function () {
70
+ const ns = { svg: 'http://www.w3.org/2000/svg' };
71
+ return (prefix) => ns[prefix] || null;
72
+ })();
73
+ const ORDERED_NODE_SNAPSHOT_TYPE = 7;
74
+ function xpathMany(target, root) {
75
+ const doc = root.documentElement ? root : root.ownerDocument;
76
+ if (!doc.documentElement) {
77
+ return [];
78
+ }
79
+ try {
80
+ let resolver = null;
81
+ if (target.indexOf(':') !== -1) {
82
+ const reversedNs = {};
83
+ const allNodes = doc.getElementsByTagName('*');
84
+ for (let i = 0; i < allNodes.length; i++) {
85
+ const n = allNodes[i];
86
+ const ns = n.namespaceURI;
87
+ if (ns && !reversedNs[ns]) {
88
+ let prefix = n.lookupPrefix(ns);
89
+ if (!prefix) {
90
+ const m = ns.match('.*/(\\w+)/?$');
91
+ prefix = m ? m[1] : 'xhtml';
92
+ }
93
+ reversedNs[ns] = prefix;
94
+ }
95
+ }
96
+ const namespaces = {};
97
+ for (const key in reversedNs) {
98
+ namespaces[reversedNs[key]] = key;
99
+ }
100
+ resolver = (prefix) => namespaces[prefix || ''] || null;
101
+ }
102
+ let result = null;
103
+ try {
104
+ result = doc.evaluate(target, root, resolver, ORDERED_NODE_SNAPSHOT_TYPE, null);
105
+ }
106
+ catch (te) {
107
+ if (te.name === 'TypeError') {
108
+ const fallback = doc.createNSResolver ? doc.createNSResolver(doc.documentElement) : DEFAULT_NS_RESOLVER;
109
+ result = doc.evaluate(target, root, fallback, ORDERED_NODE_SNAPSHOT_TYPE, null);
110
+ }
111
+ else {
112
+ throw te;
113
+ }
114
+ }
115
+ if (!result) {
116
+ return [];
117
+ }
118
+ const results = [];
119
+ for (let i = 0; i < result.snapshotLength; i++) {
120
+ const node = result.snapshotItem(i);
121
+ if (!node || node.nodeType !== Node.ELEMENT_NODE) {
122
+ throw botError(INVALID_SELECTOR, 'The result of the xpath expression "' + target + '" is: ' + node + '. It should be an element.');
123
+ }
124
+ results.push(node);
125
+ }
126
+ return results;
127
+ }
128
+ catch (ex) {
129
+ if (ex.name === 'NS_ERROR_ILLEGAL_VALUE') {
130
+ return [];
131
+ }
132
+ if (ex.code === INVALID_SELECTOR) {
133
+ throw ex;
134
+ }
135
+ throw botError(INVALID_SELECTOR, 'Unable to locate an element with the xpath expression ' + target + ' because of the following error:\n' + ex);
136
+ }
137
+ }
138
+ function getClientRect(element) {
139
+ const r = element.getBoundingClientRect();
140
+ return { left: r.left, top: r.top, width: r.width, height: r.height };
141
+ }
142
+ function resolveAnchor(selector) {
143
+ if (selector instanceof Element) {
144
+ return selector;
145
+ }
146
+ if (typeof selector === 'function') {
147
+ return resolveAnchor(selector());
148
+ }
149
+ if (selector && typeof selector === 'object') {
150
+ const found = findElements(selector);
151
+ if (!found.length) {
152
+ throw botError(NO_SUCH_ELEMENT, 'No element has been found by ' + JSON.stringify(selector));
153
+ }
154
+ return found[0];
155
+ }
156
+ throw botError(INVALID_ARGUMENT, 'Selector is of wrong type: ' + JSON.stringify(selector));
157
+ }
158
+ function makeProximityFilter(selector, test) {
159
+ return (candidate) => test(getClientRect(resolveAnchor(selector)), getClientRect(candidate));
160
+ }
161
+ const RELATIVE_STRATEGIES = {
162
+ above: (sel) => makeProximityFilter(sel, (a, c) => c.top + c.height <= a.top),
163
+ below: (sel) => makeProximityFilter(sel, (a, c) => c.top >= a.top + a.height),
164
+ left: (sel) => makeProximityFilter(sel, (a, c) => c.left + c.width <= a.left),
165
+ right: (sel) => makeProximityFilter(sel, (a, c) => c.left >= a.left + a.width),
166
+ near: (sel, distArg) => {
167
+ const distFromSelector = typeof sel['distance'] === 'number'
168
+ ? sel['distance']
169
+ : 0;
170
+ const distance = typeof distArg === 'number' && distArg > 0 ? distArg : distFromSelector || 50;
171
+ return (candidate) => {
172
+ const anchor = resolveAnchor(sel);
173
+ if (anchor === candidate)
174
+ return false;
175
+ const a = getClientRect(anchor);
176
+ const c = getClientRect(candidate);
177
+ const expanded = { left: a.left - distance, top: a.top - distance, width: a.width + distance * 2, height: a.height + distance * 2 };
178
+ return (c.left < expanded.left + expanded.width &&
179
+ c.left + c.width > expanded.left &&
180
+ c.top < expanded.top + expanded.height &&
181
+ c.top + c.height > expanded.top);
182
+ };
183
+ },
184
+ straightAbove: (sel) => makeProximityFilter(sel, (a, c) => c.left < a.left + a.width && c.left + c.width > a.left && c.top + c.height <= a.top),
185
+ straightBelow: (sel) => makeProximityFilter(sel, (a, c) => c.left < a.left + a.width && c.left + c.width > a.left && c.top >= a.top + a.height),
186
+ straightLeft: (sel) => makeProximityFilter(sel, (a, c) => c.top < a.top + a.height && c.top + c.height > a.top && c.left + c.width <= a.left),
187
+ straightRight: (sel) => makeProximityFilter(sel, (a, c) => c.top < a.top + a.height && c.top + c.height > a.top && c.left >= a.left + a.width),
188
+ };
189
+ function sortByProximity(anchor, elements) {
190
+ const ar = getClientRect(anchor);
191
+ const acx = ar.left + Math.max(1, ar.width) / 2;
192
+ const acy = ar.top + Math.max(1, ar.height) / 2;
193
+ return elements.slice().sort((a, b) => {
194
+ const ra = getClientRect(a);
195
+ const rb = getClientRect(b);
196
+ const da = Math.sqrt(Math.pow(acx - (ra.left + Math.max(1, ra.width) / 2), 2) + Math.pow(acy - (ra.top + Math.max(1, ra.height) / 2), 2));
197
+ const db = Math.sqrt(Math.pow(acx - (rb.left + Math.max(1, rb.width) / 2), 2) + Math.pow(acy - (rb.top + Math.max(1, rb.height) / 2), 2));
198
+ return da - db;
199
+ });
200
+ }
201
+ function relativeMany(target, root) {
202
+ if (!Object.prototype.hasOwnProperty.call(target, 'root') || !Object.prototype.hasOwnProperty.call(target, 'filters')) {
203
+ throw botError(INVALID_ARGUMENT, 'Locator not suitable for relative locators: ' + JSON.stringify(target));
204
+ }
205
+ const filters = target['filters'];
206
+ if (!Array.isArray(filters)) {
207
+ throw botError(INVALID_ARGUMENT, 'Targets should be an array: ' + JSON.stringify(target));
208
+ }
209
+ let elements;
210
+ const rootTarget = target['root'];
211
+ if (rootTarget instanceof Element) {
212
+ elements = [rootTarget];
213
+ }
214
+ else {
215
+ elements = findElements(rootTarget, root);
216
+ }
217
+ if (!elements.length) {
218
+ return [];
219
+ }
220
+ const matched = elements.filter(el => {
221
+ if (!el)
222
+ return false;
223
+ return filters.every(filter => {
224
+ const strategy = RELATIVE_STRATEGIES[filter.kind];
225
+ if (!strategy) {
226
+ throw botError(INVALID_ARGUMENT, 'Cannot find filter suitable for ' + filter.kind);
227
+ }
228
+ return strategy(...filter.args)(el);
229
+ });
230
+ });
231
+ const finalFilter = filters[filters.length - 1];
232
+ if (!finalFilter || !RELATIVE_STRATEGIES[finalFilter.kind]) {
233
+ return matched;
234
+ }
235
+ const lastAnchor = resolveAnchor(finalFilter.args[0]);
236
+ return sortByProximity(lastAnchor, matched);
237
+ }
238
+ const actualRoot = root || document;
239
+ const keys = Object.keys(target).filter(k => Object.prototype.hasOwnProperty.call(target, k));
240
+ if (!keys.length) {
241
+ throw botError(INVALID_ARGUMENT, 'Unsupported locator strategy: (empty)');
242
+ }
243
+ const key = keys[0];
244
+ const value = target[key];
245
+ switch (key) {
246
+ case 'className':
247
+ case 'class name':
248
+ return classNameMany(value, actualRoot);
249
+ case 'css':
250
+ case 'css selector':
251
+ return cssMany(value, actualRoot);
252
+ case 'id':
253
+ return idMany(value, actualRoot);
254
+ case 'linkText':
255
+ case 'link text':
256
+ return linkTextMany(value, actualRoot, false);
257
+ case 'partialLinkText':
258
+ case 'partial link text':
259
+ return linkTextMany(value, actualRoot, true);
260
+ case 'name':
261
+ return nameMany(value, actualRoot);
262
+ case 'tagName':
263
+ case 'tag name':
264
+ return tagNameMany(value, actualRoot);
265
+ case 'xpath':
266
+ return xpathMany(value, actualRoot);
267
+ case 'relative':
268
+ return relativeMany(value, actualRoot);
269
+ default:
270
+ throw botError(INVALID_ARGUMENT, 'Unsupported locator strategy: ' + key);
271
+ }
272
+ })
@@ -1,6 +1,152 @@
1
- function(){return (function(){var d=this||self;function f(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var h=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},k=Array.prototype.forEach?function(a,b){Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,e="string"===typeof a?a.split(""):a,g=0;g<c;g++)g in e&&b.call(void 0,e[g],g,a)};function l(a,b){this.code=a;this.a=m[a]||n;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||""}f(l,Error);var n="unknown error",m={15:"element not selectable",11:"element not visible"};m[31]=n;m[30]=n;m[24]="invalid cookie domain";m[29]="invalid element coordinates";m[12]="invalid element state";m[32]="invalid selector";
2
- m[51]="invalid selector";m[52]="invalid selector";m[17]="javascript error";m[405]="unsupported operation";m[34]="move target out of bounds";m[27]="no such alert";m[7]="no such element";m[8]="no such frame";m[23]="no such window";m[28]="script timeout";m[33]="session not created";m[10]="stale element reference";m[21]="timeout";m[25]="unable to set cookie";m[26]="unexpected alert open";m[13]=n;m[9]="unknown command";var p;a:{var q=d.navigator;if(q){var r=q.userAgent;if(r){p=r;break a}}p=""}function t(a){return-1!=p.indexOf(a)};function u(){return t("Firefox")||t("FxiOS")}function v(){return(t("Chrome")||t("CriOS"))&&!t("Edge")};function w(){return t("iPhone")&&!t("iPod")&&!t("iPad")};var y=t("Opera"),z=t("Trident")||t("MSIE"),A=t("Edge"),B=t("Gecko")&&!(-1!=p.toLowerCase().indexOf("webkit")&&!t("Edge"))&&!(t("Trident")||t("MSIE"))&&!t("Edge"),C=-1!=p.toLowerCase().indexOf("webkit")&&!t("Edge");function D(){var a=d.document;return a?a.documentMode:void 0}var E;
3
- a:{var F="",G=function(){var a=p;if(B)return/rv:([^\);]+)(\)|;)/.exec(a);if(A)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(C)return/WebKit\/(\S+)/.exec(a);if(y)return/(?:Version)[ \/]?(\S+)/.exec(a)}();G&&(F=G?G[1]:"");if(z){var H=D();if(null!=H&&H>parseFloat(F)){E=String(H);break a}}E=F}var I;I=d.document&&z?D():void 0;var J=u(),K=w()||t("iPod"),L=t("iPad"),M=t("Android")&&!(v()||u()||t("Opera")||t("Silk")),N=v(),aa=t("Safari")&&!(v()||t("Coast")||t("Opera")||t("Edge")||t("Edg/")||t("OPR")||u()||t("Silk")||t("Android"))&&!(w()||t("iPad")||t("iPod"));function O(a){return(a=a.exec(p))?a[1]:""}(function(){if(J)return O(/Firefox\/([0-9.]+)/);if(z||A||y)return E;if(N)return w()||t("iPad")||t("iPod")?O(/CriOS\/([0-9.]+)/):O(/Chrome\/([0-9.]+)/);if(aa&&!(w()||t("iPad")||t("iPod")))return O(/Version\/([0-9.]+)/);if(K||L){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(p);if(a)return a[1]+"."+a[2]}else if(M)return(a=O(/Android\s+([0-9.]+)/))?a:O(/Version\/([0-9.]+)/);return""})();var P=z&&!(8<=Number(I)),ba=z&&!(9<=Number(I));var ca={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Q={IMG:" ",BR:"\n"};function R(a,b,c){if(!(a.nodeName in ca))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in Q)b.push(Q[a.nodeName]);else for(a=a.firstChild;a;)R(a,b,c),a=a.nextSibling};function S(a,b){b=b.toLowerCase();return"style"==b?da(a.style.cssText):P&&"value"==b&&T(a,"INPUT")?a.value:ba&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var ea=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;
4
- function da(a){var b=[];k(a.split(ea),function(c){var e=c.indexOf(":");0<e&&(c=[c.slice(0,e),c.slice(e+1)],2==c.length&&b.push(c[0].toLowerCase(),":",c[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function U(a,b){P&&"value"==b&&T(a,"OPTION")&&null===S(a,"value")?(b=[],R(a,b,!1),a=b.join("")):a=a[b];return a}
5
- function T(a,b){b&&"string"!==typeof b&&(b=b.toString());return a instanceof HTMLFormElement?!!a&&1==a.nodeType&&(!b||"FORM"==b):!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function V(a){return T(a,"OPTION")?!0:T(a,"INPUT")?(a=a.type.toLowerCase(),"checkbox"==a||"radio"==a):!1};var fa={"class":"className",readonly:"readOnly"},ha="allowfullscreen allowpaymentrequest allowusermedia async autofocus autoplay checked compact complete controls declare default defaultchecked defaultselected defer disabled ended formnovalidate hidden indeterminate iscontenteditable ismap itemscope loop multiple muted nohref nomodule noresize noshade novalidate nowrap open paused playsinline pubdate readonly required reversed scoped seamless seeking selected truespeed typemustmatch willvalidate".split(" ");function W(a,b){var c=null,e=b.toLowerCase();if("style"==e)return(c=a.style)&&"string"!=typeof c&&(c=c.cssText),c;if(("selected"==e||"checked"==e)&&V(a)){if(!V(a))throw new l(15,"Element is not selectable");b="selected";c=a.type&&a.type.toLowerCase();if("checkbox"==c||"radio"==c)b="checked";return U(a,b)?"true":null}var g=T(a,"A");if(T(a,"IMG")&&"src"==e||g&&"href"==e)return(c=S(a,e))&&(c=U(a,e)),c;if("spellcheck"==e){c=S(a,e);if(null!==c){if("false"==c.toLowerCase())return"false";if("true"==c.toLowerCase())return"true"}return U(a,
6
- e)+""}g=fa[b]||b;if(0<=h(ha,e))return(c=null!==S(a,b)||U(a,g))?"true":null;try{var x=U(a,g)}catch(ia){}(e=null==x)||(e=typeof x,e="object"==e&&null!=x||"function"==e);e?c=S(a,b):c=x;return null!=c?c.toString():null}var X=["se_exportedFunctionSymbol"],Y=d;X[0]in Y||"undefined"==typeof Y.execScript||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===W?Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=W;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}
1
+ (function (element, attribute) {
2
+ const PROPERTY_ALIASES = {
3
+ 'class': 'className',
4
+ 'readonly': 'readOnly',
5
+ };
6
+ const BOOLEAN_PROPERTIES = new Set([
7
+ 'allowfullscreen',
8
+ 'allowpaymentrequest',
9
+ 'allowusermedia',
10
+ 'async',
11
+ 'autofocus',
12
+ 'autoplay',
13
+ 'checked',
14
+ 'compact',
15
+ 'complete',
16
+ 'controls',
17
+ 'declare',
18
+ 'default',
19
+ 'defaultchecked',
20
+ 'defaultselected',
21
+ 'defer',
22
+ 'disabled',
23
+ 'ended',
24
+ 'formnovalidate',
25
+ 'hidden',
26
+ 'indeterminate',
27
+ 'iscontenteditable',
28
+ 'ismap',
29
+ 'itemscope',
30
+ 'loop',
31
+ 'multiple',
32
+ 'muted',
33
+ 'nohref',
34
+ 'nomodule',
35
+ 'noresize',
36
+ 'noshade',
37
+ 'novalidate',
38
+ 'nowrap',
39
+ 'open',
40
+ 'paused',
41
+ 'playsinline',
42
+ 'pubdate',
43
+ 'readonly',
44
+ 'required',
45
+ 'reversed',
46
+ 'scoped',
47
+ 'seamless',
48
+ 'seeking',
49
+ 'selected',
50
+ 'truespeed',
51
+ 'typemustmatch',
52
+ 'willvalidate',
53
+ ]);
54
+ function getAttribute(element, attributeName) {
55
+ return element.getAttribute(attributeName.toLowerCase());
56
+ }
57
+ function getProperty(element, propertyName) {
58
+ return element[propertyName];
59
+ }
60
+ function isElement(node, tagName) {
61
+ const elem = node;
62
+ if (!elem || elem.nodeType !== 1) {
63
+ return false;
64
+ }
65
+ if (!tagName) {
66
+ return true;
67
+ }
68
+ const normalizedTag = tagName.toUpperCase();
69
+ if (node instanceof HTMLFormElement) {
70
+ return normalizedTag === 'FORM';
71
+ }
72
+ return typeof elem.tagName === 'string' && elem.tagName.toUpperCase() === normalizedTag;
73
+ }
74
+ function isSelectable(element) {
75
+ if (isElement(element, 'OPTION')) {
76
+ return true;
77
+ }
78
+ if (isElement(element, 'INPUT')) {
79
+ const type = element.type.toLowerCase();
80
+ return type === 'checkbox' || type === 'radio';
81
+ }
82
+ return false;
83
+ }
84
+ function isSelected(element) {
85
+ var _a;
86
+ if (isElement(element, 'OPTION')) {
87
+ return element.selected;
88
+ }
89
+ const type = (_a = element.type) === null || _a === void 0 ? void 0 : _a.toLowerCase();
90
+ if (type === 'checkbox' || type === 'radio') {
91
+ return element.checked;
92
+ }
93
+ return false;
94
+ }
95
+ function isObject(value) {
96
+ return value !== null && (typeof value === 'object' || typeof value === 'function');
97
+ }
98
+ const name = attribute.toLowerCase();
99
+ if (name === 'style') {
100
+ const style = element.style;
101
+ if (!style) {
102
+ return null;
103
+ }
104
+ return typeof style === 'string' ? style : style.cssText;
105
+ }
106
+ if ((name === 'selected' || name === 'checked') && isSelectable(element)) {
107
+ return isSelected(element) ? 'true' : null;
108
+ }
109
+ const isLink = isElement(element, 'A');
110
+ const isImg = isElement(element, 'IMG');
111
+ if ((isImg && name === 'src') || (isLink && name === 'href')) {
112
+ const attrValue = getAttribute(element, name);
113
+ if (attrValue) {
114
+ return String(getProperty(element, name));
115
+ }
116
+ return attrValue;
117
+ }
118
+ if (name === 'spellcheck') {
119
+ const attrValue = getAttribute(element, name);
120
+ if (attrValue !== null) {
121
+ const lower = attrValue.toLowerCase();
122
+ if (lower === 'false') {
123
+ return 'false';
124
+ }
125
+ if (lower === 'true') {
126
+ return 'true';
127
+ }
128
+ }
129
+ return String(getProperty(element, name));
130
+ }
131
+ const propName = PROPERTY_ALIASES[name] || attribute;
132
+ if (BOOLEAN_PROPERTIES.has(name)) {
133
+ const hasAttr = element.getAttribute(name) !== null;
134
+ const propValue = getProperty(element, propName);
135
+ return hasAttr || !!propValue ? 'true' : null;
136
+ }
137
+ if (name === 'value' && isElement(element, 'LI')) {
138
+ const attrValue = element.getAttribute(name);
139
+ return attrValue != null ? attrValue : null;
140
+ }
141
+ let property;
142
+ try {
143
+ property = getProperty(element, propName);
144
+ }
145
+ catch (_e) {
146
+ }
147
+ if (property == null || isObject(property)) {
148
+ const attrValue = element.getAttribute(name);
149
+ return attrValue != null ? attrValue : null;
150
+ }
151
+ return property != null ? String(property) : null;
152
+ })