testcafe 1.20.2-alpha.1 → 2.0.0-rc.3

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 (231) hide show
  1. package/lib/api/request-hooks/assert-type.js +2 -2
  2. package/lib/api/request-hooks/hook.js +2 -2
  3. package/lib/api/request-hooks/request-logger.js +2 -2
  4. package/lib/api/skip-js-errors/index.js +62 -0
  5. package/lib/api/structure/base-unit.js +2 -2
  6. package/lib/api/structure/fixture.js +13 -13
  7. package/lib/api/structure/test.js +18 -17
  8. package/lib/api/structure/testing-unit.js +26 -16
  9. package/lib/api/test-controller/assertion.js +5 -5
  10. package/lib/api/test-controller/execution-context.js +2 -2
  11. package/lib/api/test-controller/index.js +33 -30
  12. package/lib/api/test-controller/proxy.js +2 -2
  13. package/lib/api/test-page-url.js +4 -4
  14. package/lib/api/test-run-tracker.js +2 -2
  15. package/lib/api/wrap-test-function.js +3 -3
  16. package/lib/assertions/executor.js +4 -4
  17. package/lib/assertions/get-fn.js +3 -3
  18. package/lib/browser/connection/gateway.js +18 -18
  19. package/lib/browser/connection/get-hints.js +8 -8
  20. package/lib/browser/connection/index.js +11 -11
  21. package/lib/browser/connection/remotes-queue.js +4 -4
  22. package/lib/browser/provider/built-in/dedicated/base.js +6 -6
  23. package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/index.js +10 -10
  24. package/lib/browser/provider/built-in/dedicated/chrome/config.js +17 -17
  25. package/lib/browser/provider/built-in/dedicated/chrome/create-temp-profile.js +4 -4
  26. package/lib/browser/provider/built-in/dedicated/chrome/index.js +6 -6
  27. package/lib/browser/provider/built-in/dedicated/chrome/local-chrome.js +6 -6
  28. package/lib/browser/provider/built-in/dedicated/chrome/runtime-info.js +4 -4
  29. package/lib/browser/provider/built-in/dedicated/edge/runtime-info.js +2 -2
  30. package/lib/browser/provider/built-in/dedicated/firefox/config.js +8 -8
  31. package/lib/browser/provider/built-in/dedicated/firefox/create-temp-profile.js +3 -3
  32. package/lib/browser/provider/built-in/dedicated/firefox/index.js +5 -5
  33. package/lib/browser/provider/built-in/dedicated/firefox/local-firefox.js +2 -2
  34. package/lib/browser/provider/built-in/dedicated/firefox/marionette-client/index.js +7 -7
  35. package/lib/browser/provider/built-in/dedicated/firefox/runtime-info.js +3 -3
  36. package/lib/browser/provider/built-in/path.js +2 -2
  37. package/lib/browser/provider/built-in/remote.js +3 -3
  38. package/lib/browser/provider/index.js +5 -5
  39. package/lib/browser/provider/plugin-host.js +5 -6
  40. package/lib/browser/provider/pool.js +4 -4
  41. package/lib/browser/provider/utils/argument-parsing.js +3 -3
  42. package/lib/browser/provider/utils/browser-starter.js +2 -2
  43. package/lib/cli/argument-parser/index.js +52 -41
  44. package/lib/cli/argument-parser/parse-utils.js +2 -2
  45. package/lib/cli/authentication-helper.js +3 -3
  46. package/lib/cli/cli.js +8 -8
  47. package/lib/cli/correct-browsers-and-sources.js +2 -2
  48. package/lib/cli/index.js +2 -2
  49. package/lib/cli/log.js +3 -3
  50. package/lib/cli/remotes-wizard.js +3 -3
  51. package/lib/client/automation/index.js +120 -34
  52. package/lib/client/automation/index.min.js +1 -1
  53. package/lib/client/browser/idle-page/index.js +321 -317
  54. package/lib/client/browser/service-worker.js +244 -290
  55. package/lib/client/core/deps/hammerhead.js +12 -4
  56. package/lib/client/core/index.js +145 -55
  57. package/lib/client/core/index.min.js +1 -1
  58. package/lib/client/core/utils/dom.js +33 -28
  59. package/lib/client/core/utils/position.js +18 -14
  60. package/lib/client/core/utils/style.js +8 -4
  61. package/lib/client/driver/command-executors/client-functions/selector-executor/filter.js +5 -5
  62. package/lib/client/driver/command-executors/client-functions/selector-executor/utils.js +3 -3
  63. package/lib/client/driver/deps/hammerhead.js +12 -4
  64. package/lib/client/driver/deps/testcafe-core.js +12 -4
  65. package/lib/client/driver/deps/testcafe-ui.js +12 -4
  66. package/lib/client/driver/index.js +654 -630
  67. package/lib/client/driver/index.min.js +1 -1
  68. package/lib/client/driver/status.js +2 -2
  69. package/lib/client/ui/index.js +10 -8
  70. package/lib/client/ui/index.min.js +1 -1
  71. package/lib/client-functions/builder-symbol.js +1 -2
  72. package/lib/client-functions/client-function-builder.js +12 -12
  73. package/lib/client-functions/replicator.js +2 -2
  74. package/lib/client-functions/selector-api-execution-mode.js +2 -2
  75. package/lib/client-functions/selectors/add-api.js +48 -48
  76. package/lib/client-functions/selectors/selector-builder.js +17 -17
  77. package/lib/compiler/compile-client-function.js +6 -6
  78. package/lib/compiler/index.js +9 -9
  79. package/lib/compiler/test-file/api-based.js +8 -8
  80. package/lib/compiler/test-file/base.js +6 -6
  81. package/lib/compiler/test-file/exportble-lib-path.js +2 -2
  82. package/lib/compiler/test-file/formats/coffeescript/compiler.js +2 -2
  83. package/lib/compiler/test-file/formats/coffeescript/get-test-list.js +2 -2
  84. package/lib/compiler/test-file/formats/es-next/compiler.js +4 -4
  85. package/lib/compiler/test-file/formats/es-next/get-test-list.js +4 -4
  86. package/lib/compiler/test-file/formats/raw.js +2 -2
  87. package/lib/compiler/test-file/formats/typescript/compiler.js +11 -11
  88. package/lib/compiler/test-file/formats/typescript/get-test-list.js +3 -3
  89. package/lib/compiler/test-file/test-file-parser-base.js +3 -3
  90. package/lib/configuration/configuration-base.js +15 -15
  91. package/lib/configuration/interfaces.js +1 -1
  92. package/lib/configuration/skip-js-errors-option-names.js +11 -0
  93. package/lib/configuration/testcafe-configuration.js +21 -16
  94. package/lib/configuration/types.js +1 -1
  95. package/lib/configuration/typescript-configuration.js +4 -4
  96. package/lib/custom-client-scripts/assert-type.js +2 -2
  97. package/lib/custom-client-scripts/client-script.js +6 -6
  98. package/lib/custom-client-scripts/get-code.js +2 -2
  99. package/lib/custom-client-scripts/routing.js +3 -3
  100. package/lib/custom-client-scripts/utils.js +3 -3
  101. package/lib/dashboard/connector.js +4 -4
  102. package/lib/dashboard/get-default-project-link.js +2 -2
  103. package/lib/dashboard/index.js +26 -26
  104. package/lib/errors/create-stack-filter.js +2 -2
  105. package/lib/errors/error-list.js +2 -2
  106. package/lib/errors/get-callsite.js +2 -2
  107. package/lib/errors/is-internal-stack-frame.js +5 -5
  108. package/lib/errors/process-test-fn-error.js +2 -2
  109. package/lib/errors/runtime/index.js +10 -10
  110. package/lib/errors/runtime/templates.js +5 -2
  111. package/lib/errors/runtime/type-assertions.js +6 -6
  112. package/lib/errors/stack-cleaning-hook.js +2 -2
  113. package/lib/errors/test-run/formattable-adapter.js +7 -7
  114. package/lib/errors/test-run/index.js +25 -5
  115. package/lib/errors/test-run/render-error-template/index.js +6 -6
  116. package/lib/errors/test-run/render-error-template/utils.js +2 -2
  117. package/lib/errors/test-run/templates.js +40 -31
  118. package/lib/errors/test-run/utils.js +7 -7
  119. package/lib/errors/types.js +5 -1
  120. package/lib/index.js +1 -1
  121. package/lib/live/file-watcher/index.js +2 -2
  122. package/lib/live/keyboard-observer.js +3 -3
  123. package/lib/live/test-run-controller.js +3 -3
  124. package/lib/live/test-run.js +3 -2
  125. package/lib/live/test-runner.js +2 -2
  126. package/lib/load-assets.js +2 -2
  127. package/lib/notifications/add-rendered-warning.js +4 -4
  128. package/lib/notifications/debug-logger.js +6 -6
  129. package/lib/notifications/deprecated.js +2 -2
  130. package/lib/notifications/information-message.js +4 -3
  131. package/lib/proxyless/resource-injector.js +4 -4
  132. package/lib/reporter/command/command-formatter.js +4 -4
  133. package/lib/reporter/index.js +10 -10
  134. package/lib/reporter/plugin-host.js +7 -7
  135. package/lib/role/index.js +8 -8
  136. package/lib/role/role.js +2 -2
  137. package/lib/runner/bootstrapper.js +20 -20
  138. package/lib/runner/browser-job.js +3 -3
  139. package/lib/runner/browser-set.js +12 -12
  140. package/lib/runner/fixture-hook-controller.js +5 -5
  141. package/lib/runner/index.js +43 -33
  142. package/lib/runner/task/index.js +10 -6
  143. package/lib/runner/test-run-hook-controller.js +5 -5
  144. package/lib/runner/tested-app.js +7 -7
  145. package/lib/screenshots/capturer.js +17 -17
  146. package/lib/screenshots/crop.js +8 -8
  147. package/lib/screenshots/index.js +6 -10
  148. package/lib/screenshots/utils.js +4 -4
  149. package/lib/services/compiler/host.js +8 -8
  150. package/lib/services/compiler/service.js +13 -13
  151. package/lib/services/compiler/test-run-proxy.js +8 -8
  152. package/lib/services/serialization/replicator/transforms/callsite-record-transform.js +2 -2
  153. package/lib/services/serialization/replicator/transforms/command-base-trasform/command-constructors.js +2 -1
  154. package/lib/services/serialization/replicator/transforms/command-base-trasform/index.js +3 -3
  155. package/lib/services/serialization/replicator/transforms/raw-command-callsite-record-transform.js +2 -2
  156. package/lib/services/serialization/test-structure.js +4 -4
  157. package/lib/services/utils/ipc/interfaces.js +1 -3
  158. package/lib/services/utils/ipc/io.js +3 -3
  159. package/lib/services/utils/ipc/message.js +2 -2
  160. package/lib/services/utils/ipc/proxy.js +4 -4
  161. package/lib/services/utils/ipc/transport.js +2 -2
  162. package/lib/shared/errors/index.js +9 -2
  163. package/lib/shared/errors/selector-error-ctor-callback.js +7 -3
  164. package/lib/test-run/bookmark.js +1 -1
  165. package/lib/test-run/browser-manipulation-queue.js +3 -3
  166. package/lib/test-run/commands/actions.js +66 -46
  167. package/lib/test-run/commands/assertion.js +3 -3
  168. package/lib/test-run/commands/base.js +2 -2
  169. package/lib/test-run/commands/browser-manipulation.js +8 -8
  170. package/lib/test-run/commands/observation.js +4 -4
  171. package/lib/test-run/commands/options.js +27 -12
  172. package/lib/test-run/commands/type.js +2 -1
  173. package/lib/test-run/commands/utils.js +3 -2
  174. package/lib/test-run/commands/validations/argument.js +19 -10
  175. package/lib/test-run/commands/validations/factories.js +10 -2
  176. package/lib/test-run/commands/validations/initializers.js +4 -4
  177. package/lib/test-run/debug-log.js +4 -4
  178. package/lib/test-run/execute-js-expression/index.js +4 -4
  179. package/lib/test-run/index.js +48 -41
  180. package/lib/test-run/request/create-request-options.js +9 -9
  181. package/lib/test-run/request/process-response-data.js +2 -2
  182. package/lib/test-run/request/send.js +5 -5
  183. package/lib/testcafe.js +8 -4
  184. package/lib/utils/check-file-path.js +2 -2
  185. package/lib/utils/check-url.js +2 -2
  186. package/lib/utils/correct-file-path.js +4 -4
  187. package/lib/utils/delegated-api.js +1 -1
  188. package/lib/utils/detect-ffmpeg.js +3 -3
  189. package/lib/utils/diff/colors.js +2 -2
  190. package/lib/utils/diff/index.js +11 -7
  191. package/lib/utils/diff/util.js +5 -5
  192. package/lib/utils/diff.js +4 -4
  193. package/lib/utils/escape-user-agent.js +2 -2
  194. package/lib/utils/execute-fn-with-timeout.js +2 -2
  195. package/lib/utils/get-browser.js +2 -2
  196. package/lib/utils/get-filter-fn.js +4 -4
  197. package/lib/utils/get-options/base.js +2 -2
  198. package/lib/utils/get-options/compiler.js +2 -2
  199. package/lib/utils/get-options/dashboard.js +2 -2
  200. package/lib/utils/get-options/get-assertion-timeout.js +1 -1
  201. package/lib/utils/get-options/index.js +4 -2
  202. package/lib/utils/get-options/meta.js +2 -2
  203. package/lib/utils/get-options/quarantine.js +8 -6
  204. package/lib/utils/get-options/screenshot.js +2 -2
  205. package/lib/utils/get-options/skip-js-errors.js +35 -0
  206. package/lib/utils/get-options/ssl.js +6 -6
  207. package/lib/utils/get-options/video.js +2 -2
  208. package/lib/utils/is-password-input.js +1 -1
  209. package/lib/utils/log-entry.js +2 -2
  210. package/lib/utils/make-reg-exp.js +19 -6
  211. package/lib/utils/moment-loader.js +2 -2
  212. package/lib/utils/parse-file-list.js +7 -7
  213. package/lib/utils/path-pattern.js +4 -4
  214. package/lib/utils/prepare-reporters.js +2 -2
  215. package/lib/utils/prerender-callsite.js +6 -6
  216. package/lib/utils/process.js +7 -7
  217. package/lib/utils/promisified-functions.js +14 -14
  218. package/lib/utils/raw-command-callsite-record.js +2 -2
  219. package/lib/utils/resolve-path-relatively-cwd.js +2 -2
  220. package/lib/utils/string.js +3 -3
  221. package/lib/utils/temp-directory/cleanup-process/index.js +6 -6
  222. package/lib/utils/temp-directory/cleanup-process/worker.js +4 -4
  223. package/lib/utils/temp-directory/index.js +6 -6
  224. package/lib/utils/temp-directory/lockfile.js +2 -2
  225. package/lib/video-recorder/process.js +6 -6
  226. package/lib/video-recorder/recorder.js +9 -9
  227. package/lib/video-recorder/test-run-video-recorder.js +2 -2
  228. package/package.json +8 -7
  229. package/ts-defs/index.d.ts +46 -7
  230. package/ts-defs/selectors.d.ts +39 -0
  231. package/ts-defs/testcafe-scripts.d.ts +39 -0
@@ -1 +1 @@
1
- window["%hammerhead%"].utils.removeInjectedScript(),function Vu(qu){var zu=qu.document;!function(c,e,_,E,n){var s="default"in c?c.default:c;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function t(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function l(t,s,a,l){return new(a=a||e)(function(n,e){function r(t){try{o(l.next(t))}catch(t){e(t)}}function i(t){try{o(l.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(r,i)}o((l=l.apply(t,s||[])).next())})}function C(n,r){var i,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(n,a)}catch(t){e=[6,t],o=0}finally{i=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var i,o,a=Math.floor(399);(o=i=i||{}).ready="ready",o.readyForBrowserManipulation="ready-for-browser-manipulation",o.waitForFileDownload="wait-for-file-download";var u=i,d={dispatchEvent:"dispatch-event",click:"click",rightClick:"right-click",doubleClick:"double-click",drag:"drag",dragToElement:"drag-to-element",hover:"hover",scroll:"scroll",scrollBy:"scroll-by",scrollIntoView:"scroll-into-view",typeText:"type-text",selectText:"select-text",selectTextAreaContent:"select-text-area-content",selectEditableContent:"select-editable-content",pressKey:"press-key",wait:"wait",navigateTo:"navigate-to",setFilesToUpload:"set-files-to-upload",clearUpload:"clear-upload",executeClientFunction:"execute-client-function",executeSelector:"execute-selector",takeScreenshot:"take-screenshot",takeElementScreenshot:"take-element-screenshot",takeScreenshotOnFail:"take-screenshot-on-fail",prepareBrowserManipulation:"prepare-browser-manipulation",showAssertionRetriesStatus:"show-assertion-retries-status",hideAssertionRetriesStatus:"hide-assertion-retries-status",setBreakpoint:"set-breakpoint",resizeWindow:"resize-window",resizeWindowToFitDevice:"resize-window-to-fit-device",maximizeWindow:"maximize-window",switchToIframe:"switch-to-iframe",switchToMainWindow:"switch-to-main-window",openWindow:"open-window",closeWindow:"close-window",getCurrentWindow:"get-current-window",getCurrentWindows:"get-current-windows",switchToWindow:"switch-to-window",switchToWindowByPredicate:"switch-to-window-by-predicate",switchToParentWindow:"switch-to-parent-window",switchToPreviousWindow:"switch-to-previous-window",setNativeDialogHandler:"set-native-dialog-handler",getNativeDialogHistory:"get-native-dialog-history",getBrowserConsoleMessages:"get-browser-console-messages",getActiveElement:"get-active-element",setTestSpeed:"set-test-speed",setPageLoadTimeout:"set-page-load-timeout",debug:"debug",disableDebug:"disable-debug",assertion:"assertion",useRole:"useRole",testDone:"test-done",backupStorages:"backup-storages",executeExpression:"execute-expression",executeAsyncExpression:"execute-async-expression",unlockPage:"unlock-page",closeChildWindowOnFileDownloading:"close-child-window-on-file-downloading",recorder:"recorder",prepareClientEnvironmentInDebugMode:"prepare-client-environment-in-debug-mode",getCookies:"get-cookies",setCookies:"set-cookies",deleteCookies:"delete-cookies",getProxyUrl:"get-proxy-url",request:"request"},h="E1",f="E4",p="E5",m="E9",g="E10",w="E11",v="E12",y="E24",I="E26",S="E27",b="E28",W="E29",T="E30",A="E31",x="E32",N="E33",R="E34",D="E35",M="E36",P="E37",F="E39",k="E40",L="E41",O="E42",U="E43",H="E44",B="E45",G="E46",V="E49",q="E50",z="E51",X="E52",j="E57",Y="E64",K="E65",J="E68",$="E69",Q="E70",Z="E71",tt="E72",et="E73",nt="E74",rt="E76",it="E77",ot="E78",st="E82",at="E83",lt="E90",ut="E91",ct="E92",dt="E93",ht="E94",ft="E95";function pt(t){return!(function(t){return t.type===d.executeClientFunction||t.type===d.executeSelector}(r=t)||r.type===d.wait||r.type===d.assertion||r.type===d.executeExpression||gt(t)||(n=t).type===d.testDone||n.type===d.showAssertionRetriesStatus||n.type===d.hideAssertionRetriesStatus||n.type===d.setBreakpoint||n.type===d.takeScreenshotOnFail||n.type===d.recorder||n.type===d.getProxyUrl)||mt(t)&&!((e=t).type===d.switchToIframe||e.type===d.switchToMainWindow);var e,n,r}function mt(t){return t.type===d.resizeWindow||t.type===d.resizeWindowToFitDevice||t.type===d.maximizeWindow}function gt(t){return(e=t).type===d.takeScreenshot||e.type===d.takeElementScreenshot||e.type===d.takeScreenshotOnFail||mt(t);var e}function wt(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var vt,yt="step",_t=(t(Et,vt=wt),Et);function Et(t,e,n){var r=vt.call(this,t)||this;return r.optionName=e,r.actualValue=n,r}var Ct,It=(t(St,Ct=wt),St);function St(t,e){var n=Ct.call(this,V,e)||this;return n.instantiationCallsiteName=t,n}var bt,Wt=(t(Tt,bt=wt),Tt);function Tt(t,e){var n=bt.call(this,q,e)||this;return n.instantiationCallsiteName=t,n}var At,xt=(t(Nt,At=wt),Nt);function Nt(t,e,n){var r=e.apiFnChain,i=e.apiFnIndex,o=At.call(this,t,n)||this;return o.apiFnChain=r,o.apiFnIndex=i,o}var Rt,Dt=(t(Mt,Rt=wt),Mt);function Mt(t){return Rt.call(this,z,t)||this}var Pt,Ft=(t(kt,Pt=xt),kt);function kt(t,e){return Pt.call(this,X,e,t)||this}var Lt,Ot=(t(Ut,Lt=wt),Ut);function Ut(t,e){var n=Lt.call(this,h)||this;return n.errStack=t,n.pageDestUrl=e,n}var Ht,Bt=(t(Gt,Ht=wt),Gt);function Gt(t,e,n){var r=Ht.call(this,f,n)||this;return r.errMsg=String(e),r.instantiationCallsiteName=t,r}var Vt,qt=(t(zt,Vt=wt),zt);function zt(t,e,n,r){var i=Vt.call(this,p,r)||this;return i.errMsg=String(e),i.property=n,i.instantiationCallsiteName=t,i}var Xt,jt=(t(Yt,Xt=wt),Yt);function Yt(t){var e=Xt.call(this,Y)||this;return e.errMsg=String(t),e}var Kt,Jt=(t($t,Kt=wt),$t);function $t(t,e){var n=Kt.call(this,K)||this;return n.errMsg=String(t),n.moduleName=e,n}var Qt,Zt=(t(te,Qt=_t),te);function te(t,e){return Qt.call(this,m,t,e)||this}var ee,ne=(t(re,ee=_t),re);function re(t,e){return ee.call(this,g,t,e)||this}var ie,oe=(t(se,ie=_t),se);function se(t,e){return ie.call(this,w,t,e)||this}var ae,le=(t(ue,ae=_t),ue);function ue(t,e){return ae.call(this,v,t,e)||this}var ce,de=(t(he,ce=_t),he);function he(t,e){return ce.call(this,lt,t,e)||this}var fe,pe=(t(me,fe=_t),me);function me(t,e){return fe.call(this,ut,t,e)||this}var ge,we=(t(ve,ge=_t),ve);function ve(t,e){return ge.call(this,ct,t,e)||this}var ye,_e=(t(Ee,ye=_t),Ee);function Ee(t,e){return ye.call(this,dt,t,e)||this}var Ce,Ie=(t(Se,Ce=_t),Se);function Se(t,e){return Ce.call(this,ht,t,e)||this}var be,We=(t(Te,be=_t),Te);function Te(t,e){return be.call(this,ft,t,e)||this}var Ae,xe=(t(Ne,Ae=xt),Ne);function Ne(t,e){return Ae.call(this,y,e,t)||this}var Re,De=(t(Me,Re=wt),Me);function Me(t){return Re.call(this,I,t)||this}var Pe,Fe=(t(ke,Pe=wt),ke);function ke(t){var e=Pe.call(this,S)||this;return e.nodeDescription=t,e}var Le,Oe=(t(Ue,Le=xt),Ue);function Ue(t,e){var n=Le.call(this,b,e)||this;return n.argumentName=t,n}var He,Be=(t(Ge,He=wt),Ge);function Ge(t){var e=He.call(this,W)||this;return e.argumentName=t,e}var Ve,qe=(t(ze,Ve=wt),ze);function ze(t,e){var n=Ve.call(this,T)||this;return n.argumentName=t,n.nodeDescription=e,n}var Xe,je=(t(Ye,Xe=wt),Ye);function Ye(){return Xe.call(this,A)||this}var Ke,Je=(t($e,Ke=wt),$e);function $e(){return Ke.call(this,x)||this}var Qe,Ze=(t(tn,Qe=wt),tn);function tn(t){var e=Qe.call(this,N)||this;return e.argumentName=t,e}var en,nn=(t(rn,en=wt),rn);function rn(){return en.call(this,D)||this}var on,sn=(t(an,on=wt),an);function an(t){var e=on.call(this,M)||this;return e.argumentName=t,e}var ln,un=(t(cn,ln=wt),cn);function cn(t,e){var n=ln.call(this,P)||this;return n.filePaths=t,n.scannedFilePaths=e,n}var dn,hn=(t(fn,dn=wt),fn);function fn(){return dn.call(this,R)||this}var pn,mn=(t(gn,pn=wt),gn);function gn(t,e){var n=pn.call(this,L)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}var wn,vn=(t(yn,wn=wt),yn);function yn(t,e){var n=wn.call(this,j)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}var _n,En=(t(Cn,_n=wt),Cn);function Cn(t){return _n.call(this,k,t)||this}var In,Sn=(t(bn,In=wt),bn);function bn(){return In.call(this,F)||this}var Wn,Tn=(t(An,Wn=wt),An);function An(){return Wn.call(this,O)||this}var xn,Nn=(t(Rn,xn=wt),Rn);function Rn(){return xn.call(this,$)||this}var Dn,Mn=(t(Pn,Dn=wt),Pn);function Pn(){return Dn.call(this,J)||this}var Fn,kn=(t(Ln,Fn=wt),Ln);function Ln(){return Fn.call(this,Q)||this}var On,Un=(t(Hn,On=wt),Hn);function Hn(){return On.call(this,Z)||this}var Bn,Gn=(t(Vn,Bn=wt),Vn);function Vn(){return Bn.call(this,et)||this}var qn,zn=(t(Xn,qn=wt),Xn);function Xn(){return qn.call(this,st)||this}var jn,Yn=(t(Kn,jn=wt),Kn);function Kn(t){var e=jn.call(this,ot)||this;return e.errMsg=t,e}var Jn,$n=(t(Qn,Jn=wt),Qn);function Qn(){return Jn.call(this,nt)||this}var Zn,tr=(t(er,Zn=wt),er);function er(){return Zn.call(this,rt)||this}var nr,rr=(t(ir,nr=wt),ir);function ir(){return nr.call(this,it)||this}var or,sr=(t(ar,or=wt),ar);function ar(){return or.call(this,tt)||this}var lr,ur=(t(cr,lr=wt),cr);function cr(){return lr.call(this,at)||this}var dr,hr=(t(fr,dr=wt),fr);function fr(){return dr.call(this,U)||this}var pr,mr=(t(gr,pr=wt),gr);function gr(){return pr.call(this,H)||this}var wr,vr=(t(yr,wr=wt),yr);function yr(t,e){var n=wr.call(this,B)||this;return n.dialogType=t,n.pageUrl=e,n}var _r,Er=(t(Cr,_r=wt),Cr);function Cr(t,e,n){var r=_r.call(this,G)||this;return r.dialogType=t,r.errMsg=e,r.pageUrl=n,r}var Ir=Object.freeze({__proto__:null,TestRunErrorBase:wt,ClientFunctionExecutionInterruptionError:It,DomNodeClientFunctionResultError:Wt,SelectorErrorBase:xt,InvalidSelectorResultError:Dt,CannotObtainInfoForElementSpecifiedBySelectorError:Ft,UncaughtErrorOnPage:Ot,UncaughtErrorInClientFunctionCode:Bt,UncaughtErrorInCustomDOMPropertyCode:qt,UncaughtErrorInCustomClientScriptCode:jt,UncaughtErrorInCustomClientScriptLoadedFromModule:Jt,ActionIntegerOptionError:Zt,ActionPositiveIntegerOptionError:ne,ActionBooleanOptionError:oe,ActionSpeedOptionError:le,ActionStringOptionError:de,ActionDateOptionError:pe,ActionNumberOptionError:we,ActionUrlOptionError:_e,ActionUrlSearchParamsOptionError:Ie,ActionObjectOptionError:We,ActionElementNotFoundError:xe,ActionElementIsInvisibleError:De,ActionSelectorMatchesWrongNodeTypeError:Fe,ActionAdditionalElementNotFoundError:Oe,ActionAdditionalElementIsInvisibleError:Be,ActionAdditionalSelectorMatchesWrongNodeTypeError:qe,ActionElementNonEditableError:je,ActionElementNotTextAreaError:Je,ActionElementNonContentEditableError:Ze,ActionRootContainerNotFoundError:nn,ActionIncorrectKeysError:sn,ActionCannotFindFileToUploadError:un,ActionElementIsNotFileInputError:hn,ActionInvalidScrollTargetError:mn,InvalidElementScreenshotDimensionsError:vn,ActionElementNotIframeError:En,ActionIframeIsNotLoadedError:Sn,CurrentIframeIsNotLoadedError:Tn,ChildWindowNotFoundError:Nn,ChildWindowIsNotLoadedError:Mn,CannotSwitchToWindowError:kn,CloseChildWindowError:Un,CannotCloseWindowWithChildrenError:Gn,CannotCloseWindowWithoutParentError:zn,SwitchToWindowPredicateError:Yn,WindowNotFoundError:$n,ParentWindowNotFoundError:tr,PreviousWindowNotFoundError:rr,ChildWindowClosedBeforeSwitchingError:sr,CannotRestoreChildWindowError:ur,CurrentIframeNotFoundError:hr,CurrentIframeIsInvisibleError:mr,NativeDialogNotHandledError:vr,UncaughtErrorInNativeDialogHandler:Er}),Sr="_nativeMethods",br=(Wr.prototype._ensureNativeMethods=function(t){return t||{objectKeys:Object.keys,arrayForEach:Array.prototype.forEach,arrayConcat:Array.prototype.concat,arraySlice:Array.prototype.slice,objectDefineProperty:Object.defineProperty}},Wr.prototype._getWindowIds=function(t){return this[Sr].objectKeys(t)},Wr.prototype._copyArray=function(t){return this[Sr].arraySlice.call(t)},Wr.prototype._concatArrays=function(t,e){return this[Sr].arrayConcat.call(t,e)},Wr.prototype.ensureMessageContainer=function(t){this[t]||(this[t]={log:[],info:[],warn:[],error:[]})},Wr.prototype.concat=function(e){var n=this;if(!e)return this;var t=this._getWindowIds(e);return this[Sr].arrayForEach.call(t,function(t){n.ensureMessageContainer(t),n[t].log=n._concatArrays(n[t].log,e[t].log),n[t].info=n._concatArrays(n[t].info,e[t].info),n[t].warn=n._concatArrays(n[t].warn,e[t].warn),n[t].error=n._concatArrays(n[t].error,e[t].error)}),this},Wr.prototype.addMessage=function(t,e,n){this.ensureMessageContainer(n),this[n][t].push(e)},Wr.prototype.getCopy=function(){var e=this,n={},t=this._getWindowIds(this);return this[Sr].arrayForEach.call(t,function(t){n[t]={log:e._copyArray(e[t].log),info:e._copyArray(e[t].info),warn:e._copyArray(e[t].warn),error:e._copyArray(e[t].error)}}),n},Wr);function Wr(t,e){var n=this._ensureNativeMethods(e);n.objectDefineProperty(this,Sr,{value:n}),this.concat(t)}var Tr,Ar=(t(xr,Tr=br),xr);function xr(t){return Tr.call(this,t,c.nativeMethods)||this}var Nr,Rr=(function(t){function n(t){return!!s[t]}function r(t,e){this.references=t,this.transforms=e,this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0}var o=/^#*@(t|r)$/,i=(0,eval)("this"),s={Int8Array:"function"==typeof Int8Array?Int8Array:void 0,Uint8Array:"function"==typeof Uint8Array?Uint8Array:void 0,Uint8ClampedArray:"function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,Int16Array:"function"==typeof Int16Array?Int16Array:void 0,Uint16Array:"function"==typeof Uint16Array?Uint16Array:void 0,Int32Array:"function"==typeof Int32Array?Int32Array:void 0,Uint32Array:"function"==typeof Uint32Array?Uint32Array:void 0,Float32Array:"function"==typeof Float32Array?Float32Array:void 0,Float64Array:"function"==typeof Float64Array?Float64Array:void 0},a="function"==typeof ArrayBuffer,l="function"==typeof Map,u="function"==typeof Set,c="function"==typeof Buffer,d=Array.prototype.slice,e={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}};function h(t,e){this.references=t,this.transformMap=e,this.activeTransformsStack=[],this.visitedRefs=Object.create(null)}r._createRefMark=function(t){var e=Object.create(null);return e["@r"]=t,e},r.prototype._createCircularCandidate=function(t,e,n){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:e,key:n,refIdx:-1})},r.prototype._applyTransform=function(t,e,n,r){var i=Object.create(null),o=r.toSerializable(t);return"object"==typeof o&&this._createCircularCandidate(t,e,n),i["@t"]=r.type,i.data=this._handleValue(o,e,n),i},r.prototype._handleArray=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=this._handleValue(t[n],e,n);return e},r.prototype._handlePlainObject=function(n){var r=this,i=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){var e=o.test(t)?"#"+t:t;i[e]=r._handleValue(n[t],i,e)}),i},r.prototype._handleObject=function(t,e,n){return this._createCircularCandidate(t,e,n),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},r.prototype._ensureCircularReference=function(t){var e=this.circularCandidates.indexOf(t);if(-1<e){var n=this.circularCandidatesDescrs[e];return-1===n.refIdx&&(n.refIdx=n.parent?++this.circularRefCount:0),r._createRefMark(n.refIdx)}return null},r.prototype._handleValue=function(t,e,n){var r=typeof t,i="object"==r&&null!==t;if(i){var o=this._ensureCircularReference(t);if(o)return o}for(var s=0;s<this.transforms.length;s++){var a=this.transforms[s];if(a.shouldTransform(r,t))return this._applyTransform(t,e,n,a)}return i?this._handleObject(t,e,n):t},r.prototype.transform=function(){for(var t=[this._handleValue(this.references,null,null)],e=0;e<this.circularCandidatesDescrs.length;e++){var n=this.circularCandidatesDescrs[e];0<n.refIdx&&(t[n.refIdx]=n.parent[n.key],n.parent[n.key]=r._createRefMark(n.refIdx))}return t},h.prototype._handlePlainObject=function(e){var t,n=this,r=Object.create(null),i=Object.getOwnPropertyNames(e);for(t in i.forEach(function(t){n._handleValue(e[t],e,t),o.test(t)&&(r[t.substring(1)]=e[t],delete e[t])}),r)e[t]=r[t]},h.prototype._handleTransformedObject=function(t,e,n){var r=t["@t"],i=this.transformMap[r];if(!i)throw new Error("Can't find transform for \""+r+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=i.fromSerializable(t.data)},h.prototype._handleCircularSelfRefDuringTransform=function(t,e,n){var r=this.references,i=void 0;Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){return void 0===i&&(i=r[t]),i},set:function(t){return i=t}})},h.prototype._handleCircularRef=function(t,e,n){-1<this.activeTransformsStack.indexOf(this.references[t])?this._handleCircularSelfRefDuringTransform(t,e,n):(this.visitedRefs[t]||(this.visitedRefs[t]=!0,this._handleValue(this.references[t],this.references,t)),e[n]=this.references[t])},h.prototype._handleValue=function(t,e,n){if("object"==typeof t&&null!==t){var r=t["@r"];if(void 0!==r)this._handleCircularRef(r,e,n);else if(t["@t"])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var i=0;i<t.length;i++)this._handleValue(t[i],t,i);else this._handlePlainObject(t)}},h.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]};var f=[{type:"[[NaN]]",shouldTransform:function(t,e){return"number"===t&&isNaN(e)},toSerializable:function(){return""},fromSerializable:function(){return NaN}},{type:"[[undefined]]",shouldTransform:function(t){return"undefined"===t},toSerializable:function(){return""},fromSerializable:function(){}},{type:"[[Date]]",shouldTransform:function(t,e){return e instanceof Date},toSerializable:function(t){return t.getTime()},fromSerializable:function(t){var e=new Date;return e.setTime(t),e}},{type:"[[RegExp]]",shouldTransform:function(t,e){return e instanceof RegExp},toSerializable:function(t){var e={src:t.source,flags:""};return t.global&&(e.flags+="g"),t.ignoreCase&&(e.flags+="i"),t.multiline&&(e.flags+="m"),e},fromSerializable:function(t){return new RegExp(t.src,t.flags)}},{type:"[[Error]]",shouldTransform:function(t,e){return e instanceof Error},toSerializable:function(t){return{name:t.name,message:t.message,stack:t.stack}},fromSerializable:function(t){var e=new(i[t.name]||Error)(t.message);return e.stack=t.stack,e}},{type:"[[ArrayBuffer]]",shouldTransform:function(t,e){return a&&e instanceof ArrayBuffer},toSerializable:function(t){var e=new Int8Array(t);return d.call(e)},fromSerializable:function(t){if(a){var e=new ArrayBuffer(t.length);return new Int8Array(e).set(t),e}return t}},{type:"[[Buffer]]",shouldTransform:function(t,e){return c&&e instanceof Buffer},toSerializable:function(t){return d.call(t)},fromSerializable:function(t){return c?Buffer.from(t):t}},{type:"[[TypedArray]]",shouldTransform:function(t,e){return Object.keys(s).some(function(t){return n(t)&&e instanceof s[t]})},toSerializable:function(t){return{ctorName:t.constructor.name,arr:d.call(t)}},fromSerializable:function(t){return n(t.ctorName)?new s[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",shouldTransform:function(t,e){return l&&e instanceof Map},toSerializable:function(t){var n=[];return t.forEach(function(t,e){n.push(e),n.push(t)}),n},fromSerializable:function(t){if(l){for(var e=new Map,n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}for(var r=[],i=0;i<t.length;i+=2)r.push([t[n],t[n+1]]);return r}},{type:"[[Set]]",shouldTransform:function(t,e){return u&&e instanceof Set},toSerializable:function(t){var e=[];return t.forEach(function(t){e.push(t)}),e},fromSerializable:function(t){if(u){for(var e=new Set,n=0;n<t.length;n++)e.add(t[n]);return e}return t}}],p=t.exports=function(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||e,this.addTransforms(f)};p.prototype.addTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e];if(this.transformsMap[n.type])throw new Error('Transform with type "'+n.type+'" was already added.');this.transforms.push(n),this.transformsMap[n.type]=n}return this},p.prototype.removeTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e],r=this.transforms.indexOf(n);-1<r&&this.transforms.splice(r,1),delete this.transformsMap[n.type]}return this},p.prototype.encode=function(t){var e=new r(t,this.transforms).transform();return this.serializer.serialize(e)},p.prototype.decode=function(t){var e=this.serializer.deserialize(t);return new h(e,this.transformsMap).transform()}}(Nr={exports:{}}),Nr.exports),Dr=function(t){return t};function Mr(t){return new Rr({serialize:Dr,deserialize:Dr}).addTransforms(t)}var Pr=(Fr.create=function(t){return new Fr(t.top,t.right,t.bottom,t.left)},Fr.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},Fr.prototype.sub=function(t){return"top"in t&&(this.top-=t.top,this.left-=t.left),this.bottom-=t.bottom,this.right-=t.right,this},Fr.prototype.round=function(t,e){return void 0===t&&(t=Math.round),void 0===e&&(e=t),this.top=t(this.top),this.right=e(this.right),this.bottom=e(this.bottom),this.left=t(this.left),this},Fr.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},Fr);function Fr(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.top=t,this.right=e,this.bottom=n,this.left=r}function kr(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=c.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}kr("filter"),kr("map"),kr("slice"),kr("splice"),kr("unshift"),kr("forEach"),kr("indexOf"),kr("some"),kr("reverse"),kr("reduce"),kr("concat"),kr("join"),s.utils.browser,s.nativeMethods,s.utils.style.get,s.utils.dom.getActiveElement,s.utils.dom.findDocument,s.utils.dom.find,s.utils.dom.isElementInDocument;var Lr=s.utils.dom.isElementInIframe,Or=s.utils.dom.getIframeByElement,Ur=(s.utils.dom.isCrossDomainWindows,s.utils.dom.getSelectParent),Hr=s.utils.dom.getChildVisibleIndex,Br=(s.utils.dom.getSelectVisibleChildren,s.utils.dom.isElementNode),Gr=s.utils.dom.isTextNode,Vr=s.utils.dom.isRenderedNode,qr=(s.utils.dom.isIframeElement,s.utils.dom.isInputElement,s.utils.dom.isButtonElement,s.utils.dom.isFileInput,s.utils.dom.isTextAreaElement,s.utils.dom.isAnchorElement,s.utils.dom.isImgElement,s.utils.dom.isFormElement,s.utils.dom.isLabelElement,s.utils.dom.isSelectElement,s.utils.dom.isRadioButtonElement,s.utils.dom.isColorInputElement,s.utils.dom.isCheckboxElement,s.utils.dom.isOptionElement,s.utils.dom.isSVGElement),zr=s.utils.dom.isMapElement,Xr=(s.utils.dom.isBodyElement,s.utils.dom.isHtmlElement),jr=(s.utils.dom.isDocument,s.utils.dom.isWindow,s.utils.dom.isTextEditableInput,s.utils.dom.isTextEditableElement,s.utils.dom.isTextEditableElementAndEditingAllowed,s.utils.dom.isContentEditableElement),Yr=(s.utils.dom.isDomElement,s.utils.dom.isShadowUIElement,s.utils.dom.isShadowRoot,s.utils.dom.isElementFocusable,s.utils.dom.isHammerheadAttr,s.utils.dom.isElementReadOnly,s.utils.dom.getScrollbarSize),Kr=s.utils.dom.getMapContainer,Jr=(s.utils.dom.getTagName,s.utils.dom.closest),$r=(s.utils.dom.getParents,s.utils.dom.findParent),Qr=(s.utils.dom.getTopSameDomainWindow,s.utils.dom.getParentExceptShadowRoot,s.utils.style),Zr=s.utils.style.getBordersWidth,ti=(s.utils.style.getComputedStyle,s.utils.style.getElementMargin,s.utils.style.getElementPadding,s.utils.style.getElementScroll),ei=s.utils.style.getOptionHeight,ni=s.utils.style.getSelectElementSize,ri=(s.utils.style.isElementVisible,s.utils.style.isVisibleChild),ii=(s.utils.style.getWidth,s.utils.style.getHeight,s.utils.style.getInnerWidth),oi=s.utils.style.getInnerHeight,si=(s.utils.style.getScrollLeft,s.utils.style.getScrollTop),ai=(s.utils.style.setScrollLeft,s.utils.style.setScrollTop,s.utils.style.get);function li(t){return!Vr(t)||$r(t,!0,function(t){return Br(t)&&"none"===Qr.get(t,"display")})||$r(t,!0,function(t){return Br(t)&&"hidden"===Qr.get(t,"visibility")})}var ui=(ci.create=function(t){return"left"in t?new ci(t.left,t.top):"right"in t?new ci(t.right,t.bottom):new ci(t.x,t.y)},ci.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},ci.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},ci.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},ci.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},ci.prototype.mul=function(t){return this.x*=t,this.y*=t,this},ci.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},ci);function ci(t,e){this.x=t,this.y=e}var di,hi=function(t,e,n,r,i,o){this.width=t,this.height=e,this.left=n.x,this.top=n.y,this.right=n.x+t,this.bottom=n.y+e,this.border=r,this.scrollbar=o,this.scroll=i},fi=s.utils.position.getElementRectangle,pi=s.utils.position.getOffsetPosition,mi=s.utils.position.offsetToClientCoords;function gi(t){return"hidden"===ai(t,"visibility")||"none"===ai(t,"display")}function wi(t){var e=fi(t);return 0===e.width||0===e.height}function vi(t){if(Gr(t))return!li(t);if(!jr(t)&&!qr(t)&&wi(t))return!1;if(zr(t)){var e=Kr(Jr(t,"map"));return!!e&&vi(e)}if(ri(t)){var n=Ur(t),r=Hr(n,t),i=ni(n),o=Math.max(si(n)/ei(n),0),s=o+i-1,a=Math.max(r-o,0);return o<=a&&a<=s}var l;return qr(t)?!$r(t,!0,gi)&&!wi(t):(l=t)&&!(l.offsetHeight<=0&&l.offsetWidth<=0)&&!gi(t)}function yi(t){return _.domUtils.isIframeElement(t)?!gi(t):!(!c.utils.dom.isDomElement(t)&&!c.utils.dom.isTextNode(t))&&(_.domUtils.isOptionElement(t)||"optgroup"===_.domUtils.getTagName(t)?n.selectElement.isOptionElementVisible(t):vi(t))}var _i=1,Ei=2,Ci=3,Ii=((di={})[_i]=/^\.filterVisible\(\)$/,di[Ei]=/^\.filterHidden\(\)$/,di[Ci]=/^\.nth\(\d+\)$/,di);function Si(){this._err=null}var bi=(Object.defineProperty(Si.prototype,"error",{get:function(){return this._err},set:function(t){null===this._err&&(this._err=t)},enumerable:!1,configurable:!0}),Si.prototype.filter=function(t,e,n){if(e.filterVisible&&(t=t.filter(yi),this._assertFilterError(t,n,_i)),e.filterHidden&&(t=t.filter(function(t){return!yi(t)}),this._assertFilterError(t,n,Ei)),e.counterMode)return null===e.index?t.length:Si._getNodeByIndex(t,e.index)?1:0;var r;if(e.collectionMode)return null!==e.index&&(t=(r=Si._getNodeByIndex(t,e.index))?[r]:[],this._assertFilterError(t,n,Ci)),t;var i=Si._getNodeByIndex(t,e.index||0);return i||(this.error=Si._getErrorItem(n,Ci)),i},Si.prototype.cast=function(t){if(null==t)return[];if(t instanceof c.nativeMethods.Node)return[t];if(function(t){if(c.nativeMethods.isArray(t)){for(var e=0;e<t.length;e++)if(!(t[e]instanceof c.nativeMethods.Node))return;return 1}}(t))return t;if((e=t)instanceof c.nativeMethods.HTMLCollection||e instanceof c.nativeMethods.NodeList)return function(t){for(var e=t.length,n=[],r=0;r<e;r++)n.push(t[r]);return n}(t);var e;throw new Dt},Si.prototype._assertFilterError=function(t,e,n){0===t.length&&(this.error=Si._getErrorItem(e,n))},Si._getErrorItem=function(t,e){var n=t.apiFnChain,r=t.apiFnID;if(e)for(var i=r;i<n.length;i++)if(Ii[e].test(n[i]))return i;return null},Si._getNodeByIndex=function(t,e){return e<0?t[t.length+e]:t[e]},new Si);function Wi(t,e){return new c.nativeMethods.Function("fnCode","__dependencies$","Promise","RegExp",'"use strict"; return eval(fnCode)')(t,e,c.Promise,RegExp)}var Ti=(Ai.prototype.shouldTransform=function(t){return"function"===t},Ai.prototype.toSerializable=function(){return""},Ai.prototype.fromSerializable=function(t){var e=t.fnCode,n=t.dependencies;return"filterOptions"in n&&(n.selectorFilter=bi),Wi(e,n)},Ai);function Ai(){this.type="Function"}var xi=(Ni.prototype.shouldTransform=function(t,e){if(e instanceof c.nativeMethods.Node)throw new Wt(this._instantiationCallsiteName);return!1},Ni.prototype.toSerializable=function(){},Ni.prototype.fromSerializable=function(){},Ni);function Ni(t){this.type="Node",this._instantiationCallsiteName=t}var Ri=(Di.prototype.getResult=function(){var e=this;return c.Promise.resolve().then(function(){var t=e.replicator.decode(e.command.args);return e._executeFn(t)}).catch(function(t){throw t.isTestCafeError||(t=new Bt(e.command.instantiationCallsiteName,t)),t})},Di.prototype.encodeResult=function(t){return this.replicator.encode(t)},Di.prototype._createReplicator=function(){return Mr([new xi(this.command.instantiationCallsiteName),new Ti])},Di.prototype._executeFn=function(t){return this.fn.apply(qu,t)},Di);function Di(t){this.command=t,this.replicator=this._createReplicator(),this.dependencies=this.replicator.decode(t.dependencies),this.fn=Wi(t.fnCode,this.dependencies)}var Mi="appeared-dialog",Pi="unexpected-dialog",Fi="handler-error",ki=s.eventSandbox.message,Li=s.processScript,Oi=s.nativeMethods,Ui="testcafe|native-dialog-tracker|appeared-dialogs",Hi="testcafe|native-dialog-tracker|unexpected-dialog",Bi="testcafe|native-dialog-tracker|error-in-handler",Gi=Li("window.location.href"),Vi=(Object.defineProperty(qi.prototype,"appearedDialogs",{get:function(){var t=this.contextStorage.getItem(Ui);return t||(t=[],this.appearedDialogs=t),t},set:function(t){this.contextStorage.setItem(Ui,t)},enumerable:!1,configurable:!0}),Object.defineProperty(qi.prototype,"unexpectedDialog",{get:function(){return this.contextStorage.getItem(Hi)},set:function(t){this.contextStorage.setItem(Hi,t)},enumerable:!1,configurable:!0}),Object.defineProperty(qi.prototype,"handlerError",{get:function(){return this.contextStorage.getItem(Bi)},set:function(t){this.contextStorage.setItem(Bi,t)},enumerable:!1,configurable:!0}),qi._getPageUrl=function(){return Oi.eval(Gi)},qi.prototype._initListening=function(){var n=this;ki.on(ki.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.type===Mi?n._addAppearedDialogs(e.dialogType,e.text,e.url):e.type!==Pi||n.unexpectedDialog?e.type!==Fi||n.handlerError||n._onHandlerError(e.dialogType,e.message,e.url):n.unexpectedDialog={type:e.dialogType,url:e.url}})},qi.prototype._init=function(){var e=this;s.on(s.EVENTS.beforeUnload,function(t){t.prevented&&!t.isFakeIEEvent&&(e.dialogHandler?e._createDialogHandler("beforeunload")(t.returnValue||""):e._defaultDialogHandler("beforeunload")),e.contextStorage&&e.contextStorage.save()}),qu.alert=function(){return e._defaultDialogHandler("alert")},qu.confirm=function(){return e._defaultDialogHandler("confirm")},qu.prompt=function(){return e._defaultDialogHandler("prompt")}},qi.prototype._createDialogHandler=function(i){var o=this;return function(t){var e=qi._getPageUrl();o._addAppearedDialogs(i,t,e);var n=new Ri(o.dialogHandler),r=null;try{r=n.fn.apply(qu,[i,t,e])}catch(t){o._onHandlerError(i,t.message||String(t),e)}return r}},qi.prototype._defaultDialogHandler=function(t){var e=qi._getPageUrl();this.unexpectedDialog=this.unexpectedDialog||{type:t,url:e}},qi.prototype._addAppearedDialogs=function(t,e,n){this.appearedDialogs.splice(0,0,{type:t,text:e,url:n})},qi.prototype._onHandlerError=function(t,e,n){this.handlerError=this.handlerError||{type:t,message:e,url:n}},qi.prototype.setHandler=function(t){var e=this;this.dialogHandler=t,["alert","confirm","prompt"].forEach(function(t){qu[t]=e.dialogHandler?e._createDialogHandler(t):function(){return e._defaultDialogHandler(t)}})},qi.prototype.getUnexpectedDialogError=function(){var t=this.unexpectedDialog,e=this.handlerError;return this.unexpectedDialog=null,this.handlerError=null,t?new vr(t.type,t.url):e?new Er(e.type,e.message,e.url):null},qi);function qi(t,e){this.contextStorage=t,this.dialogHandler=e,this._init(),this._initListening(),this.dialogHandler&&this.setHandler(e)}function zi(){return c.nativeMethods.performanceNow().toString()}function Xi(t){this.type=t,this.id=zi()}var ji,Yi="driver|establish-connection",Ki="driver|switch-to-window",Ji="driver|close-window",$i="driver|close-window-validation",Qi="driver|switch-to-window-validation",Zi="driver|get-windows",to="driver|command-executed",eo="driver|execute-command",no="driver|confirmation",ro="driver|set-native-dialog-handler",io="driver|set-as-master",oo="driver|close-all-child-windows",so="driver|start-to-restore-child-link",ao="driver|restore-child-link",lo="driver|child-window-is-loaded-in-iframe",uo="driver|child-window-is-opened-in-iframe",co="driver|stop-internal-from-iframe",ho="driver|has-pending-action-flags",fo=(t(po,ji=Xi),po);function po(){return ji.call(this,Yi)||this}var mo,go=(t(wo,mo=Xi),wo);function wo(t){var e=t.windowId,n=mo.call(this,$i)||this;return n.windowId=e,n}var vo,yo=(t(_o,vo=Xi),_o);function _o(t){var e=t.windowId,n=t.fn,r=vo.call(this,Qi)||this;return r.windowId=e,r.fn=n,r}var Eo,Co=(t(Io,Eo=Xi),Io);function Io(){return Eo.call(this,Zi)||this}var So,bo=(t(Wo,So=Xi),Wo);function Wo(t){var e=t.windowId,n=t.isCurrentWindow,r=So.call(this,Ji)||this;return r.windowId=e,r.isCurrentWindow=n,r}var To,Ao=(t(xo,To=Xi),xo);function xo(t){var e=t.windowId,n=t.fn,r=To.call(this,Ki)||this;return r.windowId=e,r.fn=n,r}var No,Ro=(t(Do,No=Xi),Do);function Do(t){var e=No.call(this,to)||this;return e.driverStatus=t,e}var Mo,Po=(t(Fo,Mo=Xi),Fo);function Fo(t,e){var n=Mo.call(this,eo)||this;return n.command=t,n.testSpeed=e,n}var ko,Lo=(t(Oo,ko=Xi),Oo);function Oo(t,e){var n=ko.call(this,no)||this;return n.requestMessageId=t,n.result=e,n}var Uo,Ho=(t(Bo,Uo=Xi),Bo);function Bo(t){var e=Uo.call(this,ro)||this;return e.dialogHandler=t,e}var Go,Vo=(t(qo,Go=Xi),qo);function qo(t){var e=Go.call(this,io)||this;return e.finalizePendingCommand=t,e}var zo,Xo=(t(jo,zo=Xi),jo);function jo(){return zo.call(this,oo)||this}var Yo,Ko=(t(Jo,Yo=Xi),Jo);function Jo(){return Yo.call(this,so)||this}var $o,Qo=(t(Zo,$o=Xi),Zo);function Zo(t){var e=$o.call(this,ao)||this;return e.windowId=t,e}var ts,es=(t(ns,ts=Xi),ns);function ns(t){var e=ts.call(this,lo)||this;return e.windowId=t,e}var rs,is=(t(os,rs=Xi),os);function os(){return rs.call(this,uo)||this}var ss,as=(t(ls,ss=Xi),ls);function ls(){return ss.call(this,co)||this}var us,cs=(t(ds,us=Xi),ds);function ds(){return us.call(this,ho)||this}var hs=s.json,fs=s.nativeMethods,ps=(ms.prototype._createStorageKey=function(t,e){var n="testcafe|driver|"+t;return e?n+"|"+e:n},ms.prototype._loadFromStorage=function(){var t=fs.storageGetItem.call(this.storage,this.storageKey);t&&(this.data=hs.parse(t),fs.storageRemoveItem.call(this.storage,this.storageKey))},ms.prototype.save=function(){fs.storageSetItem.call(this.storage,this.storageKey,hs.stringify(this.data))},ms.prototype.setItem=function(t,e){this.data[t]=e,this.save()},ms.prototype.getItem=function(t){return this.data[t]},ms.prototype.dispose=function(){fs.storageRemoveItem.call(this.storage,this.storageKey)},ms);function ms(t,e,n){this.storage=fs.winSessionStorageGetter.call(t),this.storageKey=this._createStorageKey(e,n),this.data={},this._loadFromStorage()}var gs=(ws.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},ws.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var r=this._getAssignableProperties(),i=0;i<r.length;i++){for(var o,s=r[i],a=s.name,l=s.type,u=s.required,c=s.init,d=s.defaultValue,h=a.split("."),f=h.length-1,p=h[f],m=t,g=this,w=0;w<f&&m&&g;w++)m=m[h[w]],g=g[h[w]];g&&"defaultValue"in r[i]&&(g[a]=d),m&&g&&(void 0===(o=m[p])&&!u||(e&&l&&l(a,o),g[p]=c?c(a,o,n,e):o))}},ws);function ws(){}var vs,ys=(t(_s,vs=gs),_s.prototype._getAssignableProperties=function(){return[{name:"isCommandResult"},{name:"executionError"},{name:"pageError"},{name:"result"},{name:"consoleMessages"},{name:"isPendingWindowSwitching"},{name:"isObservingFileDownloadingInNewWindow"},{name:"isFirstRequestAfterWindowSwitching"}]},_s);function _s(t){var e=vs.call(this,t)||this;return e.id=zi(),e.isCommandResult=!1,e.executionError=null,e.pageError=null,e.resent=!1,e.result=null,e.consoleMessages=null,e.isPendingWindowSwitching=!1,e.isObservingFileDownloadingInNewWindow=!1,e.isFirstRequestAfterWindowSwitching=!1,e.debug="",e._assignFrom(t,!0),e}function Es(n,t,e,r){var i=null,o=null,s=null;return e=Math.max(e||0,2500),c.Promise.race([_.delay(e),new c.Promise(function(e){s=function(t){t.message.type===no&&t.message.requestMessageId===n.id&&e(t.message)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),i=c.nativeMethods.setInterval.call(qu,function(){return c.eventSandbox.message.sendServiceMsg(n,t)},1e3),c.eventSandbox.message.sendServiceMsg(n,t)})]).then(function(t){if(c.nativeMethods.clearInterval.call(qu,i),c.nativeMethods.clearTimeout.call(qu,o),c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),!t)throw new r;return t})}var Cs=2e4;function Is(t){var e=t.requestMsgId,n=t.result,r=t.window,i=new Lo(e,n);c.eventSandbox.message.sendServiceMsg(i,r)}var Ss=(Object.defineProperty(bs.prototype,"availabilityTimeout",{set:function(t){this.iframeAvailabilityTimeout=t},enumerable:!1,configurable:!0}),bs.prototype._ensureIframe=function(){var t=this;return _.domUtils.isElementInDocument(this.driverIframe)?_.waitFor(function(){return _.positionUtils.isIframeVisible(t.driverIframe)?t.driverIframe:null},200,this.iframeAvailabilityTimeout).catch(function(){throw new mr}):c.Promise.reject(new hr)},bs.prototype._waitForIframeRemovedOrHidden=function(){var e=this;return new c.Promise(function(t){e.checkIframeInterval=c.nativeMethods.setInterval.call(qu,function(){e._ensureIframe().catch(function(){return _.delay(500).then(function(){return t(new ys({isCommandResult:!0}))})})},1e3)})},bs.prototype._waitForCommandResult=function(){var e=this,n=null;return c.Promise.race([this._waitForIframeRemovedOrHidden(),new c.Promise(function(e){n=function(t){t.message.type===to&&e(t.message.driverStatus)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n)})]).then(function(t){return c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n),c.nativeMethods.clearInterval.call(qu,e.checkIframeInterval),t})},bs.prototype.sendConfirmationMessage=function(t){Is({requestMsgId:t,result:{id:this.driverId},window:this.driverWindow})},bs.prototype.executeCommand=function(e,n){var r=this;return this._ensureIframe().then(function(){var t=new Po(e,n);return c.Promise.all([Es(t,r.driverWindow,r.iframeAvailabilityTimeout,Tn),r._waitForCommandResult()])}).then(function(t){return t[1]})},bs);function bs(t,e){this.driverWindow=t,this.driverIframe=_.domUtils.findIframeByWindow(t),this.driverId=e,this.iframeAvailabilityTimeout=0}var Ws=["nodeType","textContent","childNodeCount","hasChildNodes","childElementCount","hasChildElements"],Ts=["tagName","attributes"],As=["tagName","visible","focused","attributes","boundingClientRect","classNames","style","innerText","namespaceURI","id","value","checked","selected","selectedIndex","scrollWidth","scrollHeight","scrollLeft","scrollTop","offsetWidth","offsetHeight","offsetLeft","offsetTop","clientWidth","clientHeight","clientLeft","clientTop"],xs={childNodeCount:function(t){return t.childNodes.length},hasChildNodes:function(t){return!!xs.childNodeCount(t)},childElementCount:function(t){var e=t.children;if(e)return e.length;for(var n=0,r=t.childNodes.length,i=0;i<r;i++)1===t.childNodes[i].nodeType&&n++;return n},hasChildElements:function(t){return!!xs.childElementCount(t)}},Ns=(Rs.prototype._initializeProperties=function(t,e,n){for(var r=0,i=e;r<i.length;r++){var o=i[r],s=n[o];this[o]=s?s(t):t[o]}},Rs);function Rs(){}var Ds,Ms=(t(Ps,Ds=Ns),Ps);function Ps(t){var e=Ds.call(this)||this;return e._initializeProperties(t,Ws,xs),e}var Fs,ks={tagName:function(t){return t.tagName.toLowerCase()},visible:vi,focused:function(t){return c.utils.dom.getActiveElement()===t},attributes:function(t){for(var e=t.attributes,n={},r=e.length-1;0<=r;r--)n[e[r].name]=e[r].value;return n},boundingClientRect:function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width,height:e.height}},classNames:function(t){var e=t.className;return"string"==typeof e.animVal&&(e=e.animVal),e.replace(/^\s+|\s+$/g,"").split(/\s+/g)},style:function(t){for(var e={},n=qu.getComputedStyle(t),r=0;r<n.length;r++){var i=n[r];e[i]=n[i]}return e},innerText:function(t){return t.innerText}},Ls=(t(Os,Fs=Ns),Os);function Os(t){var e=Fs.call(this)||this;return e._initializeProperties(t,Ts,ks),e}var Us,Hs=(t(Bs,Us=Ms),Bs);function Bs(t){var e=Us.call(this,t)||this;return e._initializeProperties(t,As,ks),e}var Gs=(Vs.prototype._extend=function(t,e){for(var n=0,r=c.nativeMethods.objectKeys(this._customDOMProperties);n<r.length;n++){var i=r[n];try{t[i]=this._customDOMProperties[i](e)}catch(t){throw new qt(this._instantiationCallsiteName,t,i)}}},Vs.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},Vs.prototype.toSerializable=function(t){var e=new(1===t.nodeType?Hs:Ms)(t);return this._extend(e,t),e},Vs.prototype.fromSerializable=function(){},Vs);function Vs(t,e){void 0===t&&(t={}),this.type="Node",this._customDOMProperties=t,this._instantiationCallsiteName=e}var qs=(zs.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},zs.prototype.once=function(n,r){var i=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.off(n,r),r.apply(void 0,t)})},zs.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=c.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},zs.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},zs.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._eventsListeners[e];if(r)for(var i=0;i<r.length;i++)try{r[i].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,r[i])}},zs);function zs(){this._eventsListeners={}}var Xs=s.Promise,js=s.nativeMethods;function Ys(e){return new Xs(function(t){return js.setTimeout.call(qu,t,e)})}var Ks="elementIsInvisibleError",Js="foundElementIsNotTarget",$s={1:"element",2:"attribute",3:"text",4:"cdata section",5:"entity reference",6:"entity node",7:"processing instruction",8:"comment",9:"document",10:"document type",11:"document fragment",12:"notation"};function Qs(t){return t?{name:"ActionAdditionalElementIsInvisibleError",firstArg:t}:"ActionElementIsInvisibleError"}function Zs(t){return t?{name:"ActionAdditionalElementNotFoundError",firstArg:t}:"ActionElementNotFoundError"}function ta(t){var e="string"==typeof t?Ir[t]:Ir[t.name],n="string"==typeof t?null:t.firstArg;return function(t){return new e(n,t)}}var ea=(na.prototype.push=function(t,r){var i=this;this._ensureElementsPromise=this._ensureElementsPromise.then(function(){return i._executeSelectorFn(t,{invisible:Qs(r),notFound:Zs(r)},i._ensureElementsStartTime)}).then(function(t){if(!_.domUtils.isDomElement(t)){var e=t.nodeType,n=$s[e];throw r?new qe(r,n):new Fe(n)}i._elements.push(t)})},na.prototype.getElements=function(){var t=this;return this._ensureElementsPromise.then(function(){return t._elements})},na);function na(t,e){this._globalSelectorTimeout=t,this._ensureElementsStartTime=c.nativeMethods.dateNow(),this._ensureElementsPromise=c.Promise.resolve(),this._executeSelectorFn=e,this._elements=[]}function ra(t){var e=t/2;return e<1?0:Math.round(e)}function ia(t,e,n){var r,i={offsetX:ra((r=fi(t)).width),offsetY:ra(r.height)};if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=function(t){var e,n,r,i,o=Xr(t),s=o?t.getElementsByTagName("body")[0]:null,a=t.getBoundingClientRect(),l=Pr.create(Zr(t)),u=ti(t),c=Lr(t),d="BackCompat"===t.ownerDocument.compatMode,h=o?new ui(0,0):ui.create(a),f=a.height,p=a.width;o&&(p=s&&d?(f=s.clientHeight,s.clientWidth):(f=t.clientHeight,t.clientWidth)),!c||(e=Or(t))&&(n=pi(e),r=mi(ui.create(n)),i=Zr(e),h.add(r).add(ui.create(i)),o&&l.add(i));var m=!o&&ii(t)!==t.clientWidth,g=!o&&oi(t)!==t.clientHeight,w={right:m?Yr():0,bottom:g?Yr():0};return new hi(p,f,h,l,u,w)}(t),s=Math.round(Math.max(t.scrollWidth,o.width)),a=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+s,u=o.scrollbar.bottom+o.border.top+o.border.bottom+a;return{offsetX:e<0?l+e:e,offsetY:n<0?u+n:n}}var oa,sa=(t(aa,oa=qs),aa.prototype._delayAfterExecution=function(){return this._command.options&&1!==this._command.options.speed?Ys(2e3*(1-this._command.options.speed)):c.Promise.resolve()},aa.prototype._isExecutionTimeoutExpired=function(){return c.nativeMethods.dateNow()-this._executionStartTime>=this._commandSelectorTimeout},aa.prototype._ensureCommandArguments=function(){var t=aa.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureCmdArgs&&t.ensureCmdArgs(this._command)},aa.prototype._ensureCommandElements=function(){var t,e=this,n=new ea(this._globalSelectorTimeout,this._executeSelectorFn);this._command.selector&&n.push(this._command.selector);var r=null===(t=aa.ACTIONS_HANDLERS[this._command.type])||void 0===t?void 0:t.additionalSelectorProps;if(r)for(var i=0,o=r;i<o.length;i++){var s=o[i];this._command[s]&&n.push(this._command[s],s)}return n.getElements().then(function(t){e._elements=t})},aa.prototype._ensureCommandElementsProperties=function(){var t=aa.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureElsProps&&t.ensureElsProps(this._elements)},aa.prototype._ensureCommandOptions=function(){return l(this,void 0,c.Promise,function(){var e,n,r,i;return C(this,function(t){return e=this._command.options,this._elements.length&&e&&"offsetX"in e&&"offsetY"in e&&(n=ia(this._elements[0],e.offsetX,e.offsetY),r=n.offsetX,i=n.offsetY,e.offsetX=r,e.offsetY=i),[2]})})},aa.prototype._createAutomation=function(){var t=aa.ACTIONS_HANDLERS[this._command.type];if(!t)throw new Error('There is no handler for the "'+this._command.type+'" command.');return t.create(this._command,this._elements)},aa.prototype._runAction=function(e){var n=this;return this._ensureCommandElements().then(function(){return n._ensureCommandElementsProperties()}).then(function(){return n._ensureCommandOptions()}).then(function(){var t=n._createAutomation();return t.TARGET_ELEMENT_FOUND_EVENT?t.on(t.TARGET_ELEMENT_FOUND_EVENT,function(t){n._targetElement=t.element,n.emit(aa.EXECUTION_STARTED_EVENT)}):n.emit(aa.EXECUTION_STARTED_EVENT),t.run(e)})},aa.prototype._runRecursively=function(){var e=this,t=!1,n=!0;return function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return e()?[4,n()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})}(function(){return!t},function(){return e._runAction(n).then(function(){t=!0}).catch(function(t){if(!e._isExecutionTimeoutExpired())return Ys(250);if(t.message===Js)return n=!1,c.Promise.resolve();throw t.message===Ks?new De:t})})},aa.prototype.execute=function(t){var e=this;this._executionStartTime=c.nativeMethods.dateNow();try{this._ensureCommandArguments()}catch(t){return c.Promise.reject(t)}return this.emit(aa.WAITING_FOR_ELEMENT_EVENT,this._commandSelectorTimeout),this._runRecursively().then(function(){return c.Promise.all([e._delayAfterExecution(),t.wait()])}).then(function(){var t=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}(e._elements);return e._targetElement&&(t[0]=e._targetElement),t})},aa.EXECUTION_STARTED_EVENT="execution-started",aa.WAITING_FOR_ELEMENT_EVENT="waiting-for-elements",aa.ACTIONS_HANDLERS={},aa);function aa(t,e,n,r){var i,o=oa.call(this)||this;return o._command=t,o._targetElement=null,o._elements=[],o._globalSelectorTimeout=e,o._executionStartTime=0,o._executeSelectorFn=r,t.options&&!t.options.speed&&(t.options.speed=n),o._commandSelectorTimeout="number"==typeof(null===(i=t.selector)||void 0===i?void 0:i.timeout)?t.selector.timeout:e,o}function la(t,e,n){return Math.min(Math.max(e,t),n)}function ua(t,e){var n="number"==typeof t.min,r="number"==typeof t.max,i="number"==typeof t.length;return i&&(t.length=la(t.length,0,e)),n&&t.min<0&&(t.min+=e),r&&t.max<0&&(t.max+=e),n||(t.min=r&&i?t.max-t.length:0),r||(t.max=i?t.min+t.length:e),t.min=la(t.min,0,e),t.max=la(t.max,0,e),t.length=t.max-t.min,t}function ca(t,e,n){return Math.round(t+la(e-t,0,n)/2)}var da,ha=(t(fa,da=Ri),fa.prototype._createReplicator=function(){return Mr([new Ti])},fa.prototype._getTimeoutErrorParams=function(){return{apiFnIndex:bi.error,apiFnChain:this.command.apiFnChain}},fa.prototype._getTimeoutError=function(t){return t?this.createIsInvisibleError:this.createNotFoundError},fa.prototype._validateElement=function(s,a){var l=this;return c.Promise.resolve().then(function(){return da.prototype._executeFn.call(l,s)}).then(function(t){var e=t,n=!!e,r=!l.command.visibilityCheck||e&&yi(e),i=c.nativeMethods.dateNow()-a>=l.timeout;if(n&&(r||c.utils.dom.isShadowRoot(e)))return e;if(!i)return Ys(200).then(function(){return l._validateElement(s,a)});var o=l.getVisibleValueMode?null:l._getTimeoutError(n);if(o)throw o(l._getTimeoutErrorParams());return null})},fa.prototype._executeFn=function(t){return this.counterMode?da.prototype._executeFn.call(this,t):this._validateElement(t,c.nativeMethods.dateNow())},fa);function fa(t,e,n,r,i){var o,s=da.call(this,t)||this;s.createNotFoundError=r,s.createIsInvisibleError=i,s.timeout="number"==typeof t.timeout?t.timeout:e,s.counterMode=s.dependencies.filterOptions.counterMode,s.getVisibleValueMode=s.dependencies.filterOptions.getVisibleValueMode,s.dependencies.selectorFilter=bi,n&&(o=c.nativeMethods.dateNow()-n,s.timeout=Math.max(s.timeout-o,0));var a=s.dependencies.customDOMProperties;return s.replicator.addTransforms([new Gs(a,t.instantiationCallsiteName)]),s}var pa=c.nativeMethods.date,ma=(ga.prototype._ensureElement=function(t){var e=this,n=t.selector,r=t.createNotFoundError,i=t.createIsInvisibleError,o=t.createHasWrongNodeTypeError;this.ensureElementsPromise=this.ensureElementsPromise.then(function(){return new ha(n,e.globalSelectorTimeout,e.ensureElementsStartTime,r,i).getResult()}).then(function(t){if(!_.domUtils.isDomElement(t))throw o($s[t.nodeType]);e.elements.push(t)})},ga.prototype.getElements=function(){var t=this;return this.ensureElementsPromise.then(function(){return t.elements})},ga);function ga(t,e){var n=this;this.elements=[],this.globalSelectorTimeout=e,this.ensureElementsPromise=c.Promise.resolve(),this.ensureElementsStartTime=new pa,t.forEach(function(t){return n._ensureElement(t)})}function wa(r){return function(t,e){var n=typeof e;if("number"!=n)throw new r(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new r(t,e)}}var va,ya,_a,Ea,Ca,Ia,Sa,ba,Wa,Ta,Aa,xa=wa(Zt),Na=(ya=wa(va=ne),function(t,e){if(ya(t,e),e<0)throw new va(t,e)}),Ra=(_a=oe,function(t,e){var n=typeof e;if("boolean"!=n)throw new _a(t,n)}),Da=(Ea=le,function(t,e){var n=typeof e;if("number"!=n)throw new Ea(t,n);if(isNaN(e)||e<.01||1<e)throw new Ea(t,e)}),Ma=(Ca=de,function(t,e){var n=typeof e;if("string"!=n)throw new Ca(t,n)}),Pa=(Ia=pe,function(t,e){if(!(e instanceof Date))throw new Ia(t,e)}),Fa=(Sa=we,function(t,e){if(isNaN(Number(e)))throw new Sa(t,typeof e)}),ka=(ba=_e,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new ba(t,n)}),La=(Wa=Ie,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new Wa(t,n)}),Oa=(Ta=We,function(t,e){var n=typeof e;if("object"!=n)throw new Ta(t,n)}),Ua=(t(Ha,Aa=gs),Ha.prototype._getAssignableProperties=function(){return[{name:"speed",type:Da}]},Ha);function Ha(t,e){var n=Aa.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var Ba,Ga=(t(Va,Ba=Ua),Va.prototype._getAssignableProperties=function(){return Ba.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:xa},{name:"offsetY",type:xa}])},Va);function Va(t,e){var n=Ba.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var qa,za=(t(Xa,qa=Ga),Xa.prototype._getAssignableProperties=function(){return qa.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:Ra},{name:"skipParentFrames",type:Ra}])},Xa);function Xa(t,e){var n=qa.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var ja,Ya=(t(Ka,ja=Ua),Ka.prototype._getAssignableProperties=function(){return ja.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:xa},{name:"scrollTargetY",type:xa},{name:"crop.left",type:xa},{name:"crop.right",type:xa},{name:"crop.top",type:xa},{name:"crop.bottom",type:xa},{name:"includeMargins",type:Ra},{name:"includeBorders",type:Ra},{name:"includePaddings",type:Ra}])},Ka);function Ka(t,e){var n=ja.call(this)||this;return n.scrollTargetX=null,n.scrollTargetY=null,n.includeMargins=!1,n.includeBorders=!0,n.includePaddings=!0,n.crop={left:null,right:null,top:null,bottom:null},n._assignFrom(t,e),n}var Ja,$a=(t(Qa,Ja=Ga),Qa.prototype._getAssignableProperties=function(){return Ja.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:Ra},{name:"modifiers.alt",type:Ra},{name:"modifiers.shift",type:Ra},{name:"modifiers.meta",type:Ra}])},Qa);function Qa(t,e){var n=Ja.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Za,tl,el,nl,rl,il,ol,sl,al=(t(ll,Za=$a),ll.prototype._getAssignableProperties=function(){return Za.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:Na}])},ll);function ll(t,e){var n=Za.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}function ul(t,e){var n=tl.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}function cl(t,e){var n=el.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function dl(t,e){var n=nl.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function hl(t,e){var n=rl.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function fl(t,e){var n=il.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function pl(t,e){var n=ol.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function ml(t,e){var n=sl.call(this)||this;return n._assignFrom(t,e),n}t(ul,tl=$a),ul.prototype._getAssignableProperties=function(){return tl.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:Ra},{name:"skipDefaultDragBehavior",type:Ra}])},t(cl,el=al),cl.prototype._getAssignableProperties=function(){return el.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:Ra},{name:"paste",type:Ra},{name:"confidential",type:Ra}])},t(dl,nl=$a),dl.prototype._getAssignableProperties=function(){return nl.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:xa},{name:"destinationOffsetY",type:xa}])},t(hl,rl=gs),hl.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:Ra}]},t(fl,il=gs),fl.prototype._getAssignableProperties=function(){return[{name:"timeout",type:Na},{name:"allowUnawaitedPromise",type:Ra}]},t(pl,ol=Ua),pl.prototype._getAssignableProperties=function(){return ol.prototype._getAssignableProperties.call(this).concat([{name:"confidential",type:Ra}])},t(ml,sl=gs),ml.prototype._getAssignableProperties=function(){return[{name:"name",type:Ma},{name:"value",type:Ma},{name:"domain",type:Ma},{name:"path",type:Ma},{name:"expires",type:Pa},{name:"maxAge",type:Fa},{name:"secure",type:Ra},{name:"httpOnly",type:Ra},{name:"sameSite",type:Ma}]};var gl,wl=(t(vl,gl=gs),vl.prototype._getAssignableProperties=function(){return[{name:"username",type:Ma,required:!0},{name:"password",type:Ma}]},vl);function vl(t,e){var n=gl.call(this)||this;return n._assignFrom(t,e),n}var yl,_l,El,Cl=(t(Il,yl=gs),Il.prototype._getAssignableProperties=function(){return[{name:"protocol",type:Ma},{name:"host",type:Ma,required:!0},{name:"port",type:Fa,required:!0},{name:"auth",type:Oa,init:Wl}]},Il);function Il(t,e){var n=yl.call(this)||this;return n._assignFrom(t,e),n}function Sl(t,e){var n=_l.call(this)||this;return n._assignFrom(t,e),n}function bl(t,e){var n=El.call(this)||this;return n._assignFrom(t,e),n}function Wl(t,e,n,r){return void 0===r&&(r=!0),new wl(e,r)}function Tl(t,e,n,r){return void 0===r&&(r=!0),new Cl(e,r)}function Al(t){return t.top!==t}t(Sl,_l=gs),Sl.prototype._getAssignableProperties=function(){return[{name:"url",type:ka},{name:"method",type:Ma},{name:"headers",type:Oa},{name:"params",type:La},{name:"body"},{name:"timeout",type:Fa},{name:"withCredentials",type:Ra},{name:"auth",type:Oa,init:Wl},{name:"proxy",type:Oa,init:Tl},{name:"rawResponse",type:Ra}]},t(bl,El=gs),bl.prototype._getAssignableProperties=function(){return[{name:"credentials",type:Fa}]};var xl=c.eventSandbox.message,Nl="driver|browser-manipulation|request",Rl="driver|browser-manipulation|response";xl.on(xl.SERVICE_MSG_RECEIVED_EVENT,function(e){var t,n,r,i,o;e.message.cmd===Nl&&(t=_.domUtils.findIframeByWindow(e.source),r=(n=e.message).command,(i=n.cropDimensions)&&(r.options=new Ya({crop:i,includePaddings:!1})),(o=new Dl(r)).element=t,o.execute().then(function(t){return xl.sendServiceMsg({cmd:Rl,result:t},e.source)}))});var Dl=(Ml.prototype._getAbsoluteCropValues=function(){var t=this.element.getBoundingClientRect(),e=t.top,n=t.left;n+=this.command.options.originOffset.x,e+=this.command.options.originOffset.y;var r=n+this.command.options.crop.right,i=e+this.command.options.crop.bottom;return{top:e+=this.command.options.crop.top,left:n+=this.command.options.crop.left,bottom:i,right:r}},Ml.prototype._createManipulationReadyMessage=function(){var t=qu.devicePixelRatio||1,e={cmd:u.readyForBrowserManipulation,pageDimensions:{dpr:t,innerWidth:qu.innerWidth,innerHeight:qu.innerHeight,documentWidth:zu.documentElement.clientWidth,documentHeight:zu.documentElement.clientHeight,bodyWidth:zu.body.clientWidth,bodyHeight:zu.body.clientHeight},disableResending:!0};return this.command.type===d.takeElementScreenshot&&(e.cropDimensions=this._getAbsoluteCropValues()),e},Ml.prototype._runScrollBeforeScreenshot=function(){var i=this;return c.Promise.resolve().then(function(){if(i.element||!i.command.selector)return c.Promise.resolve();var t,e,n=i.command.selector.timeout,r="number"==typeof n?n:i.globalSelectorTimeout;return i.statusBar.showWaitingElementStatus(r),t=[{selector:i.command.selector,createNotFoundError:function(t){return new xe(null,t)},createIsInvisibleError:function(){return new De},createHasWrongNodeTypeError:function(t){return new Fe(t)}}],e=i.globalSelectorTimeout,new ma(t,e).getElements().then(function(t){i.statusBar.hideWaitingElementStatus(),i.element=t[0]}).catch(function(t){throw i.statusBar.hideWaitingElementStatus(),t})}).then(function(){return function(v,y){return l(this,void 0,void 0,function(){var e,n,r,i,o,s,a,l,u,c,d,h,f,p,m,g,w;return C(this,function(t){if(e=v.getBoundingClientRect(),n={left:e.left,right:e.right,top:e.top,bottom:e.bottom},r=_.styleUtils.getElementMargin(v),i=_.styleUtils.getElementPadding(v),o=_.styleUtils.getBordersWidth(v),y.originOffset={x:0,y:0},s=n.left+v.scrollWidth+o.left+o.right,a=n.top+v.scrollHeight+o.top+o.bottom,n.right=Math.max(n.right,s),n.bottom=Math.max(n.bottom,a),y.includeBorders&&y.includePaddings?y.includeMargins&&(y.originOffset.x-=r.left,y.originOffset.y-=r.top,n.left-=r.left,n.top-=r.top,n.right+=r.right,n.bottom+=r.bottom):(y.originOffset.x+=o.left,y.originOffset.y+=o.top,n.left+=o.left,n.top+=o.top,n.right-=o.right,n.bottom-=o.bottom,y.includePaddings||(y.originOffset.x+=i.left,y.originOffset.y+=i.top,n.left+=i.left,n.top+=i.top,n.right-=i.right,n.bottom-=i.bottom)),n.width=n.right-n.left,n.height=n.bottom-n.top,l=ua({min:y.crop.left,max:y.crop.right,length:y.crop.width},n.width),u=ua({min:y.crop.top,max:y.crop.bottom,length:y.crop.height},n.height),y.crop.left=l.min,y.crop.right=l.max,y.crop.width=l.length,y.crop.top=u.min,y.crop.bottom=u.max,y.crop.height=u.length,y.crop.width<=0||y.crop.height<=0)throw new vn(y.crop.width,y.crop.height);if(c=_.styleUtils.getViewportDimensions(),(n.width>c.width||n.height>c.height)&&(y.scrollToCenter=!0),d="number"==typeof y.scrollTargetX,h="number"==typeof y.scrollTargetY,d||(y.scrollTargetX=ca(y.crop.left,y.crop.right,c.width)),h||(y.scrollTargetY=ca(y.crop.top,y.crop.bottom,c.height)),f=E.getOffsetOptions(v,y.scrollTargetX,y.scrollTargetY),p=f.offsetX,m=f.offsetY,y.scrollTargetX=p,y.scrollTargetY=m,g=!d||y.scrollTargetX>=y.crop.left&&y.scrollTargetX<=y.crop.right,w=!h||y.scrollTargetY>=y.crop.top&&y.scrollTargetY<=y.crop.bottom,!g||!w)throw new mn(g,w);return[2]})})}(i.element,i.command.options)}).then(function(){var t=i.command.options,e=t.scrollTargetX,n=t.scrollTargetY,r=t.scrollToCenter;return new _.ScrollAutomation(i.element,new za({offsetX:e,offsetY:n,scrollToCenter:r,skipParentFrames:!0})).run()})},Ml.prototype._hideUI=function(){return n.hide(),this.command.markData&&n.showScreenshotMark(this.command.markData),_.delay(500)},Ml.prototype._showUI=function(){this.command.markData&&n.hideScreenshotMark(),n.show()},Ml.prototype._requestManipulation=function(){if(!Al(qu))return c.transport.queuedAsyncServiceMsg(this._createManipulationReadyMessage());var t=this._getAbsoluteCropValues();return _.sendRequestToFrame({cmd:Nl,command:this.command,cropDimensions:t},Rl,qu.parent).then(function(t){if(!t.result)return{result:null};var e=t.result,n=e.result,r=e.executionError;if(r)throw r;return{result:n}})},Ml.prototype._runManipulation=function(){var r=this,i=null;return c.Promise.resolve().then(function(){return r.command.type!==d.takeElementScreenshot?c.Promise.resolve():(_.scrollController.stopPropagation(),r._runScrollBeforeScreenshot())}).then(function(){return Al(qu)?c.Promise.resolve():r._hideUI()}).then(function(){return r._requestManipulation()}).then(function(t){var e=t.result,n=t.error;if(n)throw n;return _.scrollController.enablePropagation(),i=e,Al(qu)||r._showUI(),_.delay(200)}).then(function(){return new ys({isCommandResult:!0,result:i})}).catch(function(t){return _.scrollController.enablePropagation(),new ys({isCommandResult:!0,executionError:t})})},Ml.prototype.execute=function(){var t=this;return function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=new _.ClientRequestEmitter,i=new _.RequestBarrier(r),o=new _.ScriptExecutionEmitter,s=new _.ScriptExecutionBarrier(o);_.pageUnloadBarrier.watchForPageNavigationTriggers();var a=null,l=t.apply(void 0,e),u=l.then(function(t){return a=t,c.Promise.all([i.wait().then(function(){return s.wait()}),_.pageUnloadBarrier.wait()])}).then(function(){return a});return{actionPromise:l,barriersPromise:u}}(function(){return t._runManipulation()}).barriersPromise},Ml);function Ml(t,e,n){this.command=t,this.globalSelectorTimeout=e,this.statusBar=n,this.element=null}function Pl(e){return e.getResult().then(function(t){return new ys({isCommandResult:!0,result:e.encodeResult(t)})}).catch(function(t){return new ys({isCommandResult:!0,executionError:t})})}var Fl=s.Promise,kl=(Ll.prototype.setAsMaster=function(t){var e=this;return Es(new Vo(t),this.driverWindow,Cs,kn).catch(function(t){if(!e._isNonPageWindow)throw t})},Ll.prototype.closeAllChildWindows=function(){return Es(new Xo,this.driverWindow,Cs,Un)},Ll.prototype.findChildWindows=function(t,e){return Es(new e(t),this.driverWindow,Cs,kn)},Ll.prototype.startToRestore=function(){return Es(new Ko,this.driverWindow,Cs,kn)},Ll.prototype.closeFileDownloadingWindow=function(){this._isNonPageWindow=!0,this.driverWindow.close()},Ll);function Ll(t,e){this._isNonPageWindow=!1,this.driverWindow=t,this.windowId=e}var Ol=(Ul.prototype._getTopOpenedWindow=function(t){for(var e=t;e.opener;)e=e.opener;return e.top},Ul.prototype._setAsMaster=function(t,e){return Es(new Vo(e),t,Cs,kn)},Ul.prototype.getTopOpenedWindow=function(){return this._getTopOpenedWindow(this.currentDriverWindow)},Ul.prototype.setTopOpenedWindowAsMaster=function(){var t=this._getTopOpenedWindow(this.currentDriverWindow);return this._setAsMaster(t)},Ul.prototype.setParentWindowAsMaster=function(t){void 0===t&&(t={});var e=this.currentDriverWindow.opener;return this._setAsMaster(e,t.finalizePendingCommand)},Ul.prototype.restoreChild=function(r){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){return e=new Qo(r),n=this.currentDriverWindow.opener,Es(e,n,Cs,kn),[2]})})},Ul);function Ul(t){this.currentDriverWindow=t}var Hl="master",Bl="replica",Gl=(Vl.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},Vl.prototype.toSerializable=function(t){return new Ls(t)},Vl.prototype.fromSerializable=function(){},Vl);function Vl(){this.type="Node"}var ql=(zl.prototype._startListening=function(){var e=this;this._emitter.onRequestSend(function(t){return e._onRequestSend(t)}),this._emitter.onRequestCompleted(function(t){return e._onRequestCompleted(t)}),this._emitter.onRequestError(function(t){return e._onRequestError(t)})},zl.prototype._offListening=function(){this._emitter.offAll()},zl.prototype._onRequestSend=function(t){this._collectingReqs&&this._requests.add(t)},zl.prototype._onRequestCompleted=function(t){var e=this;Ys(this._delays.additionalRequestsCollection).then(function(){return e._onRequestFinished(t)})},zl.prototype._onRequestFinished=function(t){this._requests.has(t)&&(this._requests.delete(t),this._collectingReqs||this._requests.size||!this._watchdog||this._finishWaiting())},zl.prototype._onRequestError=function(t){this._onRequestFinished(t)},zl.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._requests.clear(),this._offListening(),this._waitResolve()},zl.prototype.wait=function(t){var n=this;return Ys(t?this._delays.pageInitialRequestsCollection:this._delays.requestsCollection).then(function(){return new c.Promise(function(t){var e;n._collectingReqs=!1,n._waitResolve=t,n._requests.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},zl.TIMEOUT)):n._finishWaiting()})})},zl.TIMEOUT=3e3,zl);function zl(t,e){var n,r,i;void 0===e&&(e={}),this._delays={requestsCollection:null!==(n=e.requestsCollection)&&void 0!==n?n:50,additionalRequestsCollection:null!==(r=e.additionalRequestsCollection)&&void 0!==r?r:50,pageInitialRequestsCollection:null!==(i=e.pageInitialRequestsCollection)&&void 0!==i?i:50},this._emitter=t,this._waitResolve=null,this._watchdog=null,this._requests=new Set,this._collectingReqs=!0,this._startListening()}var Xl=(jl.prototype._startListening=function(){var e=this;this._emitter.onScriptAdded(function(t){return e._onScriptElementAdded(t)}),this._emitter.onScriptLoadedOrFailed(function(t){return e._onScriptLoadedOrFailed(t)})},jl.prototype._offListening=function(){this._emitter.offAll()},jl.prototype._onScriptElementAdded=function(t){var e=this,n=(0,c.nativeMethods.setTimeout)(function(){return e._onScriptLoadedOrFailed(t,!0)},jl.LOADING_TIMEOUT);this._scripts.set(t,n)},jl.prototype._onScriptLoadedOrFailed=function(t,e){var n=this;void 0===e&&(e=!1),this._scripts.has(t)&&(e||(0,c.nativeMethods.clearTimeout)(this._scripts.get(t)),this._scripts.delete(t),this._scripts.size||Ys(25).then(function(){n._waitResolve&&!n._scripts.size&&n._finishWaiting()}))},jl.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._scripts.clear(),this._offListening(),this._waitResolve(),this._waitResolve=null},jl.prototype.wait=function(){var n=this;return new c.Promise(function(t){var e;n._waitResolve=t,n._scripts.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},jl.TIMEOUT)):n._finishWaiting()})},jl.TIMEOUT=3e3,jl.LOADING_TIMEOUT=2e3,jl);function jl(t){this._emitter=t,this._watchdog=null,this._waitResolve=null,this._scripts=new Map,this._startListening()}var Yl=(Kl.prototype.wait=function(){var t=this;return c.Promise.all([this._requestBarrier.wait().then(function(){return t._scriptExecutionBarrier.wait()}),this._unloadBarrier.wait()]).then()},Kl);function Kl(t,e,n){this._requestBarrier=new ql(t),this._scriptExecutionBarrier=new Xl(e),(this._unloadBarrier=n).watchForPageNavigationTriggers&&n.watchForPageNavigationTriggers()}function Jl(t,e){var n=E.calculateSelectTextArguments(e[0],t);return new E.SelectText(e[0],n.startPos,n.endPos,t.options)}function $l(t){if(!_.domUtils.isFileInput(t))throw new hn}sa.ACTIONS_HANDLERS[d.dispatchEvent]={additionalSelectorProps:["relatedTarget"],create:function(t,e){return e[1]&&(t.options.relatedTarget=e[1]),new E.DispatchEvent(e[0],t.eventName,t.options)}},sa.ACTIONS_HANDLERS[d.pressKey]={create:function(t){return new E.Press(_.parseKeySequence(t.keys).combinations,t.options)},ensureCmdArgs:function(t){if(_.parseKeySequence(t.keys).error)throw new sn("keys")}},sa.ACTIONS_HANDLERS[d.click]={create:function(t,e){return/option|optgroup/.test(_.domUtils.getTagName(e[0]))?new E.SelectChildClick(e[0],t.options):new E.Click(e[0],t.options,qu,E.cursor)}},sa.ACTIONS_HANDLERS[d.rightClick]={create:function(t,e){return new E.RClick(e[0],t.options)}},sa.ACTIONS_HANDLERS[d.doubleClick]={create:function(t,e){return new E.DblClick(e[0],t.options)}},sa.ACTIONS_HANDLERS[d.hover]={create:function(t,e){return new E.Hover(e[0],t.options)}},sa.ACTIONS_HANDLERS[d.drag]={create:function(t,e){return new E.DragToOffset(e[0],t.dragOffsetX,t.dragOffsetY,t.options)}},sa.ACTIONS_HANDLERS[d.dragToElement]={additionalSelectorProps:["destinationSelector"],create:function(t,e){return new E.DragToElement(e[0],e[1],t.options)}},sa.ACTIONS_HANDLERS[d.scroll]={create:function(t,e){var n=t.x,r=t.y,i=t.position,o=t.options;return new E.SetScroll(e[0],{x:n,y:r,position:i},o)}},sa.ACTIONS_HANDLERS[d.scrollBy]={create:function(t,e){var n=t.byX,r=t.byY,i=t.options;return new E.SetScroll(e[0],{byX:n,byY:r},i)}},sa.ACTIONS_HANDLERS[d.scrollIntoView]={create:function(t,e){return new E.ScrollIntoView(e[0],t.options)}},sa.ACTIONS_HANDLERS[d.typeText]={create:function(t,e){return new E.Type(e[0],t.text,t.options)}},sa.ACTIONS_HANDLERS[d.selectText]={create:Jl,ensureElsProps:function(t){if(!_.domUtils.isEditableElement(t[0]))throw new je}},sa.ACTIONS_HANDLERS[d.selectTextAreaContent]={create:Jl,ensureElsProps:function(t){if(!_.domUtils.isTextAreaElement(t[0]))throw new Je}},sa.ACTIONS_HANDLERS[d.selectEditableContent]={additionalSelectorProps:["startSelector","endSelector"],create:function(t,e){return t.endSelector=t.endSelector||t.startSelector,new E.SelectEditableContent(e[0],e[1],t.options)},ensureElsProps:function(t){if(!_.domUtils.isContentEditableElement(t[0]))throw new Ze("startSelector");if(!_.domUtils.isContentEditableElement(t[1]))throw new Ze("endSelector");if(!_.contentEditable.getNearestCommonAncestor(t[0],t[1]))throw new nn}},sa.ACTIONS_HANDLERS[d.setFilesToUpload]={create:function(t,e){return new E.Upload(e[0],t.filePath,function(t,e){return new un(t,e)})},ensureElsProps:function(t){return $l(t[0])}},sa.ACTIONS_HANDLERS[d.clearUpload]={create:function(t,e){return new E.Upload(e[0])},ensureElsProps:function(t){return $l(t[0])}};var Ql,Zl=s.settings,tu=s.transport,eu=s.Promise,nu=s.eventSandbox.message,ru=s.storages,iu=s.nativeMethods,ou=iu.date,su=s.eventSandbox.listeners,au=s.utils.url,lu="testcafe|driver|test-done-sent-flag",uu="testcafe|driver|pending-status",cu="testcafe|driver|executing-client-function-descriptor",du="testcafe|driver|selector-execution-start-time",hu="testcafe|driver|pending-page-error",fu="testcafe|driver|active-iframe-selector",pu="testcafe|driver|test-speed",mu="testcafe|driver|assertion-retries-timeout",gu="testcafe|driver|assertion-retries-start-time",wu="testcafe|driver|console-messages",vu="testcafe|driver|pending-child-window-count",yu={NotLoadedError:Sn,NotFoundError:xe,IsInvisibleError:De},_u={NotLoadedError:Tn,NotFoundError:hr,IsInvisibleError:mr},Eu=Math.pow(2,31)-1,Cu="status-with-command-result-event",Iu="empty-command-event",Su="child-window-closed",bu=(t(Wu,Ql=_.serviceUtils.EventEmitter),Wu.prototype._isOpenedInIframe=function(){var t=qu.opener;return t&&t.top&&t.top!==t},Object.defineProperty(Wu.prototype,"speed",{get:function(){return this.contextStorage.getItem(pu)},set:function(t){this.contextStorage.setItem(pu,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Wu.prototype,"consoleMessages",{get:function(){return new Ar(this.contextStorage.getItem(wu))},set:function(t){return this.contextStorage.setItem(wu,t?t.getCopy():null)},enumerable:!1,configurable:!0}),Wu.prototype._getReadyPromise=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,_.eventUtils.documentReady(this.pageLoadTimeout)];case 1:return t.sent(),[4,this.pageInitialRequestBarrier.wait(!0)];case 2:return t.sent(),[2]}})})},Wu.prototype._hasPendingActionFlags=function(t){return t.getItem(this.COMMAND_EXECUTING_FLAG)||t.getItem(this.EXECUTING_IN_IFRAME_FLAG)},Wu.prototype._getCurrentWindowId=function(){var t=qu.location.toString(),e=s.utils.url.parseProxyUrl(t);return e&&e.windowId||null},Wu.prototype._onJsError=function(t){if(this.skipJsErrors||this.contextStorage.getItem(lu))return eu.resolve();var e=new Ot(t.stack,t.pageUrl);return this.contextStorage.getItem(hu)||this.contextStorage.setItem(hu,e),null},Wu.prototype._unlockPageAfterTestIsDone=function(){return _.disableRealEventsPreventing(),eu.resolve()},Wu.prototype._getActiveElement=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){return e=_.domUtils.getActiveElement(),[2,this.replicator.encode(e)]})})},Wu.prototype._failIfClientCodeExecutionIsInterrupted=function(){var t=this.contextStorage.getItem(cu);return!!t&&(this._onReady(new ys({isCommandResult:!0,executionError:new It(t.instantiationCallsiteName)})),!0)},Wu.prototype.onCustomClientScriptError=function(t,e){var n=e?new Jt(t,e):new jt(t);this.contextStorage.getItem(hu)||this.contextStorage.setItem(hu,n)},Wu.prototype._addChildWindowDriverLink=function(t){var e=new kl(t.window,t.windowId);this.childWindowDriverLinks.push(e),this._ensureClosedChildWindowWatcher()},Wu.prototype._ensureClosedChildWindowWatcher=function(){var e=this;this.checkClosedChildWindowIntervalId||(this.checkClosedChildWindowIntervalId=iu.setInterval.call(qu,function(){var t=_.arrayUtils.find(e.childWindowDriverLinks,function(t){return t.driverWindow.closed});t&&(e.emit(Su),_.arrayUtils.remove(e.childWindowDriverLinks,t),t.ignoreMasterSwitching||e._setCurrentWindowAsMaster(),e.childWindowDriverLinks.length||(iu.clearInterval.call(qu,e.checkClosedChildWindowIntervalId),delete e.checkClosedChildWindowIntervalId))},200))},Wu.prototype._setAsMasterInProgressOrCompleted=function(){return this.setAsMasterInProgress||this.role===Hl},Wu.prototype._setCurrentWindowAsMaster=function(){var t=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,this._clearActiveChildIframeInfo(),eu.resolve().then(function(){return _.browser.setActiveWindowId(t.browserActiveWindowId,s.createNativeXHR,t.windowId)}).then(function(){t._startInternal({finalizePendingCommand:!0,isFirstRequestAfterWindowSwitching:!0}),t.setAsMasterInProgress=!1}).catch(function(){t._onReady(new ys({isCommandResult:!0,executionError:new kn}))}))},Wu.prototype._onChildWindowOpened=function(t){this._addChildWindowDriverLink(t),this._switchToChildWindow(t.windowId)},Wu.prototype._sendStartToRestoreCommand=function(){if(this.contextStorage){this._stopRespondToChildren=!0,this.contextStorage.setItem(vu,this.childWindowDriverLinks.length);for(var t=0,e=this.childWindowDriverLinks;t<e.length;t++)e[t].startToRestore()}},Wu.prototype._onFormSubmit=function(t){this.contextStorage&&this.contextStorage.getItem(lu)&&(t.preventSubmit=!0)},Wu.prototype._onConsoleMessage=function(t){var e=t.meth,n=t.line,r=this.consoleMessages;r.addMessage(e,n,this.windowId),this.consoleMessages=r},Wu.prototype._addPendingErrorToStatus=function(t){var e=this.contextStorage.getItem(hu);e&&(this.contextStorage.setItem(hu,null),t.pageError=e)},Wu.prototype._addUnexpectedDialogErrorToStatus=function(t){var e=this.nativeDialogsTracker.getUnexpectedDialogError();t.pageError=t.pageError||e},Wu.prototype._addConsoleMessagesToStatus=function(t){t.consoleMessages=this.consoleMessages,this.consoleMessages=null},Wu.prototype._addPendingWindowSwitchingStateToStatus=function(t){t.isPendingWindowSwitching=this._isPendingSwitchingWindow()},Wu.prototype._sendStatusRequest=function(t){function e(){return _.getTimeLimitedPromise(tu.asyncServiceMsg(r),5e3)}function n(){return _.delay(300).then(e)}for(var r={cmd:u.ready,status:t,disableResending:!0,allowRejecting:!0},i=e(),o=0;o<a;o++)i=i.catch(n);return i},Wu.prototype._sendStatus=function(t){var e=this;t.resent||(this._addPendingErrorToStatus(t),this._addUnexpectedDialogErrorToStatus(t),this._addConsoleMessagesToStatus(t),this._addPendingWindowSwitchingStateToStatus(t)),this.contextStorage.setItem(uu,t);var n=null;return _.pageUnloadBarrier.wait(0).then(function(){return e._sendStatusRequest(t)}).then(function(t){return n=t,_.pageUnloadBarrier.wait(0)}).then(function(){return e.contextStorage.setItem(uu,null),n})},Wu.prototype._addChildIframeDriverLink=function(t,e){var n,r=this._getChildIframeDriverLinkByWindow(e);r||(n=this.testRunId+"-"+zi(),r=new Ss(e,n),this.childIframeDriverLinks.push(r)),r.sendConfirmationMessage(t)},Wu.prototype._getTargetWindowNotFoundResult=function(t,e){return eu.resolve({success:!1,errCode:t,errMsg:e})},Wu.prototype._getChildWindowValidateResult=function(t){var e=t.find(function(t){return t.result.success});if(e)return e.result;var n=t.find(function(t){return t.result.errCode===et||t.result.errCode===st});return(n=n||t.find(function(t){return!!t.result.errCode}))?{errCode:n.result.errCode}:void 0},Wu.prototype._handleWindowValidation=function(n,r,i,o){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._validateWindow(n,r,i,o)];case 1:return e=t.sent(),Is({requestMsgId:n.id,window:r,result:e}),[2]}})})},Wu.prototype._getWindowInfo=function(){var t=s.utils.url.parseProxyUrl(qu.location.toString());return{id:this.windowId,title:zu.title,url:t.destUrl}},Wu.prototype._isTargetWindow=function(t){return t.windowId===this.windowId},Wu.prototype._validateWindow=function(r,t,i,o){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return this._isTargetWindow(r)?[2,i()]:this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(r,o)}),[4,eu.all(e)]):[2,this._getTargetWindowNotFoundResult(nt)];case 1:return n=t.sent(),[2,this._getChildWindowValidateResult(n)]}})})},Wu._createWindowValidationError=function(t){var e=t.errCode;return new(e===et?Gn:e===st?zn:$n)},Wu.prototype._getCloseWindowFoundResult=function(){return this.parentWindowDriverLink?this.childWindowDriverLinks.length?eu.resolve({success:!1,errCode:et}):eu.resolve({success:!0}):eu.resolve({success:!1,errCode:st})},Wu.prototype._handleCloseWindowValidation=function(t,e){var n=this;return this._handleWindowValidation(t,e,function(){return n._getCloseWindowFoundResult()},go)},Wu.prototype._handleSwitchToWindowValidation=function(t,e){return this._handleWindowValidation(t,e,function(){return eu.resolve({success:!0})},yo)},Wu.prototype._handleCloseWindow=function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._closeWindow(e,n)];case 1:return t.sent(),Is({requestMsgId:e.id,window:n}),[2]}})})},Wu.prototype._closeWindowAndWait=function(n,r){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return e=this._createWaitForEventPromise(Su,2e3),n.ignoreMasterSwitching=!r.isCurrentWindow,this.closing?[3,2]:(this.closing=!0,[4,_.browser.closeWindow(this.browserCloseWindowUrl,s.createNativeXHR,this.windowId)]);case 1:t.sent(),t.label=2;case 2:return n.driverWindow.close(),[2,e]}})})},Wu.prototype._closeWindow=function(e){if(!this.childWindowDriverLinks.length)return eu.resolve();var t=this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId});if(t)return this._closeWindowAndWait(t,e);var n=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,bo)});return eu.all(n)},Wu.prototype._getWindows=function(){return l(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:return this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows({},Co)}),[4,eu.all(e)]):[2,[this._getWindowInfo()]];case 1:for(n=t.sent(),r=[this._getWindowInfo()],i=0,o=n;i<o.length;i++)s=o[i],Array.isArray(s.result)&&(r=r.concat(s.result));return[2,r]}})})},Wu.prototype._handleGetWindows=function(n,r){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._getWindows(n,r)];case 1:return e=t.sent(),Is({requestMsgId:n.id,window:r,result:e}),[2]}})})},Wu.prototype._handleSwitchToWindow=function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._switchToWindow(e)];case 1:return t.sent(),Is({requestMsgId:e.id,window:n}),[2]}})})},Wu.prototype._switchToWindow=function(e){var t=this;return this._isTargetWindow(e)?eu.resolve().then(function(){t._setCurrentWindowAsMaster()}):this.childWindowDriverLinks.length?eu.all(this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,Ao)})):eu.resolve()},Wu.prototype._handleSetAsMasterMessage=function(t,e){var n=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,Is({requestMsgId:t.id,window:e}),eu.resolve().then(function(){return _.browser.setActiveWindowId(n.browserActiveWindowId,s.createNativeXHR,n.windowId)}).then(function(){n._startInternal({finalizePendingCommand:t.finalizePendingCommand,result:{id:n.windowId}}),n.setAsMasterInProgress=!1}).catch(function(){n._onReady(new ys({isCommandResult:!0,executionError:new kn}))}))},Wu.prototype._handleCloseAllWindowsMessage=function(t,e){var n=this;this._closeAllChildWindows().then(function(){Is({requestMsgId:t.id,window:e})}).catch(function(){n._onReady(new ys({isCommandResult:!0,executionError:new Un}))})},Wu.prototype._handleStartToRestoreChildLinkMessage=function(){this.parentWindowDriverLink.restoreChild(this._getCurrentWindowId())},Wu.prototype._handleHasPendingActionFlags=function(t,e){var n=this._hasPendingActionFlags(this.contextStorage);Is({requestMsgId:t.id,window:e,result:n})},Wu.prototype._handleRestoreChildLink=function(t,e){this._stopRespondToChildren||(this._addChildWindowDriverLink({window:e,windowId:t.windowId}),this.childWindowDriverLinks.length===this.contextStorage.getItem(vu)&&this._restoreChildWindowsPromiseResolver&&(this._restoreChildWindowsPromiseResolver(),delete this._restoreChildWindowsPromiseResolver,this.contextStorage.setItem(vu,0)),Is({requestMsgId:t.id,window:e}))},Wu.prototype._handleChildWindowIsOpenedInIFrame=function(){var e=this;this._pendingChildWindowInIFrame=new eu(function(t){e._resolvePendingChildWindowInIframe=t})},Wu.prototype._handleChildWindowIsLoadedInIFrame=function(e,t){Is({requestMsgId:e.id,window:t}),this._resolvePendingChildWindowInIframe(),this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId})||this._onChildWindowOpened({window:t,windowId:e.windowId})},Wu.prototype._handleStopInternalFromFrame=function(t,e){Is({requestMsgId:t.id,window:e}),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._stopInternal()},Wu.prototype._initChildDriverListening=function(){var r=this;nu.on(nu.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message,n=t.source;switch(e.type){case Yi:r._addChildIframeDriverLink(e.id,n);break;case uo:r._handleChildWindowIsOpenedInIFrame(e,n);break;case lo:r._handleChildWindowIsLoadedInIFrame(e,n);break;case co:r._handleStopInternalFromFrame(e,n);break;case io:r._handleSetAsMasterMessage(e,n);break;case Ki:r._handleSwitchToWindow(e,n);break;case Ji:r._handleCloseWindow(e,n);break;case Qi:r._handleSwitchToWindowValidation(e,n);break;case $i:r._handleCloseWindowValidation(e,n);break;case Zi:r._handleGetWindows(e,n);break;case oo:r._handleCloseAllWindowsMessage(e,n);break;case so:r._handleStartToRestoreChildLinkMessage();break;case ho:r._handleHasPendingActionFlags(e,n);break;case ao:r._handleRestoreChildLink(e,n)}})},Wu.prototype._getChildIframeDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childIframeDriverLinks,function(t){return t.driverWindow===e})},Wu.prototype._getChildWindowDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childWindowDriverLinks,function(t){return t.driverWindow===e})},Wu.prototype._runInActiveIframe=function(t){var e=this,n=eu.resolve(),r=this.contextStorage.getItem(fu);!this.activeChildIframeDriverLink&&r&&(n=this._switchToIframe(r,_u)),n.then(function(){return e.contextStorage.setItem(e.EXECUTING_IN_IFRAME_FLAG,!0),e.activeChildIframeDriverLink.executeCommand(t,e.speed)}).then(function(t){return e._onCommandExecutedInIframe(t)}).catch(function(t){return e._onCommandExecutedInIframe(new ys({isCommandResult:!0,executionError:t}))})},Wu.prototype._onCommandExecutedInIframe=function(t){var e=this;this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1);var n=eu.resolve();this._pendingChildWindowInIFrame&&(n=this._pendingChildWindowInIFrame),n.then(function(){e._onReady(t)})},Wu.prototype._ensureChildIframeDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildIframeDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},Wu.prototype._ensureChildWindowDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildWindowDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},Wu.prototype._switchToIframe=function(e,n){var t,r,i,o,s,a,l,u=this,c="number"==typeof e.timeout,d=c?e.timeout:this.selectorTimeout;return t=e,r=d,i=null,o=function(t){return new n.NotFoundError(null,t)},s=function(){return new n.IsInvisibleError},a=this.statusBar,l=new ha(t,r,i,o,s),a.showWaitingElementStatus(l.timeout),l.getResult().then(function(t){return a.hideWaitingElementStatus(!!t).then(function(){return t})}).catch(function(t){return a.hideWaitingElementStatus(!1).then(function(){throw t})}).then(function(t){if(!_.domUtils.isIframeElement(t))throw new En;var e=c?d:Math.max(d,5e3);return u._ensureChildIframeDriverLink(iu.contentWindowGetter.call(t),n.NotLoadedError,e)}).then(function(t){t.availabilityTimeout=d,u.activeChildIframeDriverLink=t,u.contextStorage.setItem(fu,e)})},Wu.prototype._createWaitForEventPromise=function(e,n){var r=this,i=null,t=new eu(function(t){iu.setTimeout.call(qu,function(){r.off(e,i),t()},n)}),o=new eu(function(t){i=function(){this.off(e,i),t()},r.on(e,i)});return eu.race([t,o])},Wu.prototype._waitForCurrentCommandCompletion=function(){return this.contextStorage.getItem(this.COMMAND_EXECUTING_FLAG)?this._createWaitForEventPromise(Cu,Eu):eu.resolve()},Wu.prototype._waitForEmptyCommand=function(){return this._createWaitForEventPromise(Iu,3e4)},Wu.prototype._abortSwitchingToChildWindowIfItClosed=function(){if(this.activeChildWindowDriverLink.driverWindow.closed)throw _.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),this.activeChildWindowDriverLink=null,new sr},Wu.prototype._switchToChildWindow=function(t){var e=this;this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0);var n=this.contextStorage.getItem(this.WINDOW_COMMAND_API_CALL_FLAG);return function(e,t){if("string"!=typeof e)return Fl.resolve(null);var n=_.arrayUtils.find(t,function(t){return t.windowId===e});if(n)return Fl.resolve(n);var r=new Nn;return Fl.reject(r)}(t,this.childWindowDriverLinks).then(function(t){return e._ensureChildWindowDriverLink(t.driverWindow,Mn,e.childWindowReadyTimeout)}).then(function(t){return e.activeChildWindowDriverLink=t,e._waitForCurrentCommandCompletion()}).then(function(){return n?void 0:e._waitForEmptyCommand()}).then(function(){return e._observeFileDownloadingInNewWindow(),e._abortSwitchingToChildWindowIfItClosed(),e._stopInternal(),e.activeChildWindowDriverLink.setAsMaster(n)}).then(function(){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(t){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1),t instanceof sr?e._onReady(new ys):e._onReady(new ys({isCommandResult:!0,executionError:new kn}))})},Wu.prototype._switchToTopParentWindow=function(){var t=this.parentWindowDriverLink.setTopOpenedWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(t)},Wu.prototype._switchToParentWindow=function(t){void 0===t&&(t={});var e=this.parentWindowDriverLink.setParentWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(e,t)},Wu.prototype._switchToParentWindowInternal=function(t,e){var n=this;return void 0===e&&(e={}),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0),eu.resolve().then(function(){return n._stopInternal(),t(e)}).then(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1),n._onReady(new ys({isCommandResult:!0,executionError:new kn}))})},Wu.prototype._switchToMainWindow=function(t){this.activeChildIframeDriverLink&&this.activeChildIframeDriverLink.executeCommand(t),this._clearActiveChildIframeInfo()},Wu.prototype._clearActiveChildIframeInfo=function(){this.contextStorage.setItem(fu,null),this.activeChildIframeDriverLink=null},Wu.prototype._setNativeDialogHandlerInIframes=function(t){for(var e=new Ho(t),n=0;n<this.childIframeDriverLinks.length;n++)nu.sendServiceMsg(e,this.childIframeDriverLinks[n].driverWindow)},Wu.prototype._onActionCommand=function(t){var o=this,e=new sa(t,this.selectorTimeout,this.speed,function(t,e,n){var r=ta(e.notFound),i=ta(e.invisible);return new ha(t,o.selectorTimeout,n,r,i).getResult()});e.on(sa.EXECUTION_STARTED_EVENT,function(){o.statusBar.hideWaitingElementStatus(!0),o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!0)}),e.on(sa.WAITING_FOR_ELEMENT_EVENT,function(t){o.statusBar.showWaitingElementStatus(t)});var n=new _.ClientRequestEmitter,r=new _.ScriptExecutionEmitter,i=new Yl(n,r,_.pageUnloadBarrier);e.execute(i).then(function(t){return new ys({isCommandResult:!0,result:Mr(new Gl).encode(t)})}).catch(function(t){return o.statusBar.hideWaitingElementStatus(!1).then(function(){return new ys({isCommandResult:!0,executionError:t})})}).then(function(t){return o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!1),o._onReady(t)})},Wu.prototype._onSetNativeDialogHandlerCommand=function(t){this.nativeDialogsTracker.setHandler(t.dialogHandler),this._setNativeDialogHandlerInIframes(t.dialogHandler),this._onReady(new ys({isCommandResult:!0}))},Wu.prototype._onGetNativeDialogHistoryCommand=function(){this._onReady(new ys({isCommandResult:!0,result:this.nativeDialogsTracker.appearedDialogs}))},Wu.prototype._onGetBrowserConsoleMessagesCommand=function(){this._onReady(new ys({isCommandResult:!0}))},Wu.prototype._onNavigateToCommand=function(t){var e=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),function(i){return l(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new _.ClientRequestEmitter,n=new _.RequestBarrier(e),c.navigateTo(i.url,i.forceReload),[4,c.Promise.all([n.wait(),_.pageUnloadBarrier.wait()])];case 1:return t.sent(),[2,new ys({isCommandResult:!0})];case 2:return r=t.sent(),[2,new ys({isCommandResult:!0,executionError:r})];case 3:return[2]}})})}(t).then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},Wu.prototype._onGetProxyUrlCommand=function(t){this._onReady(new ys({isCommandResult:!0,result:au.getProxyUrl(t.url,t.options)}))},Wu.prototype._onExecuteClientFunctionCommand=function(t){var e=this;this.contextStorage.setItem(cu,{instantiationCallsiteName:t.instantiationCallsiteName}),Pl(new Ri(t)).then(function(t){e.contextStorage.setItem(cu,null),e._onReady(t)})},Wu.prototype._onExecuteSelectorCommand=function(t){var e,n,r,i,o,s,a,l=this,u=this.contextStorage.getItem(du)||new ou,c=ta("CannotObtainInfoForElementSpecifiedBySelectorError"),d=t.strictError?ta(Zs()):c,h=t.strictError?ta(Qs()):c;e=t,n=this.selectorTimeout,r=u,i=t.needError?d:null,o=t.needError?h:null,s=this.statusBar,a=new ha(e,n,r,i,o),s.showWaitingElementStatus(a.timeout),Pl(a).then(function(t){return s.hideWaitingElementStatus(!!t.result).then(function(){return t})}).then(function(t){l.contextStorage.setItem(du,null),l._onReady(t)})},Wu.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t),this._onReady(new ys({isCommandResult:!0}))},Wu.prototype._onSwitchToIframeCommand=function(t){var e=this;this._switchToIframe(t.selector,yu).then(function(){return e._onReady(new ys({isCommandResult:!0}))}).catch(function(t){return e._onReady(new ys({isCommandResult:!0,executionError:t}))})},Wu.prototype._onWindowOpenCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!0),qu.open(t.url)},Wu.prototype._onWindowCloseCommand=function(a){return l(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:e=this._getTopOpenedWindow(),n=a.windowId||this.windowId,r=n===this.windowId,t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this._validateChildWindowCloseCommandExists(n,e)];case 2:if(i=t.sent(),!(o=i.result).success)throw Wu._createWindowValidationError(o);return[4,Es(new bo({windowId:n,isCurrentWindow:r}),e,Cs,kn)];case 3:return t.sent(),r||this._onReady(new ys({isCommandResult:!0})),[3,5];case 4:return s=t.sent(),this._onReady(new ys({isCommandResult:!0,executionError:s})),[3,5];case 5:return[2]}})})},Wu.prototype._onGetCurrentWindowCommand=function(){this._onReady(new ys({isCommandResult:!0,result:{id:this.windowId}}))},Wu.prototype._onGetWindowsCommand=function(){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,Es(new Co,e,Cs,kn)];case 1:return n=t.sent(),this._onReady(new ys({isCommandResult:!0,result:n.result})),[2]}})})},Wu.prototype._validateChildWindowCloseCommandExists=function(t,e){return Es(new go({windowId:t}),e,Cs,kn)},Wu.prototype._validateChildWindowSwitchToWindowCommandExists=function(t,e){var n=t.windowId,r=t.fn;return Es(new yo({windowId:n,fn:r}),e,Cs,kn)},Wu.prototype._getTopOpenedWindow=function(){var t;return((null===(t=this.parentWindowDriverLink)||void 0===t?void 0:t.getTopOpenedWindow())||qu).top},Wu.prototype._onSwitchToWindow=function(i,o){return l(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,this._validateChildWindowSwitchToWindowCommandExists({windowId:i.windowId,fn:i.checkWindow},e)];case 1:return n=t.sent(),(r=n.result).success?(this._stopInternal(),Es(new Ao({windowId:i.windowId,fn:i.checkWindow}),e,Cs,kn)):this._onReady(new ys({isCommandResult:!0,executionError:o||Wu._createWindowValidationError(r)})),[2]}})})},Wu.prototype._restoreChildWindowLinks=function(){return l(this,void 0,void 0,function(){var e,n=this;return C(this,function(t){switch(t.label){case 0:if(!this.contextStorage.getItem(vu))return[2];e=new eu(function(t){n._restoreChildWindowsPromiseResolver=t}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,_.getTimeLimitedPromise(e,3e4)];case 2:return t.sent(),[3,4];case 3:return t.sent(),this._onReady(new ys({isCommandResult:!0,executionError:new ur})),[3,4];case 4:return[2]}})})},Wu.prototype._onSwitchToPreviousWindow=function(t){this._onSwitchToWindow(t,new rr)},Wu.prototype._onSwitchToParentWindow=function(){this.parentWindowDriverLink?this._switchToParentWindow({finalizePendingCommand:!0}):this._onReady(new ys({isCommandResult:!0,executionError:new tr}))},Wu.prototype._onBrowserManipulationCommand=function(t){var e,n,r,i=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),e=t,n=this.selectorTimeout,r=this.statusBar,new Dl(e,n,r).execute().then(function(t){return i.contextStorage.setItem(i.COMMAND_EXECUTING_FLAG,!1),i._onReady(t)})},Wu.prototype._onSetBreakpointCommand=function(t){var n=this,e=t.isTestError,r=t.inCompilerService,i=this.statusBar.showDebuggingStatus(e);r?(i.then(function(t){n.debug=t}),this._onReady(new ys({isCommandResult:!0,result:!0}))):i.then(function(t){var e=t===yt;n._onReady(new ys({isCommandResult:!0,result:e}))})},Wu.prototype._onDisableDebugCommand=function(){this.statusBar._resetState(),this._onReady(new ys({isCommandResult:!0}))},Wu.prototype._onSetTestSpeedCommand=function(t){this.speed=t.speed,this._onReady(new ys({isCommandResult:!0}))},Wu.prototype._onShowAssertionRetriesStatusCommand=function(t){this.contextStorage.setItem(mu,t.timeout),this.contextStorage.setItem(gu,iu.dateNow()),this.statusBar.showWaitingAssertionRetriesStatus(t.timeout),this._onReady(new ys({isCommandResult:!0}))},Wu.prototype._onHideAssertionRetriesStatusCommand=function(t){var e=this;this.contextStorage.setItem(mu,null),this.contextStorage.setItem(gu,null),this.statusBar.hideWaitingAssertionRetriesStatus(t.success).then(function(){return e._onReady(new ys({isCommandResult:!0}))})},Wu.prototype._checkStatus=function(){var r=this,t={statusUrl:this.browserStatusDoneUrl,idlePageUrl:this.browserIdleUrl};return _.browser.checkStatus(t,s.createNativeXHR,{manualRedirect:!0,proxyless:this.proxyless}).then(function(t){var e=t.command,n=t.redirecting;n&&e.url.indexOf(r.testRunId)<0?(ru.clear(),ru.lock()):r.contextStorage.setItem(lu,!1),n?_.browser.redirect(e):r._onReady({isCommandResult:!1})}).catch(function(){return _.delay(1e3)})},Wu.prototype._onCustomCommand=function(t){var e=this;(0,this.customCommandHandlers[t.type].handler)(t).then(function(t){e._onReady(new ys({isCommandResult:!0,result:t}))})},Wu.prototype._closeAllChildWindows=function(){var t=this;return this.childWindowDriverLinks.length?eu.all(this.childWindowDriverLinks.map(function(t){return t.closeAllChildWindows()})).then(function(){iu.arrayForEach.call(t.childWindowDriverLinks,function(t){t.driverWindow.close()})}):eu.resolve()},Wu.prototype._onTestDone=function(t){var e=this;this.contextStorage.setItem(lu,!0),this.parentWindowDriverLink?this._switchToTopParentWindow():this._closeAllChildWindows().then(function(){return e._sendStatus(t)}).then(function(){e._checkStatus()}).catch(function(){e._onReady(new ys({isCommandResult:!0,executionError:Un}))})},Wu.prototype._onBackupStoragesCommand=function(){this._onReady(new ys({isCommandResult:!0,result:ru.backup()}))},Wu.prototype._isPendingSwitchingWindow=function(){return!!this.contextStorage.getItem(this.PENDING_WINDOW_SWITCHING_FLAG)},Wu.prototype._onPrepareClientEnvironmentInDebugMode=function(t){iu.objectDefineProperty(qu,t.esmRuntime,{value:{g:qu,c:qu.eval},configurable:!0}),this._onReady(new ys({isCommandResult:!0,result:!0}))},Wu.prototype._isStatusWithCommandResultInPendingWindowSwitchingMode=function(t){return t.isCommandResult&&this._isPendingSwitchingWindow()},Wu.prototype._isEmptyCommandInPendingWindowSwitchingMode=function(t){return!t&&this._isPendingSwitchingWindow()},Wu.prototype._observeFileDownloadingInNewWindow=function(){var e=this,t=new ys({isObservingFileDownloadingInNewWindow:!0});this._isPendingSwitchingWindow()&&this._sendStatus(t).then(function(t){t?e._onCommand(t):e._observeFileDownloadingInNewWindow()})},Wu.prototype._onReady=function(t){var e=this;this.debug&&(t.debug=this.debug,this.debug=null),this._isStatusWithCommandResultInPendingWindowSwitchingMode(t)&&this.emit(Cu),this._sendStatus(t).then(function(t){if(t)e._onCommand(t);else{if(e._isEmptyCommandInPendingWindowSwitchingMode(t))return void e.emit(Iu);e._onReady(new ys)}})},Wu.prototype._executeCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!1),this.customCommandHandlers[t.type]?this._onCustomCommand(t):t.type===d.testDone?this._onTestDone(new ys({isCommandResult:!0})):t.type===d.setBreakpoint?this._onSetBreakpointCommand(t):t.type===d.disableDebug?this._onDisableDebugCommand():t.type===d.switchToMainWindow?this._onSwitchToMainWindowCommand(t):t.type===d.switchToIframe?this._onSwitchToIframeCommand(t):t.type===d.openWindow?this._onWindowOpenCommand(t):t.type===d.closeWindow?this._onWindowCloseCommand(t):t.type===d.getCurrentWindow?this._onGetCurrentWindowCommand(t):t.type===d.getCurrentWindows?this._onGetWindowsCommand():t.type===d.switchToWindow?this._onSwitchToWindow(t):t.type===d.switchToPreviousWindow?this._onSwitchToPreviousWindow(t):t.type===d.switchToParentWindow?this._onSwitchToParentWindow():gt(t)?this._onBrowserManipulationCommand(t):t.type===d.executeClientFunction?this._onExecuteClientFunctionCommand(t):t.type===d.executeSelector?this._onExecuteSelectorCommand(t):t.type===d.navigateTo?this._onNavigateToCommand(t):t.type===d.setNativeDialogHandler?this._onSetNativeDialogHandlerCommand(t):t.type===d.getNativeDialogHistory?this._onGetNativeDialogHistoryCommand(t):t.type===d.getBrowserConsoleMessages?this._onGetBrowserConsoleMessagesCommand(t):t.type===d.setTestSpeed?this._onSetTestSpeedCommand(t):t.type===d.showAssertionRetriesStatus?this._onShowAssertionRetriesStatusCommand(t):t.type===d.hideAssertionRetriesStatus?this._onHideAssertionRetriesStatusCommand(t):t.type===d.backupStorages?this._onBackupStoragesCommand():t.type===d.closeChildWindowOnFileDownloading?this._closeChildWindowOnFileDownloading():t.type===d.prepareClientEnvironmentInDebugMode?this._onPrepareClientEnvironmentInDebugMode(t):t.type===d.getProxyUrl?this._onGetProxyUrlCommand(t):this._onActionCommand(t)},Wu.prototype._closeChildWindowOnFileDownloading=function(){this.activeChildWindowDriverLink.closeFileDownloadingWindow(),_.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),E.cursor.show(),this._startInternal()},Wu.prototype._isExecutableInTopWindowOnly=function(t){if((e=t).type===d.testDone||e.type===d.switchToMainWindow||e.type===d.setNativeDialogHandler||e.type===d.getNativeDialogHistory||e.type===d.setTestSpeed||e.type===d.showAssertionRetriesStatus||e.type===d.hideAssertionRetriesStatus||e.type===d.setBreakpoint||gt(e)&&e.type!==d.takeElementScreenshot)return!0;var e,n=this.customCommandHandlers[t.type];return t.forceExecutionInTopWindowOnly||n&&n.isExecutableInTopWindowOnly},Wu.prototype._onCommand=function(n){var r=this;this.readyPromise.then(function(){var t,e=pt(n);r.contextStorage.getItem(hu)&&e?r._onReady(new ys({isCommandResult:!0})):(t=r.activeChildIframeDriverLink||r.contextStorage.getItem(fu),r._isExecutableInTopWindowOnly(n)||!t?r._executeCommand(n):r._runInActiveIframe(n))})},Wu.prototype.setCustomCommandHandlers=function(t,e,n){this.customCommandHandlers[t]={isExecutableInTopWindowOnly:n,handler:e}},Wu.prototype._startInternal=function(t){this.role=Hl,_.browser.startHeartbeat(this.heartbeatUrl,s.createNativeXHR),this._setupAssertionRetryIndication(),this._startCommandsProcessing(t)},Wu.prototype._stopInternal=function(){this.role=Bl,_.browser.stopHeartbeat(),E.cursor.hide()},Wu.prototype._setupAssertionRetryIndication=function(){var n=this;this.readyPromise.then(function(){n.statusBar.hidePageLoadingStatus();var t,e=n.contextStorage.getItem(mu);e&&(t=n.contextStorage.getItem(gu),0<e-(new ou-t)&&n.statusBar.showWaitingAssertionRetriesStatus(e,t))})},Wu.prototype._startCommandsProcessing=function(t){void 0===t&&(t={finalizePendingCommand:!1,isFirstRequestAfterWindowSwitching:!1,result:void 0});var e,n,r=this.contextStorage.getItem(uu);r&&(r.resent=!0),this.contextStorage.getItem(lu)?r?this._onTestDone(r):this._checkStatus():this._failIfClientCodeExecutionIsInterrupted()||(e=t.finalizePendingCommand||this._hasPendingActionFlags(this.contextStorage),n=r||new ys({isCommandResult:e,isFirstRequestAfterWindowSwitching:t.isFirstRequestAfterWindowSwitching,result:t.result}),this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!1),this._onReady(n))},Wu.prototype._initParentWindowLink=function(){qu.opener&&qu.opener!==qu&&this.windowId&&(this.parentWindowDriverLink=new Ol(qu))},Wu.prototype._initConsoleMessages=function(){var t=this.consoleMessages;t.ensureMessageContainer(this.windowId),this.consoleMessages=t},Wu.prototype._getDriverRole=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return this.windowId?[4,_.browser.getActiveWindowId(this.browserActiveWindowId,s.createNativeXHR)]:[2,Hl];case 1:return[2,t.sent().activeWindowId===this.windowId?Hl:Bl]}})})},Wu.prototype._init=function(){this.contextStorage=new ps(qu,this.testRunId,this.windowId),this.nativeDialogsTracker=new Vi(this.contextStorage,this.dialogHandler),this.statusBar=new n.StatusBar(this.userAgent,this.fixtureName,this.testName,this.contextStorage),this.statusBar.on(this.statusBar.UNLOCK_PAGE_BTN_CLICK,_.disableRealEventsPreventing),this.speed=this.initialSpeed,this._initConsoleMessages(),this._initParentWindowLink(),this._isOpenedInIframe()&&Es(new es(this.windowId),qu.opener.top,Cs,$n)},Wu.prototype._doFirstPageLoadSetup=function(){return l(this,void 0,void 0,function(){return C(this,function(t){return this.isFirstPageLoad&&this.canUseDefaultWindowActions,[2]})})},Wu.prototype.start=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return this._init(),[4,this._doFirstPageLoadSetup()];case 1:return t.sent(),[4,this._restoreChildWindowLinks()];case 2:return t.sent(),[4,this._getDriverRole()];case 3:return e=t.sent(),this.role===Hl||e===Hl&&this._startInternal(),[2]}})})},Wu);function Wu(t,e,n,r){var i=Ql.call(this)||this;i.COMMAND_EXECUTING_FLAG="testcafe|driver|command-executing-flag",i.EXECUTING_IN_IFRAME_FLAG="testcafe|driver|executing-in-iframe-flag",i.PENDING_WINDOW_SWITCHING_FLAG="testcafe|driver|pending-window-switching-flag",i.WINDOW_COMMAND_API_CALL_FLAG="testcafe|driver|window-command-api-flag",i.testRunId=t,i.heartbeatUrl=e.heartbeat,i.browserStatusUrl=e.status,i.browserStatusDoneUrl=e.statusDone,i.browserIdleUrl=e.idle,i.browserActiveWindowId=e.activeWindowId,i.browserCloseWindowUrl=e.closeWindow,i.userAgent=n.userAgent,i.fixtureName=n.fixtureName,i.testName=n.testName,i.selectorTimeout=r.selectorTimeout,i.pageLoadTimeout=r.pageLoadTimeout,i.childWindowReadyTimeout=r.childWindowReadyTimeout,i.initialSpeed=r.speed,i.skipJsErrors=r.skipJsErrors,i.dialogHandler=r.dialogHandler,i.canUseDefaultWindowActions=r.canUseDefaultWindowActions,i.proxyless=r.proxyless,i.isFirstPageLoad=Zl.get().isFirstPageLoad,i.customCommandHandlers={},i.contextStorage=null,i.nativeDialogsTracker=null,i.childIframeDriverLinks=[],i.activeChildIframeDriverLink=null,i.childWindowDriverLinks=[],i.parentWindowDriverLink=null,i.statusBar=null,i.windowId=i._getCurrentWindowId(),i.role=Bl,i.setAsMasterInProgress=!1,i.checkClosedChildWindowIntervalId=null;var o=new _.ClientRequestEmitter;return i.pageInitialRequestBarrier=new _.RequestBarrier(o),i.readyPromise=i._getReadyPromise(),i._initChildDriverListening(),_.pageUnloadBarrier.init(),_.preventRealEvents(),s.on(s.EVENTS.uncaughtJsError,function(t){return i._onJsError(t)}),s.on(s.EVENTS.unhandledRejection,function(t){return i._onJsError(t)}),s.on(s.EVENTS.consoleMethCalled,function(t){return i._onConsoleMessage(t)}),s.on(s.EVENTS.beforeFormSubmit,function(t){return i._onFormSubmit(t)}),s.on(s.EVENTS.windowOpened,function(t){return i._onChildWindowOpened(t)}),i.setCustomCommandHandlers(d.unlockPage,function(){return i._unlockPageAfterTestIsDone()}),i.setCustomCommandHandlers(d.getActiveElement,function(){return i._getActiveElement()}),su.addInternalEventBeforeListener(qu,["beforeunload"],function(){i._sendStartToRestoreCommand()}),i.replicator=Mr([new Gs]),i}var Tu=(Au.prototype.establishConnection=function(){return Es(new fo,this.driverWindow,5e3,Tn).then(function(t){return t.result.id})},Au.prototype.sendConfirmationMessage=function(t){Is({requestMsgId:t,window:this.driverWindow})},Au.prototype.onCommandExecuted=function(t){var e=new Ro(t);c.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},Au.prototype.hasPendingActionFlags=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,Es(new cs,this.driverWindow,5e3,Tn)];case 1:return[2,t.sent().result]}})})},Au);function Au(t){this.driverWindow=t}var xu,Nu=s.eventSandbox.message,Ru=(t(Du,xu=Vi),Du.prototype._defaultDialogHandler=function(t){Nu.sendServiceMsg({type:Pi,dialogType:t,url:Vi._getPageUrl()},qu.top)},Du.prototype._addAppearedDialogs=function(t,e){Nu.sendServiceMsg({type:Mi,dialogType:t,text:e,url:Vi._getPageUrl()},qu.top)},Du.prototype._onHandlerError=function(t,e){Nu.sendServiceMsg({type:Fi,dialogType:t,message:e,url:Vi._getPageUrl()},qu.top)},Du);function Du(t){return xu.call(this,null,t)||this}var Mu,Pu=c.eventSandbox.message,Fu=(t(ku,Mu=bu),ku.prototype._onJsError=function(){},ku.prototype._onConsoleMessage=function(){},ku.prototype._onChildWindowOpened=function(){Pu.sendServiceMsg(new is,qu.top)},ku.prototype._stopInternal=function(){Pu.sendServiceMsg(new as,qu.top)},ku.prototype._initParentDriverListening=function(){var n=this;c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;_.pageUnloadBarrier.wait(0).then(function(){if(e.type===eo){if(n.lastParentDriverMessageId===e.id)return;n.lastParentDriverMessageId=e.id,n.readyPromise.then(function(){n.speed=e.testSpeed,n.parentDriverLink.sendConfirmationMessage(e.id),n._onCommand(e.command)})}e.type===ro&&(n.nativeDialogsTracker.setHandler(e.dialogHandler),n._setNativeDialogHandlerInIframes(e.dialogHandler))})})},ku.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t)},ku.prototype._onReady=function(t){this.parentDriverLink.onCommandExecuted(t)},ku.prototype._isInCommandExecution=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return c.utils.dom.isCrossDomainWindows(qu,qu.parent)?[4,this.parentDriverLink.hasPendingActionFlags()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,this._hasPendingActionFlags(this.contextStorage)]}})})},ku.prototype._init=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this.parentDriverLink.establishConnection()];case 1:return e=t.sent(),this.contextStorage=new ps(qu,e,this.windowId),this._failIfClientCodeExecutionIsInterrupted()?[2]:[4,this._isInCommandExecution()];case 2:return t.sent()&&(this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._onReady(new ys({isCommandResult:!0}))),[2]}})})},ku.prototype.start=function(){this.nativeDialogsTracker=new Ru(this.dialogHandler),this.statusBar=new n.IframeStatusBar;var t=this._init();this.readyPromise=c.Promise.all([this.readyPromise,t])},ku);function ku(t,e){var n=Mu.call(this,t,{},{},e)||this;return n.lastParentDriverMessageId=null,n.parentDriverLink=new Tu(qu.parent),n._initParentDriverListening(),n}var Lu={NodeSnapshot:Ms,ElementSnapshot:Hs,SelectorExecutor:ha},Ou="%testCafeDriver%",Uu="%testCafeIframeDriver%",Hu="%testCafeEmbeddingUtils%",Bu=s.nativeMethods,Gu=s.EVENTS.evalIframeScript;Bu.objectDefineProperty(qu,Ou,{configurable:!0,value:bu}),Bu.objectDefineProperty(qu,Uu,{configurable:!0,value:Fu}),Bu.objectDefineProperty(qu,Hu,{configurable:!0,value:Lu}),s.on(Gu,function(t){return Vu(Bu.contentWindowGetter.call(t.iframe))})}(qu["%hammerhead%"],qu["%hammerhead%"].Promise,qu["%testCafeCore%"],qu["%testCafeAutomation%"],qu["%testCafeUI%"])}(window);
1
+ window["%hammerhead%"].utils.removeInjectedScript(),function ec(nc){var rc=nc.document;!function(c,e,_,E,n){var s="default"in c?c.default:c;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function t(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function l(t,s,a,l){return new(a=a||e)(function(n,e){function r(t){try{o(l.next(t))}catch(t){e(t)}}function i(t){try{o(l.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(r,i)}o((l=l.apply(t,s||[])).next())})}function C(n,r){var i,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(n,a)}catch(t){e=[6,t],o=0}finally{i=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var i,o,a=Math.floor(399);(o=i=i||{}).ready="ready",o.readyForBrowserManipulation="ready-for-browser-manipulation",o.waitForFileDownload="wait-for-file-download";var u=i,d={dispatchEvent:"dispatch-event",click:"click",rightClick:"right-click",doubleClick:"double-click",drag:"drag",dragToElement:"drag-to-element",hover:"hover",scroll:"scroll",scrollBy:"scroll-by",scrollIntoView:"scroll-into-view",typeText:"type-text",selectText:"select-text",selectTextAreaContent:"select-text-area-content",selectEditableContent:"select-editable-content",pressKey:"press-key",wait:"wait",navigateTo:"navigate-to",setFilesToUpload:"set-files-to-upload",clearUpload:"clear-upload",executeClientFunction:"execute-client-function",executeSelector:"execute-selector",takeScreenshot:"take-screenshot",takeElementScreenshot:"take-element-screenshot",takeScreenshotOnFail:"take-screenshot-on-fail",prepareBrowserManipulation:"prepare-browser-manipulation",showAssertionRetriesStatus:"show-assertion-retries-status",hideAssertionRetriesStatus:"hide-assertion-retries-status",setBreakpoint:"set-breakpoint",resizeWindow:"resize-window",resizeWindowToFitDevice:"resize-window-to-fit-device",maximizeWindow:"maximize-window",switchToIframe:"switch-to-iframe",switchToMainWindow:"switch-to-main-window",openWindow:"open-window",closeWindow:"close-window",getCurrentWindow:"get-current-window",getCurrentWindows:"get-current-windows",switchToWindow:"switch-to-window",switchToWindowByPredicate:"switch-to-window-by-predicate",switchToParentWindow:"switch-to-parent-window",switchToPreviousWindow:"switch-to-previous-window",setNativeDialogHandler:"set-native-dialog-handler",getNativeDialogHistory:"get-native-dialog-history",getBrowserConsoleMessages:"get-browser-console-messages",getActiveElement:"get-active-element",setTestSpeed:"set-test-speed",setPageLoadTimeout:"set-page-load-timeout",debug:"debug",disableDebug:"disable-debug",assertion:"assertion",useRole:"useRole",testDone:"test-done",backupStorages:"backup-storages",executeExpression:"execute-expression",executeAsyncExpression:"execute-async-expression",unlockPage:"unlock-page",closeChildWindowOnFileDownloading:"close-child-window-on-file-downloading",recorder:"recorder",prepareClientEnvironmentInDebugMode:"prepare-client-environment-in-debug-mode",getCookies:"get-cookies",setCookies:"set-cookies",deleteCookies:"delete-cookies",getProxyUrl:"get-proxy-url",request:"request",skipJsErrors:"skip-js-errors"},h="E1",f="E4",p="E5",m="E9",g="E10",w="E11",v="E12",y="E24",I="E26",S="E27",b="E28",W="E29",T="E30",A="E31",x="E32",N="E33",R="E34",D="E35",P="E36",M="E37",F="E39",k="E40",L="E41",O="E42",U="E43",H="E44",B="E45",G="E46",V="E49",q="E50",z="E51",j="E52",X="E57",Y="E64",J="E65",K="E68",$="E69",Q="E70",Z="E71",tt="E72",et="E73",nt="E74",rt="E76",it="E77",ot="E78",st="E82",at="E83",lt="E90",ut="E91",ct="E92",dt="E93",ht="E94",ft="E95",pt="E97";function mt(t){return!(gt(r=t)||r.type===d.wait||r.type===d.assertion||r.type===d.executeExpression||vt(t)||(n=t).type===d.testDone||n.type===d.showAssertionRetriesStatus||n.type===d.hideAssertionRetriesStatus||n.type===d.setBreakpoint||n.type===d.takeScreenshotOnFail||n.type===d.recorder||n.type===d.getProxyUrl)||wt(t)&&!((e=t).type===d.switchToIframe||e.type===d.switchToMainWindow);var e,n,r}function gt(t){return t.type===d.executeClientFunction||t.type===d.executeSelector}function wt(t){return t.type===d.resizeWindow||t.type===d.resizeWindowToFitDevice||t.type===d.maximizeWindow}function vt(t){return(e=t).type===d.takeScreenshot||e.type===d.takeElementScreenshot||e.type===d.takeScreenshotOnFail||wt(t);var e}function yt(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var _t,Et="step",Ct=(t(It,_t=yt),It);function It(t,e,n){var r=_t.call(this,t)||this;return r.optionName=e,r.actualValue=n,r}var St,bt=(t(Wt,St=yt),Wt);function Wt(t,e){var n=St.call(this,V,e)||this;return n.instantiationCallsiteName=t,n}var Tt,At=(t(xt,Tt=yt),xt);function xt(t,e){var n=Tt.call(this,q,e)||this;return n.instantiationCallsiteName=t,n}var Nt,Rt=(t(Dt,Nt=yt),Dt);function Dt(t,e,n){var r=e.apiFnChain,i=e.apiFnIndex,o=Nt.call(this,t,n)||this;return o.apiFnChain=r,o.apiFnIndex=i,o}var Pt,Mt=(t(Ft,Pt=yt),Ft);function Ft(t){return Pt.call(this,z,t)||this}var kt,Lt=(t(Ot,kt=Rt),Ot);function Ot(t,e){return kt.call(this,j,e,t)||this}var Ut,Ht=(t(Bt,Ut=yt),Bt);function Bt(t,e){var n=Ut.call(this,h)||this;return n.errStack=t,n.pageDestUrl=e,n}var Gt,Vt=(t(qt,Gt=yt),qt);function qt(t,e,n){var r=Gt.call(this,f,n)||this;return r.errMsg=String(e),r.instantiationCallsiteName=t,r}var zt,jt=(t(Xt,zt=yt),Xt);function Xt(t,e,n,r){var i=zt.call(this,p,r)||this;return i.errMsg=String(e),i.property=n,i.instantiationCallsiteName=t,i}var Yt,Jt=(t(Kt,Yt=yt),Kt);function Kt(t){var e=Yt.call(this,Y)||this;return e.errMsg=String(t),e}var $t,Qt=(t(Zt,$t=yt),Zt);function Zt(t,e){var n=$t.call(this,J)||this;return n.errMsg=String(t),n.moduleName=e,n}var te,ee=(t(ne,te=Ct),ne);function ne(t,e){return te.call(this,m,t,e)||this}var re,ie=(t(oe,re=Ct),oe);function oe(t,e){return re.call(this,g,t,e)||this}var se,ae=(t(le,se=Ct),le);function le(t,e){return se.call(this,w,t,e)||this}var ue,ce=(t(de,ue=Ct),de);function de(t,e){return ue.call(this,v,t,e)||this}var he,fe=(t(pe,he=Ct),pe);function pe(t,e){return he.call(this,lt,t,e)||this}var me,ge=(t(we,me=Ct),we);function we(t,e){return me.call(this,pt,t,e)||this}var ve,ye=(t(_e,ve=Ct),_e);function _e(t,e){return ve.call(this,ut,t,e)||this}var Ee,Ce=(t(Ie,Ee=Ct),Ie);function Ie(t,e){return Ee.call(this,ct,t,e)||this}var Se,be=(t(We,Se=Ct),We);function We(t,e){return Se.call(this,dt,t,e)||this}var Te,Ae=(t(xe,Te=Ct),xe);function xe(t,e){return Te.call(this,ht,t,e)||this}var Ne,Re=(t(De,Ne=Ct),De);function De(t,e){return Ne.call(this,ft,t,e)||this}var Pe,Me=(t(Fe,Pe=Rt),Fe);function Fe(t,e){return Pe.call(this,y,e,t)||this}var ke,Le=(t(Oe,ke=yt),Oe);function Oe(t){return ke.call(this,I,t)||this}var Ue,He=(t(Be,Ue=yt),Be);function Be(t){var e=Ue.call(this,S)||this;return e.nodeDescription=t,e}var Ge,Ve=(t(qe,Ge=Rt),qe);function qe(t,e){var n=Ge.call(this,b,e)||this;return n.argumentName=t,n}var ze,je=(t(Xe,ze=yt),Xe);function Xe(t){var e=ze.call(this,W)||this;return e.argumentName=t,e}var Ye,Je=(t(Ke,Ye=yt),Ke);function Ke(t,e){var n=Ye.call(this,T)||this;return n.argumentName=t,n.nodeDescription=e,n}var $e,Qe=(t(Ze,$e=yt),Ze);function Ze(){return $e.call(this,A)||this}var tn,en=(t(nn,tn=yt),nn);function nn(){return tn.call(this,x)||this}var rn,on=(t(sn,rn=yt),sn);function sn(t){var e=rn.call(this,N)||this;return e.argumentName=t,e}var an,ln=(t(un,an=yt),un);function un(){return an.call(this,D)||this}var cn,dn=(t(hn,cn=yt),hn);function hn(t){var e=cn.call(this,P)||this;return e.argumentName=t,e}var fn,pn=(t(mn,fn=yt),mn);function mn(t,e){var n=fn.call(this,M)||this;return n.filePaths=t,n.scannedFilePaths=e,n}var gn,wn=(t(vn,gn=yt),vn);function vn(){return gn.call(this,R)||this}var yn,_n=(t(En,yn=yt),En);function En(t,e){var n=yn.call(this,L)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}var Cn,In=(t(Sn,Cn=yt),Sn);function Sn(t,e){var n=Cn.call(this,X)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}var bn,Wn=(t(Tn,bn=yt),Tn);function Tn(t){return bn.call(this,k,t)||this}var An,xn=(t(Nn,An=yt),Nn);function Nn(){return An.call(this,F)||this}var Rn,Dn=(t(Pn,Rn=yt),Pn);function Pn(){return Rn.call(this,O)||this}var Mn,Fn=(t(kn,Mn=yt),kn);function kn(){return Mn.call(this,$)||this}var Ln,On=(t(Un,Ln=yt),Un);function Un(){return Ln.call(this,K)||this}var Hn,Bn=(t(Gn,Hn=yt),Gn);function Gn(){return Hn.call(this,Q)||this}var Vn,qn=(t(zn,Vn=yt),zn);function zn(){return Vn.call(this,Z)||this}var jn,Xn=(t(Yn,jn=yt),Yn);function Yn(){return jn.call(this,et)||this}var Jn,Kn=(t($n,Jn=yt),$n);function $n(){return Jn.call(this,st)||this}var Qn,Zn=(t(tr,Qn=yt),tr);function tr(t){var e=Qn.call(this,ot)||this;return e.errMsg=t,e}var er,nr=(t(rr,er=yt),rr);function rr(){return er.call(this,nt)||this}var ir,or=(t(sr,ir=yt),sr);function sr(){return ir.call(this,rt)||this}var ar,lr=(t(ur,ar=yt),ur);function ur(){return ar.call(this,it)||this}var cr,dr=(t(hr,cr=yt),hr);function hr(){return cr.call(this,tt)||this}var fr,pr=(t(mr,fr=yt),mr);function mr(){return fr.call(this,at)||this}var gr,wr=(t(vr,gr=yt),vr);function vr(){return gr.call(this,U)||this}var yr,_r=(t(Er,yr=yt),Er);function Er(){return yr.call(this,H)||this}var Cr,Ir=(t(Sr,Cr=yt),Sr);function Sr(t,e){var n=Cr.call(this,B)||this;return n.dialogType=t,n.pageUrl=e,n}var br,Wr=(t(Tr,br=yt),Tr);function Tr(t,e,n){var r=br.call(this,G)||this;return r.dialogType=t,r.errMsg=e,r.pageUrl=n,r}var Ar=Object.freeze({__proto__:null,TestRunErrorBase:yt,ClientFunctionExecutionInterruptionError:bt,DomNodeClientFunctionResultError:At,SelectorErrorBase:Rt,InvalidSelectorResultError:Mt,CannotObtainInfoForElementSpecifiedBySelectorError:Lt,UncaughtErrorOnPage:Ht,UncaughtErrorInClientFunctionCode:Vt,UncaughtErrorInCustomDOMPropertyCode:jt,UncaughtErrorInCustomClientScriptCode:Jt,UncaughtErrorInCustomClientScriptLoadedFromModule:Qt,ActionIntegerOptionError:ee,ActionPositiveIntegerOptionError:ie,ActionBooleanOptionError:ae,ActionSpeedOptionError:ce,ActionStringOptionError:fe,ActionStringOrRegexOptionError:ge,ActionDateOptionError:ye,ActionNumberOptionError:Ce,ActionUrlOptionError:be,ActionUrlSearchParamsOptionError:Ae,ActionObjectOptionError:Re,ActionElementNotFoundError:Me,ActionElementIsInvisibleError:Le,ActionSelectorMatchesWrongNodeTypeError:He,ActionAdditionalElementNotFoundError:Ve,ActionAdditionalElementIsInvisibleError:je,ActionAdditionalSelectorMatchesWrongNodeTypeError:Je,ActionElementNonEditableError:Qe,ActionElementNotTextAreaError:en,ActionElementNonContentEditableError:on,ActionRootContainerNotFoundError:ln,ActionIncorrectKeysError:dn,ActionCannotFindFileToUploadError:pn,ActionElementIsNotFileInputError:wn,ActionInvalidScrollTargetError:_n,InvalidElementScreenshotDimensionsError:In,ActionElementNotIframeError:Wn,ActionIframeIsNotLoadedError:xn,CurrentIframeIsNotLoadedError:Dn,ChildWindowNotFoundError:Fn,ChildWindowIsNotLoadedError:On,CannotSwitchToWindowError:Bn,CloseChildWindowError:qn,CannotCloseWindowWithChildrenError:Xn,CannotCloseWindowWithoutParentError:Kn,SwitchToWindowPredicateError:Zn,WindowNotFoundError:nr,ParentWindowNotFoundError:or,PreviousWindowNotFoundError:lr,ChildWindowClosedBeforeSwitchingError:dr,CannotRestoreChildWindowError:pr,CurrentIframeNotFoundError:wr,CurrentIframeIsInvisibleError:_r,NativeDialogNotHandledError:Ir,UncaughtErrorInNativeDialogHandler:Wr}),xr="_nativeMethods",Nr=(Rr.prototype._ensureNativeMethods=function(t){return t||{objectKeys:Object.keys,arrayForEach:Array.prototype.forEach,arrayConcat:Array.prototype.concat,arraySlice:Array.prototype.slice,objectDefineProperty:Object.defineProperty}},Rr.prototype._getWindowIds=function(t){return this[xr].objectKeys(t)},Rr.prototype._copyArray=function(t){return this[xr].arraySlice.call(t)},Rr.prototype._concatArrays=function(t,e){return this[xr].arrayConcat.call(t,e)},Rr.prototype.ensureMessageContainer=function(t){this[t]||(this[t]={log:[],info:[],warn:[],error:[]})},Rr.prototype.concat=function(e){var n=this;if(!e)return this;var t=this._getWindowIds(e);return this[xr].arrayForEach.call(t,function(t){n.ensureMessageContainer(t),n[t].log=n._concatArrays(n[t].log,e[t].log),n[t].info=n._concatArrays(n[t].info,e[t].info),n[t].warn=n._concatArrays(n[t].warn,e[t].warn),n[t].error=n._concatArrays(n[t].error,e[t].error)}),this},Rr.prototype.addMessage=function(t,e,n){this.ensureMessageContainer(n),this[n][t].push(e)},Rr.prototype.getCopy=function(){var e=this,n={},t=this._getWindowIds(this);return this[xr].arrayForEach.call(t,function(t){n[t]={log:e._copyArray(e[t].log),info:e._copyArray(e[t].info),warn:e._copyArray(e[t].warn),error:e._copyArray(e[t].error)}}),n},Rr);function Rr(t,e){var n=this._ensureNativeMethods(e);n.objectDefineProperty(this,xr,{value:n}),this.concat(t)}var Dr,Pr=(t(Mr,Dr=Nr),Mr);function Mr(t){return Dr.call(this,t,c.nativeMethods)||this}var Fr,kr=(function(t){function n(t){return!!s[t]}function r(t,e){this.references=t,this.transforms=e,this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0}var o=/^#*@(t|r)$/,i=(0,eval)("this"),s={Int8Array:"function"==typeof Int8Array?Int8Array:void 0,Uint8Array:"function"==typeof Uint8Array?Uint8Array:void 0,Uint8ClampedArray:"function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,Int16Array:"function"==typeof Int16Array?Int16Array:void 0,Uint16Array:"function"==typeof Uint16Array?Uint16Array:void 0,Int32Array:"function"==typeof Int32Array?Int32Array:void 0,Uint32Array:"function"==typeof Uint32Array?Uint32Array:void 0,Float32Array:"function"==typeof Float32Array?Float32Array:void 0,Float64Array:"function"==typeof Float64Array?Float64Array:void 0},a="function"==typeof ArrayBuffer,l="function"==typeof Map,u="function"==typeof Set,c="function"==typeof Buffer,d=Array.prototype.slice,e={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}};function h(t,e){this.references=t,this.transformMap=e,this.activeTransformsStack=[],this.visitedRefs=Object.create(null)}r._createRefMark=function(t){var e=Object.create(null);return e["@r"]=t,e},r.prototype._createCircularCandidate=function(t,e,n){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:e,key:n,refIdx:-1})},r.prototype._applyTransform=function(t,e,n,r){var i=Object.create(null),o=r.toSerializable(t);return"object"==typeof o&&this._createCircularCandidate(t,e,n),i["@t"]=r.type,i.data=this._handleValue(o,e,n),i},r.prototype._handleArray=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=this._handleValue(t[n],e,n);return e},r.prototype._handlePlainObject=function(n){var r=this,i=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){var e=o.test(t)?"#"+t:t;i[e]=r._handleValue(n[t],i,e)}),i},r.prototype._handleObject=function(t,e,n){return this._createCircularCandidate(t,e,n),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},r.prototype._ensureCircularReference=function(t){var e=this.circularCandidates.indexOf(t);if(-1<e){var n=this.circularCandidatesDescrs[e];return-1===n.refIdx&&(n.refIdx=n.parent?++this.circularRefCount:0),r._createRefMark(n.refIdx)}return null},r.prototype._handleValue=function(t,e,n){var r=typeof t,i="object"==r&&null!==t;if(i){var o=this._ensureCircularReference(t);if(o)return o}for(var s=0;s<this.transforms.length;s++){var a=this.transforms[s];if(a.shouldTransform(r,t))return this._applyTransform(t,e,n,a)}return i?this._handleObject(t,e,n):t},r.prototype.transform=function(){for(var t=[this._handleValue(this.references,null,null)],e=0;e<this.circularCandidatesDescrs.length;e++){var n=this.circularCandidatesDescrs[e];0<n.refIdx&&(t[n.refIdx]=n.parent[n.key],n.parent[n.key]=r._createRefMark(n.refIdx))}return t},h.prototype._handlePlainObject=function(e){var t,n=this,r=Object.create(null),i=Object.getOwnPropertyNames(e);for(t in i.forEach(function(t){n._handleValue(e[t],e,t),o.test(t)&&(r[t.substring(1)]=e[t],delete e[t])}),r)e[t]=r[t]},h.prototype._handleTransformedObject=function(t,e,n){var r=t["@t"],i=this.transformMap[r];if(!i)throw new Error("Can't find transform for \""+r+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=i.fromSerializable(t.data)},h.prototype._handleCircularSelfRefDuringTransform=function(t,e,n){var r=this.references,i=void 0;Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){return void 0===i&&(i=r[t]),i},set:function(t){return i=t}})},h.prototype._handleCircularRef=function(t,e,n){-1<this.activeTransformsStack.indexOf(this.references[t])?this._handleCircularSelfRefDuringTransform(t,e,n):(this.visitedRefs[t]||(this.visitedRefs[t]=!0,this._handleValue(this.references[t],this.references,t)),e[n]=this.references[t])},h.prototype._handleValue=function(t,e,n){if("object"==typeof t&&null!==t){var r=t["@r"];if(void 0!==r)this._handleCircularRef(r,e,n);else if(t["@t"])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var i=0;i<t.length;i++)this._handleValue(t[i],t,i);else this._handlePlainObject(t)}},h.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]};var f=[{type:"[[NaN]]",shouldTransform:function(t,e){return"number"===t&&isNaN(e)},toSerializable:function(){return""},fromSerializable:function(){return NaN}},{type:"[[undefined]]",shouldTransform:function(t){return"undefined"===t},toSerializable:function(){return""},fromSerializable:function(){}},{type:"[[Date]]",shouldTransform:function(t,e){return e instanceof Date},toSerializable:function(t){return t.getTime()},fromSerializable:function(t){var e=new Date;return e.setTime(t),e}},{type:"[[RegExp]]",shouldTransform:function(t,e){return e instanceof RegExp},toSerializable:function(t){var e={src:t.source,flags:""};return t.global&&(e.flags+="g"),t.ignoreCase&&(e.flags+="i"),t.multiline&&(e.flags+="m"),e},fromSerializable:function(t){return new RegExp(t.src,t.flags)}},{type:"[[Error]]",shouldTransform:function(t,e){return e instanceof Error},toSerializable:function(t){return{name:t.name,message:t.message,stack:t.stack}},fromSerializable:function(t){var e=new(i[t.name]||Error)(t.message);return e.stack=t.stack,e}},{type:"[[ArrayBuffer]]",shouldTransform:function(t,e){return a&&e instanceof ArrayBuffer},toSerializable:function(t){var e=new Int8Array(t);return d.call(e)},fromSerializable:function(t){if(a){var e=new ArrayBuffer(t.length);return new Int8Array(e).set(t),e}return t}},{type:"[[Buffer]]",shouldTransform:function(t,e){return c&&e instanceof Buffer},toSerializable:function(t){return d.call(t)},fromSerializable:function(t){return c?Buffer.from(t):t}},{type:"[[TypedArray]]",shouldTransform:function(t,e){return Object.keys(s).some(function(t){return n(t)&&e instanceof s[t]})},toSerializable:function(t){return{ctorName:t.constructor.name,arr:d.call(t)}},fromSerializable:function(t){return n(t.ctorName)?new s[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",shouldTransform:function(t,e){return l&&e instanceof Map},toSerializable:function(t){var n=[];return t.forEach(function(t,e){n.push(e),n.push(t)}),n},fromSerializable:function(t){if(l){for(var e=new Map,n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}for(var r=[],i=0;i<t.length;i+=2)r.push([t[n],t[n+1]]);return r}},{type:"[[Set]]",shouldTransform:function(t,e){return u&&e instanceof Set},toSerializable:function(t){var e=[];return t.forEach(function(t){e.push(t)}),e},fromSerializable:function(t){if(u){for(var e=new Set,n=0;n<t.length;n++)e.add(t[n]);return e}return t}}],p=t.exports=function(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||e,this.addTransforms(f)};p.prototype.addTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e];if(this.transformsMap[n.type])throw new Error('Transform with type "'+n.type+'" was already added.');this.transforms.push(n),this.transformsMap[n.type]=n}return this},p.prototype.removeTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e],r=this.transforms.indexOf(n);-1<r&&this.transforms.splice(r,1),delete this.transformsMap[n.type]}return this},p.prototype.encode=function(t){var e=new r(t,this.transforms).transform();return this.serializer.serialize(e)},p.prototype.decode=function(t){var e=this.serializer.deserialize(t);return new h(e,this.transformsMap).transform()}}(Fr={exports:{}}),Fr.exports),Lr=function(t){return t};function Or(t){return new kr({serialize:Lr,deserialize:Lr}).addTransforms(t)}var Ur=(Hr.create=function(t){return new Hr(t.top,t.right,t.bottom,t.left)},Hr.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},Hr.prototype.sub=function(t){return"top"in t&&(this.top-=t.top,this.left-=t.left),this.bottom-=t.bottom,this.right-=t.right,this},Hr.prototype.round=function(t,e){return void 0===t&&(t=Math.round),void 0===e&&(e=t),this.top=t(this.top),this.right=e(this.right),this.bottom=e(this.bottom),this.left=t(this.left),this},Hr.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},Hr);function Hr(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.top=t,this.right=e,this.bottom=n,this.left=r}function Br(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=c.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}Br("filter"),Br("map"),Br("slice"),Br("splice"),Br("unshift"),Br("forEach"),Br("indexOf"),Br("some"),Br("reverse"),Br("reduce"),Br("concat"),Br("join"),s.utils.browser,s.nativeMethods,s.utils.style.get,s.utils.dom.getActiveElement,s.utils.dom.findDocument,s.utils.dom.find,s.utils.dom.isElementInDocument;var Gr=s.utils.dom.isElementInIframe,Vr=s.utils.dom.getIframeByElement,qr=(s.utils.dom.isCrossDomainWindows,s.utils.dom.getSelectParent),zr=s.utils.dom.getChildVisibleIndex,jr=(s.utils.dom.getSelectVisibleChildren,s.utils.dom.isElementNode),Xr=s.utils.dom.isTextNode,Yr=s.utils.dom.isRenderedNode,Jr=(s.utils.dom.isIframeElement,s.utils.dom.isInputElement,s.utils.dom.isButtonElement,s.utils.dom.isFileInput,s.utils.dom.isTextAreaElement,s.utils.dom.isAnchorElement,s.utils.dom.isImgElement,s.utils.dom.isFormElement,s.utils.dom.isLabelElement,s.utils.dom.isSelectElement,s.utils.dom.isRadioButtonElement,s.utils.dom.isColorInputElement,s.utils.dom.isCheckboxElement,s.utils.dom.isOptionElement,s.utils.dom.isSVGElement),Kr=s.utils.dom.isMapElement,$r=(s.utils.dom.isBodyElement,s.utils.dom.isHtmlElement),Qr=(s.utils.dom.isDocument,s.utils.dom.isWindow,s.utils.dom.isTextEditableInput,s.utils.dom.isTextEditableElement,s.utils.dom.isTextEditableElementAndEditingAllowed,s.utils.dom.isContentEditableElement),Zr=(s.utils.dom.isDomElement,s.utils.dom.isShadowUIElement,s.utils.dom.isShadowRoot,s.utils.dom.isElementFocusable,s.utils.dom.isHammerheadAttr,s.utils.dom.isElementReadOnly,s.utils.dom.getScrollbarSize),ti=s.utils.dom.getMapContainer,ei=(s.utils.dom.getTagName,s.utils.dom.closest),ni=(s.utils.dom.getParents,s.utils.dom.findParent),ri=(s.utils.dom.getTopSameDomainWindow,s.utils.dom.getParentExceptShadowRoot,s.utils.style),ii=s.utils.style.getBordersWidth,oi=(s.utils.style.getComputedStyle,s.utils.style.getElementMargin,s.utils.style.getElementPadding,s.utils.style.getElementScroll),si=s.utils.style.getOptionHeight,ai=s.utils.style.getSelectElementSize,li=(s.utils.style.isElementVisible,s.utils.style.isVisibleChild),ui=(s.utils.style.getWidth,s.utils.style.getHeight,s.utils.style.getInnerWidth),ci=s.utils.style.getInnerHeight,di=(s.utils.style.getScrollLeft,s.utils.style.getScrollTop),hi=(s.utils.style.setScrollLeft,s.utils.style.setScrollTop,s.utils.style.get);function fi(t){return!Yr(t)||ni(t,!0,function(t){return jr(t)&&"none"===ri.get(t,"display")})||ni(t,!0,function(t){return jr(t)&&"hidden"===ri.get(t,"visibility")})}var pi=(mi.create=function(t){return"left"in t?new mi(t.left,t.top):"right"in t?new mi(t.right,t.bottom):new mi(t.x,t.y)},mi.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},mi.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},mi.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},mi.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},mi.prototype.mul=function(t){return this.x*=t,this.y*=t,this},mi.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},mi);function mi(t,e){this.x=t,this.y=e}var gi,wi=function(t,e,n,r,i,o){this.width=t,this.height=e,this.left=n.x,this.top=n.y,this.right=n.x+t,this.bottom=n.y+e,this.border=r,this.scrollbar=o,this.scroll=i},vi=s.utils.position.getElementRectangle,yi=s.utils.position.getOffsetPosition,_i=s.utils.position.offsetToClientCoords;function Ei(t){return"hidden"===hi(t,"visibility")||"none"===hi(t,"display")}function Ci(t){var e=vi(t);return 0===e.width||0===e.height}function Ii(t){if(Xr(t))return!fi(t);if(!Qr(t)&&!Jr(t)&&Ci(t))return!1;if(Kr(t)){var e=ti(ei(t,"map"));return!!e&&Ii(e)}if(li(t)){var n=qr(t),r=zr(n,t),i=ai(n),o=Math.max(di(n)/si(n),0),s=o+i-1,a=Math.max(r-o,0);return o<=a&&a<=s}var l;return Jr(t)?!ni(t,!0,Ei)&&!Ci(t):(l=t)&&!(l.offsetHeight<=0&&l.offsetWidth<=0)&&!Ei(t)}function Si(t){return _.domUtils.isIframeElement(t)?!Ei(t):!(!c.utils.dom.isDomElement(t)&&!c.utils.dom.isTextNode(t))&&(_.domUtils.isOptionElement(t)||"optgroup"===_.domUtils.getTagName(t)?n.selectElement.isOptionElementVisible(t):Ii(t))}var bi=1,Wi=2,Ti=3,Ai=((gi={})[bi]=/^\.filterVisible\(\)$/,gi[Wi]=/^\.filterHidden\(\)$/,gi[Ti]=/^\.nth\(\d+\)$/,gi);function xi(){this._err=null}var Ni=(Object.defineProperty(xi.prototype,"error",{get:function(){return this._err},set:function(t){null===this._err&&(this._err=t)},enumerable:!1,configurable:!0}),xi.prototype.filter=function(t,e,n){if(e.filterVisible&&(t=t.filter(Si),this._assertFilterError(t,n,bi)),e.filterHidden&&(t=t.filter(function(t){return!Si(t)}),this._assertFilterError(t,n,Wi)),e.counterMode)return null===e.index?t.length:xi._getNodeByIndex(t,e.index)?1:0;var r;if(e.collectionMode)return null!==e.index&&(t=(r=xi._getNodeByIndex(t,e.index))?[r]:[],this._assertFilterError(t,n,Ti)),t;var i=xi._getNodeByIndex(t,e.index||0);return i||(this.error=xi._getErrorItem(n,Ti)),i},xi.prototype.cast=function(t){if(null==t)return[];if(t instanceof c.nativeMethods.Node)return[t];if(function(t){if(c.nativeMethods.isArray(t)){for(var e=0;e<t.length;e++)if(!(t[e]instanceof c.nativeMethods.Node))return;return 1}}(t))return t;if((e=t)instanceof c.nativeMethods.HTMLCollection||e instanceof c.nativeMethods.NodeList)return function(t){for(var e=t.length,n=[],r=0;r<e;r++)n.push(t[r]);return n}(t);var e;throw new Mt},xi.prototype._assertFilterError=function(t,e,n){0===t.length&&(this.error=xi._getErrorItem(e,n))},xi._getErrorItem=function(t,e){var n=t.apiFnChain,r=t.apiFnID;if(e)for(var i=r;i<n.length;i++)if(Ai[e].test(n[i]))return i;return null},xi._getNodeByIndex=function(t,e){return e<0?t[t.length+e]:t[e]},new xi);function Ri(t,e){return new c.nativeMethods.Function("fnCode","__dependencies$","Promise","RegExp",'"use strict"; return eval(fnCode)')(t,e,c.Promise,RegExp)}var Di=(Pi.prototype.shouldTransform=function(t){return"function"===t},Pi.prototype.toSerializable=function(){return""},Pi.prototype.fromSerializable=function(t){var e=t.fnCode,n=t.dependencies;return"filterOptions"in n&&(n.selectorFilter=Ni),Ri(e,n)},Pi);function Pi(){this.type="Function"}var Mi=(Fi.prototype.shouldTransform=function(t,e){if(e instanceof c.nativeMethods.Node)throw new At(this._instantiationCallsiteName);return!1},Fi.prototype.toSerializable=function(){},Fi.prototype.fromSerializable=function(){},Fi);function Fi(t){this.type="Node",this._instantiationCallsiteName=t}var ki=(Li.prototype.getResult=function(){var e=this;return c.Promise.resolve().then(function(){var t=e.replicator.decode(e.command.args);return e._executeFn(t)}).catch(function(t){throw t.isTestCafeError||(t=new Vt(e.command.instantiationCallsiteName,t)),t})},Li.prototype.encodeResult=function(t){return this.replicator.encode(t)},Li.prototype._createReplicator=function(){return Or([new Mi(this.command.instantiationCallsiteName),new Di])},Li.prototype._executeFn=function(t){return this.fn.apply(nc,t)},Li);function Li(t){this.command=t,this.replicator=this._createReplicator(),this.dependencies=this.replicator.decode(t.dependencies),this.fn=Ri(t.fnCode,this.dependencies)}var Oi="appeared-dialog",Ui="unexpected-dialog",Hi="handler-error",Bi=s.eventSandbox.message,Gi=s.processScript,Vi=s.nativeMethods,qi="testcafe|native-dialog-tracker|appeared-dialogs",zi="testcafe|native-dialog-tracker|unexpected-dialog",ji="testcafe|native-dialog-tracker|error-in-handler",Xi=Gi("window.location.href"),Yi=(Object.defineProperty(Ji.prototype,"appearedDialogs",{get:function(){var t=this.contextStorage.getItem(qi);return t||(t=[],this.appearedDialogs=t),t},set:function(t){this.contextStorage.setItem(qi,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ji.prototype,"unexpectedDialog",{get:function(){return this.contextStorage.getItem(zi)},set:function(t){this.contextStorage.setItem(zi,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ji.prototype,"handlerError",{get:function(){return this.contextStorage.getItem(ji)},set:function(t){this.contextStorage.setItem(ji,t)},enumerable:!1,configurable:!0}),Ji._getPageUrl=function(){return Vi.eval(Xi)},Ji.prototype._initListening=function(){var n=this;Bi.on(Bi.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.type===Oi?n._addAppearedDialogs(e.dialogType,e.text,e.url):e.type!==Ui||n.unexpectedDialog?e.type!==Hi||n.handlerError||n._onHandlerError(e.dialogType,e.message,e.url):n.unexpectedDialog={type:e.dialogType,url:e.url}})},Ji.prototype._init=function(){var e=this;s.on(s.EVENTS.beforeUnload,function(t){t.prevented&&!t.isFakeIEEvent&&(e.dialogHandler?e._createDialogHandler("beforeunload")(t.returnValue||""):e._defaultDialogHandler("beforeunload")),e.contextStorage&&e.contextStorage.save()}),nc.alert=function(){return e._defaultDialogHandler("alert")},nc.confirm=function(){return e._defaultDialogHandler("confirm")},nc.prompt=function(){return e._defaultDialogHandler("prompt")}},Ji.prototype._createDialogHandler=function(i){var o=this;return function(t){var e=Ji._getPageUrl();o._addAppearedDialogs(i,t,e);var n=new ki(o.dialogHandler),r=null;try{r=n.fn.apply(nc,[i,t,e])}catch(t){o._onHandlerError(i,t.message||String(t),e)}return r}},Ji.prototype._defaultDialogHandler=function(t){var e=Ji._getPageUrl();this.unexpectedDialog=this.unexpectedDialog||{type:t,url:e}},Ji.prototype._addAppearedDialogs=function(t,e,n){this.appearedDialogs.splice(0,0,{type:t,text:e,url:n})},Ji.prototype._onHandlerError=function(t,e,n){this.handlerError=this.handlerError||{type:t,message:e,url:n}},Ji.prototype.setHandler=function(t){var e=this;this.dialogHandler=t,["alert","confirm","prompt"].forEach(function(t){nc[t]=e.dialogHandler?e._createDialogHandler(t):function(){return e._defaultDialogHandler(t)}})},Ji.prototype.getUnexpectedDialogError=function(){var t=this.unexpectedDialog,e=this.handlerError;return this.unexpectedDialog=null,this.handlerError=null,t?new Ir(t.type,t.url):e?new Wr(e.type,e.message,e.url):null},Ji);function Ji(t,e){this.contextStorage=t,this.dialogHandler=e,this._init(),this._initListening(),this.dialogHandler&&this.setHandler(e)}function Ki(){return c.nativeMethods.performanceNow().toString()}function $i(t){this.type=t,this.id=Ki()}var Qi,Zi="driver|establish-connection",to="driver|switch-to-window",eo="driver|close-window",no="driver|close-window-validation",ro="driver|switch-to-window-validation",io="driver|get-windows",oo="driver|command-executed",so="driver|execute-command",ao="driver|confirmation",lo="driver|set-native-dialog-handler",uo="driver|set-as-master",co="driver|close-all-child-windows",ho="driver|start-to-restore-child-link",fo="driver|restore-child-link",po="driver|child-window-is-loaded-in-iframe",mo="driver|child-window-is-opened-in-iframe",go="driver|stop-internal-from-iframe",wo="driver|has-pending-action-flags",vo=(t(yo,Qi=$i),yo);function yo(){return Qi.call(this,Zi)||this}var _o,Eo=(t(Co,_o=$i),Co);function Co(t){var e=t.windowId,n=_o.call(this,no)||this;return n.windowId=e,n}var Io,So=(t(bo,Io=$i),bo);function bo(t){var e=t.windowId,n=t.fn,r=Io.call(this,ro)||this;return r.windowId=e,r.fn=n,r}var Wo,To=(t(Ao,Wo=$i),Ao);function Ao(){return Wo.call(this,io)||this}var xo,No=(t(Ro,xo=$i),Ro);function Ro(t){var e=t.windowId,n=t.isCurrentWindow,r=xo.call(this,eo)||this;return r.windowId=e,r.isCurrentWindow=n,r}var Do,Po=(t(Mo,Do=$i),Mo);function Mo(t){var e=t.windowId,n=t.fn,r=Do.call(this,to)||this;return r.windowId=e,r.fn=n,r}var Fo,ko=(t(Lo,Fo=$i),Lo);function Lo(t){var e=Fo.call(this,oo)||this;return e.driverStatus=t,e}var Oo,Uo=(t(Ho,Oo=$i),Ho);function Ho(t,e){var n=Oo.call(this,so)||this;return n.command=t,n.testSpeed=e,n}var Bo,Go=(t(Vo,Bo=$i),Vo);function Vo(t,e){var n=Bo.call(this,ao)||this;return n.requestMessageId=t,n.result=e,n}var qo,zo=(t(jo,qo=$i),jo);function jo(t){var e=qo.call(this,lo)||this;return e.dialogHandler=t,e}var Xo,Yo=(t(Jo,Xo=$i),Jo);function Jo(t){var e=Xo.call(this,uo)||this;return e.finalizePendingCommand=t,e}var Ko,$o=(t(Qo,Ko=$i),Qo);function Qo(){return Ko.call(this,co)||this}var Zo,ts=(t(es,Zo=$i),es);function es(){return Zo.call(this,ho)||this}var ns,rs=(t(is,ns=$i),is);function is(t){var e=ns.call(this,fo)||this;return e.windowId=t,e}var os,ss=(t(as,os=$i),as);function as(t){var e=os.call(this,po)||this;return e.windowId=t,e}var ls,us=(t(cs,ls=$i),cs);function cs(){return ls.call(this,mo)||this}var ds,hs=(t(fs,ds=$i),fs);function fs(){return ds.call(this,go)||this}var ps,ms=(t(gs,ps=$i),gs);function gs(){return ps.call(this,wo)||this}var ws=s.json,vs=s.nativeMethods,ys=(_s.prototype._createStorageKey=function(t,e){var n="testcafe|driver|"+t;return e?n+"|"+e:n},_s.prototype._loadFromStorage=function(){var t=vs.storageGetItem.call(this.storage,this.storageKey);t&&(this.data=ws.parse(t),vs.storageRemoveItem.call(this.storage,this.storageKey))},_s.prototype.save=function(){vs.storageSetItem.call(this.storage,this.storageKey,ws.stringify(this.data))},_s.prototype.setItem=function(t,e){this.data[t]=e,this.save()},_s.prototype.getItem=function(t){return this.data[t]},_s.prototype.dispose=function(){vs.storageRemoveItem.call(this.storage,this.storageKey)},_s);function _s(t,e,n){this.storage=vs.winSessionStorageGetter.call(t),this.storageKey=this._createStorageKey(e,n),this.data={},this._loadFromStorage()}var Es=(Cs.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},Cs.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var r=this._getAssignableProperties(),i=0;i<r.length;i++){for(var o,s=r[i],a=s.name,l=s.type,u=s.required,c=s.init,d=s.defaultValue,h=a.split("."),f=h.length-1,p=h[f],m=t,g=this,w=0;w<f&&m&&g;w++)m=m[h[w]],g=g[h[w]];g&&"defaultValue"in r[i]&&(g[a]=d),m&&g&&(void 0===(o=m[p])&&!u||(e&&l&&l(a,o),g[p]=c?c(a,o,n,e):o))}},Cs);function Cs(){}var Is,Ss=(t(bs,Is=Es),bs.prototype._getAssignableProperties=function(){return[{name:"isCommandResult"},{name:"executionError"},{name:"pageError"},{name:"result"},{name:"consoleMessages"},{name:"isPendingWindowSwitching"},{name:"isObservingFileDownloadingInNewWindow"},{name:"isFirstRequestAfterWindowSwitching"}]},bs);function bs(t){var e=Is.call(this,t)||this;return e.id=Ki(),e.isCommandResult=!1,e.executionError=null,e.pageError=null,e.resent=!1,e.result=null,e.consoleMessages=null,e.isPendingWindowSwitching=!1,e.isObservingFileDownloadingInNewWindow=!1,e.isFirstRequestAfterWindowSwitching=!1,e.debug="",e._assignFrom(t,!0),e}function Ws(n,t,e,r){var i=null,o=null,s=null;return e=Math.max(e||0,2500),c.Promise.race([_.delay(e),new c.Promise(function(e){s=function(t){t.message.type===ao&&t.message.requestMessageId===n.id&&e(t.message)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),i=c.nativeMethods.setInterval.call(nc,function(){return c.eventSandbox.message.sendServiceMsg(n,t)},1e3),c.eventSandbox.message.sendServiceMsg(n,t)})]).then(function(t){if(c.nativeMethods.clearInterval.call(nc,i),c.nativeMethods.clearTimeout.call(nc,o),c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),!t)throw new r;return t})}var Ts=2e4;function As(t){var e=t.requestMsgId,n=t.result,r=t.window,i=new Go(e,n);c.eventSandbox.message.sendServiceMsg(i,r)}var xs=(Object.defineProperty(Ns.prototype,"availabilityTimeout",{set:function(t){this.iframeAvailabilityTimeout=t},enumerable:!1,configurable:!0}),Ns.prototype._ensureIframe=function(){var t=this;return _.domUtils.isElementInDocument(this.driverIframe)?_.waitFor(function(){return _.positionUtils.isIframeVisible(t.driverIframe)?t.driverIframe:null},200,this.iframeAvailabilityTimeout).catch(function(){throw new _r}):c.Promise.reject(new wr)},Ns.prototype._waitForIframeRemovedOrHidden=function(){var e=this;return new c.Promise(function(t){e.checkIframeInterval=c.nativeMethods.setInterval.call(nc,function(){e._ensureIframe().catch(function(){return _.delay(500).then(function(){return t(new Ss({isCommandResult:!0}))})})},1e3)})},Ns.prototype._waitForCommandResult=function(){var e=this,n=null;return c.Promise.race([this._waitForIframeRemovedOrHidden(),new c.Promise(function(e){n=function(t){t.message.type===oo&&e(t.message.driverStatus)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n)})]).then(function(t){return c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n),c.nativeMethods.clearInterval.call(nc,e.checkIframeInterval),t})},Ns.prototype.sendConfirmationMessage=function(t){As({requestMsgId:t,result:{id:this.driverId},window:this.driverWindow})},Ns.prototype.executeCommand=function(e,n){var r=this;return this._ensureIframe().then(function(){var t=new Uo(e,n);return c.Promise.all([Ws(t,r.driverWindow,r.iframeAvailabilityTimeout,Dn),r._waitForCommandResult()])}).then(function(t){return t[1]})},Ns);function Ns(t,e){this.driverWindow=t,this.driverIframe=_.domUtils.findIframeByWindow(t),this.driverId=e,this.iframeAvailabilityTimeout=0}var Rs=["nodeType","textContent","childNodeCount","hasChildNodes","childElementCount","hasChildElements"],Ds=["tagName","attributes"],Ps=["tagName","visible","focused","attributes","boundingClientRect","classNames","style","innerText","namespaceURI","id","value","checked","selected","selectedIndex","scrollWidth","scrollHeight","scrollLeft","scrollTop","offsetWidth","offsetHeight","offsetLeft","offsetTop","clientWidth","clientHeight","clientLeft","clientTop"],Ms={childNodeCount:function(t){return t.childNodes.length},hasChildNodes:function(t){return!!Ms.childNodeCount(t)},childElementCount:function(t){var e=t.children;if(e)return e.length;for(var n=0,r=t.childNodes.length,i=0;i<r;i++)1===t.childNodes[i].nodeType&&n++;return n},hasChildElements:function(t){return!!Ms.childElementCount(t)}},Fs=(ks.prototype._initializeProperties=function(t,e,n){for(var r=0,i=e;r<i.length;r++){var o=i[r],s=n[o];this[o]=s?s(t):t[o]}},ks);function ks(){}var Ls,Os=(t(Us,Ls=Fs),Us);function Us(t){var e=Ls.call(this)||this;return e._initializeProperties(t,Rs,Ms),e}var Hs,Bs={tagName:function(t){return t.tagName.toLowerCase()},visible:Ii,focused:function(t){return c.utils.dom.getActiveElement()===t},attributes:function(t){for(var e=t.attributes,n={},r=e.length-1;0<=r;r--)n[e[r].name]=e[r].value;return n},boundingClientRect:function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width,height:e.height}},classNames:function(t){var e=t.className;return"string"==typeof e.animVal&&(e=e.animVal),e.replace(/^\s+|\s+$/g,"").split(/\s+/g)},style:function(t){for(var e={},n=nc.getComputedStyle(t),r=0;r<n.length;r++){var i=n[r];e[i]=n[i]}return e},innerText:function(t){return t.innerText}},Gs=(t(Vs,Hs=Fs),Vs);function Vs(t){var e=Hs.call(this)||this;return e._initializeProperties(t,Ds,Bs),e}var qs,zs=(t(js,qs=Os),js);function js(t){var e=qs.call(this,t)||this;return e._initializeProperties(t,Ps,Bs),e}var Xs=(Ys.prototype._extend=function(t,e){for(var n=0,r=c.nativeMethods.objectKeys(this._customDOMProperties);n<r.length;n++){var i=r[n];try{t[i]=this._customDOMProperties[i](e)}catch(t){throw new jt(this._instantiationCallsiteName,t,i)}}},Ys.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},Ys.prototype.toSerializable=function(t){var e=new(1===t.nodeType?zs:Os)(t);return this._extend(e,t),e},Ys.prototype.fromSerializable=function(){},Ys);function Ys(t,e){void 0===t&&(t={}),this.type="Node",this._customDOMProperties=t,this._instantiationCallsiteName=e}var Js=(Ks.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},Ks.prototype.once=function(n,r){var i=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.off(n,r),r.apply(void 0,t)})},Ks.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=c.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},Ks.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},Ks.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._eventsListeners[e];if(r)for(var i=0;i<r.length;i++)try{r[i].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,r[i])}},Ks);function Ks(){this._eventsListeners={}}var $s=s.Promise,Qs=s.nativeMethods;function Zs(e){return new $s(function(t){return Qs.setTimeout.call(nc,t,e)})}var ta="elementIsInvisibleError",ea="foundElementIsNotTarget",na={1:"element",2:"attribute",3:"text",4:"cdata section",5:"entity reference",6:"entity node",7:"processing instruction",8:"comment",9:"document",10:"document type",11:"document fragment",12:"notation"};function ra(t){return t?{name:"ActionAdditionalElementIsInvisibleError",firstArg:t}:"ActionElementIsInvisibleError"}function ia(t){return t?{name:"ActionAdditionalElementNotFoundError",firstArg:t}:"ActionElementNotFoundError"}function oa(t){var e="string"==typeof t?Ar[t]:Ar[t.name],n="string"==typeof t?null:t.firstArg;return function(t){return new e(n,t)}}var sa=(aa.prototype.push=function(t,r){var i=this;this._ensureElementsPromise=this._ensureElementsPromise.then(function(){return i._executeSelectorFn(t,{invisible:ra(r),notFound:ia(r)},i._ensureElementsStartTime)}).then(function(t){if(!_.domUtils.isDomElement(t)){var e=t.nodeType,n=na[e];throw r?new Je(r,n):new He(n)}i._elements.push(t)})},aa.prototype.getElements=function(){var t=this;return this._ensureElementsPromise.then(function(){return t._elements})},aa);function aa(t,e){this._globalSelectorTimeout=t,this._ensureElementsStartTime=c.nativeMethods.dateNow(),this._ensureElementsPromise=c.Promise.resolve(),this._executeSelectorFn=e,this._elements=[]}function la(t){var e=t/2;return e<1?0:Math.round(e)}function ua(t,e,n){var r,i={offsetX:la((r=vi(t)).width),offsetY:la(r.height)};if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=function(t){var e,n,r,i,o=$r(t),s=o?t.getElementsByTagName("body")[0]:null,a=t.getBoundingClientRect(),l=Ur.create(ii(t)),u=oi(t),c=Gr(t),d="BackCompat"===t.ownerDocument.compatMode,h=o?new pi(0,0):pi.create(a),f=a.height,p=a.width;o&&(p=s&&d?(f=s.clientHeight,s.clientWidth):(f=t.clientHeight,t.clientWidth)),!c||(e=Vr(t))&&(n=yi(e),r=_i(pi.create(n)),i=ii(e),h.add(r).add(pi.create(i)),o&&l.add(i));var m=!o&&ui(t)!==t.clientWidth,g=!o&&ci(t)!==t.clientHeight,w={right:m?Zr():0,bottom:g?Zr():0};return new wi(p,f,h,l,u,w)}(t),s=Math.round(Math.max(t.scrollWidth,o.width)),a=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+s,u=o.scrollbar.bottom+o.border.top+o.border.bottom+a;return{offsetX:e<0?l+e:e,offsetY:n<0?u+n:n}}var ca,da=(t(ha,ca=Js),ha.prototype._delayAfterExecution=function(){return this._command.options&&1!==this._command.options.speed?Zs(2e3*(1-this._command.options.speed)):c.Promise.resolve()},ha.prototype._isExecutionTimeoutExpired=function(){return c.nativeMethods.dateNow()-this._executionStartTime>=this._commandSelectorTimeout},ha.prototype._ensureCommandArguments=function(){var t=ha.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureCmdArgs&&t.ensureCmdArgs(this._command)},ha.prototype._ensureCommandElements=function(){var t,e=this,n=new sa(this._globalSelectorTimeout,this._executeSelectorFn);this._command.selector&&n.push(this._command.selector);var r=null===(t=ha.ACTIONS_HANDLERS[this._command.type])||void 0===t?void 0:t.additionalSelectorProps;if(r)for(var i=0,o=r;i<o.length;i++){var s=o[i];this._command[s]&&n.push(this._command[s],s)}return n.getElements().then(function(t){e._elements=t})},ha.prototype._ensureCommandElementsProperties=function(){var t=ha.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureElsProps&&t.ensureElsProps(this._elements)},ha.prototype._ensureCommandOptions=function(){return l(this,void 0,c.Promise,function(){var e,n,r,i;return C(this,function(t){return e=this._command.options,this._elements.length&&e&&"offsetX"in e&&"offsetY"in e&&(n=ua(this._elements[0],e.offsetX,e.offsetY),r=n.offsetX,i=n.offsetY,e.offsetX=r,e.offsetY=i),[2]})})},ha.prototype._createAutomation=function(){var t=ha.ACTIONS_HANDLERS[this._command.type];if(!t)throw new Error('There is no handler for the "'.concat(this._command.type,'" command.'));return t.create(this._command,this._elements)},ha.prototype._runAction=function(e){var n=this;return this._ensureCommandElements().then(function(){return n._ensureCommandElementsProperties()}).then(function(){return n._ensureCommandOptions()}).then(function(){var t=n._createAutomation();return t.TARGET_ELEMENT_FOUND_EVENT?t.on(t.TARGET_ELEMENT_FOUND_EVENT,function(t){n._targetElement=t.element,n.emit(ha.EXECUTION_STARTED_EVENT)}):n.emit(ha.EXECUTION_STARTED_EVENT),t.run(e)})},ha.prototype._runRecursively=function(){var e=this,t=!1,n=!0;return function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return e()?[4,n()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})}(function(){return!t},function(){return e._runAction(n).then(function(){t=!0}).catch(function(t){if(!e._isExecutionTimeoutExpired())return Zs(250);if(t.message===ea)return n=!1,c.Promise.resolve();throw t.message===ta?new Le:t})})},ha.prototype.execute=function(t){var e=this;this._executionStartTime=c.nativeMethods.dateNow();try{this._ensureCommandArguments()}catch(t){return c.Promise.reject(t)}return this.emit(ha.WAITING_FOR_ELEMENT_EVENT,this._commandSelectorTimeout),this._runRecursively().then(function(){return c.Promise.all([e._delayAfterExecution(),t.wait()])}).then(function(){var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([],e._elements,!0);return e._targetElement&&(t[0]=e._targetElement),t})},ha.EXECUTION_STARTED_EVENT="execution-started",ha.WAITING_FOR_ELEMENT_EVENT="waiting-for-elements",ha.ACTIONS_HANDLERS={},ha);function ha(t,e,n,r){var i,o=this;return(o=ca.call(this)||this)._command=t,o._targetElement=null,o._elements=[],o._globalSelectorTimeout=e,o._executionStartTime=0,o._executeSelectorFn=r,t.options&&!t.options.speed&&(t.options.speed=n),o._commandSelectorTimeout="number"==typeof(null===(i=t.selector)||void 0===i?void 0:i.timeout)?t.selector.timeout:e,o}function fa(t,e,n){return Math.min(Math.max(e,t),n)}function pa(t,e){var n="number"==typeof t.min,r="number"==typeof t.max,i="number"==typeof t.length;return i&&(t.length=fa(t.length,0,e)),n&&t.min<0&&(t.min+=e),r&&t.max<0&&(t.max+=e),n||(t.min=r&&i?t.max-t.length:0),r||(t.max=i?t.min+t.length:e),t.min=fa(t.min,0,e),t.max=fa(t.max,0,e),t.length=t.max-t.min,t}function ma(t,e,n){return Math.round(t+fa(e-t,0,n)/2)}var ga,wa=(t(va,ga=ki),va.prototype._createReplicator=function(){return Or([new Di])},va.prototype._getTimeoutErrorParams=function(){return{apiFnIndex:Ni.error,apiFnChain:this.command.apiFnChain}},va.prototype._getTimeoutError=function(t){return t?this.createIsInvisibleError:this.createNotFoundError},va.prototype._validateElement=function(s,a){var l=this;return c.Promise.resolve().then(function(){return ga.prototype._executeFn.call(l,s)}).then(function(t){var e=t,n=!!e,r=!l.command.visibilityCheck||e&&Si(e),i=c.nativeMethods.dateNow()-a>=l.timeout;if(n&&(r||c.utils.dom.isShadowRoot(e)))return e;if(!i)return Zs(200).then(function(){return l._validateElement(s,a)});var o=l.getVisibleValueMode?null:l._getTimeoutError(n);if(o)throw o(l._getTimeoutErrorParams());return null})},va.prototype._executeFn=function(t){return this.counterMode?ga.prototype._executeFn.call(this,t):this._validateElement(t,c.nativeMethods.dateNow())},va);function va(t,e,n,r,i){var o,s=ga.call(this,t)||this;s.createNotFoundError=r,s.createIsInvisibleError=i,s.timeout="number"==typeof t.timeout?t.timeout:e,s.counterMode=s.dependencies.filterOptions.counterMode,s.getVisibleValueMode=s.dependencies.filterOptions.getVisibleValueMode,s.dependencies.selectorFilter=Ni,n&&(o=c.nativeMethods.dateNow()-n,s.timeout=Math.max(s.timeout-o,0));var a=s.dependencies.customDOMProperties;return s.replicator.addTransforms([new Xs(a,t.instantiationCallsiteName)]),s}var ya=c.nativeMethods.date,_a=(Ea.prototype._ensureElement=function(t){var e=this,n=t.selector,r=t.createNotFoundError,i=t.createIsInvisibleError,o=t.createHasWrongNodeTypeError;this.ensureElementsPromise=this.ensureElementsPromise.then(function(){return new wa(n,e.globalSelectorTimeout,e.ensureElementsStartTime,r,i).getResult()}).then(function(t){if(!_.domUtils.isDomElement(t))throw o(na[t.nodeType]);e.elements.push(t)})},Ea.prototype.getElements=function(){var t=this;return this.ensureElementsPromise.then(function(){return t.elements})},Ea);function Ea(t,e){var n=this;this.elements=[],this.globalSelectorTimeout=e,this.ensureElementsPromise=c.Promise.resolve(),this.ensureElementsStartTime=new ya,t.forEach(function(t){return n._ensureElement(t)})}function Ca(r){return function(t,e){var n=typeof e;if("number"!=n)throw new r(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new r(t,e)}}var Ia,Sa,ba,Wa,Ta,Aa,xa,Na,Ra,Da,Pa,Ma,Fa=Ca(ee),ka=(Sa=Ca(Ia=ie),function(t,e){if(Sa(t,e),e<0)throw new Ia(t,e)}),La=(ba=ae,function(t,e){var n=typeof e;if("boolean"!=n)throw new ba(t,n)}),Oa=(Wa=ce,function(t,e){var n=typeof e;if("number"!=n)throw new Wa(t,n);if(isNaN(e)||e<.01||1<e)throw new Wa(t,e)}),Ua=(Ta=fe,function(t,e){var n=typeof e;if("string"!=n)throw new Ta(t,n)}),Ha=(Aa=ge,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new Aa(t,n)}),Ba=(xa=ye,function(t,e){if(!(e instanceof Date))throw new xa(t,e)}),Ga=(Na=Ce,function(t,e){if(isNaN(Number(e)))throw new Na(t,typeof e)}),Va=(Ra=be,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new Ra(t,n)}),qa=(Da=Ae,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new Da(t,n)}),za=(Pa=Re,function(t,e){var n=typeof e;if("object"!=n)throw new Pa(t,n)}),ja=(t(Xa,Ma=Es),Xa.prototype._getAssignableProperties=function(){return[{name:"speed",type:Oa}]},Xa);function Xa(t,e){var n=Ma.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var Ya,Ja=(t(Ka,Ya=ja),Ka.prototype._getAssignableProperties=function(){return Ya.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:Fa},{name:"offsetY",type:Fa}])},Ka);function Ka(t,e){var n=Ya.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var $a,Qa=(t(Za,$a=Ja),Za.prototype._getAssignableProperties=function(){return $a.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:La},{name:"skipParentFrames",type:La}])},Za);function Za(t,e){var n=$a.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var tl,el=(t(nl,tl=ja),nl.prototype._getAssignableProperties=function(){return tl.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:Fa},{name:"scrollTargetY",type:Fa},{name:"crop.left",type:Fa},{name:"crop.right",type:Fa},{name:"crop.top",type:Fa},{name:"crop.bottom",type:Fa},{name:"includeMargins",type:La},{name:"includeBorders",type:La},{name:"includePaddings",type:La}])},nl);function nl(t,e){var n=tl.call(this)||this;return n.scrollTargetX=null,n.scrollTargetY=null,n.includeMargins=!1,n.includeBorders=!0,n.includePaddings=!0,n.crop={left:null,right:null,top:null,bottom:null},n._assignFrom(t,e),n}var rl,il=(t(ol,rl=Ja),ol.prototype._getAssignableProperties=function(){return rl.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:La},{name:"modifiers.alt",type:La},{name:"modifiers.shift",type:La},{name:"modifiers.meta",type:La}])},ol);function ol(t,e){var n=rl.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var sl,al,ll,ul,cl,dl,hl,fl,pl=(t(ml,sl=il),ml.prototype._getAssignableProperties=function(){return sl.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:ka}])},ml);function ml(t,e){var n=sl.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}function gl(t,e){var n=al.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}function wl(t,e){var n=ll.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function vl(t,e){var n=ul.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function yl(t,e){var n=cl.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function _l(t,e){var n=dl.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function El(t,e){var n=hl.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function Cl(t,e){var n=fl.call(this)||this;return n._assignFrom(t,e),n}t(gl,al=il),gl.prototype._getAssignableProperties=function(){return al.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:La},{name:"skipDefaultDragBehavior",type:La}])},t(wl,ll=pl),wl.prototype._getAssignableProperties=function(){return ll.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:La},{name:"paste",type:La},{name:"confidential",type:La}])},t(vl,ul=il),vl.prototype._getAssignableProperties=function(){return ul.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:Fa},{name:"destinationOffsetY",type:Fa}])},t(yl,cl=Es),yl.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:La}]},t(_l,dl=Es),_l.prototype._getAssignableProperties=function(){return[{name:"timeout",type:ka},{name:"allowUnawaitedPromise",type:La}]},t(El,hl=ja),El.prototype._getAssignableProperties=function(){return hl.prototype._getAssignableProperties.call(this).concat([{name:"confidential",type:La}])},t(Cl,fl=Es),Cl.prototype._getAssignableProperties=function(){return[{name:"name",type:Ua},{name:"value",type:Ua},{name:"domain",type:Ua},{name:"path",type:Ua},{name:"expires",type:Ba},{name:"maxAge",type:Ga},{name:"secure",type:La},{name:"httpOnly",type:La},{name:"sameSite",type:Ua}]};var Il,Sl=(t(bl,Il=Es),bl.prototype._getAssignableProperties=function(){return[{name:"username",type:Ua,required:!0},{name:"password",type:Ua}]},bl);function bl(t,e){var n=Il.call(this)||this;return n._assignFrom(t,e),n}var Wl,Tl,Al,xl,Nl=(t(Rl,Wl=Es),Rl.prototype._getAssignableProperties=function(){return[{name:"protocol",type:Ua},{name:"host",type:Ua,required:!0},{name:"port",type:Ga,required:!0},{name:"auth",type:za,init:Fl}]},Rl);function Rl(t,e){var n=Wl.call(this)||this;return n._assignFrom(t,e),n}function Dl(t,e){var n=Tl.call(this)||this;return n._assignFrom(t,e),n}function Pl(t,e){var n=Al.call(this)||this;return n._assignFrom(t,e),n}function Ml(t,e){var n=xl.call(this)||this;return n._assignFrom(t,e),n}function Fl(t,e,n,r){return void 0===r&&(r=!0),new Sl(e,r)}function kl(t,e,n,r){return void 0===r&&(r=!0),new Nl(e,r)}function Ll(t){return t.top!==t}t(Dl,Tl=Es),Dl.prototype._getAssignableProperties=function(){return[{name:"url",type:Va},{name:"method",type:Ua},{name:"headers",type:za},{name:"params",type:qa},{name:"body"},{name:"timeout",type:Ga},{name:"withCredentials",type:La},{name:"auth",type:za,init:Fl},{name:"proxy",type:za,init:kl},{name:"rawResponse",type:La}]},t(Pl,Al=Es),Pl.prototype._getAssignableProperties=function(){return[{name:"credentials",type:Ga}]},t(Ml,xl=Es),Ml.prototype._getAssignableProperties=function(){return[{name:"stack",type:Ha,required:!1},{name:"message",type:Ha,required:!1},{name:"pageUrl",type:Ha,required:!1}]};var Ol=c.eventSandbox.message,Ul="driver|browser-manipulation|request",Hl="driver|browser-manipulation|response";Ol.on(Ol.SERVICE_MSG_RECEIVED_EVENT,function(e){var t,n,r,i,o;e.message.cmd===Ul&&(t=_.domUtils.findIframeByWindow(e.source),r=(n=e.message).command,(i=n.cropDimensions)&&(r.options=new el({crop:i,includePaddings:!1})),(o=new Bl(r)).element=t,o.execute().then(function(t){return Ol.sendServiceMsg({cmd:Hl,result:t},e.source)}))});var Bl=(Gl.prototype._getAbsoluteCropValues=function(){var t=this.element.getBoundingClientRect(),e=t.top,n=t.left;n+=this.command.options.originOffset.x,e+=this.command.options.originOffset.y;var r=n+this.command.options.crop.right,i=e+this.command.options.crop.bottom;return{top:e+=this.command.options.crop.top,left:n+=this.command.options.crop.left,bottom:i,right:r}},Gl.prototype._createManipulationReadyMessage=function(){var t=nc.devicePixelRatio||1,e={cmd:u.readyForBrowserManipulation,pageDimensions:{dpr:t,innerWidth:nc.innerWidth,innerHeight:nc.innerHeight,documentWidth:rc.documentElement.clientWidth,documentHeight:rc.documentElement.clientHeight,bodyWidth:rc.body.clientWidth,bodyHeight:rc.body.clientHeight},disableResending:!0};return this.command.type===d.takeElementScreenshot&&(e.cropDimensions=this._getAbsoluteCropValues()),e},Gl.prototype._runScrollBeforeScreenshot=function(){var i=this;return c.Promise.resolve().then(function(){if(i.element||!i.command.selector)return c.Promise.resolve();var t,e,n=i.command.selector.timeout,r="number"==typeof n?n:i.globalSelectorTimeout;return i.statusBar.showWaitingElementStatus(r),t=[{selector:i.command.selector,createNotFoundError:function(t){return new Me(null,t)},createIsInvisibleError:function(){return new Le},createHasWrongNodeTypeError:function(t){return new He(t)}}],e=i.globalSelectorTimeout,new _a(t,e).getElements().then(function(t){i.statusBar.hideWaitingElementStatus(),i.element=t[0]}).catch(function(t){throw i.statusBar.hideWaitingElementStatus(),t})}).then(function(){return function(v,y){return l(this,void 0,void 0,function(){var e,n,r,i,o,s,a,l,u,c,d,h,f,p,m,g,w;return C(this,function(t){if(e=v.getBoundingClientRect(),n={left:e.left,right:e.right,top:e.top,bottom:e.bottom},r=_.styleUtils.getElementMargin(v),i=_.styleUtils.getElementPadding(v),o=_.styleUtils.getBordersWidth(v),y.originOffset={x:0,y:0},s=n.left+v.scrollWidth+o.left+o.right,a=n.top+v.scrollHeight+o.top+o.bottom,n.right=Math.max(n.right,s),n.bottom=Math.max(n.bottom,a),y.includeBorders&&y.includePaddings?y.includeMargins&&(y.originOffset.x-=r.left,y.originOffset.y-=r.top,n.left-=r.left,n.top-=r.top,n.right+=r.right,n.bottom+=r.bottom):(y.originOffset.x+=o.left,y.originOffset.y+=o.top,n.left+=o.left,n.top+=o.top,n.right-=o.right,n.bottom-=o.bottom,y.includePaddings||(y.originOffset.x+=i.left,y.originOffset.y+=i.top,n.left+=i.left,n.top+=i.top,n.right-=i.right,n.bottom-=i.bottom)),n.width=n.right-n.left,n.height=n.bottom-n.top,l=pa({min:y.crop.left,max:y.crop.right,length:y.crop.width},n.width),u=pa({min:y.crop.top,max:y.crop.bottom,length:y.crop.height},n.height),y.crop.left=l.min,y.crop.right=l.max,y.crop.width=l.length,y.crop.top=u.min,y.crop.bottom=u.max,y.crop.height=u.length,y.crop.width<=0||y.crop.height<=0)throw new In(y.crop.width,y.crop.height);if(c=_.styleUtils.getViewportDimensions(),(n.width>c.width||n.height>c.height)&&(y.scrollToCenter=!0),d="number"==typeof y.scrollTargetX,h="number"==typeof y.scrollTargetY,d||(y.scrollTargetX=ma(y.crop.left,y.crop.right,c.width)),h||(y.scrollTargetY=ma(y.crop.top,y.crop.bottom,c.height)),f=E.getOffsetOptions(v,y.scrollTargetX,y.scrollTargetY),p=f.offsetX,m=f.offsetY,y.scrollTargetX=p,y.scrollTargetY=m,g=!d||y.scrollTargetX>=y.crop.left&&y.scrollTargetX<=y.crop.right,w=!h||y.scrollTargetY>=y.crop.top&&y.scrollTargetY<=y.crop.bottom,!g||!w)throw new _n(g,w);return[2]})})}(i.element,i.command.options)}).then(function(){var t=i.command.options,e=t.scrollTargetX,n=t.scrollTargetY,r=t.scrollToCenter;return new _.ScrollAutomation(i.element,new Qa({offsetX:e,offsetY:n,scrollToCenter:r,skipParentFrames:!0})).run()})},Gl.prototype._hideUI=function(){return n.hide(),this.command.markData&&n.showScreenshotMark(this.command.markData),_.delay(500)},Gl.prototype._showUI=function(){this.command.markData&&n.hideScreenshotMark(),n.show()},Gl.prototype._requestManipulation=function(){if(!Ll(nc))return c.transport.queuedAsyncServiceMsg(this._createManipulationReadyMessage());var t=this._getAbsoluteCropValues();return _.sendRequestToFrame({cmd:Ul,command:this.command,cropDimensions:t},Hl,nc.parent).then(function(t){if(!t.result)return{result:null};var e=t.result,n=e.result,r=e.executionError;if(r)throw r;return{result:n}})},Gl.prototype._runManipulation=function(){var r=this,i=null;return c.Promise.resolve().then(function(){return r.command.type!==d.takeElementScreenshot?c.Promise.resolve():(_.scrollController.stopPropagation(),r._runScrollBeforeScreenshot())}).then(function(){return Ll(nc)?c.Promise.resolve():r._hideUI()}).then(function(){return r._requestManipulation()}).then(function(t){var e=t.result,n=t.error;if(n)throw n;return _.scrollController.enablePropagation(),i=e,Ll(nc)||r._showUI(),_.delay(200)}).then(function(){return new Ss({isCommandResult:!0,result:i})}).catch(function(t){return _.scrollController.enablePropagation(),new Ss({isCommandResult:!0,executionError:t})})},Gl.prototype.execute=function(){var t=this;return function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=new _.ClientRequestEmitter,i=new _.RequestBarrier(r),o=new _.ScriptExecutionEmitter,s=new _.ScriptExecutionBarrier(o);_.pageUnloadBarrier.watchForPageNavigationTriggers();var a=null,l=t.apply(void 0,e),u=l.then(function(t){return a=t,c.Promise.all([i.wait().then(function(){return s.wait()}),_.pageUnloadBarrier.wait()])}).then(function(){return a});return{actionPromise:l,barriersPromise:u}}(function(){return t._runManipulation()}).barriersPromise},Gl);function Gl(t,e,n){this.command=t,this.globalSelectorTimeout=e,this.statusBar=n,this.element=null}function Vl(e){return e.getResult().then(function(t){return new Ss({isCommandResult:!0,result:e.encodeResult(t)})}).catch(function(t){return new Ss({isCommandResult:!0,executionError:t})})}var ql=s.Promise,zl=(jl.prototype.setAsMaster=function(t){var e=this;return Ws(new Yo(t),this.driverWindow,Ts,Bn).catch(function(t){if(!e._isNonPageWindow)throw t})},jl.prototype.closeAllChildWindows=function(){return Ws(new $o,this.driverWindow,Ts,qn)},jl.prototype.findChildWindows=function(t,e){return Ws(new e(t),this.driverWindow,Ts,Bn)},jl.prototype.startToRestore=function(){return Ws(new ts,this.driverWindow,Ts,Bn)},jl.prototype.closeFileDownloadingWindow=function(){this._isNonPageWindow=!0,this.driverWindow.close()},jl);function jl(t,e){this._isNonPageWindow=!1,this.driverWindow=t,this.windowId=e}var Xl=(Yl.prototype._getTopOpenedWindow=function(t){for(var e=t;e.opener;)e=e.opener;return e.top},Yl.prototype._setAsMaster=function(t,e){return Ws(new Yo(e),t,Ts,Bn)},Yl.prototype.getTopOpenedWindow=function(){return this._getTopOpenedWindow(this.currentDriverWindow)},Yl.prototype.setTopOpenedWindowAsMaster=function(){var t=this._getTopOpenedWindow(this.currentDriverWindow);return this._setAsMaster(t)},Yl.prototype.setParentWindowAsMaster=function(t){void 0===t&&(t={});var e=this.currentDriverWindow.opener;return this._setAsMaster(e,t.finalizePendingCommand)},Yl.prototype.restoreChild=function(r){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){return e=new rs(r),n=this.currentDriverWindow.opener,Ws(e,n,Ts,Bn),[2]})})},Yl);function Yl(t){this.currentDriverWindow=t}var Jl="master",Kl="replica",$l=(Ql.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},Ql.prototype.toSerializable=function(t){return new Gs(t)},Ql.prototype.fromSerializable=function(){},Ql);function Ql(){this.type="Node"}var Zl=(tu.prototype._startListening=function(){var e=this;this._emitter.onRequestSend(function(t){return e._onRequestSend(t)}),this._emitter.onRequestCompleted(function(t){return e._onRequestCompleted(t)}),this._emitter.onRequestError(function(t){return e._onRequestError(t)})},tu.prototype._offListening=function(){this._emitter.offAll()},tu.prototype._onRequestSend=function(t){this._collectingReqs&&this._requests.add(t)},tu.prototype._onRequestCompleted=function(t){var e=this;Zs(this._delays.additionalRequestsCollection).then(function(){return e._onRequestFinished(t)})},tu.prototype._onRequestFinished=function(t){this._requests.has(t)&&(this._requests.delete(t),this._collectingReqs||this._requests.size||!this._watchdog||this._finishWaiting())},tu.prototype._onRequestError=function(t){this._onRequestFinished(t)},tu.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._requests.clear(),this._offListening(),this._waitResolve()},tu.prototype.wait=function(t){var n=this;return Zs(t?this._delays.pageInitialRequestsCollection:this._delays.requestsCollection).then(function(){return new c.Promise(function(t){var e;n._collectingReqs=!1,n._waitResolve=t,n._requests.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},tu.TIMEOUT)):n._finishWaiting()})})},tu.TIMEOUT=3e3,tu);function tu(t,e){var n,r,i;void 0===e&&(e={}),this._delays={requestsCollection:null!==(n=e.requestsCollection)&&void 0!==n?n:50,additionalRequestsCollection:null!==(r=e.additionalRequestsCollection)&&void 0!==r?r:50,pageInitialRequestsCollection:null!==(i=e.pageInitialRequestsCollection)&&void 0!==i?i:50},this._emitter=t,this._waitResolve=null,this._watchdog=null,this._requests=new Set,this._collectingReqs=!0,this._startListening()}var eu=(nu.prototype._startListening=function(){var e=this;this._emitter.onScriptAdded(function(t){return e._onScriptElementAdded(t)}),this._emitter.onScriptLoadedOrFailed(function(t){return e._onScriptLoadedOrFailed(t)})},nu.prototype._offListening=function(){this._emitter.offAll()},nu.prototype._onScriptElementAdded=function(t){var e=this,n=(0,c.nativeMethods.setTimeout)(function(){return e._onScriptLoadedOrFailed(t,!0)},nu.LOADING_TIMEOUT);this._scripts.set(t,n)},nu.prototype._onScriptLoadedOrFailed=function(t,e){var n=this;void 0===e&&(e=!1),this._scripts.has(t)&&(e||(0,c.nativeMethods.clearTimeout)(this._scripts.get(t)),this._scripts.delete(t),this._scripts.size||Zs(25).then(function(){n._waitResolve&&!n._scripts.size&&n._finishWaiting()}))},nu.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._scripts.clear(),this._offListening(),this._waitResolve(),this._waitResolve=null},nu.prototype.wait=function(){var n=this;return new c.Promise(function(t){var e;n._waitResolve=t,n._scripts.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},nu.TIMEOUT)):n._finishWaiting()})},nu.TIMEOUT=3e3,nu.LOADING_TIMEOUT=2e3,nu);function nu(t){this._emitter=t,this._watchdog=null,this._waitResolve=null,this._scripts=new Map,this._startListening()}var ru=(iu.prototype.wait=function(){var t=this;return c.Promise.all([this._requestBarrier.wait().then(function(){return t._scriptExecutionBarrier.wait()}),this._unloadBarrier.wait()]).then()},iu);function iu(t,e,n){this._requestBarrier=new Zl(t),this._scriptExecutionBarrier=new eu(e),(this._unloadBarrier=n).watchForPageNavigationTriggers&&n.watchForPageNavigationTriggers()}function ou(t,e){var n=E.calculateSelectTextArguments(e[0],t);return new E.SelectText(e[0],n.startPos,n.endPos,t.options)}function su(t){if(!_.domUtils.isFileInput(t))throw new wn}function au(i,o){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return gt(i)?[4,(e=i,r={stack:(n=o).stack,pageUrl:n.pageUrl,message:n.msg},e.args=[[r]],new ki(e).getResult())]:[3,2];case 1:return[2,t.sent()];case 2:return[2,i||!1]}var e,n,r})})}da.ACTIONS_HANDLERS[d.dispatchEvent]={additionalSelectorProps:["relatedTarget"],create:function(t,e){return e[1]&&(t.options.relatedTarget=e[1]),new E.DispatchEvent(e[0],t.eventName,t.options)}},da.ACTIONS_HANDLERS[d.pressKey]={create:function(t){return new E.Press(_.parseKeySequence(t.keys).combinations,t.options)},ensureCmdArgs:function(t){if(_.parseKeySequence(t.keys).error)throw new dn("keys")}},da.ACTIONS_HANDLERS[d.click]={create:function(t,e){return/option|optgroup/.test(_.domUtils.getTagName(e[0]))?new E.SelectChildClick(e[0],t.options):new E.Click(e[0],t.options,nc,E.cursor)}},da.ACTIONS_HANDLERS[d.rightClick]={create:function(t,e){return new E.RClick(e[0],t.options)}},da.ACTIONS_HANDLERS[d.doubleClick]={create:function(t,e){return new E.DblClick(e[0],t.options)}},da.ACTIONS_HANDLERS[d.hover]={create:function(t,e){return new E.Hover(e[0],t.options)}},da.ACTIONS_HANDLERS[d.drag]={create:function(t,e){return new E.DragToOffset(e[0],t.dragOffsetX,t.dragOffsetY,t.options)}},da.ACTIONS_HANDLERS[d.dragToElement]={additionalSelectorProps:["destinationSelector"],create:function(t,e){return new E.DragToElement(e[0],e[1],t.options)}},da.ACTIONS_HANDLERS[d.scroll]={create:function(t,e){var n=t.x,r=t.y,i=t.position,o=t.options;return new E.SetScroll(e[0],{x:n,y:r,position:i},o)}},da.ACTIONS_HANDLERS[d.scrollBy]={create:function(t,e){var n=t.byX,r=t.byY,i=t.options;return new E.SetScroll(e[0],{byX:n,byY:r},i)}},da.ACTIONS_HANDLERS[d.scrollIntoView]={create:function(t,e){return new E.ScrollIntoView(e[0],t.options)}},da.ACTIONS_HANDLERS[d.typeText]={create:function(t,e){return new E.Type(e[0],t.text,t.options)}},da.ACTIONS_HANDLERS[d.selectText]={create:ou,ensureElsProps:function(t){if(!_.domUtils.isEditableElement(t[0]))throw new Qe}},da.ACTIONS_HANDLERS[d.selectTextAreaContent]={create:ou,ensureElsProps:function(t){if(!_.domUtils.isTextAreaElement(t[0]))throw new en}},da.ACTIONS_HANDLERS[d.selectEditableContent]={additionalSelectorProps:["startSelector","endSelector"],create:function(t,e){return t.endSelector=t.endSelector||t.startSelector,new E.SelectEditableContent(e[0],e[1],t.options)},ensureElsProps:function(t){if(!_.domUtils.isContentEditableElement(t[0]))throw new on("startSelector");if(!_.domUtils.isContentEditableElement(t[1]))throw new on("endSelector");if(!_.contentEditable.getNearestCommonAncestor(t[0],t[1]))throw new ln}},da.ACTIONS_HANDLERS[d.setFilesToUpload]={create:function(t,e){return new E.Upload(e[0],t.filePath,function(t,e){return new pn(t,e)})},ensureElsProps:function(t){return su(t[0])}},da.ACTIONS_HANDLERS[d.clearUpload]={create:function(t,e){return new E.Upload(e[0])},ensureElsProps:function(t){return su(t[0])}};var lu,uu=s.settings,cu=s.transport,du=s.Promise,hu=s.eventSandbox.message,fu=s.storages,pu=s.nativeMethods,mu=pu.date,gu=s.eventSandbox.listeners,wu=s.utils.url,vu="testcafe|driver|test-done-sent-flag",yu="testcafe|driver|pending-status",_u="testcafe|driver|executing-client-function-descriptor",Eu="testcafe|driver|executing-skip-js-errors-function-flag",Cu="testcafe|driver|selector-execution-start-time",Iu="testcafe|driver|pending-page-error",Su="testcafe|driver|active-iframe-selector",bu="testcafe|driver|test-speed",Wu="testcafe|driver|assertion-retries-timeout",Tu="testcafe|driver|assertion-retries-start-time",Au="testcafe|driver|console-messages",xu="testcafe|driver|pending-child-window-count",Nu={NotLoadedError:xn,NotFoundError:Me,IsInvisibleError:Le},Ru={NotLoadedError:Dn,NotFoundError:wr,IsInvisibleError:_r},Du=Math.pow(2,31)-1,Pu="status-with-command-result-event",Mu="empty-command-event",Fu="child-window-closed",ku="skip-js-errors-function-execution-complete",Lu=(t(Ou,lu=_.serviceUtils.EventEmitter),Ou.prototype._isOpenedInIframe=function(){var t=nc.opener;return t&&t.top&&t.top!==t},Object.defineProperty(Ou.prototype,"speed",{get:function(){return this.contextStorage.getItem(bu)},set:function(t){this.contextStorage.setItem(bu,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ou.prototype,"consoleMessages",{get:function(){return new Pr(this.contextStorage.getItem(Au))},set:function(t){return this.contextStorage.setItem(Au,t?t.getCopy():null)},enumerable:!1,configurable:!0}),Ou.prototype._getReadyPromise=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,_.eventUtils.documentReady(this.pageLoadTimeout)];case 1:return t.sent(),[4,this.pageInitialRequestBarrier.wait(!0)];case 2:return t.sent(),[2]}})})},Ou.prototype._hasPendingActionFlags=function(t){return t.getItem(this.COMMAND_EXECUTING_FLAG)||t.getItem(this.EXECUTING_IN_IFRAME_FLAG)},Ou.prototype._getCurrentWindowId=function(){var t=nc.location.toString(),e=s.utils.url.parseProxyUrl(t);return e&&e.windowId||null},Ou.prototype._onJsError=function(n){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:if(this.contextStorage.getItem(vu))return[2];if(!this.skipJsErrors)return[3,6];this.contextStorage.setItem(Eu,!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,au(this.skipJsErrors,n)];case 2:return t.sent()||this._setUncaughtErrorOnPage(n),[3,5];case 3:return e=t.sent(),this.contextStorage.getItem(Iu)||this.contextStorage.setItem(Iu,e),[3,5];case 4:return this.contextStorage.setItem(Eu,!1),this.emit(ku),[7];case 5:return[2];case 6:return this._setUncaughtErrorOnPage(n),[2]}})})},Ou.prototype._setUncaughtErrorOnPage=function(t){var e=new Ht(t.stack,t.pageUrl);this.contextStorage.getItem(Iu)||this.contextStorage.setItem(Iu,e)},Ou.prototype._unlockPageAfterTestIsDone=function(){return _.disableRealEventsPreventing(),du.resolve()},Ou.prototype._getActiveElement=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){return e=_.domUtils.getActiveElement(),[2,this.replicator.encode(e)]})})},Ou.prototype._failIfClientCodeExecutionIsInterrupted=function(){var t=this.contextStorage.getItem(_u);return!!t&&(this._onReady(new Ss({isCommandResult:!0,executionError:new bt(t.instantiationCallsiteName)})),!0)},Ou.prototype.onCustomClientScriptError=function(t,e){var n=e?new Qt(t,e):new Jt(t);this.contextStorage.getItem(Iu)||this.contextStorage.setItem(Iu,n)},Ou.prototype._addChildWindowDriverLink=function(t){var e=new zl(t.window,t.windowId);this.childWindowDriverLinks.push(e),this._ensureClosedChildWindowWatcher()},Ou.prototype._ensureClosedChildWindowWatcher=function(){var e=this;this.checkClosedChildWindowIntervalId||(this.checkClosedChildWindowIntervalId=pu.setInterval.call(nc,function(){var t=_.arrayUtils.find(e.childWindowDriverLinks,function(t){return t.driverWindow.closed});t&&(e.emit(Fu),_.arrayUtils.remove(e.childWindowDriverLinks,t),t.ignoreMasterSwitching||e._setCurrentWindowAsMaster(),e.childWindowDriverLinks.length||(pu.clearInterval.call(nc,e.checkClosedChildWindowIntervalId),delete e.checkClosedChildWindowIntervalId))},200))},Ou.prototype._setAsMasterInProgressOrCompleted=function(){return this.setAsMasterInProgress||this.role===Jl},Ou.prototype._setCurrentWindowAsMaster=function(){var t=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,this._clearActiveChildIframeInfo(),du.resolve().then(function(){return _.browser.setActiveWindowId(t.browserActiveWindowId,s.createNativeXHR,t.windowId)}).then(function(){t._startInternal({finalizePendingCommand:!0,isFirstRequestAfterWindowSwitching:!0}),t.setAsMasterInProgress=!1}).catch(function(){t._onReady(new Ss({isCommandResult:!0,executionError:new Bn}))}))},Ou.prototype._onChildWindowOpened=function(t){this._addChildWindowDriverLink(t),this._switchToChildWindow(t.windowId)},Ou.prototype._sendStartToRestoreCommand=function(){if(this.contextStorage){this._stopRespondToChildren=!0,this.contextStorage.setItem(xu,this.childWindowDriverLinks.length);for(var t=0,e=this.childWindowDriverLinks;t<e.length;t++)e[t].startToRestore()}},Ou.prototype._onFormSubmit=function(t){this.contextStorage&&this.contextStorage.getItem(vu)&&(t.preventSubmit=!0)},Ou.prototype._onConsoleMessage=function(t){var e=t.meth,n=t.line,r=this.consoleMessages;r.addMessage(e,n,this.windowId),this.consoleMessages=r},Ou.prototype._addPendingErrorToStatus=function(t){var e=this.contextStorage.getItem(Iu);e&&(this.contextStorage.setItem(Iu,null),t.pageError=e)},Ou.prototype._addUnexpectedDialogErrorToStatus=function(t){var e=this.nativeDialogsTracker.getUnexpectedDialogError();t.pageError=t.pageError||e},Ou.prototype._addConsoleMessagesToStatus=function(t){t.consoleMessages=this.consoleMessages,this.consoleMessages=null},Ou.prototype._addPendingWindowSwitchingStateToStatus=function(t){t.isPendingWindowSwitching=this._isPendingSwitchingWindow()},Ou.prototype._sendStatusRequest=function(t){function e(){return _.getTimeLimitedPromise(cu.asyncServiceMsg(r),5e3)}function n(){return _.delay(300).then(e)}for(var r={cmd:u.ready,status:t,disableResending:!0,allowRejecting:!0},i=e(),o=0;o<a;o++)i=i.catch(n);return i},Ou.prototype._sendStatus=function(t){var e=this;t.resent||(this._addPendingErrorToStatus(t),this._addUnexpectedDialogErrorToStatus(t),this._addConsoleMessagesToStatus(t),this._addPendingWindowSwitchingStateToStatus(t)),this.contextStorage.setItem(yu,t);var n=null;return _.pageUnloadBarrier.wait(0).then(function(){return e._sendStatusRequest(t)}).then(function(t){return n=t,_.pageUnloadBarrier.wait(0)}).then(function(){return e.contextStorage.setItem(yu,null),n})},Ou.prototype._addChildIframeDriverLink=function(t,e){var n,r=this._getChildIframeDriverLinkByWindow(e);r||(n="".concat(this.testRunId,"-").concat(Ki()),r=new xs(e,n),this.childIframeDriverLinks.push(r)),r.sendConfirmationMessage(t)},Ou.prototype._getTargetWindowNotFoundResult=function(t,e){return du.resolve({success:!1,errCode:t,errMsg:e})},Ou.prototype._getChildWindowValidateResult=function(t){var e=t.find(function(t){return t.result.success});if(e)return e.result;var n=t.find(function(t){return t.result.errCode===et||t.result.errCode===st});return(n=n||t.find(function(t){return!!t.result.errCode}))?{errCode:n.result.errCode}:void 0},Ou.prototype._handleWindowValidation=function(n,r,i,o){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._validateWindow(n,r,i,o)];case 1:return e=t.sent(),As({requestMsgId:n.id,window:r,result:e}),[2]}})})},Ou.prototype._getWindowInfo=function(){var t=s.utils.url.parseProxyUrl(nc.location.toString());return{id:this.windowId,title:rc.title,url:t.destUrl}},Ou.prototype._isTargetWindow=function(t){return t.windowId===this.windowId},Ou.prototype._validateWindow=function(r,t,i,o){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return this._isTargetWindow(r)?[2,i()]:this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(r,o)}),[4,du.all(e)]):[2,this._getTargetWindowNotFoundResult(nt)];case 1:return n=t.sent(),[2,this._getChildWindowValidateResult(n)]}})})},Ou._createWindowValidationError=function(t){var e=t.errCode;return new(e===et?Xn:e===st?Kn:nr)},Ou.prototype._getCloseWindowFoundResult=function(){return this.parentWindowDriverLink?this.childWindowDriverLinks.length?du.resolve({success:!1,errCode:et}):du.resolve({success:!0}):du.resolve({success:!1,errCode:st})},Ou.prototype._handleCloseWindowValidation=function(t,e){var n=this;return this._handleWindowValidation(t,e,function(){return n._getCloseWindowFoundResult()},Eo)},Ou.prototype._handleSwitchToWindowValidation=function(t,e){return this._handleWindowValidation(t,e,function(){return du.resolve({success:!0})},So)},Ou.prototype._handleCloseWindow=function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._closeWindow(e,n)];case 1:return t.sent(),As({requestMsgId:e.id,window:n}),[2]}})})},Ou.prototype._closeWindowAndWait=function(n,r){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return e=this._createWaitForEventPromise(Fu,2e3),n.ignoreMasterSwitching=!r.isCurrentWindow,this.closing?[3,2]:(this.closing=!0,[4,_.browser.closeWindow(this.browserCloseWindowUrl,s.createNativeXHR,this.windowId)]);case 1:t.sent(),t.label=2;case 2:return n.driverWindow.close(),[2,e]}})})},Ou.prototype._closeWindow=function(e){if(!this.childWindowDriverLinks.length)return du.resolve();var t=this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId});if(t)return this._closeWindowAndWait(t,e);var n=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,No)});return du.all(n)},Ou.prototype._getWindows=function(){return l(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:return this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows({},To)}),[4,du.all(e)]):[2,[this._getWindowInfo()]];case 1:for(n=t.sent(),r=[this._getWindowInfo()],i=0,o=n;i<o.length;i++)s=o[i],Array.isArray(s.result)&&(r=r.concat(s.result));return[2,r]}})})},Ou.prototype._handleGetWindows=function(n,r){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._getWindows(n,r)];case 1:return e=t.sent(),As({requestMsgId:n.id,window:r,result:e}),[2]}})})},Ou.prototype._handleSwitchToWindow=function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._switchToWindow(e)];case 1:return t.sent(),As({requestMsgId:e.id,window:n}),[2]}})})},Ou.prototype._switchToWindow=function(e){var t=this;return this._isTargetWindow(e)?du.resolve().then(function(){t._setCurrentWindowAsMaster()}):this.childWindowDriverLinks.length?du.all(this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,Po)})):du.resolve()},Ou.prototype._handleSetAsMasterMessage=function(t,e){var n=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,As({requestMsgId:t.id,window:e}),du.resolve().then(function(){return _.browser.setActiveWindowId(n.browserActiveWindowId,s.createNativeXHR,n.windowId)}).then(function(){n._startInternal({finalizePendingCommand:t.finalizePendingCommand,result:{id:n.windowId}}),n.setAsMasterInProgress=!1}).catch(function(){n._onReady(new Ss({isCommandResult:!0,executionError:new Bn}))}))},Ou.prototype._handleCloseAllWindowsMessage=function(t,e){var n=this;this._closeAllChildWindows().then(function(){As({requestMsgId:t.id,window:e})}).catch(function(){n._onReady(new Ss({isCommandResult:!0,executionError:new qn}))})},Ou.prototype._handleStartToRestoreChildLinkMessage=function(){this.parentWindowDriverLink.restoreChild(this._getCurrentWindowId())},Ou.prototype._handleHasPendingActionFlags=function(t,e){var n=this._hasPendingActionFlags(this.contextStorage);As({requestMsgId:t.id,window:e,result:n})},Ou.prototype._handleRestoreChildLink=function(t,e){this._stopRespondToChildren||(this._addChildWindowDriverLink({window:e,windowId:t.windowId}),this.childWindowDriverLinks.length===this.contextStorage.getItem(xu)&&this._restoreChildWindowsPromiseResolver&&(this._restoreChildWindowsPromiseResolver(),delete this._restoreChildWindowsPromiseResolver,this.contextStorage.setItem(xu,0)),As({requestMsgId:t.id,window:e}))},Ou.prototype._handleChildWindowIsOpenedInIFrame=function(){var e=this;this._pendingChildWindowInIFrame=new du(function(t){e._resolvePendingChildWindowInIframe=t})},Ou.prototype._handleChildWindowIsLoadedInIFrame=function(e,t){As({requestMsgId:e.id,window:t}),this._resolvePendingChildWindowInIframe(),this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId})||this._onChildWindowOpened({window:t,windowId:e.windowId})},Ou.prototype._handleStopInternalFromFrame=function(t,e){As({requestMsgId:t.id,window:e}),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._stopInternal()},Ou.prototype._initChildDriverListening=function(){var r=this;hu.on(hu.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message,n=t.source;switch(e.type){case Zi:r._addChildIframeDriverLink(e.id,n);break;case mo:r._handleChildWindowIsOpenedInIFrame(e,n);break;case po:r._handleChildWindowIsLoadedInIFrame(e,n);break;case go:r._handleStopInternalFromFrame(e,n);break;case uo:r._handleSetAsMasterMessage(e,n);break;case to:r._handleSwitchToWindow(e,n);break;case eo:r._handleCloseWindow(e,n);break;case ro:r._handleSwitchToWindowValidation(e,n);break;case no:r._handleCloseWindowValidation(e,n);break;case io:r._handleGetWindows(e,n);break;case co:r._handleCloseAllWindowsMessage(e,n);break;case ho:r._handleStartToRestoreChildLinkMessage();break;case wo:r._handleHasPendingActionFlags(e,n);break;case fo:r._handleRestoreChildLink(e,n)}})},Ou.prototype._getChildIframeDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childIframeDriverLinks,function(t){return t.driverWindow===e})},Ou.prototype._getChildWindowDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childWindowDriverLinks,function(t){return t.driverWindow===e})},Ou.prototype._runInActiveIframe=function(t){var e=this,n=du.resolve(),r=this.contextStorage.getItem(Su);!this.activeChildIframeDriverLink&&r&&(n=this._switchToIframe(r,Ru)),n.then(function(){return e.contextStorage.setItem(e.EXECUTING_IN_IFRAME_FLAG,!0),e.activeChildIframeDriverLink.executeCommand(t,e.speed)}).then(function(t){return e._onCommandExecutedInIframe(t)}).catch(function(t){return e._onCommandExecutedInIframe(new Ss({isCommandResult:!0,executionError:t}))})},Ou.prototype._onCommandExecutedInIframe=function(t){var e=this;this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1);var n=du.resolve();this._pendingChildWindowInIFrame&&(n=this._pendingChildWindowInIFrame),n.then(function(){e._onReady(t)})},Ou.prototype._ensureChildIframeDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildIframeDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},Ou.prototype._ensureChildWindowDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildWindowDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},Ou.prototype._switchToIframe=function(e,n){var t,r,i,o,s,a,l,u=this,c="number"==typeof e.timeout,d=c?e.timeout:this.selectorTimeout;return t=e,r=d,i=null,o=function(t){return new n.NotFoundError(null,t)},s=function(){return new n.IsInvisibleError},a=this.statusBar,l=new wa(t,r,i,o,s),a.showWaitingElementStatus(l.timeout),l.getResult().then(function(t){return a.hideWaitingElementStatus(!!t).then(function(){return t})}).catch(function(t){return a.hideWaitingElementStatus(!1).then(function(){throw t})}).then(function(t){if(!_.domUtils.isIframeElement(t))throw new Wn;var e=c?d:Math.max(d,5e3);return u._ensureChildIframeDriverLink(pu.contentWindowGetter.call(t),n.NotLoadedError,e)}).then(function(t){t.availabilityTimeout=d,u.activeChildIframeDriverLink=t,u.contextStorage.setItem(Su,e)})},Ou.prototype._createWaitForEventPromise=function(e,n){var r=this,i=null,t=new du(function(t){pu.setTimeout.call(nc,function(){r.off(e,i),t()},n)}),o=new du(function(t){i=function(){this.off(e,i),t()},r.on(e,i)});return du.race([t,o])},Ou.prototype._waitForCurrentCommandCompletion=function(){return this.contextStorage.getItem(this.COMMAND_EXECUTING_FLAG)?this._createWaitForEventPromise(Pu,Du):du.resolve()},Ou.prototype._waitForSkipJsErrorFunctionCompletion=function(n){var r=this;return this.contextStorage.getItem(Eu)?new du(function(t){var e=function(){r.off(ku,e),t(n)};r.on(ku,e)}):du.resolve(n)},Ou.prototype._waitForEmptyCommand=function(){return this._createWaitForEventPromise(Mu,3e4)},Ou.prototype._abortSwitchingToChildWindowIfItClosed=function(){if(this.activeChildWindowDriverLink.driverWindow.closed)throw _.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),this.activeChildWindowDriverLink=null,new dr},Ou.prototype._switchToChildWindow=function(t){var e=this;this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0);var n=this.contextStorage.getItem(this.WINDOW_COMMAND_API_CALL_FLAG);return function(e,t){if("string"!=typeof e)return ql.resolve(null);var n=_.arrayUtils.find(t,function(t){return t.windowId===e});if(n)return ql.resolve(n);var r=new Fn;return ql.reject(r)}(t,this.childWindowDriverLinks).then(function(t){return e._ensureChildWindowDriverLink(t.driverWindow,On,e.childWindowReadyTimeout)}).then(function(t){return e.activeChildWindowDriverLink=t,e._waitForCurrentCommandCompletion()}).then(function(){return n?void 0:e._waitForEmptyCommand()}).then(function(){return e._observeFileDownloadingInNewWindow(),e._abortSwitchingToChildWindowIfItClosed(),e._stopInternal(),e.activeChildWindowDriverLink.setAsMaster(n)}).then(function(){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(t){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1),t instanceof dr?e._onReady(new Ss):e._onReady(new Ss({isCommandResult:!0,executionError:new Bn}))})},Ou.prototype._switchToTopParentWindow=function(){var t=this.parentWindowDriverLink.setTopOpenedWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(t)},Ou.prototype._switchToParentWindow=function(t){void 0===t&&(t={});var e=this.parentWindowDriverLink.setParentWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(e,t)},Ou.prototype._switchToParentWindowInternal=function(t,e){var n=this;return void 0===e&&(e={}),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0),du.resolve().then(function(){return n._stopInternal(),t(e)}).then(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1),n._onReady(new Ss({isCommandResult:!0,executionError:new Bn}))})},Ou.prototype._switchToMainWindow=function(t){this.activeChildIframeDriverLink&&this.activeChildIframeDriverLink.executeCommand(t),this._clearActiveChildIframeInfo()},Ou.prototype._clearActiveChildIframeInfo=function(){this.contextStorage.setItem(Su,null),this.activeChildIframeDriverLink=null},Ou.prototype._setNativeDialogHandlerInIframes=function(t){for(var e=new zo(t),n=0;n<this.childIframeDriverLinks.length;n++)hu.sendServiceMsg(e,this.childIframeDriverLinks[n].driverWindow)},Ou.prototype._onActionCommand=function(t){var o=this,e=new da(t,this.selectorTimeout,this.speed,function(t,e,n){var r=oa(e.notFound),i=oa(e.invisible);return new wa(t,o.selectorTimeout,n,r,i).getResult()});e.on(da.EXECUTION_STARTED_EVENT,function(){o.statusBar.hideWaitingElementStatus(!0),o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!0)}),e.on(da.WAITING_FOR_ELEMENT_EVENT,function(t){o.statusBar.showWaitingElementStatus(t)});var n=new _.ClientRequestEmitter,r=new _.ScriptExecutionEmitter,i=new ru(n,r,_.pageUnloadBarrier);e.execute(i).then(function(t){return new Ss({isCommandResult:!0,result:Or(new $l).encode(t)})}).catch(function(t){return o.statusBar.hideWaitingElementStatus(!1).then(function(){return new Ss({isCommandResult:!0,executionError:t})})}).then(function(t){return o._waitForSkipJsErrorFunctionCompletion(t)}).then(function(t){o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!1),o.contextStorage.setItem(Eu,!1),o._onReady(t)})},Ou.prototype._onSetNativeDialogHandlerCommand=function(t){this.nativeDialogsTracker.setHandler(t.dialogHandler),this._setNativeDialogHandlerInIframes(t.dialogHandler),this._onReady(new Ss({isCommandResult:!0}))},Ou.prototype._onGetNativeDialogHistoryCommand=function(){this._onReady(new Ss({isCommandResult:!0,result:this.nativeDialogsTracker.appearedDialogs}))},Ou.prototype._onGetBrowserConsoleMessagesCommand=function(){this._onReady(new Ss({isCommandResult:!0}))},Ou.prototype._onNavigateToCommand=function(t){var e=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),function(i){return l(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new _.ClientRequestEmitter,n=new _.RequestBarrier(e),c.navigateTo(i.url,i.forceReload),[4,c.Promise.all([n.wait(),_.pageUnloadBarrier.wait()])];case 1:return t.sent(),[2,new Ss({isCommandResult:!0})];case 2:return r=t.sent(),[2,new Ss({isCommandResult:!0,executionError:r})];case 3:return[2]}})})}(t).then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},Ou.prototype._onGetProxyUrlCommand=function(t){this._onReady(new Ss({isCommandResult:!0,result:wu.getProxyUrl(t.url,t.options)}))},Ou.prototype._onSkipJsErrorsCommand=function(t){var e=t.options;this.skipJsErrors=e,this._onReady(new Ss({isCommandResult:!0}))},Ou.prototype._onExecuteClientFunctionCommand=function(t){var e=this;this.contextStorage.setItem(_u,{instantiationCallsiteName:t.instantiationCallsiteName}),Vl(new ki(t)).then(function(t){e.contextStorage.setItem(_u,null),e._onReady(t)})},Ou.prototype._onExecuteSelectorCommand=function(t){var e,n,r,i,o,s,a,l=this,u=this.contextStorage.getItem(Cu)||new mu,c=oa("CannotObtainInfoForElementSpecifiedBySelectorError"),d=t.strictError?oa(ia()):c,h=t.strictError?oa(ra()):c;e=t,n=this.selectorTimeout,r=u,i=t.needError?d:null,o=t.needError?h:null,s=this.statusBar,a=new wa(e,n,r,i,o),s.showWaitingElementStatus(a.timeout),Vl(a).then(function(t){return s.hideWaitingElementStatus(!!t.result).then(function(){return t})}).then(function(t){l.contextStorage.setItem(Cu,null),l._onReady(t)})},Ou.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t),this._onReady(new Ss({isCommandResult:!0}))},Ou.prototype._onSwitchToIframeCommand=function(t){var e=this;this._switchToIframe(t.selector,Nu).then(function(){return e._onReady(new Ss({isCommandResult:!0}))}).catch(function(t){return e._onReady(new Ss({isCommandResult:!0,executionError:t}))})},Ou.prototype._onWindowOpenCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!0),nc.open(t.url)},Ou.prototype._onWindowCloseCommand=function(a){return l(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:e=this._getTopOpenedWindow(),n=a.windowId||this.windowId,r=n===this.windowId,t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this._validateChildWindowCloseCommandExists(n,e)];case 2:if(i=t.sent(),!(o=i.result).success)throw Ou._createWindowValidationError(o);return[4,Ws(new No({windowId:n,isCurrentWindow:r}),e,Ts,Bn)];case 3:return t.sent(),r||this._onReady(new Ss({isCommandResult:!0})),[3,5];case 4:return s=t.sent(),this._onReady(new Ss({isCommandResult:!0,executionError:s})),[3,5];case 5:return[2]}})})},Ou.prototype._onGetCurrentWindowCommand=function(){this._onReady(new Ss({isCommandResult:!0,result:{id:this.windowId}}))},Ou.prototype._onGetWindowsCommand=function(){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,Ws(new To,e,Ts,Bn)];case 1:return n=t.sent(),this._onReady(new Ss({isCommandResult:!0,result:n.result})),[2]}})})},Ou.prototype._validateChildWindowCloseCommandExists=function(t,e){return Ws(new Eo({windowId:t}),e,Ts,Bn)},Ou.prototype._validateChildWindowSwitchToWindowCommandExists=function(t,e){var n=t.windowId,r=t.fn;return Ws(new So({windowId:n,fn:r}),e,Ts,Bn)},Ou.prototype._getTopOpenedWindow=function(){var t;return((null===(t=this.parentWindowDriverLink)||void 0===t?void 0:t.getTopOpenedWindow())||nc).top},Ou.prototype._onSwitchToWindow=function(i,o){return l(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,this._validateChildWindowSwitchToWindowCommandExists({windowId:i.windowId,fn:i.checkWindow},e)];case 1:return n=t.sent(),(r=n.result).success?(this._stopInternal(),Ws(new Po({windowId:i.windowId,fn:i.checkWindow}),e,Ts,Bn)):this._onReady(new Ss({isCommandResult:!0,executionError:o||Ou._createWindowValidationError(r)})),[2]}})})},Ou.prototype._restoreChildWindowLinks=function(){return l(this,void 0,void 0,function(){var e,n=this;return C(this,function(t){switch(t.label){case 0:if(!this.contextStorage.getItem(xu))return[2];e=new du(function(t){n._restoreChildWindowsPromiseResolver=t}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,_.getTimeLimitedPromise(e,3e4)];case 2:return t.sent(),[3,4];case 3:return t.sent(),this._onReady(new Ss({isCommandResult:!0,executionError:new pr})),[3,4];case 4:return[2]}})})},Ou.prototype._onSwitchToPreviousWindow=function(t){this._onSwitchToWindow(t,new lr)},Ou.prototype._onSwitchToParentWindow=function(){this.parentWindowDriverLink?this._switchToParentWindow({finalizePendingCommand:!0}):this._onReady(new Ss({isCommandResult:!0,executionError:new or}))},Ou.prototype._onBrowserManipulationCommand=function(t){var e,n,r,i=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),e=t,n=this.selectorTimeout,r=this.statusBar,new Bl(e,n,r).execute().then(function(t){return i.contextStorage.setItem(i.COMMAND_EXECUTING_FLAG,!1),i._onReady(t)})},Ou.prototype._onSetBreakpointCommand=function(t){var n=this,e=t.isTestError,r=t.inCompilerService,i=this.statusBar.showDebuggingStatus(e);r?(i.then(function(t){n.debug=t}),this._onReady(new Ss({isCommandResult:!0,result:!0}))):i.then(function(t){var e=t===Et;n._onReady(new Ss({isCommandResult:!0,result:e}))})},Ou.prototype._onDisableDebugCommand=function(){this.statusBar._resetState(),this._onReady(new Ss({isCommandResult:!0}))},Ou.prototype._onSetTestSpeedCommand=function(t){this.speed=t.speed,this._onReady(new Ss({isCommandResult:!0}))},Ou.prototype._onShowAssertionRetriesStatusCommand=function(t){this.contextStorage.setItem(Wu,t.timeout),this.contextStorage.setItem(Tu,pu.dateNow()),this.statusBar.showWaitingAssertionRetriesStatus(t.timeout),this._onReady(new Ss({isCommandResult:!0}))},Ou.prototype._onHideAssertionRetriesStatusCommand=function(t){var e=this;this.contextStorage.setItem(Wu,null),this.contextStorage.setItem(Tu,null),this.statusBar.hideWaitingAssertionRetriesStatus(t.success).then(function(){return e._onReady(new Ss({isCommandResult:!0}))})},Ou.prototype._checkStatus=function(){var r=this,t={statusUrl:this.browserStatusDoneUrl,idlePageUrl:this.browserIdleUrl};return _.browser.checkStatus(t,s.createNativeXHR,{manualRedirect:!0,proxyless:this.proxyless}).then(function(t){var e=t.command,n=t.redirecting;n&&e.url.indexOf(r.testRunId)<0?(fu.clear(),fu.lock()):r.contextStorage.setItem(vu,!1),n?_.browser.redirect(e):r._onReady({isCommandResult:!1})}).catch(function(){return _.delay(1e3)})},Ou.prototype._onCustomCommand=function(t){var e=this;(0,this.customCommandHandlers[t.type].handler)(t).then(function(t){e._onReady(new Ss({isCommandResult:!0,result:t}))})},Ou.prototype._closeAllChildWindows=function(){var t=this;return this.childWindowDriverLinks.length?du.all(this.childWindowDriverLinks.map(function(t){return t.closeAllChildWindows()})).then(function(){pu.arrayForEach.call(t.childWindowDriverLinks,function(t){t.driverWindow.close()})}):du.resolve()},Ou.prototype._onTestDone=function(t){var e=this;this.contextStorage.setItem(vu,!0),this.parentWindowDriverLink?this._switchToTopParentWindow():this._closeAllChildWindows().then(function(){return e._sendStatus(t)}).then(function(){e._checkStatus()}).catch(function(){e._onReady(new Ss({isCommandResult:!0,executionError:qn}))})},Ou.prototype._onBackupStoragesCommand=function(){this._onReady(new Ss({isCommandResult:!0,result:fu.backup()}))},Ou.prototype._isPendingSwitchingWindow=function(){return!!this.contextStorage.getItem(this.PENDING_WINDOW_SWITCHING_FLAG)},Ou.prototype._onPrepareClientEnvironmentInDebugMode=function(t){pu.objectDefineProperty(nc,t.esmRuntime,{value:{g:nc,c:nc.eval},configurable:!0}),this._onReady(new Ss({isCommandResult:!0,result:!0}))},Ou.prototype._isStatusWithCommandResultInPendingWindowSwitchingMode=function(t){return t.isCommandResult&&this._isPendingSwitchingWindow()},Ou.prototype._isEmptyCommandInPendingWindowSwitchingMode=function(t){return!t&&this._isPendingSwitchingWindow()},Ou.prototype._observeFileDownloadingInNewWindow=function(){var e=this,t=new Ss({isObservingFileDownloadingInNewWindow:!0});this._isPendingSwitchingWindow()&&this._sendStatus(t).then(function(t){t?e._onCommand(t):e._observeFileDownloadingInNewWindow()})},Ou.prototype._onReady=function(t){var e=this;this.debug&&(t.debug=this.debug,this.debug=null),this._isStatusWithCommandResultInPendingWindowSwitchingMode(t)&&this.emit(Pu),this._sendStatus(t).then(function(t){if(t)e._onCommand(t);else{if(e._isEmptyCommandInPendingWindowSwitchingMode(t))return void e.emit(Mu);e._onReady(new Ss)}})},Ou.prototype._executeCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!1),this.customCommandHandlers[t.type]?this._onCustomCommand(t):t.type===d.testDone?this._onTestDone(new Ss({isCommandResult:!0})):t.type===d.setBreakpoint?this._onSetBreakpointCommand(t):t.type===d.disableDebug?this._onDisableDebugCommand():t.type===d.switchToMainWindow?this._onSwitchToMainWindowCommand(t):t.type===d.switchToIframe?this._onSwitchToIframeCommand(t):t.type===d.openWindow?this._onWindowOpenCommand(t):t.type===d.closeWindow?this._onWindowCloseCommand(t):t.type===d.getCurrentWindow?this._onGetCurrentWindowCommand(t):t.type===d.getCurrentWindows?this._onGetWindowsCommand():t.type===d.switchToWindow?this._onSwitchToWindow(t):t.type===d.switchToPreviousWindow?this._onSwitchToPreviousWindow(t):t.type===d.switchToParentWindow?this._onSwitchToParentWindow():vt(t)?this._onBrowserManipulationCommand(t):t.type===d.executeClientFunction?this._onExecuteClientFunctionCommand(t):t.type===d.executeSelector?this._onExecuteSelectorCommand(t):t.type===d.navigateTo?this._onNavigateToCommand(t):t.type===d.setNativeDialogHandler?this._onSetNativeDialogHandlerCommand(t):t.type===d.getNativeDialogHistory?this._onGetNativeDialogHistoryCommand(t):t.type===d.getBrowserConsoleMessages?this._onGetBrowserConsoleMessagesCommand(t):t.type===d.setTestSpeed?this._onSetTestSpeedCommand(t):t.type===d.showAssertionRetriesStatus?this._onShowAssertionRetriesStatusCommand(t):t.type===d.hideAssertionRetriesStatus?this._onHideAssertionRetriesStatusCommand(t):t.type===d.backupStorages?this._onBackupStoragesCommand():t.type===d.closeChildWindowOnFileDownloading?this._closeChildWindowOnFileDownloading():t.type===d.prepareClientEnvironmentInDebugMode?this._onPrepareClientEnvironmentInDebugMode(t):t.type===d.getProxyUrl?this._onGetProxyUrlCommand(t):t.type===d.skipJsErrors?this._onSkipJsErrorsCommand(t):this._onActionCommand(t)},Ou.prototype._closeChildWindowOnFileDownloading=function(){this.activeChildWindowDriverLink.closeFileDownloadingWindow(),_.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),E.cursor.show(),this._startInternal()},Ou.prototype._isExecutableInTopWindowOnly=function(t){if((e=t).type===d.testDone||e.type===d.switchToMainWindow||e.type===d.setNativeDialogHandler||e.type===d.getNativeDialogHistory||e.type===d.setTestSpeed||e.type===d.showAssertionRetriesStatus||e.type===d.hideAssertionRetriesStatus||e.type===d.setBreakpoint||vt(e)&&e.type!==d.takeElementScreenshot)return!0;var e,n=this.customCommandHandlers[t.type];return t.forceExecutionInTopWindowOnly||n&&n.isExecutableInTopWindowOnly},Ou.prototype._onCommand=function(n){var r=this;this.readyPromise.then(function(){var t,e=mt(n);r.contextStorage.getItem(Iu)&&e?r._onReady(new Ss({isCommandResult:!0})):(t=r.activeChildIframeDriverLink||r.contextStorage.getItem(Su),r._isExecutableInTopWindowOnly(n)||!t?r._executeCommand(n):r._runInActiveIframe(n))})},Ou.prototype.setCustomCommandHandlers=function(t,e,n){this.customCommandHandlers[t]={isExecutableInTopWindowOnly:n,handler:e}},Ou.prototype._startInternal=function(t){this.role=Jl,_.browser.startHeartbeat(this.heartbeatUrl,s.createNativeXHR),this._setupAssertionRetryIndication(),this._startCommandsProcessing(t)},Ou.prototype._stopInternal=function(){this.role=Kl,_.browser.stopHeartbeat(),E.cursor.hide()},Ou.prototype._setupAssertionRetryIndication=function(){var n=this;this.readyPromise.then(function(){n.statusBar.hidePageLoadingStatus();var t,e=n.contextStorage.getItem(Wu);e&&(t=n.contextStorage.getItem(Tu),0<e-(new mu-t)&&n.statusBar.showWaitingAssertionRetriesStatus(e,t))})},Ou.prototype._startCommandsProcessing=function(t){void 0===t&&(t={finalizePendingCommand:!1,isFirstRequestAfterWindowSwitching:!1,result:void 0});var e,n,r=this.contextStorage.getItem(yu);r&&(r.resent=!0),this.contextStorage.getItem(vu)?r?this._onTestDone(r):this._checkStatus():this._failIfClientCodeExecutionIsInterrupted()||(e=t.finalizePendingCommand||this._hasPendingActionFlags(this.contextStorage),n=r||new Ss({isCommandResult:e,isFirstRequestAfterWindowSwitching:t.isFirstRequestAfterWindowSwitching,result:t.result}),this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!1),this._onReady(n))},Ou.prototype._initParentWindowLink=function(){nc.opener&&nc.opener!==nc&&this.windowId&&(this.parentWindowDriverLink=new Xl(nc))},Ou.prototype._initConsoleMessages=function(){var t=this.consoleMessages;t.ensureMessageContainer(this.windowId),this.consoleMessages=t},Ou.prototype._getDriverRole=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return this.windowId?[4,_.browser.getActiveWindowId(this.browserActiveWindowId,s.createNativeXHR)]:[2,Jl];case 1:return[2,t.sent().activeWindowId===this.windowId?Jl:Kl]}})})},Ou.prototype._init=function(){this.contextStorage=new ys(nc,this.testRunId,this.windowId),this.nativeDialogsTracker=new Yi(this.contextStorage,this.dialogHandler),this.statusBar=new n.StatusBar(this.userAgent,this.fixtureName,this.testName,this.contextStorage),this.statusBar.on(this.statusBar.UNLOCK_PAGE_BTN_CLICK,_.disableRealEventsPreventing),this.speed=this.initialSpeed,this._initConsoleMessages(),this._initParentWindowLink(),this._isOpenedInIframe()&&Ws(new ss(this.windowId),nc.opener.top,Ts,nr)},Ou.prototype._doFirstPageLoadSetup=function(){return l(this,void 0,void 0,function(){return C(this,function(t){return this.isFirstPageLoad&&this.canUseDefaultWindowActions,[2]})})},Ou.prototype.start=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return this._init(),[4,this._doFirstPageLoadSetup()];case 1:return t.sent(),[4,this._restoreChildWindowLinks()];case 2:return t.sent(),[4,this._getDriverRole()];case 3:return e=t.sent(),this.role===Jl||e===Jl&&this._startInternal(),[2]}})})},Ou);function Ou(t,e,n,r){var i=lu.call(this)||this;i.COMMAND_EXECUTING_FLAG="testcafe|driver|command-executing-flag",i.EXECUTING_IN_IFRAME_FLAG="testcafe|driver|executing-in-iframe-flag",i.PENDING_WINDOW_SWITCHING_FLAG="testcafe|driver|pending-window-switching-flag",i.WINDOW_COMMAND_API_CALL_FLAG="testcafe|driver|window-command-api-flag",i.testRunId=t,i.heartbeatUrl=e.heartbeat,i.browserStatusUrl=e.status,i.browserStatusDoneUrl=e.statusDone,i.browserIdleUrl=e.idle,i.browserActiveWindowId=e.activeWindowId,i.browserCloseWindowUrl=e.closeWindow,i.userAgent=n.userAgent,i.fixtureName=n.fixtureName,i.testName=n.testName,i.selectorTimeout=r.selectorTimeout,i.pageLoadTimeout=r.pageLoadTimeout,i.childWindowReadyTimeout=r.childWindowReadyTimeout,i.initialSpeed=r.speed,i.skipJsErrors=r.skipJsErrors,i.dialogHandler=r.dialogHandler,i.canUseDefaultWindowActions=r.canUseDefaultWindowActions,i.proxyless=r.proxyless,i.isFirstPageLoad=uu.get().isFirstPageLoad,i.customCommandHandlers={},i.contextStorage=null,i.nativeDialogsTracker=null,i.childIframeDriverLinks=[],i.activeChildIframeDriverLink=null,i.childWindowDriverLinks=[],i.parentWindowDriverLink=null,i.statusBar=null,i.windowId=i._getCurrentWindowId(),i.role=Kl,i.setAsMasterInProgress=!1,i.checkClosedChildWindowIntervalId=null;var o=new _.ClientRequestEmitter;return i.pageInitialRequestBarrier=new _.RequestBarrier(o),i.readyPromise=i._getReadyPromise(),i._initChildDriverListening(),_.pageUnloadBarrier.init(),_.preventRealEvents(),s.on(s.EVENTS.uncaughtJsError,function(t){return i._onJsError(t)}),s.on(s.EVENTS.unhandledRejection,function(t){return i._onJsError(t)}),s.on(s.EVENTS.consoleMethCalled,function(t){return i._onConsoleMessage(t)}),s.on(s.EVENTS.beforeFormSubmit,function(t){return i._onFormSubmit(t)}),s.on(s.EVENTS.windowOpened,function(t){return i._onChildWindowOpened(t)}),i.setCustomCommandHandlers(d.unlockPage,function(){return i._unlockPageAfterTestIsDone()}),i.setCustomCommandHandlers(d.getActiveElement,function(){return i._getActiveElement()}),gu.addInternalEventBeforeListener(nc,["beforeunload"],function(){i._sendStartToRestoreCommand()}),i.replicator=Or([new Xs]),i}var Uu=(Hu.prototype.establishConnection=function(){return Ws(new vo,this.driverWindow,5e3,Dn).then(function(t){return t.result.id})},Hu.prototype.sendConfirmationMessage=function(t){As({requestMsgId:t,window:this.driverWindow})},Hu.prototype.onCommandExecuted=function(t){var e=new ko(t);c.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},Hu.prototype.hasPendingActionFlags=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,Ws(new ms,this.driverWindow,5e3,Dn)];case 1:return[2,t.sent().result]}})})},Hu);function Hu(t){this.driverWindow=t}var Bu,Gu=s.eventSandbox.message,Vu=(t(qu,Bu=Yi),qu.prototype._defaultDialogHandler=function(t){Gu.sendServiceMsg({type:Ui,dialogType:t,url:Yi._getPageUrl()},nc.top)},qu.prototype._addAppearedDialogs=function(t,e){Gu.sendServiceMsg({type:Oi,dialogType:t,text:e,url:Yi._getPageUrl()},nc.top)},qu.prototype._onHandlerError=function(t,e){Gu.sendServiceMsg({type:Hi,dialogType:t,message:e,url:Yi._getPageUrl()},nc.top)},qu);function qu(t){return Bu.call(this,null,t)||this}var zu,ju=c.eventSandbox.message,Xu=(t(Yu,zu=Lu),Yu.prototype._onJsError=function(){},Yu.prototype._onConsoleMessage=function(){},Yu.prototype._onChildWindowOpened=function(){ju.sendServiceMsg(new us,nc.top)},Yu.prototype._stopInternal=function(){ju.sendServiceMsg(new hs,nc.top)},Yu.prototype._initParentDriverListening=function(){var n=this;c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;_.pageUnloadBarrier.wait(0).then(function(){if(e.type===so){if(n.lastParentDriverMessageId===e.id)return;n.lastParentDriverMessageId=e.id,n.readyPromise.then(function(){n.speed=e.testSpeed,n.parentDriverLink.sendConfirmationMessage(e.id),n._onCommand(e.command)})}e.type===lo&&(n.nativeDialogsTracker.setHandler(e.dialogHandler),n._setNativeDialogHandlerInIframes(e.dialogHandler))})})},Yu.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t)},Yu.prototype._onReady=function(t){this.parentDriverLink.onCommandExecuted(t)},Yu.prototype._isInCommandExecution=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return c.utils.dom.isCrossDomainWindows(nc,nc.parent)?[4,this.parentDriverLink.hasPendingActionFlags()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,this._hasPendingActionFlags(this.contextStorage)]}})})},Yu.prototype._init=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this.parentDriverLink.establishConnection()];case 1:return e=t.sent(),this.contextStorage=new ys(nc,e,this.windowId),this._failIfClientCodeExecutionIsInterrupted()?[2]:[4,this._isInCommandExecution()];case 2:return t.sent()&&(this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._onReady(new Ss({isCommandResult:!0}))),[2]}})})},Yu.prototype.start=function(){this.nativeDialogsTracker=new Vu(this.dialogHandler),this.statusBar=new n.IframeStatusBar;var t=this._init();this.readyPromise=c.Promise.all([this.readyPromise,t])},Yu);function Yu(t,e){var n=zu.call(this,t,{},{},e)||this;return n.lastParentDriverMessageId=null,n.parentDriverLink=new Uu(nc.parent),n._initParentDriverListening(),n}var Ju={NodeSnapshot:Os,ElementSnapshot:zs,SelectorExecutor:wa},Ku="%testCafeDriver%",$u="%testCafeIframeDriver%",Qu="%testCafeEmbeddingUtils%",Zu=s.nativeMethods,tc=s.EVENTS.evalIframeScript;Zu.objectDefineProperty(nc,Ku,{configurable:!0,value:Lu}),Zu.objectDefineProperty(nc,$u,{configurable:!0,value:Xu}),Zu.objectDefineProperty(nc,Qu,{configurable:!0,value:Ju}),s.on(tc,function(t){return ec(Zu.contentWindowGetter.call(t.iframe))})}(nc["%hammerhead%"],nc["%hammerhead%"].Promise,nc["%testCafeCore%"],nc["%testCafeAutomation%"],nc["%testCafeUI%"])}(window);
@@ -8,7 +8,7 @@ const generate_id_1 = __importDefault(require("./generate-id"));
8
8
  class DriverStatus extends assignable_1.default {
9
9
  constructor(obj) {
10
10
  super(obj);
11
- this.id = generate_id_1.default();
11
+ this.id = (0, generate_id_1.default)();
12
12
  this.isCommandResult = false;
13
13
  this.executionError = null;
14
14
  this.pageError = null;
@@ -35,4 +35,4 @@ class DriverStatus extends assignable_1.default {
35
35
  }
36
36
  }
37
37
  exports.default = DriverStatus;
38
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdHVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC9kcml2ZXIvc3RhdHVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsd0VBQWdEO0FBQ2hELGdFQUF1QztBQUd2QyxNQUFxQixZQUFhLFNBQVEsb0JBQVU7SUFDaEQsWUFBYSxHQUFHO1FBQ1osS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBRVgsSUFBSSxDQUFDLEVBQUUsR0FBc0MscUJBQVUsRUFBRSxDQUFDO1FBQzFELElBQUksQ0FBQyxlQUFlLEdBQXlCLEtBQUssQ0FBQztRQUNuRCxJQUFJLENBQUMsY0FBYyxHQUEwQixJQUFJLENBQUM7UUFDbEQsSUFBSSxDQUFDLFNBQVMsR0FBK0IsSUFBSSxDQUFDO1FBQ2xELElBQUksQ0FBQyxNQUFNLEdBQWtDLEtBQUssQ0FBQztRQUNuRCxJQUFJLENBQUMsTUFBTSxHQUFrQyxJQUFJLENBQUM7UUFDbEQsSUFBSSxDQUFDLGVBQWUsR0FBeUIsSUFBSSxDQUFDO1FBQ2xELElBQUksQ0FBQyx3QkFBd0IsR0FBZ0IsS0FBSyxDQUFDO1FBQ25ELElBQUksQ0FBQyxxQ0FBcUMsR0FBRyxLQUFLLENBQUM7UUFDbkQsSUFBSSxDQUFDLGtDQUFrQyxHQUFNLEtBQUssQ0FBQztRQUNuRCxJQUFJLENBQUMsS0FBSyxHQUFtQyxFQUFFLENBQUM7UUFFaEQsSUFBSSxDQUFDLFdBQVcsQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUM7SUFDaEMsQ0FBQztJQUVELHdCQUF3QjtRQUNwQixPQUFPO1lBQ0gsRUFBRSxJQUFJLEVBQUUsaUJBQWlCLEVBQUU7WUFDM0IsRUFBRSxJQUFJLEVBQUUsZ0JBQWdCLEVBQUU7WUFDMUIsRUFBRSxJQUFJLEVBQUUsV0FBVyxFQUFFO1lBQ3JCLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRTtZQUNsQixFQUFFLElBQUksRUFBRSxpQkFBaUIsRUFBRTtZQUMzQixFQUFFLElBQUksRUFBRSwwQkFBMEIsRUFBRTtZQUNwQyxFQUFFLElBQUksRUFBRSx1Q0FBdUMsRUFBRTtZQUNqRCxFQUFFLElBQUksRUFBRSxvQ0FBb0MsRUFBRTtTQUNqRCxDQUFDO0lBQ04sQ0FBQztDQUNKO0FBL0JELCtCQStCQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBBc3NpZ25hYmxlIGZyb20gJy4uLy4uL3V0aWxzL2Fzc2lnbmFibGUnO1xuaW1wb3J0IGdlbmVyYXRlSWQgZnJvbSAnLi9nZW5lcmF0ZS1pZCc7XG5cblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgRHJpdmVyU3RhdHVzIGV4dGVuZHMgQXNzaWduYWJsZSB7XG4gICAgY29uc3RydWN0b3IgKG9iaikge1xuICAgICAgICBzdXBlcihvYmopO1xuXG4gICAgICAgIHRoaXMuaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGdlbmVyYXRlSWQoKTtcbiAgICAgICAgdGhpcy5pc0NvbW1hbmRSZXN1bHQgICAgICAgICAgICAgICAgICAgICAgID0gZmFsc2U7XG4gICAgICAgIHRoaXMuZXhlY3V0aW9uRXJyb3IgICAgICAgICAgICAgICAgICAgICAgICA9IG51bGw7XG4gICAgICAgIHRoaXMucGFnZUVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IG51bGw7XG4gICAgICAgIHRoaXMucmVzZW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IGZhbHNlO1xuICAgICAgICB0aGlzLnJlc3VsdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBudWxsO1xuICAgICAgICB0aGlzLmNvbnNvbGVNZXNzYWdlcyAgICAgICAgICAgICAgICAgICAgICAgPSBudWxsO1xuICAgICAgICB0aGlzLmlzUGVuZGluZ1dpbmRvd1N3aXRjaGluZyAgICAgICAgICAgICAgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5pc09ic2VydmluZ0ZpbGVEb3dubG9hZGluZ0luTmV3V2luZG93ID0gZmFsc2U7XG4gICAgICAgIHRoaXMuaXNGaXJzdFJlcXVlc3RBZnRlcldpbmRvd1N3aXRjaGluZyAgICA9IGZhbHNlO1xuICAgICAgICB0aGlzLmRlYnVnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSAnJztcblxuICAgICAgICB0aGlzLl9hc3NpZ25Gcm9tKG9iaiwgdHJ1ZSk7XG4gICAgfVxuXG4gICAgX2dldEFzc2lnbmFibGVQcm9wZXJ0aWVzICgpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIHsgbmFtZTogJ2lzQ29tbWFuZFJlc3VsdCcgfSxcbiAgICAgICAgICAgIHsgbmFtZTogJ2V4ZWN1dGlvbkVycm9yJyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAncGFnZUVycm9yJyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAncmVzdWx0JyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAnY29uc29sZU1lc3NhZ2VzJyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAnaXNQZW5kaW5nV2luZG93U3dpdGNoaW5nJyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAnaXNPYnNlcnZpbmdGaWxlRG93bmxvYWRpbmdJbk5ld1dpbmRvdycgfSxcbiAgICAgICAgICAgIHsgbmFtZTogJ2lzRmlyc3RSZXF1ZXN0QWZ0ZXJXaW5kb3dTd2l0Y2hpbmcnIH0sXG4gICAgICAgIF07XG4gICAgfVxufVxuIl19
38
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdHVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC9kcml2ZXIvc3RhdHVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsd0VBQWdEO0FBQ2hELGdFQUF1QztBQUd2QyxNQUFxQixZQUFhLFNBQVEsb0JBQVU7SUFDaEQsWUFBYSxHQUFHO1FBQ1osS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBRVgsSUFBSSxDQUFDLEVBQUUsR0FBc0MsSUFBQSxxQkFBVSxHQUFFLENBQUM7UUFDMUQsSUFBSSxDQUFDLGVBQWUsR0FBeUIsS0FBSyxDQUFDO1FBQ25ELElBQUksQ0FBQyxjQUFjLEdBQTBCLElBQUksQ0FBQztRQUNsRCxJQUFJLENBQUMsU0FBUyxHQUErQixJQUFJLENBQUM7UUFDbEQsSUFBSSxDQUFDLE1BQU0sR0FBa0MsS0FBSyxDQUFDO1FBQ25ELElBQUksQ0FBQyxNQUFNLEdBQWtDLElBQUksQ0FBQztRQUNsRCxJQUFJLENBQUMsZUFBZSxHQUF5QixJQUFJLENBQUM7UUFDbEQsSUFBSSxDQUFDLHdCQUF3QixHQUFnQixLQUFLLENBQUM7UUFDbkQsSUFBSSxDQUFDLHFDQUFxQyxHQUFHLEtBQUssQ0FBQztRQUNuRCxJQUFJLENBQUMsa0NBQWtDLEdBQU0sS0FBSyxDQUFDO1FBQ25ELElBQUksQ0FBQyxLQUFLLEdBQW1DLEVBQUUsQ0FBQztRQUVoRCxJQUFJLENBQUMsV0FBVyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNoQyxDQUFDO0lBRUQsd0JBQXdCO1FBQ3BCLE9BQU87WUFDSCxFQUFFLElBQUksRUFBRSxpQkFBaUIsRUFBRTtZQUMzQixFQUFFLElBQUksRUFBRSxnQkFBZ0IsRUFBRTtZQUMxQixFQUFFLElBQUksRUFBRSxXQUFXLEVBQUU7WUFDckIsRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFO1lBQ2xCLEVBQUUsSUFBSSxFQUFFLGlCQUFpQixFQUFFO1lBQzNCLEVBQUUsSUFBSSxFQUFFLDBCQUEwQixFQUFFO1lBQ3BDLEVBQUUsSUFBSSxFQUFFLHVDQUF1QyxFQUFFO1lBQ2pELEVBQUUsSUFBSSxFQUFFLG9DQUFvQyxFQUFFO1NBQ2pELENBQUM7SUFDTixDQUFDO0NBQ0o7QUEvQkQsK0JBK0JDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEFzc2lnbmFibGUgZnJvbSAnLi4vLi4vdXRpbHMvYXNzaWduYWJsZSc7XG5pbXBvcnQgZ2VuZXJhdGVJZCBmcm9tICcuL2dlbmVyYXRlLWlkJztcblxuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBEcml2ZXJTdGF0dXMgZXh0ZW5kcyBBc3NpZ25hYmxlIHtcbiAgICBjb25zdHJ1Y3RvciAob2JqKSB7XG4gICAgICAgIHN1cGVyKG9iaik7XG5cbiAgICAgICAgdGhpcy5pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gZ2VuZXJhdGVJZCgpO1xuICAgICAgICB0aGlzLmlzQ29tbWFuZFJlc3VsdCAgICAgICAgICAgICAgICAgICAgICAgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5leGVjdXRpb25FcnJvciAgICAgICAgICAgICAgICAgICAgICAgID0gbnVsbDtcbiAgICAgICAgdGhpcy5wYWdlRXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gbnVsbDtcbiAgICAgICAgdGhpcy5yZXNlbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gZmFsc2U7XG4gICAgICAgIHRoaXMucmVzdWx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IG51bGw7XG4gICAgICAgIHRoaXMuY29uc29sZU1lc3NhZ2VzICAgICAgICAgICAgICAgICAgICAgICA9IG51bGw7XG4gICAgICAgIHRoaXMuaXNQZW5kaW5nV2luZG93U3dpdGNoaW5nICAgICAgICAgICAgICA9IGZhbHNlO1xuICAgICAgICB0aGlzLmlzT2JzZXJ2aW5nRmlsZURvd25sb2FkaW5nSW5OZXdXaW5kb3cgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5pc0ZpcnN0UmVxdWVzdEFmdGVyV2luZG93U3dpdGNoaW5nICAgID0gZmFsc2U7XG4gICAgICAgIHRoaXMuZGVidWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9ICcnO1xuXG4gICAgICAgIHRoaXMuX2Fzc2lnbkZyb20ob2JqLCB0cnVlKTtcbiAgICB9XG5cbiAgICBfZ2V0QXNzaWduYWJsZVByb3BlcnRpZXMgKCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgeyBuYW1lOiAnaXNDb21tYW5kUmVzdWx0JyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAnZXhlY3V0aW9uRXJyb3InIH0sXG4gICAgICAgICAgICB7IG5hbWU6ICdwYWdlRXJyb3InIH0sXG4gICAgICAgICAgICB7IG5hbWU6ICdyZXN1bHQnIH0sXG4gICAgICAgICAgICB7IG5hbWU6ICdjb25zb2xlTWVzc2FnZXMnIH0sXG4gICAgICAgICAgICB7IG5hbWU6ICdpc1BlbmRpbmdXaW5kb3dTd2l0Y2hpbmcnIH0sXG4gICAgICAgICAgICB7IG5hbWU6ICdpc09ic2VydmluZ0ZpbGVEb3dubG9hZGluZ0luTmV3V2luZG93JyB9LFxuICAgICAgICAgICAgeyBuYW1lOiAnaXNGaXJzdFJlcXVlc3RBZnRlcldpbmRvd1N3aXRjaGluZycgfSxcbiAgICAgICAgXTtcbiAgICB9XG59XG4iXX0=