testcafe 2.3.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/LICENSE +1 -1
  3. package/README.md +40 -46
  4. package/bin/testcafe-with-v8-flag-filter.js +2 -2
  5. package/lib/api/test-controller/execution-context.js +4 -2
  6. package/lib/api/test-controller/index.js +6 -1
  7. package/lib/api/test-run-tracker.js +1 -1
  8. package/lib/browser/connection/gateway/index.js +273 -0
  9. package/lib/browser/connection/gateway/status.js +10 -0
  10. package/lib/browser/connection/index.js +60 -47
  11. package/lib/browser/connection/service-routes.js +4 -2
  12. package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/index.js +3 -2
  13. package/lib/browser/provider/built-in/dedicated/chrome/index.js +48 -23
  14. package/lib/browser/provider/built-in/dedicated/edge/index.js +4 -1
  15. package/lib/browser/provider/index.js +13 -4
  16. package/lib/browser/provider/plugin-host.js +7 -1
  17. package/lib/cli/argument-parser/index.js +10 -14
  18. package/lib/cli/cli.js +3 -4
  19. package/lib/cli/remotes-wizard.js +2 -1
  20. package/lib/cli/utils/should-move-option-to-end.js +17 -0
  21. package/lib/client/automation/deps/hammerhead.js +24 -0
  22. package/lib/client/automation/deps/testcafe-core.js +24 -0
  23. package/lib/client/automation/index.js +528 -161
  24. package/lib/client/automation/index.min.js +1 -1
  25. package/lib/client/automation/playback/press/get-key-info.js +44 -0
  26. package/lib/client/automation/playback/press/utils.js +142 -0
  27. package/lib/client/automation/utils/get-key-code.js +15 -0
  28. package/lib/client/automation/utils/get-key-identifier.js +14 -0
  29. package/lib/client/automation/utils/is-letter.js +7 -0
  30. package/lib/client/automation/utils/key-identifier-maps.js +93 -0
  31. package/lib/client/browser/idle-page/index.html.mustache +2 -2
  32. package/lib/client/browser/idle-page/index.js +13 -8
  33. package/lib/client/core/index.js +58 -10
  34. package/lib/client/core/index.min.js +1 -1
  35. package/lib/client/core/utils/array.js +77 -0
  36. package/lib/client/core/utils/dom.js +459 -0
  37. package/lib/client/core/utils/send-request-to-frame.js +22 -0
  38. package/lib/client/core/utils/style.js +102 -0
  39. package/lib/client/core/utils/values/boundary-values.js +41 -0
  40. package/lib/client/driver/index.js +253 -224
  41. package/lib/client/driver/index.min.js +1 -1
  42. package/lib/client/test-run/iframe.js.mustache +6 -6
  43. package/lib/client/test-run/index.js.mustache +37 -33
  44. package/lib/client/ui/index.js +3238 -54
  45. package/lib/client/ui/index.min.js +1 -1
  46. package/lib/client/ui/sprite.svg +15 -0
  47. package/lib/client/ui/styles.css +184 -41
  48. package/lib/compiler/babel/load-libs.js +6 -6
  49. package/lib/compiler/compilers.js +7 -7
  50. package/lib/compiler/index.js +6 -6
  51. package/lib/compiler/interfaces.js +1 -1
  52. package/lib/compiler/test-file/api-based.js +5 -5
  53. package/lib/compiler/test-file/formats/es-next/compiler.js +5 -5
  54. package/lib/compiler/test-file/formats/typescript/compiler.js +9 -9
  55. package/lib/compiler/test-file/get-exportable-lib-path.js +3 -3
  56. package/lib/configuration/configuration-base.js +9 -6
  57. package/lib/configuration/default-values.js +3 -3
  58. package/lib/configuration/formats.js +9 -5
  59. package/lib/configuration/interfaces.js +1 -1
  60. package/lib/configuration/option-names.js +3 -3
  61. package/lib/configuration/run-option-names.js +2 -2
  62. package/lib/configuration/testcafe-configuration.js +41 -24
  63. package/lib/configuration/types.js +1 -1
  64. package/lib/configuration/utils.js +32 -0
  65. package/lib/custom-client-scripts/client-script.js +2 -2
  66. package/lib/custom-client-scripts/get-code.js +3 -3
  67. package/lib/custom-client-scripts/routing.js +10 -12
  68. package/lib/errors/runtime/templates.js +4 -2
  69. package/lib/errors/test-run/templates.js +4 -1
  70. package/lib/errors/types.js +4 -1
  71. package/lib/index.js +6 -29
  72. package/lib/live/test-runner.js +5 -3
  73. package/lib/native-automation/add-custom-debug-formatters.js +22 -0
  74. package/lib/native-automation/api-base.js +27 -0
  75. package/lib/native-automation/client/event-descriptor.js +112 -0
  76. package/lib/native-automation/client/input.js +50 -0
  77. package/lib/native-automation/client/key-press/utils.js +31 -0
  78. package/lib/native-automation/client/types.js +11 -0
  79. package/lib/native-automation/client/utils.js +54 -0
  80. package/lib/native-automation/cookie-provider.js +115 -0
  81. package/lib/native-automation/empty-page-markup.js +11 -0
  82. package/lib/native-automation/error-route.js +7 -0
  83. package/lib/native-automation/errors.js +20 -0
  84. package/lib/native-automation/index.js +53 -0
  85. package/lib/native-automation/request-hooks/event-factory/frame-navigated-event-based.js +40 -0
  86. package/lib/native-automation/request-hooks/event-factory/request-paused-event-based.js +94 -0
  87. package/lib/native-automation/request-hooks/event-provider.js +52 -0
  88. package/lib/native-automation/request-hooks/pipeline-context.js +11 -0
  89. package/lib/{proxyless → native-automation}/request-pipeline/constants.js +1 -1
  90. package/lib/native-automation/request-pipeline/context-info.js +55 -0
  91. package/lib/native-automation/request-pipeline/index.js +309 -0
  92. package/lib/native-automation/request-pipeline/resendAuthRequest.js +23 -0
  93. package/lib/native-automation/request-pipeline/safe-api.js +63 -0
  94. package/lib/native-automation/request-pipeline/special-handlers.js +73 -0
  95. package/lib/native-automation/request-pipeline/test-run-bridge.js +45 -0
  96. package/lib/native-automation/resource-injector.js +175 -0
  97. package/lib/native-automation/session-storage/index.js +43 -0
  98. package/lib/native-automation/storages-provider.js +17 -0
  99. package/lib/native-automation/types.js +12 -0
  100. package/lib/native-automation/utils/cdp.js +70 -0
  101. package/lib/native-automation/utils/convert.js +11 -0
  102. package/lib/native-automation/utils/get-active-client.js +8 -0
  103. package/lib/native-automation/utils/headers.js +30 -0
  104. package/lib/native-automation/utils/string.js +32 -0
  105. package/lib/reporter/index.js +52 -4
  106. package/lib/reporter/interfaces.js +1 -1
  107. package/lib/reporter/plugin-host.js +44 -4
  108. package/lib/reporter/plugin-methods.js +2 -1
  109. package/lib/reporter/report-data-log.js +25 -0
  110. package/lib/runner/bootstrapper.js +38 -6
  111. package/lib/runner/index.js +87 -47
  112. package/lib/runner/interfaces.js +1 -1
  113. package/lib/runner/task/index.js +1 -29
  114. package/lib/runner/test-run-controller.js +45 -1
  115. package/lib/services/compiler/host.js +3 -3
  116. package/lib/services/compiler/interfaces.js +1 -1
  117. package/lib/services/compiler/service.js +6 -5
  118. package/lib/services/compiler/test-run-proxy.js +3 -2
  119. package/lib/services/interfaces.js +1 -1
  120. package/lib/services/serialization/replicator/transforms/command-base-trasform/command-constructors.js +2 -1
  121. package/lib/shared/errors/index.js +8 -2
  122. package/lib/shared/utils/is-file-protocol.js +2 -2
  123. package/lib/test-run/commands/actions.js +16 -4
  124. package/lib/test-run/commands/type.js +2 -1
  125. package/lib/test-run/cookies/base.js +4 -1
  126. package/lib/test-run/cookies/factory.js +4 -4
  127. package/lib/test-run/cookies/provider.js +9 -2
  128. package/lib/test-run/execute-js-expression/index.js +4 -2
  129. package/lib/test-run/index.js +29 -22
  130. package/lib/test-run/request/create-request-options.js +37 -24
  131. package/lib/test-run/request/send.js +2 -3
  132. package/lib/test-run/role-provider.js +5 -5
  133. package/lib/test-run/session-controller.js +5 -5
  134. package/lib/test-run/storages/factory.js +4 -4
  135. package/lib/testcafe.js +17 -10
  136. package/lib/utils/check-is-vm.js +58 -0
  137. package/lib/utils/debug-loggers.js +7 -7
  138. package/lib/utils/get-browser.js +5 -2
  139. package/lib/utils/get-options/boolean-or-object-option.js +18 -0
  140. package/lib/utils/get-options/quarantine.js +10 -13
  141. package/lib/utils/get-options/skip-js-errors.js +12 -16
  142. package/lib/utils/parse-user-agent.js +4 -12
  143. package/lib/utils/string.js +1 -1
  144. package/package.json +13 -9
  145. package/ts-defs/index.d.ts +12 -2
  146. package/ts-defs/selectors.d.ts +8 -1
  147. package/ts-defs/testcafe-scripts.d.ts +8 -1
  148. package/lib/browser/connection/gateway.js +0 -205
  149. package/lib/proxyless/add-custom-debug-formatters.js +0 -22
  150. package/lib/proxyless/api-base.js +0 -25
  151. package/lib/proxyless/client/event-simulator.js +0 -40
  152. package/lib/proxyless/client/types.js +0 -11
  153. package/lib/proxyless/client/utils.js +0 -24
  154. package/lib/proxyless/cookie-provider.js +0 -87
  155. package/lib/proxyless/default-setup-options.js +0 -9
  156. package/lib/proxyless/empty-page-markup.js +0 -11
  157. package/lib/proxyless/error-route.js +0 -7
  158. package/lib/proxyless/index.js +0 -53
  159. package/lib/proxyless/request-hooks/event-factory/frame-navigated-event-based.js +0 -40
  160. package/lib/proxyless/request-hooks/event-factory/request-paused-event-based.js +0 -95
  161. package/lib/proxyless/request-hooks/event-provider.js +0 -52
  162. package/lib/proxyless/request-hooks/pipeline-context.js +0 -11
  163. package/lib/proxyless/request-pipeline/context-info.js +0 -55
  164. package/lib/proxyless/request-pipeline/index.js +0 -230
  165. package/lib/proxyless/request-pipeline/resendAuthRequest.js +0 -23
  166. package/lib/proxyless/request-pipeline/safe-api.js +0 -62
  167. package/lib/proxyless/request-pipeline/special-handlers.js +0 -73
  168. package/lib/proxyless/request-pipeline/test-run-bridge.js +0 -45
  169. package/lib/proxyless/resource-injector.js +0 -162
  170. package/lib/proxyless/session-storage/index.js +0 -39
  171. package/lib/proxyless/storages-provider.js +0 -17
  172. package/lib/proxyless/types.js +0 -10
  173. package/lib/proxyless/utils/cdp.js +0 -66
  174. package/lib/proxyless/utils/get-active-client.js +0 -8
  175. package/lib/proxyless/utils/headers.js +0 -30
  176. package/lib/proxyless/utils/string.js +0 -32
@@ -1 +1 @@
1
- window["%hammerhead%"].utils.removeInjectedScript(),function tf(ef){var nf=ef.document;!function(m,e,g,i){var h="default"in m?m.default:m;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var E="default"in g?g.default:g;i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var n=h.nativeMethods,o=/^((mouse\w+)|((dbl)?click)|(contextmenu))$/,r=/^((drag\w*)|(drop))$/,s=/^key\w+$/,l=/^(before)?input$/,a=/^(blur|(focus(in|out)?))$/,u=/^pointer\w+/,c={click:1,dblclick:2,mousedown:1,mouseup:1},f="MouseEvent",d="PointerEvent",p="KeyboardEvent",v="InputEvent",y="FocusEvent",t=(b.prototype.run=function(){var t=this.options,e=t.bubbles,n=t.cancelable,i=t.detail,o=(t.view,t.buttons),e=!1!==e,n=!1!==n,i=i||c[this.eventName],o=void 0===o?1:o;Object.assign(this.options,{bubbles:e,cancelable:n,detail:i,view:ef,buttons:o});var r,s=b._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},b._getEventCtorByEventType=function(t,e){if(e&&"function"==typeof b._getEventCtorFromWindow(e)){var n=b._getEventCtorFromNativeMethods(e);if(n&&"function"==typeof n)return n}return o.test(t)||r.test(t)?b._getEventCtorFromNativeMethods(f):u.test(t)?b._getEventCtorFromNativeMethods(d):s.test(t)?b._getEventCtorFromNativeMethods(p):l.test(t)?b._getEventCtorFromNativeMethods(v):a.test(t)?b._getEventCtorFromNativeMethods(y):b._getEventCtorFromNativeMethods("CustomEvent")},b._getEventCtorFromNativeMethods=function(t){return n["Window"+t]||b._getEventCtorFromWindow(t)},b._getEventCtorFromWindow=function(t){return ef[t]},b);function b(t,e,n){this.element=t,this.eventName=e,this.options=n}var S=function(t,e){return(S=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,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}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function w(t,s,l,a){return new(l=l||e)(function(n,e){function i(t){try{r(a.next(t))}catch(t){e(t)}}function o(t){try{r(a.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof l?e:new l(function(t){t(e)})).then(i,o)}r((a=a.apply(t,s||[])).next())})}function P(n,i){var o,r,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function t(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;a&&e[a=0]&&(l=0),l;)try{if(o=1,r&&(s=2&e[0]?r.return:e[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,e[1])).done)return s;switch(r=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,r=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){l.label=e[1];break}if(6===e[0]&&l.label<s[1]){l.label=s[1],s=e;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(e);break}s[2]&&l.ops.pop(),l.trys.pop();continue}e=i.call(n,l)}catch(t){e=[6,t],r=0}finally{o=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var x=(C.create=function(t){return"left"in t?new C(t.left,t.top):"right"in t?new C(t.right,t.bottom):new C(t.x,t.y)},C.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},C.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},C.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},C.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},C.prototype.mul=function(t){return this.x*=t,this.y*=t,this},C.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},C);function C(t,e){this.x=t,this.y=e}function A(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=m.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}A("filter"),A("map"),A("slice"),A("splice"),A("unshift"),A("forEach"),A("indexOf");var T=A("some"),M=(A("reverse"),A("reduce"),A("concat"),A("join"),h.utils.browser,h.nativeMethods),D=(h.utils.style.get,h.utils.dom.getActiveElement,h.utils.dom.findDocument),U=h.utils.dom.find,I=(h.utils.dom.isElementInDocument,h.utils.dom.isElementInIframe),O=h.utils.dom.getIframeByElement,k=(h.utils.dom.isCrossDomainWindows,h.utils.dom.getSelectParent,h.utils.dom.getChildVisibleIndex,h.utils.dom.getSelectVisibleChildren,h.utils.dom.isElementNode),N=(h.utils.dom.isTextNode,h.utils.dom.isRenderedNode,h.utils.dom.isIframeElement,h.utils.dom.isInputElement,h.utils.dom.isButtonElement,h.utils.dom.isFileInput,h.utils.dom.isTextAreaElement,h.utils.dom.isAnchorElement,h.utils.dom.isImgElement),B=(h.utils.dom.isFormElement,h.utils.dom.isLabelElement,h.utils.dom.isSelectElement,h.utils.dom.isRadioButtonElement,h.utils.dom.isColorInputElement,h.utils.dom.isCheckboxElement,h.utils.dom.isOptionElement,h.utils.dom.isSVGElement,h.utils.dom.isMapElement),F=h.utils.dom.isBodyElement,L=h.utils.dom.isHtmlElement,R=(h.utils.dom.isDocument,h.utils.dom.isWindow,h.utils.dom.isTextEditableInput,h.utils.dom.isTextEditableElement,h.utils.dom.isTextEditableElementAndEditingAllowed,h.utils.dom.isContentEditableElement,h.utils.dom.isDomElement,h.utils.dom.isShadowUIElement,h.utils.dom.isShadowRoot,h.utils.dom.isElementFocusable,h.utils.dom.isHammerheadAttr,h.utils.dom.isElementReadOnly,h.utils.dom.getScrollbarSize),V=h.utils.dom.getMapContainer,W=h.utils.dom.getTagName,Y=h.utils.dom.closest,K=h.utils.dom.getParents,X=h.utils.dom.findParent;function H(t,e){return t.contains?t.contains(e):T(t,function(t){return t.contains(e)})}function G(t){return M.nodeTextContentGetter.call(t)}h.utils.dom.getTopSameDomainWindow,h.utils.dom.getParentExceptShadowRoot;var q=(z.create=function(t){return new z(t.top,t.right,t.bottom,t.left)},z.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},z.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},z.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},z.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},z);function z(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.top=t,this.right=e,this.bottom=n,this.left=i}var j=h.utils.style,$=h.utils.style.getBordersWidth,Q=(h.utils.style.getComputedStyle,h.utils.style.getElementMargin,h.utils.style.getElementPadding),Z=h.utils.style.getElementScroll,J=(h.utils.style.getOptionHeight,h.utils.style.getSelectElementSize,h.utils.style.isElementVisible,h.utils.style.isVisibleChild,h.utils.style.getWidth),tt=h.utils.style.getHeight,et=h.utils.style.getInnerWidth,nt=h.utils.style.getInnerHeight,it=h.utils.style.getScrollLeft,ot=h.utils.style.getScrollTop,rt=h.utils.style.setScrollLeft,st=h.utils.style.setScrollTop,lt=h.utils.style.get;function at(t){return k(t)&&"fixed"===j.get(t,"position")}h.utils.style.getBordersWidthFloat,h.utils.style.getElementPaddingFloat,h.shadowUI,h.nativeMethods;var ut=function(t,e,n,i,o,r){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=i,this.scrollbar=r,this.scroll=o},ct={notElementOrTextNode:function(t){return"\n The ".concat(t," is neither a DOM element nor a text node.\n ")},elOutsideBounds:function(t,e){return"\n The ".concat(e," (").concat(t,") is located outside the the layout viewport.\n ")},elHasWidthOrHeightZero:function(t,e,n,i){return"\n The ".concat(e," (").concat(t,") is too small to be visible: ").concat(n,"px x ").concat(i,"px.\n ")},elHasDisplayNone:function(t,e){return"\n The ".concat(e," (").concat(t,") is invisible. \n The value of its 'display' property is 'none'.\n ")},parentHasDisplayNone:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible. \n It descends from an element that has the 'display: none' property (").concat(n,").\n ")},elHasVisibilityHidden:function(t,e){return"\n The ".concat(e," (").concat(t,") is invisible.\n The value of its 'visibility' property is 'hidden'.\n ")},parentHasVisibilityHidden:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible.\n It descends from an element that has the 'visibility: hidden' property (").concat(n,").\n ")},elHasVisibilityCollapse:function(t,e){return"\n The ".concat(e," (").concat(t,") is invisible.\n The value of its 'visibility' property is 'collapse'.\n ")},parentHasVisibilityCollapse:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible.\n It descends from an element that has the 'visibility: collapse' property (").concat(n,").\n ")},elNotRendered:function(t,e){return"\n The ".concat(e," (").concat(t,") has not been rendered.\n ")},optionNotVisible:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible. \n The parent element (").concat(n,") is collapsed, and its length is shorter than 2.\n ")},mapContainerNotVisible:function(t,e){return"\n The action target (".concat(t,") is invisible because ").concat(e,"\n ")}},ht=h.utils.html,ft=h.nativeMethods,dt=10;function mt(t){if(!t)return"";var e,n,i,o=ft.cloneNode.call(t),r=ht.cleanUpHtml(ft.elementOuterHTMLGetter.call(o)),s=(e=ft.nodeTextContentGetter.call(t),n=dt,void 0===i&&(i="..."),e.length<n?e:e.substring(0,n-i.length)+i),l=ft.elementChildrenGetter.call(t);return 0<ft.htmlCollectionLengthGetter.call(l)?r.replace("></",">...</"):s?r.replace("></",">".concat(s,"</")):r}var pt=h.utils.position.getElementRectangle,vt=h.utils.position.getOffsetPosition,gt=h.utils.position.offsetToClientCoords;function yt(t){var e,n,i,o,r=L(t),s=r?t.getElementsByTagName("body")[0]:null,l=t.getBoundingClientRect(),a=q.create($(t)),u=Z(t),c=I(t),h="BackCompat"===t.ownerDocument.compatMode,f=r?new x(0,0):x.create(l),d=l.height,m=l.width;r&&(m=s&&h?(d=s.clientHeight,s.clientWidth):(d=t.clientHeight,t.clientWidth)),!c||(e=O(t))&&(n=vt(e),i=gt(x.create(n)),o=$(e),f.add(i).add(x.create(o)),r&&a.add(o));var p=!r&&et(t)!==t.clientWidth,v=!r&&nt(t)!==t.clientHeight,g={right:p?R():0,bottom:v?R():0};return new ut(m,d,f,a,u,g)}function Et(t){var e=t.x,n=t.y,i=nf.getElementFromPoint||nf.elementFromPoint,o=null;try{o=i.call(nf,e,n)}catch(t){return null}for(null===o&&(o=i.call(nf,e-1,n-1));o&&o.shadowRoot&&o.shadowRoot.elementFromPoint;){var r=o.shadowRoot.elementFromPoint(e,n);if(!r||o===r)break;o=r}return o}function bt(t,e,n){var i=yt(t),o=Math.max(t.scrollWidth,i.width),r=Math.max(t.scrollHeight,i.height),s=i.scrollbar.right+i.border.left+i.border.right+o,l=i.scrollbar.bottom+i.border.top+i.border.bottom+r;return(void 0===e||0<=e&&e<=s)&&(void 0===n||0<=n&&n<=l)}function St(t){var e=vt(t),n=e.left,i=e.top,o=gt({x:n,y:i});return o.x=Math.round(o.x),o.y=Math.round(o.y),o}function _t(n,e){return m.Promise.resolve(n===nf.documentElement).then(function(t){if(t)return new x(0,0);var e=m.utils.browser.isFirefox?Math.ceil:Math.round;return m.Promise.resolve(vt(n,e)).then(function(t){return x.create(t)})}).then(function(t){return t.add(e)})}var wt=/auto|scroll|hidden/i,Pt="visible";function xt(t){var e,n=lt(t,"overflowX"),i=lt(t,"overflowY"),o=wt.test(n),r=wt.test(i),s=D(t).documentElement,l=t.scrollHeight;return(m.utils.browser.isChrome||m.utils.browser.isFirefox||m.utils.browser.isSafari)&&(e=t.getBoundingClientRect().top,l=l-s.getBoundingClientRect().top+e),(o||r)&&l>s.scrollHeight}function Ct(t){if(F(t))return xt(t);if(L(t))return function(t){var e=lt(t,"overflowX"),n=lt(t,"overflowY");if("hidden"===e&&"hidden"===n)return!1;var i=t.scrollHeight>t.clientHeight,o=t.scrollWidth>t.clientWidth;if(i||o)return!0;var r=t.getElementsByTagName("body")[0];if(!r)return!1;if(xt(r))return!1;var s=Math.min(t.clientWidth,r.clientWidth),l=Math.min(t.clientHeight,r.clientHeight);return r.scrollHeight>l||r.scrollWidth>s}(t);var e,n,i,o,r,s=(n=lt(e=t,"overflowX"),i=lt(e,"overflowY"),o=wt.test(n),r=wt.test(i),m.utils.browser.isIE&&(o=o||r&&n===Pt,r=r||o&&i===Pt),new x(o,r));if(!s.x&&!s.y)return!1;var l=s.y&&t.scrollHeight>t.clientHeight;return s.x&&t.scrollWidth>t.clientWidth||l}function At(i,o){return w(this,void 0,void 0,function(){var e,n;return P(this,function(t){switch(t.label){case 0:return[4,Z(i)];case 1:return e=t.sent(),n=Ct(i),!/html/i.test(i.tagName)&&n&&(o.x-=e.left,o.y-=e.top),[2,gt(o)]}})})}function Tt(t){if(!t)return null;var e,n,i=(e=ef.screenLeft||ef.screenX,n=ef.screenTop||ef.screenY,new x(e,n)),o=i.x,r=i.y,s=o+t.x,l=r+t.y;return new x(s,l)}function Mt(t){var e=t/2;return e<1?0:Math.round(e)}function Dt(t){var e=pt(t);return{offsetX:Mt(e.width),offsetY:Mt(e.height)}}function Ut(t,e,n){var i=Dt(t);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=yt(t),r=Math.round(Math.max(t.scrollWidth,o.width)),s=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:e<0?l+e:e,offsetY:n<0?a+n:n}}var It=E.positionUtils;function Ot(e,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var t=It.getElementFromPoint(e);return i.show(n).then(function(){return t})})}function kt(t,n){return m.Promise.resolve(Et(t)).then(function(e){return m.Promise.resolve(H(n,e)).then(function(t){return t&&G(e)}).then(function(t){return t||e&&e===n?e:null})})}function Nt(n,i){if(!i||!n||n===i)return n;if("tref"===W(i))return i;var e,o,t="area"===W(i)&&N(n);return m.utils.browser.isFirefox&&t?(e=n,o=i,m.Promise.resolve(Y(o,"map")).then(function(t){return t&&t.name===e.useMap.substring(1)?o:e})):m.Promise.resolve(Y(i,"a")).then(function(t){return!!t}).then(function(t){return!!t&&m.Promise.resolve(H(i,n)).then(function(t){return t&&G(n)}).then(function(t){return!t&&G(i)})}).then(function(t){return t?m.Promise.resolve(yt(i)).then(function(e){return kt({x:e.right-1,y:e.top+1},i).then(function(t){return t||kt({x:e.left+1,y:e.bottom-1},i)}).then(function(t){return t||n})}):n})}function Bt(n,i,o){return Ot(n).then(function(t){var e=m.Promise.resolve(t);return!t&&m.utils.dom.isIframeWindow(i||ef)&&0<n.x&&0<n.y&&(e=e.then(function(){return Ot(n,!0)})),e.then(function(t){return Nt(t,o)})})}function Ft(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var Lt,Rt,Vt,Wt="E1",Yt="E4",Kt="E5",Xt="E9",Ht="E10",Gt="E11",qt="E12",zt="E24",jt="E26",$t="E27",Qt="E28",Zt="E29",Jt="E30",te="E31",ee="E32",ne="E33",ie="E34",oe="E35",re="E36",se="E37",le="E39",ae="E40",ue="E41",ce="E42",he="E43",fe="E44",de="E45",me="E46",pe="E49",ve="E50",ge="E51",ye="E52",Ee="E57",be="E64",Se="E65",_e="E68",we="E69",Pe="E70",xe="E71",Ce="E72",Ae="E73",Te="E74",Me="E76",De="E77",Ue="E78",Ie="E82",Oe="E83",ke="E90",Ne="E91",Be="E92",Fe="E93",Le="E94",Re="E95",Ve="E97",We="E99",Ye="E100",Ke="E101",Xe=(_(He,Lt=Ft),He);function He(t,e,n){var i=Lt.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function Ge(t,e){var n=Rt.call(this,pe,e)||this;return n.instantiationCallsiteName=t,n}function qe(t,e){var n=Vt.call(this,ve,e)||this;return n.instantiationCallsiteName=t,n}_(Ge,Rt=Ft),_(qe,Vt=Ft);var ze,je,$e,Qe,Ze,Je,tn,en,nn=(_(on,ze=Ft),on);function on(t,e,n){var i=void 0===e?{}:e,o=i.apiFnChain,r=i.apiFnIndex,s=i.reason,l=ze.call(this,t,n)||this;return l.apiFnChain=o,l.apiFnIndex=r,l.reason=s,l}function rn(t){return je.call(this,ge,t)||this}function sn(t,e){return $e.call(this,ye,e,t)||this}function ln(t,e){var n=Qe.call(this,Wt)||this;return n.errStack=t,n.pageDestUrl=e,n}function an(t,e,n){var i=Ze.call(this,Yt,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}function un(t,e,n,i){var o=Je.call(this,Kt,i)||this;return o.errMsg=String(e),o.property=n,o.instantiationCallsiteName=t,o}function cn(t){var e=tn.call(this,be)||this;return e.errMsg=String(t),e}function hn(t,e){var n=en.call(this,Se)||this;return n.errMsg=String(t),n.moduleName=e,n}_(rn,je=Ft),_(sn,$e=nn),_(ln,Qe=Ft),_(an,Ze=Ft),_(un,Je=Ft),_(cn,tn=Ft),_(hn,en=Ft);var fn,dn=(_(mn,fn=Xe),mn);function mn(t,e){return fn.call(this,Xt,t,e)||this}var pn,vn=(_(gn,pn=Xe),gn);function gn(t,e){return pn.call(this,Ht,t,e)||this}var yn,En=(_(bn,yn=Xe),bn);function bn(t,e){return yn.call(this,Gt,t,e)||this}var Sn,_n=(_(wn,Sn=Xe),wn);function wn(t,e){return Sn.call(this,qt,t,e)||this}var Pn,xn=(_(Cn,Pn=Xe),Cn);function Cn(t,e){return Pn.call(this,ke,t,e)||this}var An,Tn=(_(Mn,An=Xe),Mn);function Mn(t,e){return An.call(this,Ve,t,e)||this}var Dn,Un=(_(In,Dn=Xe),In);function In(t,e){return Dn.call(this,Ne,t,e)||this}var On,kn=(_(Nn,On=Xe),Nn);function Nn(t,e){return On.call(this,Be,t,e)||this}var Bn,Fn=(_(Ln,Bn=Xe),Ln);function Ln(t,e){return Bn.call(this,Fe,t,e)||this}var Rn,Vn=(_(Wn,Rn=Xe),Wn);function Wn(t,e){return Rn.call(this,Le,t,e)||this}var Yn,Kn=(_(Xn,Yn=Xe),Xn);function Xn(t,e){return Yn.call(this,Re,t,e)||this}var Hn,Gn=(_(qn,Hn=Xe),qn);function qn(t,e){return Hn.call(this,We,t,e)||this}var zn,jn,$n=(_(Qn,zn=Ft),Qn);function Qn(t,e,n){var i=zn.call(this,Ye)||this;return i.objectName=t,i.propertyName=e,i.availableProperties=n,i}function Zn(t,e){return jn.call(this,zt,e,t)||this}_(Zn,jn=nn);var Jn,ti,ei,ni=(_(ii,Jn=nn),ii);function ii(t,e){return Jn.call(this,jt,e,t)||this}function oi(t){var e=ti.call(this,$t)||this;return e.nodeDescription=t,e}function ri(t,e){var n=ei.call(this,Qt,e)||this;return n.argumentName=t,n}_(oi,ti=Ft),_(ri,ei=nn);var si,li,ai,ui,ci,hi,fi,di,mi,pi,vi,gi,yi,Ei,bi,Si,_i,wi,Pi,xi,Ci,Ai,Ti,Mi,Di,Ui,Ii,Oi,ki,Ni,Bi,Fi=(_(Li,si=Ft),Li);function Li(t){return si.call(this,Ke,t)||this}function Ri(t,e){var n=li.call(this,Zt,e)||this;return n.argumentName=t,n}function Vi(t,e){var n=ai.call(this,Jt)||this;return n.argumentName=t,n.nodeDescription=e,n}function Wi(){return ui.call(this,te)||this}function Yi(){return ci.call(this,ee)||this}function Ki(t){var e=hi.call(this,ne)||this;return e.argumentName=t,e}function Xi(){return fi.call(this,oe)||this}function Hi(t){var e=di.call(this,re)||this;return e.argumentName=t,e}function Gi(t,e){var n=mi.call(this,se)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function qi(){return pi.call(this,ie)||this}function zi(t,e){var n=vi.call(this,ue)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function ji(t,e){var n=gi.call(this,Ee)||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}function $i(t){return yi.call(this,ae,t)||this}function Qi(){return Ei.call(this,le)||this}function Zi(){return bi.call(this,ce)||this}function Ji(){return Si.call(this,we)||this}function to(){return _i.call(this,_e)||this}function eo(){return wi.call(this,Pe)||this}function no(){return Pi.call(this,xe)||this}function io(){return xi.call(this,Ae)||this}function oo(){return Ci.call(this,Ie)||this}function ro(t){var e=Ai.call(this,Ue)||this;return e.errMsg=t,e}function so(){return Ti.call(this,Te)||this}function lo(){return Mi.call(this,Me)||this}function ao(){return Di.call(this,De)||this}function uo(){return Ui.call(this,Ce)||this}function co(){return Ii.call(this,Oe)||this}function ho(){return Oi.call(this,he)||this}function fo(){return ki.call(this,fe)||this}function mo(t,e){var n=Ni.call(this,de)||this;return n.dialogType=t,n.pageUrl=e,n}function po(t,e,n){var i=Bi.call(this,me)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}_(Ri,li=nn),_(Vi,ai=Ft),_(Wi,ui=Ft),_(Yi,ci=Ft),_(Ki,hi=Ft),_(Xi,fi=Ft),_(Hi,di=Ft),_(Gi,mi=Ft),_(qi,pi=Ft),_(zi,vi=Ft),_(ji,gi=Ft),_($i,yi=Ft),_(Qi,Ei=Ft),_(Zi,bi=Ft),_(Ji,Si=Ft),_(to,_i=Ft),_(eo,wi=Ft),_(no,Pi=Ft),_(io,xi=Ft),_(oo,Ci=Ft),_(ro,Ai=Ft),_(so,Ti=Ft),_(lo,Mi=Ft),_(ao,Di=Ft),_(uo,Ui=Ft),_(co,Ii=Ft),_(ho,Oi=Ft),_(fo,ki=Ft),_(mo,Ni=Ft),_(po,Bi=Ft);var vo=(Object.defineProperty(go.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(go.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(go.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(go.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),go);function go(t){this._speedFactor=t||1}var yo=h.Promise,Eo=h.nativeMethods;function bo(e){return new yo(function(t){return Eo.setTimeout.call(ef,t,e)})}function So(){return bo(0)}var _o=Object.prototype.toString,wo=String.prototype.indexOf,Po=String.prototype.endsWith||function(t,e){var n=_o.call(this);(void 0===e||e>n.length)&&(e=n.length),e-=t.length;var i=wo.call(n,t,e);return-1!==i&&i===e},xo=Array.prototype.indexOf,Co=Array.prototype.map,Ao=Array.prototype.sort,To=Array.prototype.filter,Mo=Array.prototype.concat,Do="Command",Uo=(Io.prototype.getAssignableProperties=function(){return[]},Io.prototype.getAllAssignableProperties=function(){for(var t=Object.getPrototypeOf(this),e=[];t&&t.getAssignableProperties;)e=Mo.call(e,t.getAssignableProperties()),t=Object.getPrototypeOf(t);return e},Io.prototype.getNonReportedProperties=function(){return[]},Io.prototype.getReportedProperties=function(){var t=Co.call(this.getAllAssignableProperties(),function(t){return t.name}),e=this.getNonReportedProperties();return To.call(t,function(t){return!(-1<xo.call(e,t))})},Io.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t){e&&function(t,e){var n,i=e.constructor.name,o=Co.call(e.getAllAssignableProperties(),function(t){return t.name}),r=Ao.call(e.getReportedProperties());for(n in t)if(!(-1<xo.call(o,n)||n in e))throw new $n(i,n,r)}(t,this);for(var i,o,r=this.getAllAssignableProperties(),s=0;s<r.length;s++){var l=r[s],a=l.name,u=l.type,c=l.required,h=l.init,f=l.defaultValue;void 0!==f&&(this[a]=f);var d=t[a];void 0===d&&!c||(e&&u&&u((i=this.constructor.name,o=a,Po.call(i,Do)?o:"".concat(i,".").concat(o)),d),this[a]=h?h(a,d,n,e):d)}}},Io);function Io(){}function Oo(i){return function(t,e){var n=typeof e;if("number"!=n)throw new i(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new i(t,e)}}var ko,No,Bo,Fo,Lo,Ro,Vo,Wo,Yo,Ko,Xo,Ho,Go,qo=Oo(dn),zo=(No=Oo(ko=vn),function(t,e){if(No(t,e),e<0)throw new ko(t,e)}),jo=(Bo=En,function(t,e){var n=typeof e;if("boolean"!=n)throw new Bo(t,n)}),$o=(Fo=_n,function(t,e){var n=typeof e;if("number"!=n)throw new Fo(t,n);if(isNaN(e)||e<.01||1<e)throw new Fo(t,e)}),Qo=(Lo=xn,function(t,e){var n=typeof e;if("string"!=n)throw new Lo(t,n)}),Zo=(Ro=Tn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new Ro(t,n)}),Jo=(Vo=Un,function(t,e){if(!(e instanceof Date))throw new Vo(t,e)}),tr=(Wo=kn,function(t,e){if(isNaN(Number(e)))throw new Wo(t,typeof e)}),er=(Yo=Fn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new Yo(t,n)}),nr=(Ko=Vn,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new Ko(t,n)}),ir=(Xo=Kn,function(t,e){var n=typeof e;if("object"!=n)throw new Xo(t,n)}),or=(Ho=Gn,function(t,e){var n=typeof e;if("function"!=n)throw new Ho(t,n)}),rr=(_(sr,Go=Uo),sr.prototype.getAssignableProperties=function(){return[{name:"speed",type:$o}]},sr);function sr(t,e){var n=Go.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var lr,ar=(_(ur,lr=rr),ur.prototype.getAssignableProperties=function(){return[{name:"offsetX",type:qo},{name:"offsetY",type:qo},{name:"isDefaultOffset",type:jo}]},ur);function ur(t,e){var n=lr.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var cr,hr=(_(fr,cr=ar),fr.prototype.getAssignableProperties=function(){return[{name:"scrollToCenter",type:jo},{name:"skipParentFrames",type:jo}]},fr);function fr(t,e){var n=cr.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var dr,mr,pr=(_(vr,dr=Uo),vr.prototype.getAssignableProperties=function(){return[{name:"left",type:qo,defaultValue:null},{name:"right",type:qo,defaultValue:null},{name:"top",type:qo,defaultValue:null},{name:"bottom",type:qo,defaultValue:null}]},vr);function vr(t,e){var n=dr.call(this)||this;return n._assignFrom(t,e),n}function gr(t,e){var n=mr.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}_(gr,mr=rr),gr.prototype.getAssignableProperties=function(){return[{name:"scrollTargetX",type:qo},{name:"scrollTargetY",type:qo},{name:"crop",type:ir,init:rs},{name:"includeMargins",type:jo},{name:"includeBorders",type:jo},{name:"includePaddings",type:jo}]};var yr,Er=(_(br,yr=Uo),br.prototype.getAssignableProperties=function(){return[{name:"ctrl",type:jo,defaultValue:!1},{name:"alt",type:jo,defaultValue:!1},{name:"shift",type:jo,defaultValue:!1},{name:"meta",type:jo,defaultValue:!1}]},br);function br(t,e){var n=yr.call(this)||this;return n._assignFrom(t,e),n}var Sr,_r=(_(wr,Sr=ar),wr.prototype.getAssignableProperties=function(){return[{name:"modifiers",type:ir,init:ss}]},wr);function wr(t,e){var n=Sr.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Pr,xr=(_(Cr,Pr=_r),Cr.prototype.getAssignableProperties=function(){return[{name:"caretPos",type:zo}]},Cr);function Cr(t,e){var n=Pr.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var Ar,Tr=(_(Mr,Ar=_r),Mr.prototype.getAssignableProperties=function(){return[{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:jo},{name:"skipDefaultDragBehavior",type:jo}]},Mr);function Mr(t,e){var n=Ar.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}var Dr,Ur,Ir,Or,kr,Nr,Br=(_(Fr,Dr=xr),Fr.prototype.getAssignableProperties=function(){return[{name:"replace",type:jo},{name:"paste",type:jo},{name:"confidential",type:jo}]},Fr);function Fr(t,e){var n=Dr.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function Lr(t,e){var n=Ur.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function Rr(t,e){var n=Ir.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Vr(t,e){var n=Or.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Wr(t,e){var n=kr.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function Yr(t,e){var n=Nr.call(this)||this;return n._assignFrom(t,e),n}_(Lr,Ur=_r),Lr.prototype.getAssignableProperties=function(){return[{name:"destinationOffsetX",type:qo},{name:"destinationOffsetY",type:qo}]},_(Rr,Ir=Uo),Rr.prototype.getAssignableProperties=function(){return[{name:"portraitOrientation",type:jo}]},_(Vr,Or=Uo),Vr.prototype.getAssignableProperties=function(){return[{name:"timeout",type:zo},{name:"allowUnawaitedPromise",type:jo}]},_(Wr,kr=rr),Wr.prototype.getAssignableProperties=function(){return[{name:"confidential",type:jo}]},_(Yr,Nr=Uo),Yr.prototype.getAssignableProperties=function(){return[{name:"name",type:Qo},{name:"value",type:Qo},{name:"domain",type:Qo},{name:"path",type:Qo},{name:"expires",type:Jo},{name:"maxAge",type:tr},{name:"secure",type:jo},{name:"httpOnly",type:jo},{name:"sameSite",type:Qo}]};var Kr,Xr=(_(Hr,Kr=Uo),Hr.prototype.getAssignableProperties=function(){return[{name:"username",type:Qo,required:!0},{name:"password",type:Qo}]},Hr);function Hr(t,e){var n=Kr.call(this)||this;return n._assignFrom(t,e),n}var Gr,qr,zr,jr,$r,Qr=(_(Zr,Gr=Uo),Zr.prototype.getAssignableProperties=function(){return[{name:"protocol",type:Qo},{name:"host",type:Qo,required:!0},{name:"port",type:tr,required:!0},{name:"auth",type:ir,init:is}]},Zr);function Zr(t,e){var n=Gr.call(this)||this;return n._assignFrom(t,e),n}function Jr(t,e){var n=qr.call(this)||this;return n._assignFrom(t,e),n}function ts(t,e){var n=zr.call(this)||this;return n._assignFrom(t,e),n}function es(t,e){var n=jr.call(this)||this;return n._assignFrom(t,e),n}function ns(t,e){var n=$r.call(this)||this;return n._assignFrom(t,e),n}function is(t,e,n,i){return void 0===i&&(i=!0),new Xr(e,i)}function os(t,e,n,i){return void 0===i&&(i=!0),new Qr(e,i)}function rs(t,e,n,i){return void 0===i&&(i=!0),new pr(e,i)}function ss(t,e,n,i){return void 0===i&&(i=!0),new Er(e,i)}_(Jr,qr=Uo),Jr.prototype.getAssignableProperties=function(){return[{name:"url",type:er},{name:"method",type:Qo},{name:"headers",type:ir},{name:"params",type:nr},{name:"body"},{name:"timeout",type:tr},{name:"withCredentials",type:jo},{name:"auth",type:ir,init:is},{name:"proxy",type:ir,init:os},{name:"rawResponse",type:jo}]},_(ts,zr=Uo),ts.prototype.getAssignableProperties=function(){return[{name:"credentials",type:tr}]},_(es,jr=Uo),es.prototype.getAssignableProperties=function(){return[{name:"stack",type:Zo,required:!1},{name:"message",type:Zo,required:!1},{name:"pageUrl",type:Zo,required:!1}]},_(ns,$r=Uo),ns.prototype.getAssignableProperties=function(){return[{name:"fn",type:or,required:!0},{name:"dependencies",type:ir,required:!1}]};var ls=null,as=function(){return ls},us=function(t){ls=t},cs=(h.Promise,h.nativeMethods,h.eventSandbox.listeners,h.utils.browser,h.utils.event.BUTTON,h.utils.event.BUTTONS_PARAMETER);function hs(t){return t.top!==t}h.utils.event.DOM_EVENTS,h.utils.event.WHICH_PARAMETER,h.utils.event.preventDefault;var fs=h.Promise,ds=h.eventSandbox.message;function ms(t,i,e){return new fs(function(n){ds.on(ds.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(ds.off(ds.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),ds.sendServiceMsg(t,e)})}var ps=(vs.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},vs.prototype.once=function(n,i){var o=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.off(n,i),i.apply(void 0,t)})},vs.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=m.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},vs.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},vs.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=this._eventsListeners[e];if(i)for(var o=0;o<i.length;o++)try{i[o].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,i[o])}},vs);function vs(){this._eventsListeners={}}var gs=ps,ys=m.eventSandbox.listeners;function Es(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new gs}var bs=(Es.prototype._internalListener=function(t,e,n,i,o){this.events.emit("scroll",t),this.stopPropagationFlag&&(i(),o())},Es.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,ys.initElementListening(ef,["scroll"]),ys.addFirstInternalEventBeforeListener(ef,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n._internalListener.apply(n,t)}))},Es.prototype.waitForScroll=function(t){var e=this,n=null,i=new m.Promise(function(t){n=t});return i.cancel=function(){return e.events.off("scroll",n)},this.initialized?this.handleScrollEvents(t,n):n(),i},Es.prototype.handleScrollEvents=function(n,t){var e,i=this;this.events.once("scroll",t),(e=n)&&e.getRootNode&&D(e)!==e.getRootNode()&&(ys.initElementListening(n,["scroll"]),ys.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i._internalListener.apply(i,t),ys.cancelElementListening(n)}))},Es.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},Es.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new Es),Ss=(_s._isScrollValuesChanged=function(t,e){return it(t)!==e.left||ot(t)!==e.top},_s.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=L(t)?D(t):t,s={left:it(r),top:ot(r)},i=Math.max(i,0),o=Math.max(o,0),l=bs.waitForScroll(r);return rt(r,i),st(r,o),_s._isScrollValuesChanged(r,s)?l=l.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=_s._isScrollValuesChanged(r,s))}):(l.cancel(),m.Promise.resolve())},_s.prototype._getScrollToPoint=function(t,e,n){var i=Math.floor(t.width/2),o=Math.floor(t.height/2),r=this._scrollToCenter?i:Math.min(n.left,i),s=this._scrollToCenter?o:Math.min(n.top,o),l=t.scroll,a=l.left,u=l.top,c=e.x>=a+t.width-r,h=e.x<=a+r,f=e.y>=u+t.height-s,d=e.y<=u+s;return c?a=e.x-t.width+r:h&&(a=e.x-r),f?u=e.y-t.height+s:d&&(u=e.y-s),{left:a,top:u}},_s.prototype._getScrollToFullChildView=function(t,e,n){var i,o,r,s,l,a,u={left:null,top:null},c=t.width>=e.width,h=t.height>=e.height,f=(i=e,o=t,q.create({top:i.top-o.top,left:i.left-o.left,right:o.right-i.right,bottom:o.bottom-i.bottom}).sub(o.border).sub(o.scrollbar).round(Math.ceil,Math.floor));return c&&(r=t.width-e.width,s=Math.min(n.left,r),this._scrollToCenter&&(s=r/2),f.left<s?u.left=Math.round(t.scroll.left+f.left-s):f.right<s&&(u.left=Math.round(t.scroll.left+Math.min(f.left,-f.right)+s))),h&&(l=t.height-e.height,a=Math.min(n.top,l),this._scrollToCenter&&(a=l/2),f.top<a?u.top=Math.round(t.scroll.top+f.top-a):f.bottom<a&&(u.top=Math.round(t.scroll.top+Math.min(f.top,-f.bottom)+a))),u},_s._getChildPoint=function(t,e,n){return x.create(e).sub(x.create(t)).add(x.create(t.scroll)).add(x.create(e.border)).add(n)},_s.prototype._getScrollPosition=function(t,e,n,i){var o=_s._getChildPoint(t,e,n),r=this._getScrollToPoint(t,o,i),s=this._getScrollToFullChildView(t,e,i);return{left:Math.max(null===s.left?r.left:s.left,0),top:Math.max(null===s.top?r.top:s.top,0)}},_s._getChildPointAfterScroll=function(t,e,n,i){return x.create(e).add(x.create(t.scroll)).sub(x.create(n)).add(i)},_s.prototype._isChildFullyVisible=function(t,e,n){var i=_s._getChildPointAfterScroll(t,e,t.scroll,n),o=this._getScrollPosition(t,e,n,{left:0,top:0}),r=o.left,s=o.top;return!this._isTargetElementObscuredInPoint(i)&&r===t.scroll.left&&s===t.scroll.top},_s.prototype._scrollToChild=function(t,e,n){for(var i=yt(t),o=yt(e),r=et(ef),s=nt(ef),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this._maxScrollMargin);var u=_s._getChildPointAfterScroll(i,o,l,n),c=this._isTargetElementObscuredInPoint(u);this._maxScrollMargin.left+=20,this._maxScrollMargin.left>=r&&(this._maxScrollMargin.left=50,this._maxScrollMargin.top+=20),a=c&&this._maxScrollMargin.top<s}return this._maxScrollMargin={left:50,top:50},this._setScroll(t,l)},_s.prototype._scrollElement=function(){if(!Ct(this._element))return m.Promise.resolve();var t=yt(this._element),e=this._getScrollToPoint(t,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,e)},_s.prototype._scrollParents=function(){var t,e,n,i,o,r,s=this,l=(t=this._element,i=K(t),!I(t)||(e=O(t))&&(n=K(e),i.concat(n)),m.nativeMethods.arrayFilter.call(i,Ct)),a=this._element,u=it(a),c=ot(a),h=x.create(this._offsets).sub(new x(u,c).round()),f=function(n,i){return w(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<n?[4,i(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}})})}(l.length,function(t){return s._scrollToChild(l[t],a,h).then(function(){o=yt(a),r=yt(l[t]),h.add(x.create(o)).sub(x.create(r)).add(x.create(r.border)),a=l[t]})}),d={scrollWasPerformed:this._scrollWasPerformed,offsetX:h.x,offsetY:h.y,maxScrollMargin:this._maxScrollMargin};return f.then(function(){if(!s._skipParentFrames&&hs(ef))return d.cmd=_s.SCROLL_REQUEST_CMD,ms(d,_s.SCROLL_RESPONSE_CMD,ef.parent)}).then(function(){return s._scrollWasPerformed})},_s._getFixedAncestorOrSelf=function(t){return X(t,!0,at)},_s.prototype._isTargetElementObscuredInPoint=function(t){var e=Et(t);if(!e)return!1;var n=_s._getFixedAncestorOrSelf(e);return!!n&&!n.contains(this._element)},_s.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()})},_s.SCROLL_REQUEST_CMD="automation|scroll|request",_s.SCROLL_RESPONSE_CMD="automation|scroll|response",_s);function _s(t,e,n){this._element=t,this._offsets=new x(e.offsetX,e.offsetY),this._scrollToCenter=!!e.scrollToCenter,this._skipParentFrames=!!e.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}var ws=h.utils.browser,Ps=(xs.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},xs.prototype.leaveElement=function(){},xs.prototype.move=function(){},xs.prototype.enterElement=function(){},xs.prototype.dragAndDrop=function(){},xs.prototype.teardown=function(){},xs.prototype.run=function(t,e,n,i,o){var r=e&&g.domUtils.isElementInDocument(e),s=e&&g.domUtils.isElementInIframe(e)&&!g.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?g.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),ws.isIE&&this.move(t,n),l&&g.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),ws.isIE||this.move(t,n),this.dragAndDrop(i,t,e,n,o),this.teardown(t,n,e);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},xs);function xs(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var Cs=h.eventSandbox.eventSimulator,As=h.utils.extend,Ts=h.nativeMethods,Ms=(Ds.leaveElement=function(t,e,n,i){Cs.mouseout(e,As({relatedTarget:t},i));for(var o=e;o&&o!==n;)Cs.mouseleave(o,As({relatedTarget:t},i)),o=Ts.nodeParentNodeGetter.call(o)},Ds.enterElement=function(t,e,n,i){Cs.mouseover(t,As({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=g.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)Cs.mouseenter(r[s],As({relatedTarget:e},i))},Ds.move=function(t,e,n){Cs[t](e,n)},Ds);function Ds(){}var Us=(Is.dragAndDrop=function(t,e,n,i){return Cs.drag(t,i),e!==n&&(g.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,Cs.dragenter(e,i)),n&&(i.relatedTarget=e,Cs.dragleave(n,i))),!Cs.dragover(e,i)},Is);function Is(){}var Os,ks=h.eventSandbox.eventSimulator,Ns=(_(Bs,Os=Ps),Bs.prototype.leaveElement=function(t,e,n,i){Ms.leaveElement(t,e,n,i)},Bs.prototype.enterElement=function(t,e,n,i){Ms.enterElement(t,e,n,i)},Bs.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Ms.move(this.moveEvent,t,e)},Bs.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(t)&&t!==n&&ks[this.moveEvent](t,e)},Bs.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},Bs);function Bs(t){var e=Os.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Fs,Ls=(_(Rs,Fs=Ps),Rs.prototype.setup=function(){Fs.prototype.setup.call(this),this.dragAndDropMode=!0},Rs.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Us.dragAndDrop(t,e,n,i)},Rs);function Rs(){return null!==Fs&&Fs.apply(this,arguments)||this}var Vs,Ws=h.eventSandbox.eventSimulator,Ys=(_(Ks,Vs=Ps),Ks.prototype.setup=function(){Vs.prototype.setup.call(this),this.dragAndDropMode=!0},Ks.prototype.leaveElement=function(t,e,n,i){Ms.leaveElement(t,e,n,i)},Ks.prototype.move=function(t,e){Ms.move(this.moveEvent,t,e)},Ks.prototype.enterElement=function(t,e,n,i){Ms.enterElement(t,e,n,i)},Ks.prototype.dragAndDrop=function(t,e,n,i,o){var r=Ws.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Us.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},Ks.prototype.run=function(t,e,n,i,o){return Vs.prototype.run.call(this,t,null,n,i,o)},Ks);function Ks(){return null!==Vs&&Vs.apply(this,arguments)||this}function Xs(t,e,n){return new(t?e?Ls:Ys:Ns)(n)}var Hs=(Gs.create=function(o,r,s,l){return w(this,void 0,m.Promise,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,Gs.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new Gs(n,i,r,s,l)]}})})},Gs.getTarget=function(e,n,i){return m.Promise.resolve(bt(e,i.x,i.y)).then(function(t){return t?{element:e,offset:i}:m.Promise.all([_t(e,i),n.document.documentElement]).then(function(t){var e=t[0];return{element:t[1],offset:e}})})},Gs.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},Gs.prototype._getTargetClientPoint=function(){var o=this;return m.Promise.resolve(Z(this.element)).then(function(i){return L(o.element)?x.create(o.offset).sub(x.create(i)).round(Math.round):m.Promise.resolve(St(o.element)).then(function(t){var e=F(o.element),n=x.create(t).add(o.offset);return e||n.sub(x.create(i)),n.round(Math.floor)})})},Gs.prototype._getEventSequenceOptions=function(t){var e=cs.noButton,n=Tt(t);return{eventOptions:{clientX:t.x,clientY:t.y,screenX:null==n?void 0:n.x,screenY:null==n?void 0:n.y,buttons:e,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta},eventSequenceOptions:{moveEvent:this.moveEvent}}},Gs.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions;return Xs(!1,this.firstMovingStepOccured,i).run(t,as(),n,null,null)},Gs.prototype._emulateEvents=function(t,e){var n=this._getEventSequenceOptions(e);this._runEventSequence(t,n),this.firstMovingStepOccured=!0,us(t)},Gs.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return Ot(i.cursor.getPosition())}).then(function(t){var e=i._getCorrectedTopElement(t);return e?i._emulateEvents(e,n):null}).then(So)},Gs.prototype._getCorrectedTopElement=function(t){return t},Gs.prototype._move=function(e){var n=this,i=this.cursor.getPosition(),o=x.create(e).sub(i),r=m.nativeMethods.dateNow(),s=Math.max(Math.max(Math.abs(o.x),Math.abs(o.y))/this.cursorSpeed,this.minMovingTime),l=x.create(i),a=!0;return function(e,n){return w(this,void 0,void 0,function(){return P(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!l.eql(e)},function(){var t;return n._needMoveCursorImmediately()?l=x.create(e):a?(a=!1,l.add({x:0<o.x?1:-1,y:0<o.y?1:-1})):(t=Math.min((m.nativeMethods.dateNow()-r)/s,1),l=x.create(o).mul(t).add(i).round(Math.floor)),n._movingStep(l)})},Gs.prototype._needMoveCursorImmediately=function(){return this.touchMode},Gs.prototype._scroll=function(){if(this.skipScrolling)return m.Promise.resolve(!1);var t=new hr({offsetX:this.offset.x,offsetY:this.offset.y},!1);return new Ss(this.element,t).run()},Gs.prototype._moveToCurrentFrame=function(t){var e=this;if(this.cursor.isActive(this.window))return m.Promise.resolve();var n=this.cursor.getPosition(),i=n.x,o=n.y,r=this.cursor.getActiveWindow(this.window),c=null,s=null,h={cmd:"automation|move|request",startX:i,startY:o,endX:t.x,endY:t.y,modifiers:this.modifiers,speed:this.speed,shouldRender:this.cursor.shouldRender};return m.Promise.resolve().then(function(){if(r.parent===e.window)return m.Promise.resolve(function(t){var e=[];U(nf,"*",function(t){"IFRAME"===t.tagName&&e.push(t),t.shadowRoot&&U(t.shadowRoot,"iframe",function(t){return e.push(t)})});for(var n=0;n<e.length;n++)if(M.contentWindowGetter.call(e[n])===t)return e[n];return null}(r)).then(function(t){return c=t,m.Promise.resolve((n=vt(e=t),i=n.left,o=n.top,r=gt({x:i,y:o}),s=$(e),l=Q(e),a=r.x+s.left+l.left,u=r.y+s.top+l.top,new q(u,a+J(e),u+tt(e),a))).then(function(t){h.left=t.left,h.top=t.top,h.right=t.right,h.bottom=t.bottom});var e,n,i,o,r,s,l,a,u})}).then(function(){return Ot(e.cursor.getPosition())}).then(function(t){return s=t===c,r.parent===e.window&&(h.iframeUnderCursor=s),ms(h,"automation|move|response",r)}).then(function(t){if(e.cursor.setActiveWindow(e.window),s||m.utils.dom.isIframeWindow(e.window))return e.cursor.move(t)})},Gs.prototype.run=function(){var n=this;return this._scroll().then(function(){return m.Promise.all([n._getTargetClientPoint(),(t=n.window,new q(0,J(t),tt(t),0))]);var t}).then(function(t){var e=t[0];if(t[1].contains(e))return n._moveToCurrentFrame(e).then(function(){return n._move(e)})})},Gs);function Gs(t,e,n,i,o){this.touchMode=m.utils.featureDetection.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.automationSettings=new vo(n.speed),this.cursorSpeed=this._getCursorSpeed(),this.element=t,this.window=i,this.offset=e,this.cursor=o,this.minMovingTime=n.minMovingTime||0,this.modifiers=n.modifiers||{},this.skipScrolling=n.skipScrolling,this.skipDefaultDragBehavior=n.skipDefaultDragBehavior,this.speed=n.speed,this.firstMovingStepOccured=!1}var qs=(zs.prototype._ensureActiveWindow=function(t){this._activeWindow!==t&&this._activeWindow!==t.parent&&this._activeWindow.parent!==t&&(this._activeWindow=t)},zs.prototype.isActive=function(t){return this._ensureActiveWindow(t),this._activeWindow===t},zs.prototype.setActiveWindow=function(t){this._activeWindow=t},zs.prototype.getActiveWindow=function(t){return this._ensureActiveWindow(t),this._activeWindow},zs.prototype.getPosition=function(){return new x(this._x,this._y)},Object.defineProperty(zs.prototype,"shouldRender",{get:function(){return this._ui.shouldRender},set:function(t){this._ui.shouldRender=t},enumerable:!1,configurable:!0}),zs.prototype.move=function(t){return this._x=t.x,this._y=t.y,this._ui.move(t)},zs.prototype.hide=function(){return this._ui.hide?this._ui.hide():m.Promise.resolve()},zs.prototype.show=function(){return this._ui.show?this._ui.show():m.Promise.resolve()},zs.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},zs.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},zs.prototype.buttonUp=function(){return this._ui.buttonUp()},zs);function zs(t,e){this._ui=e,this._x=-1,this._y=-1,this._activeWindow=t}var js,$s,Qs,Zs,Js=hs(ef)?i.iframeCursorUI:i.cursorUI,tl=new qs(ef.top,Js),el=E.positionUtils,nl=E.domUtils,il=E.eventUtils,ol="elementOverlapped";($s=js=js||{})[$s.Mouse=0]="Mouse",$s[$s.Key=1]="Key",$s[$s.Touch=2]="Touch",(Zs=Qs=Qs||{})[Zs.alt=1]="alt",Zs[Zs.ctrl=2]="ctrl",Zs[Zs.meta=4]="meta",Zs[Zs.shift=8]="shift";var rl={clickCount:1,button:"left"},sl=(ll.prototype._createMouseEventOptions=function(t,e){return m.utils.extend({x:e.options.clientX+this._leftTopPoint.x,y:e.options.clientY+this._leftTopPoint.y,modifiers:(n=e.options,i=0,n.ctrl&&(i|=Qs.ctrl),n.alt&&(i|=Qs.alt),n.shift&&(i|=Qs.shift),n.meta&&(i|=Qs.meta),i),button:e.options.button?"right":"left",type:t},rl);var n,i},ll.prototype.mouseDown=function(t){var e=this._createMouseEventOptions("mousePressed",t);return this._dispatchEventFn(js.Mouse,e)},ll.prototype.mouseUp=function(t){var e=this._createMouseEventOptions("mouseReleased",t);return this._dispatchEventFn(js.Mouse,e)},ll);function ll(t,e){this._dispatchEventFn=t,this._leftTopPoint=e||new x(0,0)}var al=(ul.create=function(t){var n=t.element,i=t.clientPoint,o=t.screenPoint,r=t.isTarget,s=t.inMoving;return w(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return e=null,i?[4,Tt(i)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,new ul({element:n,clientPoint:i,screenPoint:o,isTarget:r,inMoving:s,devicePoint:e})]}})})},ul);function ul(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u,h=t.devicePoint,f=void 0===h?null:h;this.element=n,this.clientPoint=o,this.screenPoint=s,this.devicePoint=f,this.isTarget=a,this.inMoving=c}var cl,hl=(_(fl,cl=ps),fl.prototype._ensureWindowAndCursorForLegacyTests=function(t){t.window=t.window||ef,t.cursor=tl},fl.prototype.canUseProxylessEventSimulator=function(t){return!!this.proxylessEventSimulator&&!!t&&"select"!==W(t)},fl.prototype._getElementForEvent=function(n){return w(this,void 0,void 0,function(){var e;return P(this,function(t){return e=bt(this.element,this.options.offsetX,this.options.offsetY)?this.element:null,[2,Bt(n.point,this.window,e)]})})},fl.prototype._moveToElement=function(){return w(this,void 0,void 0,function(){var e,n=this;return P(this,function(t){switch(t.label){case 0:return e=new Tr(m.utils.extend({skipScrolling:!0},this.options),!1),[4,Hs.create(this.element,e,this.window,this.cursor)];case 1:return[2,t.sent().run().then(function(){return bo(n.automationSettings.mouseActionStepDelay)})]}})})},fl.prototype._scrollToElement=function(){var e=this,n=!1,t=new hr(this.options,!1);return new Ss(this.element,t).run().then(function(t){return n=!!t,bo(e.automationSettings.mouseActionStepDelay)}).then(function(){return Bt(e.cursor.getPosition(),e.window)}).then(function(t){return function(s,l,a){return w(this,void 0,h.Promise,function(){var e,n,i,o,r;return P(this,function(t){switch(t.label){case 0:return s&&nl.contains(l,s)&&a?(e=as(),n=nl.getCommonAncestor(s,e),[4,el.getClientPosition(s)]):[2];case 1:return[4,Tt(i=t.sent())];case 2:return(o=t.sent())&&(r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:il.BUTTONS_PARAMETER.leftButton},Ms.leaveElement(s,e,n,r),Ms.enterElement(s,e,n,r),us(s)),[2]}})})}(t,e.element,n)}).then(function(){return n})},fl.prototype._getElementOffset=function(){var t=Ut(this.element),e=this.options,n=e.offsetX,i=e.offsetY,o=i||0===i?i:t.offsetY,r=n||0===n?n:t.offsetX;return x.create({x:r,y:o})},fl.prototype._isTargetElement=function(n,i){return w(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return(e=!i||n===i||n===this.element)||!n?[3,2]:[4,this._contains(this.element,n)];case 1:e=t.sent(),t.label=2;case 2:return[2,e]}})})},fl.prototype._getCheckedPoints=function(t){for(var e=[t],n=t.x/2,i=t.y/2,o=2*t.x,r=2*t.y,s=i;s<r;s+=i)for(var l=n;l<o;l+=n)e.push(x.create({x:l,y:s}));return e},fl.prototype._getAvailableOffset=function(r,s){return w(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){switch(t.label){case 0:e=this._getCheckedPoints(s),i=n=null,o=0,t.label=1;case 1:return o<e.length?[4,_t(this.element,e[o])]:[3,7];case 2:return n=t.sent(),[4,At(this.element,n)];case 3:return[4,Bt(t.sent(),this.window,r)];case 4:return i=t.sent(),[4,this._isTargetElement(i,r)];case 5:if(t.sent())return[2,e[o]];t.label=6;case 6:return o++,[3,1];case 7:return[2,null]}})})},fl.prototype._wrapAction=function(m){return w(this,void 0,void 0,function(){var e,n,i,o,r,s,l,a,u,c,h,f,d;return P(this,function(t){switch(t.label){case 0:return e=this._getElementOffset(),[4,bt(this.element,e.x,e.y)];case 1:return n=t.sent()?this.element:null,[4,_t(this.element,e)];case 2:return i=t.sent(),[4,St(this.element)];case 3:return o=t.sent(),[4,m()];case 4:return t.sent(),this.options.isDefaultOffset?[4,this._getAvailableOffset(n,e)]:[3,6];case 5:r=t.sent(),e.x=(null==r?void 0:r.x)||e.x,e.y=(null==r?void 0:r.y)||e.y,this.options.offsetX=e.x,this.options.offsetY=e.y,t.label=6;case 6:return[4,_t(this.element,e)];case 7:return s=t.sent(),[4,St(this.element)];case 8:return l=t.sent(),[4,At(this.element,s)];case 9:return[4,Bt(a=t.sent(),this.window,n)];case 10:return(u=t.sent())?[4,this._isTargetElement(u,n)]:[2,al.create({element:null,clientPoint:null,screenPoint:null,isTarget:!1,inMoving:!1})];case 11:return c=t.sent(),h=i.x!==s.x||i.y!==s.y,f=o.x!==l.x||o.y!==l.y,d=h&&f,[2,al.create({element:u,clientPoint:a,screenPoint:s,isTarget:c,inMoving:d})]}})})},fl.prototype._checkElementState=function(t,e){if(!t.element)throw new ni(null,{reason:function t(e,n){void 0===n&&(n="action target");var i=mt(e);if(B(e)){var o=(t(V(Y(e,"map")),"container")||"").replace(/.*The/,"its");return ct.mapContainerNotVisible(i,o)}return ct.elOutsideBounds(i,n)}(this.element)});if(e&&(!t.isTarget||t.inMoving))throw new Fi;return t},fl.prototype._ensureElement=function(o,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this._wrapAction(function(){return r._scrollToElement()}).then(function(t){return r._checkElementState(t,o)}).then(function(t){return n?t:r._wrapAction(function(){return r._moveToElement()})}).then(function(t){return e||r._checkElementState(t,o),t}).then(function(t){var e,n,i=null==t?void 0:t.element;return r.emit(r.TARGET_ELEMENT_FOUND_EVENT,{element:i||null}),o||!i||t.isTarget||(e=mt(r.element),n=mt(i),r.emit(r.WARNING_EVENT,{type:ol,args:[e,n]})),{element:(null==t?void 0:t.element)||null,clientPoint:(null==t?void 0:t.clientPoint)||null,screenPoint:(null==t?void 0:t.screenPoint)||null,devicePoint:(null==t?void 0:t.devicePoint)||null}})},fl.prototype._contains=function(o,r){return w(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,K(r)];case 1:for(e=t.sent(),n=0,i=e;n<i.length;n++)if(i[n]===o)return[2,!0];return[2,!1]}})})},fl);function fl(t,e,n,i,o,r){var s=cl.call(this)||this;return s.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",s.WARNING_EVENT="automation|warning-event",s.element=t,s.options=e,s.automationSettings=new vo(e.speed||1),s.window=n,s.cursor=i,s.proxylessEventSimulator=o?new sl(o,r):null,s._ensureWindowAndCursorForLegacyTests(s),s}var dl,ml=h.Promise,pl=(_(vl,dl=hl),vl.prototype.run=function(t){var e=this,n=ml.resolve();return this.element!==nf.scrollingElement&&this.element!==nf.documentElement&&(n=this._ensureElement(t,!0,!0)),n.then(function(){e.element.scrollLeft=e.scrollLeft,e.element.scrollTop=e.scrollTop})},vl);function vl(t,e,n){var i,o,r,s,l,a=e.x,u=e.y,c=e.position,h=e.byX,f=e.byY,d=dl.call(this,t,n,ef,tl)||this;return c&&(o=t,r=c,s=Math.floor(o.scrollWidth/2-o.clientWidth/2),l=Math.floor(o.scrollHeight/2-o.clientHeight/2),a=(i={top:[s,0],right:[o.scrollWidth,l],bottom:[s,o.scrollHeight],left:[0,l],topRight:[o.scrollWidth,0],topLeft:[0,0],bottomRight:[o.scrollWidth,o.scrollHeight],bottomLeft:[0,o.scrollHeight],center:[s,l]}[r])[0],u=i[1]),d.scrollLeft="number"==typeof a?a:t.scrollLeft,d.scrollTop="number"==typeof u?u:t.scrollTop,h&&(d.scrollLeft+=h),f&&(d.scrollTop+=f),d}var gl,yl=(_(El,gl=hl),El.prototype.run=function(t){return this._ensureElement(t,!0,!0)},El);function El(t,e){return gl.call(this,t,e,ef,tl)||this}var bl=h.Promise,Sl=h.nativeMethods,_l=h.utils.browser,wl=h.eventSandbox.focusBlur,Pl=E.contentEditable,xl=E.textSelection,Cl=E.domUtils,Al=E.styleUtils,Tl=h.eventSandbox.message,Ml="automation|iframe|request",Dl="automation|iframe|response";function Ul(v,g,y){var t=this;return new bl(function(p){return w(t,void 0,void 0,function(){var s,n,i,o,r,l,a,u,c,h,f,d,m;return P(this,function(t){switch(t.label){case 0:return hs(ef)?[4,ms({cmd:Ml},Dl,ef.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(s=Cl.getActiveElement(),n=Cl.isTextEditableElement(v),i=Cl.closest(v,"label[for]"),o=Cl.isElementFocusable(v),r=!o&&i,l=Cl.isContentEditableElement(v),a=l?Pl.findContentEditableParent(v):v,g&&_l.isWebKit&&n&&xl.select(v,0,0),r)return g&&(e=i,Cl.isElementFocusable(e)?wl.focus(e,E.noop,!1,!0):Ol(e)),p(),[2];if(u=!g,c=!1,!o&&!l){if(h=Cl.findDocument(a),f=Sl.documentActiveElementGetter.call(h),d=Cl.isBodyElement(f),m=Cl.isBodyElement(a)?a:Cl.getFocusableParent(a),f&&!d&&Cl.containsElement(f,a)||d&&Cl.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return wl.focus(a,function(){var t,e,n,i,o,r;!g||l||v===Cl.getActiveElement()?(t=v,e=y,o=Cl.isTextEditableElement(t),r=Cl.isContentEditableElement(t),o||r?r&&isNaN(parseInt(e,10))?xl.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Cl.getElementValue(t).length:e,xl.select(t,n,n)):(i=Pl.findContentEditableParent(t))&&xl.setCursorToLastVisiblePosition(Pl.findContentEditableParent(i)),g||Cl.getActiveElement()===s?p():wl.focus(s,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function Il(t){var e=Cl.closest(t,"label[for]"),n=e&&(e.control||nf.getElementById(e.htmlFor));return n&&Al.isElementVisible(n)?n:null}function Ol(t){var e=Il(t);e&&Cl.getActiveElement()!==e&&wl.focus(e,E.noop,!1,!0)}Tl.on(Tl.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===Ml&&(e=Cl.findIframeByWindow(t.source),wl.focus(e,function(){Tl.sendServiceMsg({cmd:Dl},t.source)},!1))});var kl=h.utils.browser,Nl=h.eventSandbox.eventSimulator,Bl=h.eventSandbox.listeners,Fl=h.nativeMethods,Ll=E.domUtils,Rl=E.styleUtils,Vl=E.selectController,Wl=i.selectElement,Yl=(Kl.prototype.run=function(){this.eventState.clickElement&&Nl.click(this.eventState.clickElement,this.eventArgs.options),Ll.isElementFocusable(this.eventArgs.element)||Ol(this.eventArgs.element)},Kl);function Kl(t,e){this.eventState=t,this.eventArgs=e}var Xl,Hl=(_(Gl,Xl=Yl),Gl.prototype.run=function(){function t(t){n=Fl.eventTargetGetter.call(t)===e.input}var e=this,n=!1;Bl.addInternalEventBeforeListener(ef,["focus"],t),Xl.prototype.run.call(this),Bl.removeInternalEventBeforeListener(ef,["focus"],t),Ll.isElementFocusable(this.targetElement)&&!n&&this._ensureBoundElementFocusRaised()},Gl.prototype._ensureBoundElementFocusRaised=function(){Nl.focus(this.input)},Gl);function Gl(t,e){var n=Xl.call(this,t,e)||this;return n.targetElement=n.eventArgs.element,n.input=Il(n.eventArgs.element),n}var ql,zl=(_(jl,ql=Yl),jl.prototype.run=function(){ql.prototype.run.call(this),this._toggleSelectOptionList()},jl.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===Rl.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(Vl.isOptionListExpanded(t)?Wl.collapseOptionList():Wl.expandOptionList(t))},jl);function jl(t,e){return ql.call(this,t,e)||this}var $l,Ql=(_(Zl,$l=Yl),Zl.prototype.run=function(){return this.eventArgs.element},Zl);function Zl(t,e){return $l.call(this,t,e)||this}var Jl,ta=(_(ea,Jl=Hl),ea.prototype.run=function(){function t(){e=!0}var e=!1;Bl.addInternalEventBeforeListener(ef,["change"],t),Jl.prototype.run.call(this),Bl.removeInternalEventBeforeListener(ef,["change"],t),!kl.isChrome||e||this.checkbox.disabled||this._isClickableElementInsideLabel(this.targetElement)||this._ensureCheckboxStateChanged()},ea.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,Nl.change(this.checkbox)},ea.prototype._isClickableElementInsideLabel=function(t){var e=Ll.isAnchorElement(t)&&t.getAttribute("href"),n=Ll.isButtonElement(t);return e||n},ea);function ea(t,e){var n=Jl.call(this,t,e)||this;return n.checkbox=n.input,n}var na=h.Promise,ia=h.utils.browser,oa=h.utils.featureDetection,ra=h.eventSandbox.eventSimulator,sa=h.eventSandbox.listeners,la=E.domUtils,aa=E.eventUtils,ua=E.arrayUtils,ca=(ha.prototype.mousedown=function(t){var e=this;this.targetElementParentNodes=la.getParents(t.element),this.mouseDownElement=t.element,this._raiseTouchEvents(t);var n=la.getActiveElement();this.activeElementBeforeMouseDown=n;var i=(ia.isWebKit||ia.isIE)&&la.isSelectElement(this.mouseDownElement);return i&&this._bindMousedownHandler(),this._bindBlurHandler(n),this._isTouchEventWasCancelled()||(this.eventState.simulateDefaultBehavior=ra.mousedown(t.element,t.options)),!1===this.eventState.simulateDefaultBehavior&&(this.eventState.simulateDefaultBehavior=i&&!this.eventState.mousedownPrevented),this._ensureActiveElementBlur(n).then(function(){return e._focus(t)})},ha.prototype.mouseup=function(t,e){var n,i,o,r,s;e.element=t,this.eventState.clickElement=(n=this.mouseDownElement,i=t,o=this.targetElementParentNodes,r=la.getParents(i),s=la.isTheSameNode(i,n),ia.isFirefox?s?n:null:s?ua.equals(o,r)?n:null:n.contains(i)&&!la.isEditableFormElement(i)?n:i.contains(n)?i:ua.getCommonElement(r,o));var l={},a=function(t){l=t.timeStamp,sa.removeInternalEventBeforeListener(ef,["mouseup"],a)};return ia.isIE||sa.addInternalEventBeforeListener(ef,["mouseup"],a),this._isTouchEventWasCancelled()||ra.mouseup(t,e.options),e.options&&(e.options.timeStamp=l),this._click(e)},ha.prototype._click=function(u){return w(this,void 0,h.Promise,function(){var a;return P(this,function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=Il((n=u).element),o=Ll.isSelectElement(n.element),r=Ll.isOptionElement(n.element),s=Ll.isLabelElement(n.element)&&i,l=i&&Ll.isCheckboxElement(i),a=new(o?zl:r?Ql:l?ta:s?Hl:Yl)(e,n),this._isTouchEventWasCancelled()||a.run(),[2,u]})})},ha.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},ha.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,aa.preventDefault(t),aa.unbind(e.element,"mousedown",n)};aa.bind(this.element,"mousedown",n)},ha.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,aa.unbind(t,"blur",n,!0)};aa.bind(t,"blur",n,!0)},ha.prototype._ensureActiveElementBlur=function(e){var n=this;return new na(function(t){la.getActiveElement()===e||n.eventState.blurRaised?t():ia.isIE&&ia.version<12?So().then(function(){n.eventState.blurRaised||ra.blur(e),t()}):(ra.blur(e),t())})},ha.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?na.resolve():Ul(la.isContentEditableElement(this.element)?this.element:t.element,!ia.isIE||this.activeElementBeforeMouseDown===la.getActiveElement(),this.caretPos)},ha.prototype._raiseTouchEvents=function(t){oa.isTouchDevice&&(this.eventState.touchStartCancelled=!ra.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!ra.touchend(t.element,t.options))},ha);function ha(t,e){this.element=t,this.caretPos=e,this.targetElementParentNodes=[],this.activeElementBeforeMouseDown=null,this.mouseDownElement=null,this.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1}}var fa,da=(_(ma,fa=hl),ma.prototype._mousedown=function(t){return this.canUseProxylessEventSimulator(t.element)?this.proxylessEventSimulator.mouseDown(t):this.strategy.mousedown(t)},ma.prototype._mouseup=function(t,e){return this.canUseProxylessEventSimulator(e.element)?this.proxylessEventSimulator.mouseUp(e):this.strategy.mouseup(t,e)},ma.prototype.run=function(t){var r,s=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return r={point:n,screenPoint:i,element:e,options:m.utils.extend({clientX:null==n?void 0:n.x,clientY:null==n?void 0:n.y,screenX:null==o?void 0:o.x,screenY:null==o?void 0:o.y},s.modifiers)},m.Promise.all([bo(s.automationSettings.mouseActionStepDelay),s.cursor.leftButtonDown().then(function(){return s._mousedown(r)})])}).then(function(){return s.cursor.buttonUp()}).then(function(){return s._getElementForEvent(r)}).then(function(t){return t?s._mouseup(t,r):null})},ma);function ma(t,e,n,i,o,r){var s,l,a=fa.call(this,t,e,n,i,o,r)||this;return a.modifiers=e.modifiers,a.strategy=(s=a.element,l=e.caretPos,new ca(s,l)),a}function pa(t,e,n){var i=function(t,e,n){if(e.y-t.y==0)return 0;var i=(e.x-t.x)/(e.y-t.y),o=t.y*(t.x-e.x)/(e.y-t.y)+t.x;return Math.round(i*n+o)}(t,e,n.top);return i&&i>=n.left&&i<=n.right?new x(i,n.top):null}function va(t,e,n){var i=function(t,e,n){if(e.x===t.x)return 0;var i=(e.y-t.y)/(e.x-t.x),o=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(i*n+o)}(t,e,n.left);return i&&i>=n.top&&i<=n.bottom?new x(n.left,i):null}function ga(t,e,n){for(var i=[],o=0,r=[{left:n.left,top:n.top,right:n.left,bottom:n.bottom,isHorizontal:!1},{left:n.right,top:n.top,right:n.right,bottom:n.bottom,isHorizontal:!1},{left:n.left,top:n.top,right:n.right,bottom:n.top,isHorizontal:!0},{left:n.left,top:n.bottom,right:n.right,bottom:n.bottom,isHorizontal:!0}];o<r.length;o++){var s=r[o],l=(s.isHorizontal?pa:va)(t,e,s);l&&i.push(l)}return i.length?1===i.length||i[0].distance(t)<i[1].distance(t)?i[0]:i[1]:null}var ya=h.eventSandbox.eventSimulator,Ea=h.eventSandbox.message,ba=E.positionUtils,Sa=E.domUtils,_a=E.styleUtils,wa="automation|move|response";Ea.on(Ea.SERVICE_MSG_RECEIVED_EVENT,function(t){"automation|move|request"===t.message.cmd&&(t.source.parent===ef?function(t){var e=new x(t.message.endX,t.message.endY),n=t.source,i=Sa.findIframeByWindow(n),o=_a.getBordersWidth(i),r=_a.getElementPadding(i),s=ba.getIframeClientCoordinates(i),l=ba.getIframePointRelativeToParentFrame(e,n),a=tl.getPosition();tl.shouldRender=t.message.shouldRender;var u=ba.isInRectangle(a,s)?a:ga(a,l,s),c={x:u.x-s.left,y:u.y-s.top},h=new Tr({modifiers:t.message.modifiers,offsetX:c.x+o.left+r.left,offsetY:c.y+o.top+r.top,speed:t.message.speed,skipScrolling:!0},!1),f={cmd:wa,x:c.x,y:c.y};tl.getActiveWindow(ef)!==n?Hs.create(i,h,ef,tl).then(function(t){return t.run()}).then(function(){tl.setActiveWindow(n),Ea.sendServiceMsg(f,n)}):Ea.sendServiceMsg(f,n)}(t):(h.on(h.EVENTS.beforeUnload,function(){return Ea.sendServiceMsg({cmd:wa},t.source)}),function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=as();return a&&(ya.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),ya.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),Ea.sendServiceMsg({cmd:wa},e)}var u,c=tl.getPosition(),h=ga(x.create(n).add(c),new x(t.message.endX,t.message.endY),n);h?(u=new Tr({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),Hs.create(nf.documentElement,u,ef,tl).then(function(t){return t.run()}).then(function(){var t={cmd:wa,x:h.x,y:h.y};tl.setActiveWindow(e),Ea.sendServiceMsg(t,e)})):Ea.sendServiceMsg({cmd:wa,x:n.left,y:n.top},e)}(t)))});var Pa=h.Promise,xa=h.utils.browser,Ca=h.utils.featureDetection,Aa=h.eventSandbox.eventSimulator,Ta=h.eventSandbox.focusBlur,Ma=h.nativeMethods,Da=E.domUtils,Ua=E.styleUtils,Ia=E.delay,Oa=E.selectController,ka=i.selectElement,Na=Ca.isTouchDevice?0:160,Ba=(Fa.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Oa.getEmulatedChildElement(this.element):this.element,e=1<Ua.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:xa.isIE&&e?this.parentSelect:t}},Fa.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=Dt(n=Oa.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=nf.documentElement,i=(e=ka.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},Fa.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Tr({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return Hs.create(n,s,ef,tl).then(function(t){return t.run()}).then(function(){return Ia(e.automationSettings.mouseActionStepDelay)})},Fa.prototype._mousedown=function(){var t=this;return xa.isFirefox?(Aa.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):xa.isIE?(Aa.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Ia(Na)}).then(function(){Aa.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},Fa.prototype._focus=function(){var e=this;return new Pa(function(t){Ta.focus(e.parentSelect,t,!1,!0)})},Fa.prototype._mouseup=function(){var t=xa.isIE?this.parentSelect:this.eventsArgs.element;Aa.mouseup(t,this.eventsArgs.options),xa.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=xa.isFirefox||xa.isSafari||xa.isChrome&&53<=xa.version,n=e||xa.isIE;return e&&this.clickCausesChange&&Aa.input(this.parentSelect),n&&this.clickCausesChange&&Aa.change(this.parentSelect),Pa.resolve()},Fa.prototype._click=function(){Aa.click(this.eventsArgs.element,this.eventsArgs.options)},Fa.prototype.run=function(){var t=this;if(!this.parentSelect)return Aa.click(this.eventsArgs.element,this.eventsArgs.options),Pa.resolve();this.optionListExpanded||ka.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Ua.getSelectElementSize(this.parentSelect)<=1?this._move(e).then(function(){return t._click()}):this._move(e).then(function(){return t._mousedown()}).then(function(){return t._mouseup()}).then(function(){return t._click()})},Fa);function Fa(t,e){var n,i,o,r,s;this.element=t,this.modifiers=e.modifiers,this.caretPos=e.caretPos,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.speed=e.speed,this.automationSettings=new vo(e.speed),this.parentSelect=Da.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Oa.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=Da.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=Da.getElementIndexInParent(this.parentSelect,this.element),o=Ma.nodeParentNodeGetter.call(this.element),r=Da.isOptionGroupElement(o)?o:null,s=this.element.disabled||r&&r.disabled,this.clickCausesChange=n&&!s&&this.childIndex!==i),this.eventsArgs={options:this.modifiers,element:this.element}}var La,Ra=h.utils.featureDetection,Va=h.utils.browser,Wa=h.eventSandbox.eventSimulator,Ya=E.eventUtils,Ka=E.delay,Xa=Ra.isTouchDevice?0:160,Ha=(_(Ga,La=hl),Ga.prototype._firstClick=function(t){var e=this,n=new xr(this.options);n.speed=1;var i=new da(this.element,n,ef,tl);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return Ka(Xa).then(function(){return t})})},Ga.prototype._secondClick=function(t){var e=this;Va.isIE&&Ya.bind(nf,"focus",Ya.preventDefault,!0);var n=new xr({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new da(nf.documentElement,n,ef,tl);return i.run().then(function(t){return e.eventState.dblClickElement=i.strategy.eventState.clickElement,Va.isIE&&Ya.unbind(nf,"focus",Ya.preventDefault,!0),t})},Ga.prototype._dblClick=function(t){this.eventState.dblClickElement&&Wa.dblclick(this.eventState.dblClickElement,t.options)},Ga.prototype.run=function(t){var e=this;return this._firstClick(t).then(function(t){return e._secondClick(t)}).then(function(t){return e._dblClick(t)})},Ga);function Ga(t,e){var n=La.call(this,t,e,ef,tl)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new vo(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var qa,za=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},ja=h.nativeMethods,$a=h.utils.featureDetection,Qa=h.utils.html,Za=h.utils.url,Ja=h.eventSandbox.DataTransfer,tu=h.eventSandbox.DragDataStore,eu=E.eventUtils,nu=E.domUtils,iu=(_(ou,qa=Hs),ou.create=function(o,r,s,l){return w(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,Hs.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new ou(n,i,r,s,l)]}})})},ou.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},ou.prototype._getEventSequenceOptions=function(t){var e=qa.prototype._getEventSequenceOptions.call(this,t),n=e.eventOptions,i=e.eventSequenceOptions;return n.dataTransfer=this.dragAndDropState.dataTransfer,n.buttons=eu.BUTTONS_PARAMETER.leftButton,i.holdLeftButton=!0,{eventOptions:n,eventSequenceOptions:i}},ou.prototype._getCorrectedTopElement=function(t){return this.touchMode?this.dragElement:t},ou.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions,o=Xs(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(t,as(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},ou.prototype._needMoveCursorImmediately=function(){return!1},ou.prototype.run=function(){var l=this;return Bt(this.cursor.getPosition()).then(function(t){l.dragElement=t;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=ja.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&$a.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new tu,l.dragAndDropState.dataTransfer=new Ja(l.dragAndDropState.dataStore),((e=nu.isAnchorElement(l.dragElement))||nu.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=Za.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=Qa.cleanUpHtml(ja.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),qa.prototype.run.call(l).then(function(){return l.dragAndDropState})})},ou);function ou(t,e,n,i,o){var r=qa.call(this,t,e,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new za,r}var ru,su=h.Promise,lu=h.utils.extend,au=h.utils.featureDetection,uu=h.eventSandbox.eventSimulator,cu=h.eventSandbox.focusBlur,hu=(_(fu,ru=hl),fu.prototype._getEndPoint=function(){throw new Error("Not implemented")},fu.prototype._mousedown=function(t){var e=this;return tl.leftButtonDown().then(function(){return e.simulateDefaultBehavior=uu[e.downEvent](t.element,t.options),e._focus(t)})},fu.prototype._focus=function(n){var i=this;return new su(function(t){var e=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;cu.focus(e,t,!1,!0)})},fu.prototype._getDestination=function(){throw new Error("Not implemented")},fu.prototype._drag=function(){var r=this;return this._getDestination().then(function(t){var e=t.element,n=t.offsets,i=t.endPoint;r.endPoint=i;var o=new Tr({offsetX:n.offsetX,offsetY:n.offsetY,modifiers:r.modifiers,speed:r.speed,minMovingTime:25,skipDefaultDragBehavior:!1===r.simulateDefaultBehavior},!1);return iu.create(e,o,ef,tl)}).then(function(t){return t.run()}).then(function(t){return r.dragAndDropState=t,g.delay(r.automationSettings.mouseActionStepDelay)})},fu.prototype._mouseup=function(){var o=this;return tl.buttonUp().then(function(){var e=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=lu({clientX:e.x,clientY:e.y},o.modifiers);return Bt(e).then(function(t){return(n=t)?(o.dragAndDropState.enabled?(i.dataTransfer=o.dragAndDropState.dataTransfer,o.dragAndDropState.dropAllowed&&uu.drop(n,i),uu.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):uu[o.upEvent](n,i),Bt(e)):n}).then(function(t){n&&t===n&&!o.dragAndDropState.enabled&&uu.click(n,i)})})},fu.prototype.run=function(t){var i,o=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint;return i={point:n,element:e,options:lu({clientX:n.x,clientY:n.y},o.modifiers)},su.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},fu);function fu(t,e){var n=ru.call(this,t,e,ef,tl)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=au.isTouchDevice?"touchstart":"mousedown",n.upEvent=au.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var du,mu=E.styleUtils,pu=(_(vu,du=hu),vu.prototype._getDestination=function(){return w(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){switch(t.label){case 0:return[4,_t(this.element,{x:this.offsetX,y:this.offsetY})];case 1:return e=t.sent(),n=mu.getWidth(nf),i=mu.getHeight(nf),o={x:e.x+this.dragOffsetX,y:e.y+this.dragOffsetY},o={x:Math.min(Math.max(0,o.x),n),y:Math.min(Math.max(0,o.y),i)},[2,{element:nf.documentElement,offsets:{offsetX:o.x,offsetY:o.y},endPoint:o}]}})})},vu);function vu(t,e,n,i){var o=du.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var gu,yu=E.positionUtils,Eu=(_(bu,gu=hu),bu.prototype._getDestination=function(){return w(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){return e=this.destinationElement,n=yu.getElementRectangle(e),i=Ut(e,this.destinationOffsetX,this.destinationOffsetY),o={x:n.left+i.offsetX,y:n.top+i.offsetY},[2,{element:e,offsets:i,endPoint:o}]})})},bu);function bu(t,e,n){var i=gu.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var Su,_u=(_(wu,Su=hl),wu.prototype.run=function(t){return this._ensureElement(t,!0)},wu);function wu(t,e){return Su.call(this,t,e,ef,tl)||this}var Pu=h.utils.browser,xu=h.sandbox.event,Cu=h.eventSandbox.eventSimulator,Au=h.eventSandbox.listeners,Tu=h.nativeMethods,Mu=E.domUtils,Du=E.contentEditable,Uu=E.textSelection,Iu=/ /g;function Ou(t){var e=Uu.getSelectionByElement(t),n=Uu.hasInverseSelectionContentEditable(t);return Uu.hasElementContainsSelection(t)?Du.getSelection(t,e,n):{startPos:Du.calculateNodeAndOffsetByPosition(t,0),endPos:Du.calculateNodeAndOffsetByPosition(t,0)}}function ku(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=Du.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=Du.getLastNonWhitespaceSymbolIndex(e.nodeValue);return n<o&&0!==n?(t.startPos.offset=o,t.endPos.offset=i+o-n):r<i&&i!==e.nodeValue.length&&(t.startPos.offset=e.nodeValue.length,t.endPos.offset=i+e.nodeValue.length-n),t}function Nu(t,e,n){return!n||Cu.beforeInput(t,e)}function Bu(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}Pu.isSafari&&(Au.addInternalEventBeforeListener(ef,["textInput"],i),xu.on(xu.EVENT_PREVENTED_EVENT,o));var r=Pu.isFirefox||Cu.textInput(t,e)||n;return Pu.isSafari&&(Au.removeInternalEventBeforeListener(ef,["textInput"],i),xu.off(xu.EVENT_PREVENTED_EVENT,o)),r||Pu.isIE11}function Fu(t,e){var n,i,o,r,s,l,a,u,c,h,f,d=Ou(t),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,y=e;function E(){g=!1}function b(t,e,n){n()}e=e.replace(Iu,String.fromCharCode(160)),m&&p&&Mu.isContentEditableElement(m)&&Mu.isContentEditableElement(p)&&(Mu.isTheSameNode(m,p)||(Uu.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=Tu.nodeParentNodeGetter.call(o)&&o.parentElement,!(Pu.isChrome&&Pu.version<58||Pu.isSafari)&&r&&Mu.isElementContainsNode(n,o)||(i=Ou(n),Uu.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Mu.isContentEditableElement(m)&&Mu.isRenderedNode(m)&&Nu(t,e,Pu.isChrome||Pu.isFirefox)&&(v=Bu(t,y),g=v&&!Pu.isIE11,Au.addInternalEventBeforeListener(ef,["input"],E),Au.addInternalEventBeforeListener(ef,["textinput"],b),(v=v&&Nu(t,e,Pu.isSafari))&&(Mu.isElementNode(m)?(s=m,l=e,c=nf.createTextNode(l),h={node:c,offset:l.length},f=Tu.nodeParentNodeGetter.call(s),"br"===Mu.getTagName(s)?f.insertBefore(c,s):0<a?(u=Tu.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Uu.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;Mu.isElementContainsNode(t,i)||(i=(e=ku(Ou(t))).startPos.node);var o=e.startPos.offset,r=e.endPos.offset,s=i.nodeValue,l={node:i,offset:o+n.length};i.nodeValue=s.substring(0,o)+n+s.substring(r,s.length),Uu.selectByNodesAndOffsets(l,l)}(t,ku(d),e)),So().then(function(){g&&Cu.input(t,e),Au.removeInternalEventBeforeListener(ef,["input"],E),Au.removeInternalEventBeforeListener(ef,["textinput"],b)})))}function Lu(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Mu.isContentEditableElement(t)&&Fu(t,e),Mu.isElementReadOnly(t)||(Mu.isTextEditableElement(t)?(l=t,a=e,h=Mu.getElementValue(l),f=a.length,d=Uu.getSelectionStart(l),m=Uu.getSelectionEnd(l),p=Mu.isInputElement(l)&&"number"===l.type,Nu(l,a,Pu.isChrome||Pu.isFirefox)&&Bu(l,a)&&Nu(l,a,Pu.isSafari)&&((u=!Pu.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=Pu.isIE&&Pu.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&Pu.isIOS&&"."===h[h.length-1]&&(d+=1),Mu.setElementValue(l,c),Uu.select(l,d+f,d+f)),Cu.input(l,a))):Mu.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=Mu.getElementValue(i),Mu.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Mu.setElementValue(i,o),Cu.change(i),Cu.input(i,o)))}function Ru(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var Vu=h.nativeMethods,Wu=h.utils.browser,Yu=h.eventSandbox.focusBlur,Ku=h.Promise,Xu=g.domUtils.isRadioButtonElement,Hu=g.domUtils.getActiveElement,Gu=g.domUtils.getTabIndexAttributeIntValue;function qu(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function zu(t){var e=Hu(t||nf),n=null;if(e&&g.domUtils.isIframeElement(e)&&Vu.contentDocumentGetter.call(e))try{n=zu(Vu.contentDocumentGetter.call(e))}catch(t){}return n||e}function ju(t,e,n){if(!Xu(e))return t;if(!n&&!e.name&&!Wu.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||Wu.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return Xu(t)&&t.name===i.name}:Wu.isChrome&&(o=function(t){return Xu(t)&&!t.name}),o);return r&&(t=g.arrayUtils.filter(t,r)),t}function $u(t,e,n){var i,o,r,s,l,a,u,c,h=e?-1:1,f=g.domUtils.getTopSameDomainWindow(ef).document,d=(i=f,o=Vu.documentActiveElementGetter.call(i),r=o&&Gu(o),!(o&&r<0)),m=ju(m=g.domUtils.getFocusableElements(f,d),t,n),p=Xu(t),v=g.arrayUtils.indexOf(m,t);return(e?0===v:v===m.length-1)?!e&&t.tabIndex<0?g.arrayUtils.find(m,function(t){return 0===t.tabIndex}):n||!p?nf.body:m[m.length-1-v]:e&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=Xu(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(t){return Xu(t)&&t.name===l.name&&t.checked})),c||l)}function Qu(t){if(Ru(t))return t.toUpperCase().charCodeAt(0);var e=g.KEY_MAPS.shiftMap[t]?g.KEY_MAPS.shiftMap[t].charCodeAt(0):t.charCodeAt(0);return g.KEY_MAPS.symbolCharCodeToKeyCode[e]||e}var Zu={SPECIAL_KEYS:{capslock:"CapsLock",delete:"U+007F",end:"End",enter:"Enter",esc:"U+001B",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:"U+0020",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},LETTERS:{a:"U+0041",b:"U+0042",c:"U+0043",d:"U+0044",e:"U+0045",f:"U+0046",g:"U+0047",h:"U+0048",i:"U+0049",j:"U+004A",k:"U+004B",l:"U+004C",m:"U+004D",n:"U+004E",o:"U+004F",p:"U+0050",q:"U+0051",r:"U+0052",s:"U+0053",t:"U+0054",u:"U+0055",v:"U+0056",w:"U+0057",x:"U+0058",y:"U+0059",z:"U+005A"},SYMBOLS:{0:"U+0030",1:"U+0031",2:"U+0032",3:"U+0033",4:"U+0034",5:"U+0035",6:"U+0036",7:"U+0037",8:"U+0038",9:"U+0039"," ":"U+0020","!":"U+0021","@":"U+0040","#":"U+0023",$:"U+0024","%":"U+0025","^":"U+005E","*":"U+002A","(":"U+0028",")":"U+0029",_:"U+005F","|":"U+007C","\\":"U+005C","/":"U+002F","?":"U+003F",".":"U+002E",",":"U+002C","<":"U+003C",">":"U+003E","[":"U+005B","]":"U+005D","{":"U+007B","}":"U+007D","§":"U+00A7","±":"U+00B1","'":"U+0027",'"':"U+0022",":":"U+003A",";":"U+003B","`":"U+0060","~":"U+007E"}};function Ju(t){return Ru(t)?Zu.LETTERS[t.toLowerCase()]:Zu.SYMBOLS[t]||Zu.SPECIAL_KEYS[t]||t}function tc(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var ec=h.utils.browser,nc=h.utils.extend,ic=h.eventSandbox.eventSimulator,oc=(rc._isKeyActivatedInputElement=function(t){return g.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},rc.prototype._type=function(t,e){var n,i=t!==this.storedActiveElement,o=!i,r=t,s=g.domUtils.isEditableElement(t),l=g.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=g.domUtils.isElementInIframe(t)===g.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!ec.isFirefox||l)&&(!ec.isWebKit||n))}catch(t){}o&&(!ec.isIE&&i&&l&&s&&(r=this.storedActiveElement),Lu(r,e))},rc.prototype._addKeyPropertyToEventOptions=function(t){return nc(t,tc("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},rc.prototype.down=function(t){this.storedActiveElement=zu(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=qu(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),ic.keydown(this.storedActiveElement,nc(e,t))},rc.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=zu(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(Ru(t))return qu(t);if(g.KEY_MAPS.reversedShiftMap[t])return g.KEY_MAPS.reversedShiftMap[t]}return t}(this.sanitizedKey,t.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=e!==this.storedActiveElement;if(ec.isWebKit&&o&&g.domUtils.isElementInIframe(e)!==g.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=e;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=ec.isAndroid||ic.keypress(e,nc(r,t));if(!s)return s;e=zu(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=rc._isKeyActivatedInputElement(e),a=g.domUtils.isButtonElement(e);return ec.isSafari&&0<=ec.compareVersions([ec.webkitVersion,"603.1.30"])||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},rc.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=ic.keyup(zu(this.topSameDomainDocument),nc(e,t)),i=zu(this.topSameDomainDocument);return!ec.isFirefox&&!ec.isSafari&&(!ec.isChrome||53<=ec.version)&&n&&"space"===this.sanitizedKey&&rc._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(rc.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),rc);function rc(t,e){this.isLetter=Ru(t),this.isChar=1===t.length||"space"===t,this.sanitizedKey=g.getSanitizedKey(t),this.modifierKeyCode=g.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=g.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=Ju(e),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(ef).document,this.keyProperty=g.KEY_MAPS.keyProperty[e]||e,this.isChar&&"space"!==t?this.keyCode=Qu(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}var sc,lc={ctrlA:"ctrl+a",backspace:"backspace",delete:"delete",left:"left",right:"right",up:"up",down:"down",shiftLeft:"shift+left",shiftRight:"shift+right",shiftUp:"shift+up",shiftDown:"shift+down",shiftHome:"shift+home",shiftEnd:"shift+end",home:"home",end:"end",enter:"enter",tab:"tab",shiftTab:"shift+tab",esc:"esc"},ac=h.Promise,uc=h.utils.browser,cc=h.eventSandbox.eventSimulator,hc=h.eventSandbox.elementEditingWatcher,fc=E.textSelection,dc=E.eventUtils,mc=E.domUtils,pc=i.selectElement,vc=null,gc=null;function yc(){gc=vc=null,dc.unbind(this,"blur",yc,!0)}function Ec(t){var e,n,i,o;mc.isTextAreaElement(t)&&(vc!==t&&(dc.bind(t,"blur",yc,!0),vc=t),e=t,n=fc.hasInverseSelection(e),i=mc.getTextAreaValue(e),o=n?fc.getSelectionStart(e):fc.getSelectionEnd(e),gc=i&&o?mc.getTextareaIndentInLine(e,o):0)}function bc(t,e){var n,i,o,r,s,l,a=mc.getTextAreaValue(t);a&&(n=fc.getSelectionStart(t),i=fc.getSelectionEnd(t),o=fc.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==gc&&vc===t||Ec(t),s=l.lastIndexOf("\n"),_c(t,n,i,o,Math.min(s+1+gc,l.length),e))}function Sc(t,e){var n,i,o,r,s,l,a,u,c,h,f=mc.getTextAreaValue(t);f&&(n=fc.getSelectionStart(t),i=fc.getSelectionEnd(t),u=(r=(o=fc.hasInverseSelection(t))?n:i)+(l=-1===(c=(s=f.substring(r)).indexOf("\n"))?s.length:c+1),h=-1===(c=(a=s.substring(l)).indexOf("\n"))?a.length:c,null!==gc&&vc===t||Ec(t),_c(t,n,i,o,u=Math.min(u+gc,u+h),e))}function _c(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;fc.select(t,s,l)}function wc(t,e,n){mc.isInputElement(t)&&"number"===t.type&&("-"===e.charAt(0)&&"."===e.charAt(1)&&(e=e.substring(1)),"."===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1))),mc.setElementValue(t,e),fc.select(t,n,n),cc.input(t)}function Pc(t,e){var n,i,o,r,s,l,a,u;return mc.isTextEditableElement(t)&&(n=fc.getSelectionStart(t),i=fc.getSelectionEnd(t),o=fc.hasInverseSelection(t),s=null,s=(r=!mc.isTextAreaElement(t)||mc.getTextareaLineNumberByPosition(t,n)===mc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=mc.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,fc.select(t,u,a)):o?fc.select(t,i,a):fc.select(t,n,a)),ac.resolve()}function xc(t,e){var n,i,o,r,s,l,a,u,c;return mc.isTextEditableElement(t)&&(n=fc.getSelectionStart(t),i=fc.getSelectionEnd(t),o=fc.hasInverseSelection(t),s=null,u=s=(r=!mc.isTextAreaElement(t)||mc.getTextareaLineNumberByPosition(t,n)===mc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=mc.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,fc.select(t,c,u)):o?fc.select(t,i,u):fc.select(t,n,u)),ac.resolve()}function Cc(t){return Pc(t,!0)}function Ac(t){return xc(t,!0)}function Tc(t){return mc.isRadioButtonElement(t)}function Mc(t,e){return Dc(t,e,!1).then(function(t){t&&(t.checked=!0)})}function Dc(t,e,n){return void 0===n&&(n=!0),t?(mc.isSelectElement(t)&&pc.collapseOptionList(),i=t,o=e,r=n,new Ku(function(t){var e=$u(i,o,r);e?Yu.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&mc.isTextEditableInput(t)&&fc.select(t),t})):ac.resolve();var i,o,r}var Uc=((sc={})[lc.ctrlA]=function(t){return mc.isEditableElement(t)&&fc.select(t),ac.resolve()},sc[lc.backspace]=function(t){var e,n,i;return mc.isTextEditableElementAndEditingAllowed(t)&&(e=fc.getSelectionStart(t),n=fc.getSelectionEnd(t),i=mc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&wc(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):wc(t,i.substring(0,e)+i.substring(n,i.length),e)),mc.isContentEditableElement(t)&&fc.deleteSelectionContents(t),ac.resolve()},sc[lc.delete]=function(t){var e,n,i;return mc.isTextEditableElementAndEditingAllowed(t)&&(e=fc.getSelectionStart(t),n=fc.getSelectionEnd(t),i=mc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&wc(t,i.substring(0,e)+i.substring(n+1,i.length),e):wc(t,i.substring(0,e)+i.substring(n,i.length),e)),mc.isContentEditableElement(t)&&fc.deleteSelectionContents(t),ac.resolve()},sc[lc.left]=function(t){var e,n,i,o,r=null;return mc.isSelectElement(t)&&pc.switchOptionsByKeys(t,"left"),Tc(t)?Mc(t,!0):(mc.isTextEditableElement(t)&&(e=(r=fc.getSelectionStart(t)||0)===fc.getSelectionEnd(t)?r-1:r,fc.select(t,e,e),Ec(t)),mc.isContentEditableElement(t)&&(r=fc.getSelectionStart(t))!==fc.getSelectionEnd(t)&&(n=fc.getSelectionByElement(t),o={node:(i=fc.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},fc.selectByNodesAndOffsets(o,o,!0)),ac.resolve())},sc[lc.right]=function(t){var e,n,i,o,r=null,s=null;return mc.isSelectElement(t)&&pc.switchOptionsByKeys(t,"right"),Tc(t)?Mc(t,!1):(mc.isTextEditableElement(t)&&(e=(r=fc.getSelectionStart(t))===(s=fc.getSelectionEnd(t))?s+1:s,r===mc.getElementValue(t).length&&(e=r),fc.select(t,e,e),Ec(t)),mc.isContentEditableElement(t)&&(r=fc.getSelectionStart(t))!==(s=fc.getSelectionEnd(t))&&(n=fc.getSelectionByElement(t),o={node:(i=fc.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},fc.selectByNodesAndOffsets(o,o,!0)),ac.resolve())},sc[lc.up]=function(t){return mc.isSelectElement(t)&&pc.switchOptionsByKeys(t,"up"),Tc(t)?Mc(t,!0):uc.isWebKit&&mc.isInputElement(t)?Pc(t):(mc.isTextAreaElement(t)&&bc(t,!1),ac.resolve())},sc[lc.down]=function(t){return mc.isSelectElement(t)&&pc.switchOptionsByKeys(t,"down"),Tc(t)?Mc(t,!1):uc.isWebKit&&mc.isInputElement(t)?xc(t):(mc.isTextAreaElement(t)&&Sc(t,!1),ac.resolve())},sc[lc.shiftLeft]=function(t){var e,n;return mc.isTextEditableElement(t)&&((e=fc.getSelectionStart(t))===(n=fc.getSelectionEnd(t))||fc.hasInverseSelection(t)?fc.select(t,n,Math.max(e-1,0)):fc.select(t,e,Math.max(n-1,0)),Ec(t)),ac.resolve()},sc[lc.shiftRight]=function(t){var e,n,i;return mc.isTextEditableElement(t)&&(e=fc.getSelectionStart(t),n=fc.getSelectionEnd(t),i=mc.getElementValue(t).length,e!==n&&fc.hasInverseSelection(t)?fc.select(t,n,Math.min(e+1,i)):fc.select(t,e,Math.min(n+1,i)),Ec(t)),ac.resolve()},sc[lc.shiftUp]=function(t){return uc.isWebKit&&mc.isInputElement(t)?Cc(t):(mc.isTextAreaElement(t)&&bc(t,!0),ac.resolve())},sc[lc.shiftDown]=function(t){return uc.isWebKit&&mc.isInputElement(t)?Ac(t):(mc.isTextAreaElement(t)&&Sc(t,!0),ac.resolve())},sc[lc.shiftHome]=Cc,sc[lc.shiftEnd]=Ac,sc[lc.home]=Pc,sc[lc.end]=xc,sc[lc.enter]=function(t){var e,n,i,o,r,s;return mc.isSelectElement(t)&&pc.collapseOptionList(),mc.isInputElement(t)?(uc.isIE||hc.processElementChanging(t),(e=mc.getParents(t,"form")[0])&&function(t,e){var n=t.querySelectorAll("input, button"),i=null,o=null;for(o=0;o<n.length;o++)if(!i&&"submit"===n[o].type&&!n[o].disabled){i=n[o];break}if(i)cc.click(i);else if(mc.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)mc.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&cc.submit(t)&&t.submit()}}(e,t)):mc.isTextAreaElement(t)?(n=fc.getSelectionStart(t),o=(i=mc.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,wc(t,o+String.fromCharCode(10)+r,s)):t.tagName&&mc.isAnchorElement(t)&&cc.click(t),ac.resolve()},sc[lc.tab]=function(t){return Dc(t,!1)},sc[lc.shiftTab]=function(t){return Dc(t,!0)},sc[lc.esc]=function(t){return mc.isSelectElement(t)&&pc.collapseOptionList(),ac.resolve()},sc),Ic=h.Promise,Oc=h.utils.browser,kc=h.eventSandbox.message,Nc=h.nativeMethods,Bc="automation|press|request",Fc="automation|press|response";kc.on(kc.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Bc&&(h.on(h.EVENTS.beforeUnload,function(){return kc.sendServiceMsg({cmd:Fc},t.source)}),new Lc(t.message.keyCombinations,t.message.options).run().then(function(){return kc.sendServiceMsg({cmd:Fc},t.source)}))});var Lc=(Rc._getKeyPressSimulators=function(t){var e=function(t){for(var e=t.slice(),n=0;n<t.length;n++){var i=t[n];if("shift"===i.toLowerCase()){var o=t[n+1];if(!o)continue;g.KEY_MAPS.shiftMap[o]?t[n+1]=g.KEY_MAPS.shiftMap[o]:g.KEY_MAPS.reversedShiftMap[o]&&(e[n+1]=g.KEY_MAPS.reversedShiftMap[o])}!g.KEY_MAPS.shiftMap[i]||t[n-1]&&"shift"===t[n-1].toLowerCase()||(t[n]=g.KEY_MAPS.shiftMap[i],t.splice(n,0,"shift"),e.splice(n,0,"shift"),n++)}return{actualKeys:t,eventKeyProperties:e}}(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return new oc(t,i[e])})},Rc._getShortcuts=function(t){for(var e=g.getKeyArray(t.toLowerCase()),n=[],i=[],o=[],r=0;r<e.length;r++)for(i.push(e[r]),o=i.slice();o.length;){var s=o.join("+");Uc[s]?(n.push(s),i=o=[]):o.shift()}return n},Rc._getShortcutHandlers=function(t){for(var e,n,i,o=Rc._getShortcuts(t.toLowerCase()),r={},s="",l=0;l<o.length;l++)e=o[l],n=t.indexOf(e),i=e.length,r[s+=t.substring(0,n+i)]=Uc[e],t=t.substring(n+i);return r},Rc.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return Ic.resolve(e)},Rc.prototype._press=function(t,e){var n=this;if(e&&!this.isSelectElement)return g.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&!Oc.isFirefox&&"enter"!==t.key||(o=!t.press(this.modifiersState)),o&&!this.isSelectElement||!i?g.delay(this.automationSettings.keyActionStepDelay):i(zu(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},Rc.prototype._up=function(t){return t.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},Rc.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(zu(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=Rc._getShortcutHandlers(t);var e=Rc._getKeyPressSimulators(t);return g.promiseUtils.each(e,function(e){return n._down(e).then(function(t){return n._press(e,t)})}).then(function(){return g.arrayUtils.reverse(e),g.promiseUtils.each(e,function(t){return n._up(t)})})},Rc.prototype.run=function(){var e=this,t=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(t);if(!hs(ef)&&n&&Nc.contentWindowGetter.call(t)){var i={cmd:Bc,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,Fc,Nc.contentWindowGetter.call(t))}return g.promiseUtils.each(this.keyCombinations,function(t){return e._runCombination(t).then(function(){return g.delay(e.automationSettings.keyActionStepDelay)})})},Rc);function Rc(t,e){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(ef).document,this.automationSettings=new vo(e.speed),this.options=e}var Vc,Wc=h.Promise,Yc=h.utils.extend,Kc=h.utils.browser,Xc=h.eventSandbox.eventSimulator,Hc=E.domUtils,Gc=E.eventUtils,qc=E.delay,zc=(_(jc,Vc=hl),jc.prototype._mousedown=function(t){var e=this;return tl.rightButtonDown().then(function(){return e.eventState.activeElementBeforeMouseDown=Hc.getActiveElement(),e.eventState.simulateDefaultBehavior=Xc.mousedown(t.element,t.options),e._focus(t)})},jc.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?So():Ul(Hc.isContentEditableElement(this.element)?this.element:t.element,!Kc.isIE||this.eventState.activeElementBeforeMouseDown===Hc.getActiveElement(),this.caretPos).then(So)},jc.prototype._mouseup=function(e){var t=this;return tl.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return Xc.mouseup(t,e.options)})},jc.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){Xc.contextmenu(t,e.options),Hc.isElementFocusable(t)||Ol(t)})},jc.prototype.run=function(t){var o=this,r=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.devicePoint;return r={point:n,element:e,options:Yc({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:Gc.BUTTON.right},o.modifiers)},Wc.all([qc(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},jc);function jc(t,e){var n=Vc.call(this,t,e,ef,tl)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var $c=h.utils.browser,Qc=E.domUtils,Zc=E.positionUtils,Jc=E.styleUtils,th=E.contentEditable,eh=E.arrayUtils,nh=["direction","font-family","font-size","font-size-adjust","font-variant","font-weight","font-style","letter-spacing","line-height","text-align","text-indent","text-transform","word-wrap","word-spacing","padding-top","padding-left","padding-right","padding-bottom","margin-top","margin-left","margin-right","margin-bottom","border-top-width","border-left-width","border-right-width","border-bottom-width"];function ih(t,e){var n,i,o,r,s,l=Jc.getBordersWidth(t),a=Zc.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return Qc.isTextAreaElement(t)||(i=(n=Zc.offsetToClientCoords({x:a.left,y:a.top})).x+l.left+1,o=n.y+l.top+1,r=n.y+l.top+l.bottom+u,s=n.y+l.top+u-1,c=Math.ceil(c<=n.x?i:e.left),h=Math.ceil(h<=n.y?o:e.top),f=Math.floor(r<=f?s:e.bottom)),{left:c,top:h,bottom:f}}function oh(t){var e=Jc.getElementScroll(nf);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function rh(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=nf.body,r=Zc.getOffsetPosition(e),s=Jc.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=nf.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===Jc.get(o,"position")&&(t=Jc.getElementMargin(o),n=Jc.get(o,"left"),i=Jc.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),eh.forEach(nh,function(t){c+="".concat(t,":").concat(Jc.get(e,t),";")}),Jc.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:e.scrollWidth+"px",height:e.scrollHeight+"px"}),h.nativeMethods.nodeTextContentSetter.call(u,Qc.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=Qc.getElementValue(t).length;try{var u=nf.createRange();u.setStart(h.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e,a)),u.setEnd(h.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e+1,a+1)),Qc.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return Qc.remove(i),o?{width:o.width,height:o.height,top:o.top-s,bottom:o.bottom-s,left:o.left-l,right:o.right-l}:null}function sh(t,e){var n,i,o,r,s,l,a=null;return(a=Qc.isContentEditableElement(t)?(o=t,r=e,s=Qc.findDocument(o).createRange(),l=th.calculateNodeAndOffsetByPosition(o,r),s.setStart(l.node,Math.min(l.offset,l.node.length)),s.setEnd(l.node,Math.min(l.offset,l.node.length)),s.getClientRects()[0]):"function"==typeof t.createTextRange?(n=e,(i=t.createTextRange()).collapse(!0),i.moveStart("character",n),i.moveEnd("character",n),i.collapse(!0),i.getBoundingClientRect()):rh(t,e))?{x:(a=oh(a=ih(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function lh(t,e){var n=Qc.isTextEditableElement(t),i=Qc.isContentEditableElement(t);return n&&0<Qc.getElementValue(t).length||i&&th.getContentEditableValue(t).length?sh(t,e):Zc.findCenter(t)}function ah(t,e,n){var i=Qc.findDocument(t).createRange();i.setStart(e,Math.min(n,e.length)),i.setEnd(e,Math.min(n,e.length));var o=i.getClientRects()[0];return o?{x:(o=oh(ih(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var uh,ch=h.Promise,hh=h.utils.browser,fh=h.utils.featureDetection,dh=h.eventSandbox.eventSimulator,mh=h.eventSandbox.focusBlur,ph=E.contentEditable,vh=E.domUtils,gh=E.positionUtils,yh=E.eventUtils,Eh=E.delay,bh=(_(Sh,uh=hl),Sh.prototype._calculateEventArguments=function(){var e=this,n=gh.offsetToClientCoords(this.clientPoint);return Bt(n).then(function(t){if(!t)throw new ni(null,{reason:gh.getElOutsideBoundsReason(e.element)});return{element:t,options:{clientX:n.x,clientY:n.y}}})},Sh.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Tr({offsetX:i,offsetY:o,speed:r},!1);return Hs.create(n,s,ef,tl).then(function(t){return t.run()}).then(function(){return Eh(e.automationSettings.mouseActionStepDelay)})},Sh.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,yh.preventDefault(t),yh.unbind(e.element,"mousedown",n)};yh.bind(this.element,"mousedown",n)},Sh.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},Sh.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},Sh.prototype._moveToPoint=function(t){!function(t,e){if(Qc.isEditableElement(t)){var n=Qc.isTextAreaElement(t);if(!Qc.isInputElement(t)||!($c.isFirefox||$c.isIE&&10<$c.version)){var i=Zc.getOffsetPosition(t),o=Jc.getBordersWidth(t),r=Jc.getElementScroll(t),s=e.x-i.left-o.left,l=e.y-i.top-o.top,a=null;if(n)return l<r.top&&(a=l),l>t.clientHeight+r.top&&(a=l-t.clientHeight),null!==a&&Jc.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&Jc.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=Qc.isTextEditableElement(t),i=Qc.isInputElement(t);if(!n&&!Qc.isContentEditableElement(t))return e;var o=Zc.getOffsetPosition(t),r=Jc.getBordersWidth(t),s=Jc.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&($c.isFirefox||$c.isIE&&10<$c.version)?{x:Math.min(e.x,l),y:e.y}:{x:e.x-s.left,y:e.y-s.top}}(this.element,t);var e={element:nf.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},Sh.prototype._mousedown=function(){var n=this;return tl.leftButtonDown().then(function(){return n._calculateEventArguments()}).then(function(t){n.eventArgs=t;var e=(hh.isWebKit||hh.isIE)&&vh.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=dh[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},Sh.prototype._focus=function(){var n=this;return new ch(function(t){var e=vh.isContentEditableElement(n.element)?ph.findContentEditableParent(n.element):n.element;mh.focus(e,t,!1,!0)})},Sh.prototype._setSelection=function(){throw new Error("Not implemented")},Sh.prototype._mouseup=function(){var e=this;return tl.buttonUp().then(function(){return e._setSelection(),e._calculateEventArguments()}).then(function(t){e.eventArgs=t,dh[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},Sh.prototype.run=function(){var t=this;return this.absoluteStartPoint=this._calculateAbsoluteStartPoint(),this.absoluteEndPoint=this._calculateAbsoluteEndPoint(),this._moveToPoint(this.absoluteStartPoint).then(function(){return t._mousedown()}).then(function(){return t._moveToPoint(t.absoluteEndPoint)}).then(function(){return t._mouseup()})},Sh);function Sh(t,e){var n=uh.call(this,t,e,ef,tl)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=fh.isTouchDevice?"touchstart":"mousedown",n.upEvent=fh.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var _h,wh=E.textSelection,Ph=E.domUtils,xh=E.positionUtils,Ch=(_(Ah,_h=bh),Ah.prototype._calculateAbsoluteStartPoint=function(){return lh(this.element,this.startPos)||xh.findCenter(this.element)},Ah.prototype._calculateAbsoluteEndPoint=function(){var t=lh(this.element,this.endPos);return t||(Ph.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=sh(t,o+=i)););return r=r||sh(t,e)||Zc.findCenter(t)}(this.element,this.startPos,this.endPos):xh.findCenter(this.element))},Ah.prototype._setSelection=function(){var t=Ph.isTextEditableElement(this.element),e=Ph.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&wh.select(this.element,this.startPos,this.endPos)},Ah.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return _h.prototype.run.call(e)})},Ah);function Ah(t,e,n,i){var o=_h.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var Th,Mh=E.textSelection,Dh=E.contentEditable,Uh=E.positionUtils,Ih=(_(Oh,Th=bh),Oh.prototype._calculateAbsoluteStartPoint=function(){return ah(this.element,this.startNode,this.startOffset)||Uh.findCenter(this.element)},Oh.prototype._calculateAbsoluteEndPoint=function(){return ah(this.element,this.endNode,this.endOffset)||Uh.findCenter(this.element)},Oh.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Mh.selectByNodesAndOffsets(t,e,!0))},Oh);function Oh(t,e,n){var i=Th.call(this,Dh.getNearestCommonAncestor(t,e),n)||this,o=Dh.getFirstVisiblePosition(t),r=Dh.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=Dh.calculatePositionByNodeAndOffset(i.element,s);return Dh.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=Dh.getLastVisiblePosition(t),r=Dh.getFirstVisiblePosition(e)),s=Dh.calculateNodeAndOffsetByPosition(t,o),l=Dh.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var kh=h.Promise,Nh=h.utils.extend,Bh=h.utils.browser,Fh=h.eventSandbox.eventSimulator,Lh=h.eventSandbox.elementEditingWatcher,Rh=E.domUtils,Vh=E.promiseUtils,Wh=E.contentEditable,Yh=E.textSelection,Kh=E.delay,Xh=E.KEY_MAPS.specialKeys,Hh=(Gh.findTextEditableChild=function(t){var e=null;if(!Rh.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(Rh.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},Gh.prototype._calculateEventArguments=function(t){var e=Rh.getActiveElement(),n=Rh.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=Gh.findTextEditableChild(e)||e);var o=Nh({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),Nh(o,tc(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},Gh.prototype._calculateTargetElement=function(){var t=Rh.getActiveElement(),e=Rh.isContentEditableElement(this.element);if(e){if(t!==Wh.findContentEditableParent(this.element))return void(this.eventState.skipType=!0)}else if(t!==this.element)return void(this.eventState.skipType=!0);this.element=e?this.element:t},Gh.prototype._click=function(t){var e,n=this,i=Rh.getActiveElement(),o=Rh.isTextEditableElementAndEditingAllowed(this.element),r=Rh.isContentEditableElement(this.element);if(i===this.element)return o&&Lh.watchElementEditing(this.element),(o||r)&&(e=Yh.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||Yh.select(this.element,this.caretPos,this.caretPos)),kh.resolve();var s=Dt(this.element),l=s.offsetX,a=s.offsetY,u=new xr({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new da(this.element,u,ef,tl).run(t).then(function(){return Kh(n.automationSettings.mouseActionStepDelay)})},Gh.prototype._type=function(){var t=this;if(this.eventState.skipType)return kh.resolve();var e=Rh.isContentEditableElement(this.element);return this.replace&&(Rh.isTextEditableElementAndEditingAllowed(this.element)?Yh.select(this.element):e&&Yh.deleteSelectionContents(this.element,!0)),Vh.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},Gh.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},Gh.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=Qu(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this.currentKeyCode===Xh.enter?"Enter":t,this.currentKeyIdentifier=Ju(this.currentKey),this.ignoreChangeEvent=Rh.getElementValue(this.element)===Lh.getElementSavedValue(this.element),this._keydown(),this._keypress(),this._keyup()},Gh.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=Fh.keydown(this.eventArgs.element,this.eventArgs.options)},Gh.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=Bh.isAndroid||Fh.keypress(this.eventArgs.element,this.eventArgs.options))},Gh.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=Rh.isTextEditableElement(this.element),i=Rh.isContentEditableElement(this.element),o=this.paste||!n&&!i;return kh.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){Fh.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},Gh.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&Lh.restartWatchingElementEditing(t),Kh(this.automationSettings.keyActionStepDelay);var e=this.typingText.charAt(this.currentPos),n=/^\d$/.test(e),i=0===this.currentPos?null:this.typingText.charAt(this.currentPos-1);if(Rh.isInputElement(t)&&"number"===t.type){var o=Yh.getSelectionStart(t),r=Rh.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return Kh(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return Lu(t,e,null),Kh(this.automationSettings.keyActionStepDelay)},Gh.prototype._typeAllText=function(t){return Lu(t,this.typingText,this.caretPos),Kh(this.automationSettings.keyActionStepDelay)},Gh.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},Gh);function Gh(t,e,n){this.element=Gh.findTextEditableChild(t)||t,this.typingText=e.toString(),this.modifiers=n.modifiers,this.caretPos=n.caretPos,this.replace=n.replace,this.paste=n.paste,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=n.speed,this.automationSettings=new vo(this.speed),this.elementChanged=t!==this.element,this.currentPos=0,this.currentKeyCode=null,this.currentCharCode=null,this.currentKey=null,this.currentKeyIdentifier=null,this.ignoreChangeEvent=!0,this.eventArgs={options:null,element:null},this.eventState={skipType:!1,simulateKeypress:!0,simulateTypeChar:!0}}var qh=(zh.prototype.run=function(){var i=this;return m.doUpload(this.element,this.paths).then(function(t){if(t.length){var e=g.arrayUtils.map(t,function(t){return t.path}),n=g.arrayUtils.reduce(t,function(t,e){return t.concat(e.resolvedPaths)},[]);throw i.createError(e,n)}})},zh);function zh(t,e,n){this.element=t,this.paths=e,this.createError=n}var jh=E.domUtils,$h=E.contentEditable,Qh={};Qh.DispatchEvent=t,Qh.SetScroll=pl,Qh.ScrollIntoView=yl,Qh.Click=da,Qh.SelectChildClick=Ba,Qh.DblClick=Ha,Qh.DragToOffset=pu,Qh.DragToElement=Eu,Qh.Hover=_u,Qh.Press=Lc,Qh.RClick=zc,Qh.SelectText=Ch,Qh.SelectEditableContent=Ih,Qh.Type=Hh,Qh.Upload=qh,Qh.MouseOptions=_r,Qh.ClickOptions=xr,Qh.TypeOptions=Br,Qh.AutomationSettings=vo,Qh.getOffsetOptions=Ut,Qh.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=jh.isTextEditableElement(t),m=d?0:$h.getFirstVisiblePosition(t),p=d?jh.getElementValue(t).length:$h.getLastVisiblePosition(t),v=e.startPos?Math.min(e.startPos,p):m,g=void 0===e.endPos||null===e.endPos?p:Math.min(e.endPos,p);return void 0!==e.offset?(g=0<=e.offset?Math.min(e.offset,g):(v=g,Math.max(0,g+e.offset)),{startPos:v,endPos:g}):void 0!==e.startLine?(n=t,i=e,o=jh.getTextAreaValue(n),r=o&&o.length?o.split("\n"):[],s=r.length-1,l=i.startLine?Math.min(i.startLine,s):0,a=r[l]?r[l].length:0,u=i.startPos?Math.min(i.startPos,a):0,c=void 0===i.endLine||null===i.endLine?s:Math.min(i.endLine,s),h=r[c]?r[c].length:0,f=void 0===i.endPos||null===i.endPos?h:Math.min(i.endPos,h),{startPos:jh.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:jh.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},Qh.cursor=tl,Qh.getNextFocusableElement=$u,Qh.SHORTCUT_TYPE=lc,Qh.getSelectionCoordinatesByPosition=lh,Qh.getElementFromPoint=Bt,Qh.MoveAutomation=Hs;var Zh=h.nativeMethods,Jh=h.EVENTS.evalIframeScript;Zh.objectDefineProperty(ef,"%testCafeAutomation%",{configurable:!0,value:Qh}),h.on(Jh,function(t){return tf(Zh.contentWindowGetter.call(t.iframe))})}(ef["%hammerhead%"],ef["%hammerhead%"].Promise,ef["%testCafeCore%"],ef["%testCafeUI%"])}(window);
1
+ window["%hammerhead%"].utils.removeInjectedScript(),function Ef(bf){var Sf=bf.document;!function(m,e,g,i){var y="default"in m?m.default:m;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var E="default"in g?g.default:g;i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var n=y.nativeMethods,o=/^((mouse\w+)|((dbl)?click)|(contextmenu))$/,r=/^((drag\w*)|(drop))$/,s=/^key\w+$/,l=/^(before)?input$/,a=/^(blur|(focus(in|out)?))$/,u=/^pointer\w+/,c={click:1,dblclick:2,mousedown:1,mouseup:1},h="MouseEvent",f="PointerEvent",d="KeyboardEvent",p="InputEvent",v="FocusEvent",t=(b.prototype.run=function(){var t=this.options,e=t.bubbles,n=t.cancelable,i=t.detail,o=(t.view,t.buttons),e=!1!==e,n=!1!==n,i=i||c[this.eventName],o=void 0===o?1:o;Object.assign(this.options,{bubbles:e,cancelable:n,detail:i,view:bf,buttons:o});var r,s=b._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},b._getEventCtorByEventType=function(t,e){if(e&&"function"==typeof b._getEventCtorFromWindow(e)){var n=b._getEventCtorFromNativeMethods(e);if(n&&"function"==typeof n)return n}return o.test(t)||r.test(t)?b._getEventCtorFromNativeMethods(h):u.test(t)?b._getEventCtorFromNativeMethods(f):s.test(t)?b._getEventCtorFromNativeMethods(d):l.test(t)?b._getEventCtorFromNativeMethods(p):a.test(t)?b._getEventCtorFromNativeMethods(v):b._getEventCtorFromNativeMethods("CustomEvent")},b._getEventCtorFromNativeMethods=function(t){return n["Window"+t]||b._getEventCtorFromWindow(t)},b._getEventCtorFromWindow=function(t){return bf[t]},b);function b(t,e,n){this.element=t,this.eventName=e,this.options=n}var S=function(t,e){return(S=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 w(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}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function _(t,s,l,a){return new(l=l||e)(function(n,e){function i(t){try{r(a.next(t))}catch(t){e(t)}}function o(t){try{r(a.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof l?e:new l(function(t){t(e)})).then(i,o)}r((a=a.apply(t,s||[])).next())})}function P(n,i){var o,r,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function t(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;a&&e[a=0]&&(l=0),l;)try{if(o=1,r&&(s=2&e[0]?r.return:e[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,e[1])).done)return s;switch(r=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,r=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){l.label=e[1];break}if(6===e[0]&&l.label<s[1]){l.label=s[1],s=e;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(e);break}s[2]&&l.ops.pop(),l.trys.pop();continue}e=i.call(n,l)}catch(t){e=[6,t],r=0}finally{o=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var x=(A.create=function(t){return"left"in t?new A(t.left,t.top):"right"in t?new A(t.right,t.bottom):new A(t.x,t.y)},A.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},A.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},A.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},A.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},A.prototype.mul=function(t){return this.x*=t,this.y*=t,this},A.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},A);function A(t,e){this.x=t,this.y=e}function C(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=m.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}C("filter"),C("map"),C("slice"),C("splice"),C("unshift"),C("forEach"),C("indexOf");var T=C("some"),M=(C("reverse"),C("reduce"),C("concat"),C("join"),C("every"),y.utils.browser,y.nativeMethods),D=(y.utils.style.get,y.utils.dom.getActiveElement,y.utils.dom.findDocument),I=y.utils.dom.find,U=(y.utils.dom.isElementInDocument,y.utils.dom.isElementInIframe),k=y.utils.dom.getIframeByElement,O=(y.utils.dom.isCrossDomainWindows,y.utils.dom.getSelectParent,y.utils.dom.getChildVisibleIndex,y.utils.dom.getSelectVisibleChildren,y.utils.dom.isElementNode),N=(y.utils.dom.isTextNode,y.utils.dom.isRenderedNode,y.utils.dom.isIframeElement,y.utils.dom.isInputElement,y.utils.dom.isButtonElement,y.utils.dom.isFileInput,y.utils.dom.isTextAreaElement,y.utils.dom.isAnchorElement,y.utils.dom.isImgElement),B=(y.utils.dom.isFormElement,y.utils.dom.isLabelElement,y.utils.dom.isSelectElement,y.utils.dom.isRadioButtonElement,y.utils.dom.isColorInputElement,y.utils.dom.isCheckboxElement,y.utils.dom.isOptionElement,y.utils.dom.isSVGElement,y.utils.dom.isMapElement),F=y.utils.dom.isBodyElement,L=y.utils.dom.isHtmlElement,V=(y.utils.dom.isDocument,y.utils.dom.isWindow,y.utils.dom.isTextEditableInput,y.utils.dom.isTextEditableElement,y.utils.dom.isTextEditableElementAndEditingAllowed,y.utils.dom.isContentEditableElement,y.utils.dom.isDomElement,y.utils.dom.isShadowUIElement,y.utils.dom.isShadowRoot,y.utils.dom.isElementFocusable,y.utils.dom.isHammerheadAttr,y.utils.dom.isElementReadOnly,y.utils.dom.getScrollbarSize),K=y.utils.dom.getMapContainer,R=y.utils.dom.getTagName,Y=y.utils.dom.closest,W=y.utils.dom.getParents,X=y.utils.dom.findParent;function H(t,e){return t.contains?t.contains(e):T(t,function(t){return t.contains(e)})}function q(t){var e=[];I(Sf,"*",function(t){"IFRAME"===t.tagName&&e.push(t),t.shadowRoot&&I(t.shadowRoot,"iframe",function(t){return e.push(t)})});for(var n=0;n<e.length;n++)if(M.contentWindowGetter.call(e[n])===t)return e[n];return null}function G(t){return M.nodeTextContentGetter.call(t)}y.utils.dom.getTopSameDomainWindow,y.utils.dom.getParentExceptShadowRoot;var z=(j.create=function(t){return new j(t.top,t.right,t.bottom,t.left)},j.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},j.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},j.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},j.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},j);function j(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.top=t,this.right=e,this.bottom=n,this.left=i}var $=y.utils.style,Q=y.utils.style.getBordersWidth,Z=(y.utils.style.getComputedStyle,y.utils.style.getElementMargin,y.utils.style.getElementPadding),J=y.utils.style.getElementScroll,tt=(y.utils.style.getOptionHeight,y.utils.style.getSelectElementSize,y.utils.style.isElementVisible,y.utils.style.isVisibleChild,y.utils.style.getWidth),et=y.utils.style.getHeight,nt=y.utils.style.getInnerWidth,it=y.utils.style.getInnerHeight,ot=y.utils.style.getScrollLeft,rt=y.utils.style.getScrollTop,st=y.utils.style.setScrollLeft,lt=y.utils.style.setScrollTop,at=y.utils.style.get,ut=y.utils.style.getBordersWidthFloat,ct=y.utils.style.getElementPaddingFloat;function ht(t){return O(t)&&"fixed"===$.get(t,"position")}y.shadowUI,y.nativeMethods;var ft=function(t,e,n,i,o,r){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=i,this.scrollbar=r,this.scroll=o},dt={notElementOrTextNode:function(t){return"\n The ".concat(t," is neither a DOM element nor a text node.\n ")},elOutsideBounds:function(t,e){return"\n The ".concat(e," (").concat(t,") is located outside the the layout viewport.\n ")},elHasWidthOrHeightZero:function(t,e,n,i){return"\n The ".concat(e," (").concat(t,") is too small to be visible: ").concat(n,"px x ").concat(i,"px.\n ")},elHasDisplayNone:function(t,e){return"\n The ".concat(e," (").concat(t,") is invisible. \n The value of its 'display' property is 'none'.\n ")},parentHasDisplayNone:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible. \n It descends from an element that has the 'display: none' property (").concat(n,").\n ")},elHasVisibilityHidden:function(t,e){return"\n The ".concat(e," (").concat(t,") is invisible.\n The value of its 'visibility' property is 'hidden'.\n ")},parentHasVisibilityHidden:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible.\n It descends from an element that has the 'visibility: hidden' property (").concat(n,").\n ")},elHasVisibilityCollapse:function(t,e){return"\n The ".concat(e," (").concat(t,") is invisible.\n The value of its 'visibility' property is 'collapse'.\n ")},parentHasVisibilityCollapse:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible.\n It descends from an element that has the 'visibility: collapse' property (").concat(n,").\n ")},elNotRendered:function(t,e){return"\n The ".concat(e," (").concat(t,") has not been rendered.\n ")},optionNotVisible:function(t,e,n){return"\n The ".concat(e," (").concat(t,") is invisible. \n The parent element (").concat(n,") is collapsed, and its length is shorter than 2.\n ")},mapContainerNotVisible:function(t,e){return"\n The action target (".concat(t,") is invisible because ").concat(e,"\n ")}},mt=y.utils.html,pt=y.nativeMethods,vt=10;function gt(t){if(!t)return"";var e,n,i,o=pt.cloneNode.call(t),r=mt.cleanUpHtml(pt.elementOuterHTMLGetter.call(o)),s=(e=pt.nodeTextContentGetter.call(t),n=vt,void 0===i&&(i="..."),e.length<n?e:e.substring(0,n-i.length)+i),l=pt.elementChildrenGetter.call(t);return 0<pt.htmlCollectionLengthGetter.call(l)?r.replace("></",">...</"):s?r.replace("></",">".concat(s,"</")):r}var yt=y.utils.position.getElementRectangle,Et=y.utils.position.getOffsetPosition,bt=y.utils.position.offsetToClientCoords;function St(t){var e,n,i,o,r=L(t),s=r?t.getElementsByTagName("body")[0]:null,l=t.getBoundingClientRect(),a=z.create(Q(t)),u=J(t),c=U(t),h="BackCompat"===t.ownerDocument.compatMode,f=r?new x(0,0):x.create(l),d=l.height,m=l.width;r&&(m=s&&h?(d=s.clientHeight,s.clientWidth):(d=t.clientHeight,t.clientWidth)),!c||(e=k(t))&&(n=Et(e),i=bt(x.create(n)),o=Q(e),f.add(i).add(x.create(o)),r&&a.add(o));var p=!r&&nt(t)!==t.clientWidth,v=!r&&it(t)!==t.clientHeight,g={right:p?V():0,bottom:v?V():0};return new ft(m,d,f,a,u,g)}function wt(t){var e=t.x,n=t.y,i=Sf.getElementFromPoint||Sf.elementFromPoint,o=null;try{o=i.call(Sf,e,n)}catch(t){return null}for(null===o&&(o=i.call(Sf,e-1,n-1));o&&o.shadowRoot&&o.shadowRoot.elementFromPoint;){var r=o.shadowRoot.elementFromPoint(e,n);if(!r||o===r)break;o=r}return o}function _t(t,e,n){var i=St(t),o=Math.max(t.scrollWidth,i.width),r=Math.max(t.scrollHeight,i.height),s=i.scrollbar.right+i.border.left+i.border.right+o,l=i.scrollbar.bottom+i.border.top+i.border.bottom+r;return(void 0===e||0<=e&&e<=s)&&(void 0===n||0<=n&&n<=l)}function Pt(t){var e=Et(t),n=e.left,i=e.top,o=bt({x:n,y:i});return o.x=Math.round(o.x),o.y=Math.round(o.y),o}function xt(n,e){return m.Promise.resolve(n===Sf.documentElement).then(function(t){if(t)return new x(0,0);var e=m.utils.browser.isFirefox?Math.ceil:Math.round;return m.Promise.resolve(Et(n,e)).then(function(t){return x.create(t)})}).then(function(t){return t.add(e)})}var At=/auto|scroll|hidden/i,Ct="visible";function Tt(t){var e,n=at(t,"overflowX"),i=at(t,"overflowY"),o=At.test(n),r=At.test(i),s=D(t).documentElement,l=t.scrollHeight;return(m.utils.browser.isChrome||m.utils.browser.isFirefox||m.utils.browser.isSafari)&&(e=t.getBoundingClientRect().top,l=l-s.getBoundingClientRect().top+e),(o||r)&&l>s.scrollHeight}function Mt(t){if(F(t))return Tt(t);if(L(t))return function(t){var e=at(t,"overflowX"),n=at(t,"overflowY");if("hidden"===e&&"hidden"===n)return!1;var i=t.scrollHeight>t.clientHeight,o=t.scrollWidth>t.clientWidth;if(i||o)return!0;var r=t.getElementsByTagName("body")[0];if(!r)return!1;if(Tt(r))return!1;var s=Math.min(t.clientWidth,r.clientWidth),l=Math.min(t.clientHeight,r.clientHeight);return r.scrollHeight>l||r.scrollWidth>s}(t);var e,n,i,o,r,s=(n=at(e=t,"overflowX"),i=at(e,"overflowY"),o=At.test(n),r=At.test(i),m.utils.browser.isIE&&(o=o||r&&n===Ct,r=r||o&&i===Ct),new x(o,r));if(!s.x&&!s.y)return!1;var l=s.y&&t.scrollHeight>t.clientHeight;return s.x&&t.scrollWidth>t.clientWidth||l}function Dt(i,o){return _(this,void 0,void 0,function(){var e,n;return P(this,function(t){switch(t.label){case 0:return[4,J(i)];case 1:return e=t.sent(),n=Mt(i),!/html/i.test(i.tagName)&&n&&(o.x-=e.left,o.y-=e.top),[2,bt(o)]}})})}function It(t){if(!t)return null;var e,n,i=(e=bf.screenLeft||bf.screenX,n=bf.screenTop||bf.screenY,new x(e,n)),o=i.x,r=i.y,s=o+t.x,l=r+t.y;return new x(s,l)}function Ut(t){var e=t/2;return e<1?0:Math.round(e)}function kt(t){var e=yt(t);return{offsetX:Ut(e.width),offsetY:Ut(e.height)}}function Ot(t,e,n){var i=kt(t);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=St(t),r=Math.round(Math.max(t.scrollWidth,o.width)),s=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:e<0?l+e:e,offsetY:n<0?a+n:n}}var Nt=E.positionUtils;function Bt(e,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var t=Nt.getElementFromPoint(e);return i.show(n).then(function(){return t})})}function Ft(t,n){return m.Promise.resolve(wt(t)).then(function(e){return m.Promise.resolve(H(n,e)).then(function(t){return t&&G(e)}).then(function(t){return t||e&&e===n?e:null})})}function Lt(n,i){if(!i||!n||n===i)return n;if("tref"===R(i))return i;var e,o,t="area"===R(i)&&N(n);return m.utils.browser.isFirefox&&t?(e=n,o=i,m.Promise.resolve(Y(o,"map")).then(function(t){return t&&t.name===e.useMap.substring(1)?o:e})):m.Promise.resolve(Y(i,"a")).then(function(t){return!!t}).then(function(t){return!!t&&m.Promise.resolve(H(i,n)).then(function(t){return t&&G(n)}).then(function(t){return!t&&G(i)})}).then(function(t){return t?m.Promise.resolve(St(i)).then(function(e){return Ft({x:e.right-1,y:e.top+1},i).then(function(t){return t||Ft({x:e.left+1,y:e.bottom-1},i)}).then(function(t){return t||n})}):n})}function Vt(n,i,o){return Bt(n).then(function(t){var e=m.Promise.resolve(t);return!t&&m.utils.dom.isIframeWindow(i||bf)&&0<n.x&&0<n.y&&(e=e.then(function(){return Bt(n,!0)})),e.then(function(t){return Lt(t,o)})})}function Kt(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var Rt,Yt,Wt,Xt="E1",Ht="E4",qt="E5",Gt="E9",zt="E10",jt="E11",$t="E12",Qt="E24",Zt="E26",Jt="E27",te="E28",ee="E29",ne="E30",ie="E31",oe="E32",re="E33",se="E34",le="E35",ae="E36",ue="E37",ce="E39",he="E40",fe="E41",de="E42",me="E43",pe="E44",ve="E45",ge="E46",ye="E49",Ee="E50",be="E51",Se="E52",we="E57",_e="E64",Pe="E65",xe="E68",Ae="E69",Ce="E70",Te="E71",Me="E72",De="E73",Ie="E74",Ue="E76",ke="E77",Oe="E78",Ne="E82",Be="E83",Fe="E90",Le="E91",Ve="E92",Ke="E93",Re="E94",Ye="E95",We="E97",Xe="E99",He="E100",qe="E101",Ge="E102",ze=(w(je,Rt=Kt),je);function je(t,e,n){var i=Rt.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function $e(t,e){var n=Yt.call(this,ye,e)||this;return n.instantiationCallsiteName=t,n}function Qe(t,e){var n=Wt.call(this,Ee,e)||this;return n.instantiationCallsiteName=t,n}w($e,Yt=Kt),w(Qe,Wt=Kt);var Ze,Je,tn,en,nn,on,rn,sn,ln=(w(an,Ze=Kt),an);function an(t,e,n){var i=void 0===e?{}:e,o=i.apiFnChain,r=i.apiFnIndex,s=i.reason,l=Ze.call(this,t,n)||this;return l.apiFnChain=o,l.apiFnIndex=r,l.reason=s,l}function un(t){return Je.call(this,be,t)||this}function cn(t,e){return tn.call(this,Se,e,t)||this}function hn(t,e){var n=en.call(this,Xt)||this;return n.errStack=t,n.pageDestUrl=e,n}function fn(t,e,n){var i=nn.call(this,Ht,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}function dn(t,e,n,i){var o=on.call(this,qt,i)||this;return o.errMsg=String(e),o.property=n,o.instantiationCallsiteName=t,o}function mn(t){var e=rn.call(this,_e)||this;return e.errMsg=String(t),e}function pn(t,e){var n=sn.call(this,Pe)||this;return n.errMsg=String(t),n.moduleName=e,n}w(un,Je=Kt),w(cn,tn=ln),w(hn,en=Kt),w(fn,nn=Kt),w(dn,on=Kt),w(mn,rn=Kt),w(pn,sn=Kt);var vn,gn=(w(yn,vn=ze),yn);function yn(t,e){return vn.call(this,Gt,t,e)||this}var En,bn=(w(Sn,En=ze),Sn);function Sn(t,e){return En.call(this,zt,t,e)||this}var wn,_n=(w(Pn,wn=ze),Pn);function Pn(t,e){return wn.call(this,jt,t,e)||this}var xn,An=(w(Cn,xn=ze),Cn);function Cn(t,e){return xn.call(this,$t,t,e)||this}var Tn,Mn=(w(Dn,Tn=ze),Dn);function Dn(t,e){return Tn.call(this,Fe,t,e)||this}var In,Un=(w(kn,In=ze),kn);function kn(t,e){return In.call(this,We,t,e)||this}var On,Nn=(w(Bn,On=ze),Bn);function Bn(t,e){return On.call(this,Le,t,e)||this}var Fn,Ln=(w(Vn,Fn=ze),Vn);function Vn(t,e){return Fn.call(this,Ve,t,e)||this}var Kn,Rn=(w(Yn,Kn=ze),Yn);function Yn(t,e){return Kn.call(this,Ke,t,e)||this}var Wn,Xn=(w(Hn,Wn=ze),Hn);function Hn(t,e){return Wn.call(this,Re,t,e)||this}var qn,Gn=(w(zn,qn=ze),zn);function zn(t,e){return qn.call(this,Ye,t,e)||this}var jn,$n=(w(Qn,jn=ze),Qn);function Qn(t,e){return jn.call(this,Xe,t,e)||this}var Zn,Jn,ti=(w(ei,Zn=Kt),ei);function ei(t,e,n){var i=Zn.call(this,He)||this;return i.objectName=t,i.propertyName=e,i.availableProperties=n,i}function ni(t,e){return Jn.call(this,Qt,e,t)||this}w(ni,Jn=ln);var ii,oi,ri,si=(w(li,ii=ln),li);function li(t,e){return ii.call(this,Zt,e,t)||this}function ai(t){var e=oi.call(this,Jt)||this;return e.nodeDescription=t,e}function ui(t,e){var n=ri.call(this,te,e)||this;return n.argumentName=t,n}w(ai,oi=Kt),w(ui,ri=ln);var ci,hi,fi,di,mi,pi,vi,gi,yi,Ei,bi,Si,wi,_i,Pi,xi,Ai,Ci,Ti,Mi,Di,Ii,Ui,ki,Oi,Ni,Bi,Fi,Li,Vi,Ki,Ri,Yi=(w(Wi,ci=Kt),Wi);function Wi(t){return ci.call(this,qe,t)||this}function Xi(t,e){var n=hi.call(this,ee,e)||this;return n.argumentName=t,n}function Hi(t,e){var n=fi.call(this,ne)||this;return n.argumentName=t,n.nodeDescription=e,n}function qi(){return di.call(this,ie)||this}function Gi(){return mi.call(this,oe)||this}function zi(t){var e=pi.call(this,re)||this;return e.argumentName=t,e}function ji(){return vi.call(this,le)||this}function $i(t){var e=gi.call(this,ae)||this;return e.argumentName=t,e}function Qi(t,e){var n=yi.call(this,ue)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function Zi(){return Ei.call(this,se)||this}function Ji(t,e){var n=bi.call(this,fe)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function to(t,e){var n=Si.call(this,we)||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}function eo(t){return wi.call(this,he,t)||this}function no(){return _i.call(this,ce)||this}function io(){return Pi.call(this,de)||this}function oo(){return xi.call(this,Ae)||this}function ro(){return Ai.call(this,xe)||this}function so(){return Ci.call(this,Ce)||this}function lo(){return Ti.call(this,Te)||this}function ao(){return Mi.call(this,De)||this}function uo(){return Di.call(this,Ne)||this}function co(t){var e=Ii.call(this,Oe)||this;return e.errMsg=t,e}function ho(){return Ui.call(this,Ie)||this}function fo(){return ki.call(this,Ue)||this}function mo(){return Oi.call(this,ke)||this}function po(){return Ni.call(this,Me)||this}function vo(){return Bi.call(this,Be)||this}function go(){return Fi.call(this,me)||this}function yo(){return Li.call(this,pe)||this}function Eo(t,e){var n=Vi.call(this,ve)||this;return n.dialogType=t,n.pageUrl=e,n}function bo(t,e,n){var i=Ki.call(this,ge)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}function So(){return Ri.call(this,Ge)||this}w(Xi,hi=ln),w(Hi,fi=Kt),w(qi,di=Kt),w(Gi,mi=Kt),w(zi,pi=Kt),w(ji,vi=Kt),w($i,gi=Kt),w(Qi,yi=Kt),w(Zi,Ei=Kt),w(Ji,bi=Kt),w(to,Si=Kt),w(eo,wi=Kt),w(no,_i=Kt),w(io,Pi=Kt),w(oo,xi=Kt),w(ro,Ai=Kt),w(so,Ci=Kt),w(lo,Ti=Kt),w(ao,Mi=Kt),w(uo,Di=Kt),w(co,Ii=Kt),w(ho,Ui=Kt),w(fo,ki=Kt),w(mo,Oi=Kt),w(po,Ni=Kt),w(vo,Bi=Kt),w(go,Fi=Kt),w(yo,Li=Kt),w(Eo,Vi=Kt),w(bo,Ki=Kt),w(So,Ri=Kt);var wo=(Object.defineProperty(_o.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(_o.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(_o.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(_o.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),_o);function _o(t){this._speedFactor=t||1}var Po=y.Promise,xo=y.nativeMethods;function Ao(e){return new Po(function(t){return xo.setTimeout.call(bf,t,e)})}function Co(){return Ao(0)}var To=Object.prototype.toString,Mo=String.prototype.indexOf,Do=String.prototype.endsWith||function(t,e){var n=To.call(this);(void 0===e||e>n.length)&&(e=n.length),e-=t.length;var i=Mo.call(n,t,e);return-1!==i&&i===e},Io=Array.prototype.indexOf,Uo=Array.prototype.map,ko=Array.prototype.sort,Oo=Array.prototype.filter,No=Array.prototype.concat,Bo="Command",Fo=(Lo.prototype.getAssignableProperties=function(){return[]},Lo.prototype.getAllAssignableProperties=function(){for(var t=Object.getPrototypeOf(this),e=[];t&&t.getAssignableProperties;)e=No.call(e,t.getAssignableProperties()),t=Object.getPrototypeOf(t);return e},Lo.prototype.getNonReportedProperties=function(){return[]},Lo.prototype.getReportedProperties=function(){var t=Uo.call(this.getAllAssignableProperties(),function(t){return t.name}),e=this.getNonReportedProperties();return Oo.call(t,function(t){return!(-1<Io.call(e,t))})},Lo.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t){e&&function(t,e){var n,i=e.constructor.name,o=Uo.call(e.getAllAssignableProperties(),function(t){return t.name}),r=ko.call(e.getReportedProperties());for(n in t)if(!(-1<Io.call(o,n)||n in e))throw new ti(i,n,r)}(t,this);for(var i,o,r=this.getAllAssignableProperties(),s=0;s<r.length;s++){var l=r[s],a=l.name,u=l.type,c=l.required,h=l.init,f=l.defaultValue;void 0!==f&&(this[a]=f);var d=t[a];void 0===d&&!c||(e&&u&&u((i=this.constructor.name,o=a,Do.call(i,Bo)?o:"".concat(i,".").concat(o)),d),this[a]=h?h(a,d,n,e):d)}}},Lo);function Lo(){}function Vo(i){return function(t,e){var n=typeof e;if("number"!=n)throw new i(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new i(t,e)}}var Ko,Ro,Yo,Wo,Xo,Ho,qo,Go,zo,jo,$o,Qo,Zo,Jo=Vo(gn),tr=(Ro=Vo(Ko=bn),function(t,e){if(Ro(t,e),e<0)throw new Ko(t,e)}),er=(Yo=_n,function(t,e){var n=typeof e;if("boolean"!=n)throw new Yo(t,n)}),nr=(Wo=An,function(t,e){var n=typeof e;if("number"!=n)throw new Wo(t,n);if(isNaN(e)||e<.01||1<e)throw new Wo(t,e)}),ir=(Xo=Mn,function(t,e){var n=typeof e;if("string"!=n)throw new Xo(t,n)}),or=(Ho=Un,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new Ho(t,n)}),rr=(qo=Nn,function(t,e){if(!(e instanceof Date))throw new qo(t,e)}),sr=(Go=Ln,function(t,e){if(isNaN(Number(e)))throw new Go(t,typeof e)}),lr=(zo=Rn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new zo(t,n)}),ar=(jo=Xn,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new jo(t,n)}),ur=($o=Gn,function(t,e){var n=typeof e;if("object"!=n)throw new $o(t,n)}),cr=(Qo=$n,function(t,e){var n=typeof e;if("function"!=n)throw new Qo(t,n)}),hr=(w(fr,Zo=Fo),fr.prototype.getAssignableProperties=function(){return[{name:"speed",type:nr}]},fr);function fr(t,e){var n=Zo.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var dr,mr=(w(pr,dr=hr),pr.prototype.getAssignableProperties=function(){return[{name:"offsetX",type:Jo},{name:"offsetY",type:Jo},{name:"isDefaultOffset",type:er}]},pr);function pr(t,e){var n=dr.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var vr,gr=(w(yr,vr=mr),yr.prototype.getAssignableProperties=function(){return[{name:"scrollToCenter",type:er},{name:"skipParentFrames",type:er}]},yr);function yr(t,e){var n=vr.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var Er,br,Sr=(w(wr,Er=Fo),wr.prototype.getAssignableProperties=function(){return[{name:"left",type:Jo,defaultValue:null},{name:"right",type:Jo,defaultValue:null},{name:"top",type:Jo,defaultValue:null},{name:"bottom",type:Jo,defaultValue:null}]},wr);function wr(t,e){var n=Er.call(this)||this;return n._assignFrom(t,e),n}function _r(t,e){var n=br.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}w(_r,br=hr),_r.prototype.getAssignableProperties=function(){return[{name:"scrollTargetX",type:Jo},{name:"scrollTargetY",type:Jo},{name:"crop",type:ur,init:hs},{name:"includeMargins",type:er},{name:"includeBorders",type:er},{name:"includePaddings",type:er}]};var Pr,xr=(w(Ar,Pr=Fo),Ar.prototype.getAssignableProperties=function(){return[{name:"ctrl",type:er,defaultValue:!1},{name:"alt",type:er,defaultValue:!1},{name:"shift",type:er,defaultValue:!1},{name:"meta",type:er,defaultValue:!1}]},Ar);function Ar(t,e){var n=Pr.call(this)||this;return n._assignFrom(t,e),n}var Cr,Tr=(w(Mr,Cr=mr),Mr.prototype.getAssignableProperties=function(){return[{name:"modifiers",type:ur,init:fs}]},Mr);function Mr(t,e){var n=Cr.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Dr,Ir=(w(Ur,Dr=Tr),Ur.prototype.getAssignableProperties=function(){return[{name:"caretPos",type:tr}]},Ur);function Ur(t,e){var n=Dr.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var kr,Or=(w(Nr,kr=Tr),Nr.prototype.getAssignableProperties=function(){return[{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:er},{name:"skipDefaultDragBehavior",type:er}]},Nr);function Nr(t,e){var n=kr.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}var Br,Fr,Lr,Vr,Kr,Rr,Yr=(w(Wr,Br=Ir),Wr.prototype.getAssignableProperties=function(){return[{name:"replace",type:er},{name:"paste",type:er},{name:"confidential",type:er}]},Wr);function Wr(t,e){var n=Br.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function Xr(t,e){var n=Fr.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function Hr(t,e){var n=Lr.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function qr(t,e){var n=Vr.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Gr(t,e){var n=Kr.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function zr(t,e){var n=Rr.call(this)||this;return n._assignFrom(t,e),n}w(Xr,Fr=Tr),Xr.prototype.getAssignableProperties=function(){return[{name:"destinationOffsetX",type:Jo},{name:"destinationOffsetY",type:Jo}]},w(Hr,Lr=Fo),Hr.prototype.getAssignableProperties=function(){return[{name:"portraitOrientation",type:er}]},w(qr,Vr=Fo),qr.prototype.getAssignableProperties=function(){return[{name:"timeout",type:tr},{name:"allowUnawaitedPromise",type:er}]},w(Gr,Kr=hr),Gr.prototype.getAssignableProperties=function(){return[{name:"confidential",type:er}]},w(zr,Rr=Fo),zr.prototype.getAssignableProperties=function(){return[{name:"name",type:ir},{name:"value",type:ir},{name:"domain",type:ir},{name:"path",type:ir},{name:"expires",type:rr},{name:"maxAge",type:sr},{name:"secure",type:er},{name:"httpOnly",type:er},{name:"sameSite",type:ir}]};var jr,$r=(w(Qr,jr=Fo),Qr.prototype.getAssignableProperties=function(){return[{name:"username",type:ir,required:!0},{name:"password",type:ir}]},Qr);function Qr(t,e){var n=jr.call(this)||this;return n._assignFrom(t,e),n}var Zr,Jr,ts,es,ns,is=(w(os,Zr=Fo),os.prototype.getAssignableProperties=function(){return[{name:"protocol",type:ir},{name:"host",type:ir,required:!0},{name:"port",type:sr,required:!0},{name:"auth",type:ur,init:us}]},os);function os(t,e){var n=Zr.call(this)||this;return n._assignFrom(t,e),n}function rs(t,e){var n=Jr.call(this)||this;return n._assignFrom(t,e),n}function ss(t,e){var n=ts.call(this)||this;return n._assignFrom(t,e),n}function ls(t,e){var n=es.call(this)||this;return n._assignFrom(t,e),n}function as(t,e){var n=ns.call(this)||this;return n._assignFrom(t,e),n}function us(t,e,n,i){return void 0===i&&(i=!0),new $r(e,i)}function cs(t,e,n,i){return void 0===i&&(i=!0),new is(e,i)}function hs(t,e,n,i){return void 0===i&&(i=!0),new Sr(e,i)}function fs(t,e,n,i){return void 0===i&&(i=!0),new xr(e,i)}w(rs,Jr=Fo),rs.prototype.getAssignableProperties=function(){return[{name:"url",type:lr},{name:"method",type:ir},{name:"headers",type:ur},{name:"params",type:ar},{name:"body"},{name:"timeout",type:sr},{name:"withCredentials",type:er},{name:"auth",type:ur,init:us},{name:"proxy",type:ur,init:cs},{name:"rawResponse",type:er}]},w(ss,ts=Fo),ss.prototype.getAssignableProperties=function(){return[{name:"credentials",type:sr}]},w(ls,es=Fo),ls.prototype.getAssignableProperties=function(){return[{name:"stack",type:or,required:!1},{name:"message",type:or,required:!1},{name:"pageUrl",type:or,required:!1}]},w(as,ns=Fo),as.prototype.getAssignableProperties=function(){return[{name:"fn",type:cr,required:!0},{name:"dependencies",type:ur,required:!1}]};var ds=null,ms=function(){return ds},ps=function(t){ds=t},vs=(y.Promise,y.nativeMethods,y.eventSandbox.listeners,y.utils.browser,y.utils.event.BUTTON,y.utils.event.BUTTONS_PARAMETER);function gs(t){return t.top!==t}y.utils.event.DOM_EVENTS,y.utils.event.WHICH_PARAMETER,y.utils.event.preventDefault;var ys=y.Promise,Es=y.eventSandbox.message;function bs(t,i,e){return new ys(function(n){Es.on(Es.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(Es.off(Es.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),Es.sendServiceMsg(t,e)})}var Ss=(ws.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},ws.prototype.once=function(n,i){var o=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.off(n,i),i.apply(void 0,t)})},ws.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=m.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},ws.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},ws.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=this._eventsListeners[e];if(i)for(var o=0;o<i.length;o++)try{i[o].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,i[o])}},ws);function ws(){this._eventsListeners={}}var _s=Ss,Ps=m.eventSandbox.listeners;function xs(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new _s}var As=(xs.prototype._internalListener=function(t,e,n,i,o){this.events.emit("scroll",t),this.stopPropagationFlag&&(i(),o())},xs.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,Ps.initElementListening(bf,["scroll"]),Ps.addFirstInternalEventBeforeListener(bf,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n._internalListener.apply(n,t)}))},xs.prototype.waitForScroll=function(t){var e=this,n=null,i=new m.Promise(function(t){n=t});return i.cancel=function(){return e.events.off("scroll",n)},this.initialized?this.handleScrollEvents(t,n):n(),i},xs.prototype.handleScrollEvents=function(n,t){var e,i=this;this.events.once("scroll",t),(e=n)&&e.getRootNode&&D(e)!==e.getRootNode()&&(Ps.initElementListening(n,["scroll"]),Ps.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i._internalListener.apply(i,t),Ps.cancelElementListening(n)}))},xs.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},xs.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new xs),Cs=(Ts._isScrollValuesChanged=function(t,e){return ot(t)!==e.left||rt(t)!==e.top},Ts.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=L(t)?D(t):t,s={left:ot(r),top:rt(r)},i=Math.max(i,0),o=Math.max(o,0),l=As.waitForScroll(r);return st(r,i),lt(r,o),Ts._isScrollValuesChanged(r,s)?l=l.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=Ts._isScrollValuesChanged(r,s))}):(l.cancel(),m.Promise.resolve())},Ts.prototype._getScrollToPoint=function(t,e,n){var i=Math.floor(t.width/2),o=Math.floor(t.height/2),r=this._scrollToCenter?i:Math.min(n.left,i),s=this._scrollToCenter?o:Math.min(n.top,o),l=t.scroll,a=l.left,u=l.top,c=e.x>=a+t.width-r,h=e.x<=a+r,f=e.y>=u+t.height-s,d=e.y<=u+s;return c?a=e.x-t.width+r:h&&(a=e.x-r),f?u=e.y-t.height+s:d&&(u=e.y-s),{left:a,top:u}},Ts.prototype._getScrollToFullChildView=function(t,e,n){var i,o,r,s,l,a,u={left:null,top:null},c=t.width>=e.width,h=t.height>=e.height,f=(i=e,o=t,z.create({top:i.top-o.top,left:i.left-o.left,right:o.right-i.right,bottom:o.bottom-i.bottom}).sub(o.border).sub(o.scrollbar).round(Math.ceil,Math.floor));return c&&(r=t.width-e.width,s=Math.min(n.left,r),this._scrollToCenter&&(s=r/2),f.left<s?u.left=Math.round(t.scroll.left+f.left-s):f.right<s&&(u.left=Math.round(t.scroll.left+Math.min(f.left,-f.right)+s))),h&&(l=t.height-e.height,a=Math.min(n.top,l),this._scrollToCenter&&(a=l/2),f.top<a?u.top=Math.round(t.scroll.top+f.top-a):f.bottom<a&&(u.top=Math.round(t.scroll.top+Math.min(f.top,-f.bottom)+a))),u},Ts._getChildPoint=function(t,e,n){return x.create(e).sub(x.create(t)).add(x.create(t.scroll)).add(x.create(e.border)).add(n)},Ts.prototype._getScrollPosition=function(t,e,n,i){var o=Ts._getChildPoint(t,e,n),r=this._getScrollToPoint(t,o,i),s=this._getScrollToFullChildView(t,e,i);return{left:Math.max(null===s.left?r.left:s.left,0),top:Math.max(null===s.top?r.top:s.top,0)}},Ts._getChildPointAfterScroll=function(t,e,n,i){return x.create(e).add(x.create(t.scroll)).sub(x.create(n)).add(i)},Ts.prototype._isChildFullyVisible=function(t,e,n){var i=Ts._getChildPointAfterScroll(t,e,t.scroll,n),o=this._getScrollPosition(t,e,n,{left:0,top:0}),r=o.left,s=o.top;return!this._isTargetElementObscuredInPoint(i)&&r===t.scroll.left&&s===t.scroll.top},Ts.prototype._scrollToChild=function(t,e,n){for(var i=St(t),o=St(e),r=nt(bf),s=it(bf),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this._maxScrollMargin);var u=Ts._getChildPointAfterScroll(i,o,l,n),c=this._isTargetElementObscuredInPoint(u);this._maxScrollMargin.left+=20,this._maxScrollMargin.left>=r&&(this._maxScrollMargin.left=50,this._maxScrollMargin.top+=20),a=c&&this._maxScrollMargin.top<s}return this._maxScrollMargin={left:50,top:50},this._setScroll(t,l)},Ts.prototype._scrollElement=function(){if(!Mt(this._element))return m.Promise.resolve();var t=St(this._element),e=this._getScrollToPoint(t,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,e)},Ts.prototype._scrollParents=function(){var t,e,n,i,o,r,s=this,l=(t=this._element,i=W(t),!U(t)||(e=k(t))&&(n=W(e),i.concat(n)),m.nativeMethods.arrayFilter.call(i,Mt)),a=this._element,u=ot(a),c=rt(a),h=x.create(this._offsets).sub(new x(u,c).round()),f=function(n,i){return _(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<n?[4,i(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}})})}(l.length,function(t){return s._scrollToChild(l[t],a,h).then(function(){o=St(a),r=St(l[t]),h.add(x.create(o)).sub(x.create(r)).add(x.create(r.border)),a=l[t]})}),d={scrollWasPerformed:this._scrollWasPerformed,offsetX:h.x,offsetY:h.y,maxScrollMargin:this._maxScrollMargin};return f.then(function(){if(!s._skipParentFrames&&gs(bf))return d.cmd=Ts.SCROLL_REQUEST_CMD,bs(d,Ts.SCROLL_RESPONSE_CMD,bf.parent)}).then(function(){return s._scrollWasPerformed})},Ts._getFixedAncestorOrSelf=function(t){return X(t,!0,ht)},Ts.prototype._isTargetElementObscuredInPoint=function(t){var e=wt(t);if(!e)return!1;var n=Ts._getFixedAncestorOrSelf(e);return!!n&&!n.contains(this._element)},Ts.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()})},Ts.SCROLL_REQUEST_CMD="automation|scroll|request",Ts.SCROLL_RESPONSE_CMD="automation|scroll|response",Ts);function Ts(t,e,n){this._element=t,this._offsets=new x(e.offsetX,e.offsetY),this._scrollToCenter=!!e.scrollToCenter,this._skipParentFrames=!!e.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}var Ms=y.utils.browser,Ds=(Is.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Is.prototype.leaveElement=function(){},Is.prototype.move=function(){},Is.prototype.enterElement=function(){},Is.prototype.dragAndDrop=function(){},Is.prototype.teardown=function(){},Is.prototype.run=function(t,e,n,i,o){var r=e&&g.domUtils.isElementInDocument(e),s=e&&g.domUtils.isElementInIframe(e)&&!g.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?g.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),Ms.isIE&&this.move(t,n),l&&g.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Ms.isIE||this.move(t,n),this.dragAndDrop(i,t,e,n,o),this.teardown(t,n,e);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},Is);function Is(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var Us=y.eventSandbox.eventSimulator,ks=y.utils.extend,Os=y.nativeMethods,Ns=(Bs.leaveElement=function(t,e,n,i){Us.mouseout(e,ks({relatedTarget:t},i));for(var o=e;o&&o!==n;)Us.mouseleave(o,ks({relatedTarget:t},i)),o=Os.nodeParentNodeGetter.call(o)},Bs.enterElement=function(t,e,n,i){Us.mouseover(t,ks({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=g.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)Us.mouseenter(r[s],ks({relatedTarget:e},i))},Bs.move=function(t,e,n){Us[t](e,n)},Bs);function Bs(){}var Fs=(Ls.dragAndDrop=function(t,e,n,i){return Us.drag(t,i),e!==n&&(g.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,Us.dragenter(e,i)),n&&(i.relatedTarget=e,Us.dragleave(n,i))),!Us.dragover(e,i)},Ls);function Ls(){}var Vs,Ks=y.eventSandbox.eventSimulator,Rs=(w(Ys,Vs=Ds),Ys.prototype.leaveElement=function(t,e,n,i){Ns.leaveElement(t,e,n,i)},Ys.prototype.enterElement=function(t,e,n,i){Ns.enterElement(t,e,n,i)},Ys.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Ns.move(this.moveEvent,t,e)},Ys.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(t)&&t!==n&&Ks[this.moveEvent](t,e)},Ys.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},Ys);function Ys(t){var e=Vs.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Ws,Xs=(w(Hs,Ws=Ds),Hs.prototype.setup=function(){Ws.prototype.setup.call(this),this.dragAndDropMode=!0},Hs.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Fs.dragAndDrop(t,e,n,i)},Hs);function Hs(){return null!==Ws&&Ws.apply(this,arguments)||this}var qs,Gs=y.eventSandbox.eventSimulator,zs=(w(js,qs=Ds),js.prototype.setup=function(){qs.prototype.setup.call(this),this.dragAndDropMode=!0},js.prototype.leaveElement=function(t,e,n,i){Ns.leaveElement(t,e,n,i)},js.prototype.move=function(t,e){Ns.move(this.moveEvent,t,e)},js.prototype.enterElement=function(t,e,n,i){Ns.enterElement(t,e,n,i)},js.prototype.dragAndDrop=function(t,e,n,i,o){var r=Gs.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Fs.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},js.prototype.run=function(t,e,n,i,o){return qs.prototype.run.call(this,t,null,n,i,o)},js);function js(){return null!==qs&&qs.apply(this,arguments)||this}function $s(t,e,n){return new(t?e?Xs:zs:Rs)(n)}function Qs(a,u,c){return _(this,void 0,void 0,function(){var e,n,i,o,r,s,l;return P(this,function(t){switch(t.label){case 0:e=!0,n=x.create(a.startPoint),i=x.create(a.endPoint).round(Math.floor),o=x.create(a.startPoint).round(Math.floor),r=x.create(a.startPoint),s=u(),t.label=1;case 1:return o.eql(i)?[3,4]:(r=x.create(o),a.needMoveImmediately?o=i:e?(e=!1,o.add({x:0<a.distance.x?1:-1,y:0<a.distance.y?1:-1})):(l=Math.min((u()-s)/a.movingTime,1),o=x.create(a.distance).mul(l).add(n).round(Math.floor)),o.eql(r)?[3,3]:[4,c(o)]);case 2:t.sent(),t.label=3;case 3:return[3,1];case 4:return[2]}})})}var Zs=(Js.create=function(o,r,s,l,a){return void 0===a&&(a=null),_(this,void 0,m.Promise,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,Js.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new Js(n,i,r,s,l,a)]}})})},Js.getTarget=function(e,n,i){return m.Promise.resolve(_t(e,i.x,i.y)).then(function(t){return t?{element:e,offset:i}:m.Promise.all([xt(e,i),n.document.documentElement]).then(function(t){var e=t[0];return{element:t[1],offset:e}})})},Js.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},Js.prototype._getTargetClientPoint=function(){var o=this;return m.Promise.resolve(J(this.element)).then(function(i){return L(o.element)?x.create(o.offset).sub(x.create(i)).round(Math.round):m.Promise.resolve(Pt(o.element)).then(function(t){var e=F(o.element),n=x.create(t).add(o.offset);return e||n.sub(x.create(i)),n.round(Math.floor)})})},Js.prototype._getEventSequenceOptions=function(t){var e=vs.noButton,n=It(t);return{eventOptions:{clientX:t.x,clientY:t.y,screenX:null==n?void 0:n.x,screenY:null==n?void 0:n.y,buttons:e,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta},eventSequenceOptions:{moveEvent:this.moveEvent}}},Js.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions;return $s(!1,this.firstMovingStepOccured,i).run(t,ms(),n,null,null)},Js.prototype._emulateEvents=function(t,e){var n=this._getEventSequenceOptions(e);this._runEventSequence(t,n),this.firstMovingStepOccured=!0,ps(t)},Js.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return Bt(i.cursor.getPosition())}).then(function(t){var e=i._getCorrectedTopElement(t);return e?i._emulateEvents(e,n):null}).then(Co)},Js.prototype._getCorrectedTopElement=function(t){return t},Js.prototype._move=function(l){return _(this,void 0,m.Promise,function(){var e,n,i,o,r,s=this;return P(this,function(t){switch(t.label){case 0:return e=this.cursor.getPosition(),n=x.create(l).sub(e),i=Math.max(Math.max(Math.abs(n.x),Math.abs(n.y))/this.cursorSpeed,this.minMovingTime),o={startPoint:e,endPoint:l,movingTime:i,distance:n,needMoveImmediately:this._needMoveCursorImmediately()},this.nativeAutomationInput?(r=[],[4,Qs(o,m.nativeMethods.dateNow,function(i){return _(s,void 0,void 0,function(){var e,n;return P(this,function(t){switch(t.label){case 0:return[4,null===(n=this.nativeAutomationInput)||void 0===n?void 0:n.createMouseMoveEvent(i)];case 1:return e=t.sent(),r.push(e),[2,Co()]}})})})]):[3,4];case 1:return t.sent(),[4,this.nativeAutomationInput.executeEventSequence(r)];case 2:return t.sent(),[4,this.cursor.move(l)];case 3:return t.sent(),[3,6];case 4:return[4,Qs(o,m.nativeMethods.dateNow,function(t){return s._movingStep(t)})];case 5:t.sent(),t.label=6;case 6:return[2]}})})},Js.prototype._needMoveCursorImmediately=function(){return this.touchMode},Js.prototype._scroll=function(){if(this.skipScrolling)return m.Promise.resolve(!1);var t=new gr({offsetX:this.offset.x,offsetY:this.offset.y},!1);return new Cs(this.element,t).run()},Js.prototype._moveToCurrentFrame=function(t,e){var n=this;if(this.cursor.isActive(this.window))return m.Promise.resolve();var i=this.cursor.getPosition(),o=i.x,r=i.y,s=this.cursor.getActiveWindow(this.window),c=null,l=null,h={cmd:"automation|move|request",startX:o,startY:r,endX:t.x,endY:t.y,modifiers:this.modifiers,speed:this.speed,nativeAutomationMove:e};return m.Promise.resolve().then(function(){if(s.parent===n.window)return m.Promise.resolve(q(s)).then(function(t){return c=t,m.Promise.resolve((n=Et(e=t),i=n.left,o=n.top,r=bt({x:i,y:o}),s=Q(e),l=Z(e),a=r.x+s.left+l.left,u=r.y+s.top+l.top,new z(u,a+tt(e),u+et(e),a))).then(function(t){h.left=t.left,h.top=t.top,h.right=t.right,h.bottom=t.bottom});var e,n,i,o,r,s,l,a,u})}).then(function(){return Bt(n.cursor.getPosition())}).then(function(t){return l=t===c,s.parent===n.window&&(h.iframeUnderCursor=l),bs(h,"automation|move|response",s)}).then(function(t){if(n.cursor.setActiveWindow(n.window),l||m.utils.dom.isIframeWindow(n.window))return n.cursor.move(t)})},Js.prototype.run=function(){var n=this;return this._scroll().then(function(){return m.Promise.all([n._getTargetClientPoint(),(t=n.window,new z(0,tt(t),et(t),0))]);var t}).then(function(t){var e=t[0];if(t[1].contains(e))return n._moveToCurrentFrame(e,!!n.nativeAutomationInput).then(function(){return n._move(e)})})},Js);function Js(t,e,n,i,o,r){void 0===r&&(r=null),this.touchMode=m.utils.featureDetection.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.automationSettings=new wo(n.speed),this.cursorSpeed=this._getCursorSpeed(),this.element=t,this.window=i,this.offset=e,this.cursor=o,this.minMovingTime=n.minMovingTime||0,this.modifiers=n.modifiers||{},this.skipScrolling=n.skipScrolling,this.skipDefaultDragBehavior=n.skipDefaultDragBehavior,this.speed=n.speed,this.nativeAutomationInput=r||null,this.firstMovingStepOccured=!1}var tl=(el.prototype._ensureActiveWindow=function(t){this._activeWindow!==t&&this._activeWindow!==t.parent&&this._activeWindow.parent!==t&&(this._activeWindow=t)},el.prototype.isActive=function(t){return this._ensureActiveWindow(t),this._activeWindow===t},el.prototype.setActiveWindow=function(t){this._activeWindow=t},el.prototype.getActiveWindow=function(t){return this._ensureActiveWindow(t),this._activeWindow},el.prototype.getPosition=function(){return new x(this._x,this._y)},el.prototype.move=function(t){return this._x=t.x,this._y=t.y,this._ui.move(t)},el.prototype.hide=function(){return this._ui.hide?this._ui.hide():m.Promise.resolve()},el.prototype.show=function(){return this._ui.show?this._ui.show():m.Promise.resolve()},el.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},el.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},el.prototype.buttonUp=function(){return this._ui.buttonUp()},el);function el(t,e){this._ui=e,this._x=-1,this._y=-1,this._activeWindow=t}var nl,il,ol,rl,sl=gs(bf)?i.iframeCursorUI:i.cursorUI,ll=new tl(bf.top,sl),al=E.positionUtils,ul=E.domUtils,cl=E.eventUtils,hl="elementOverlapped";(il=nl=nl||{})[il.Mouse=0]="Mouse",il[il.Keyboard=1]="Keyboard",il[il.Touch=2]="Touch",il[il.Delay=3]="Delay",il[il.InsertText=4]="InsertText",(rl=ol=ol||{})[rl.alt=1]="alt",rl[rl.ctrl=2]="ctrl",rl[rl.meta=4]="meta";var fl={ctrl:!(rl[rl.shift=8]="shift"),alt:!1,shift:!1,meta:!1};function dl(t){return ol[t]||0}var ml=m.eventSandbox.message,pl={clickCount:1},vl="native-automation|calculate-top-left-point|request",gl="native-automation|calculate-top-left-point|response";function yl(){return _(this,void 0,void 0,function(){return P(this,function(t){switch(t.label){case 0:return bf===bf.parent?[3,2]:[4,bs({cmd:vl},gl,bf.parent)];case 1:return[2,t.sent().topLeftPoint];case 2:return[2,{x:0,y:0}]}})})}ml.on(ml.SERVICE_MSG_RECEIVED_EVENT,function(f){return _(void 0,void 0,void 0,function(){var r,s,l,a,u,c,h;return P(this,function(t){switch(t.label){case 0:return f.message.cmd!==vl?[3,2]:(r=f.source,[4,yl()]);case 1:s=t.sent(),l=s.x,a=s.y,u=q(r),n=(e=u).getBoundingClientRect(),i=ut(e),o=ct(e),c={x:n.left+i.left+o.left,y:n.top+i.top+o.top},h={cmd:gl,topLeftPoint:{x:c.x+l,y:c.y+a}},ml.sendServiceMsg(h,r),t.label=2;case 2:return[2]}var e,n,i,o})})});var El=(bl._getKeyDownEventText=function(t){return t.isNewLine?"\r":1===t.keyProperty.length?t.keyProperty:""},bl.createKeyDownOptions=function(t){var e=bl._getKeyDownEventText(t);return{type:e?"keyDown":"rawKeyDown",modifiers:t.modifiers||0,windowsVirtualKeyCode:t.keyCode,key:t.keyProperty,text:e}},bl.createKeyUpOptions=function(t){return{type:"keyUp",modifiers:t.modifiers||0,key:t.keyProperty,windowsVirtualKeyCode:t.keyCode}},bl.createMouseEventOptions=function(l,a){return _(this,void 0,void 0,function(){var o,r,s;return P(this,function(t){switch(t.label){case 0:return[4,yl()];case 1:return o=t.sent(),r=o.x,s=o.y,[2,m.utils.extend({x:a.options.clientX+r,y:a.options.clientY+s,modifiers:(n=a.options,i=0,n&&(n.ctrl&&(i|=ol.ctrl),n.alt&&(i|=ol.alt),n.shift&&(i|=ol.shift),n.meta&&(i|=ol.meta)),i),button:(e=a.options).button?e.button:"left",type:l},pl)]}var e,n,i})})},bl.delay=function(t){return{type:nl.Delay,options:{delay:t}}},bl.keyDown=function(t){return{type:nl.Keyboard,options:bl.createKeyDownOptions(t)}},bl.keyUp=function(t){return{type:nl.Keyboard,options:bl.createKeyUpOptions(t)}},bl);function bl(){}var Sl=(wl.prototype.mouseDown=function(n){return _(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return[4,El.createMouseEventOptions("mousePressed",n)];case 1:return e=t.sent(),[2,this._dispatchEventFn.single(nl.Mouse,e)]}})})},wl.prototype.mouseUp=function(n){return _(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return[4,El.createMouseEventOptions("mouseReleased",n)];case 1:return e=t.sent(),[2,this._dispatchEventFn.single(nl.Mouse,e)]}})})},wl.prototype.keyDown=function(t){var e=El.createKeyDownOptions(t);return this._dispatchEventFn.single(nl.Keyboard,e)},wl.prototype.keyUp=function(t){var e=El.createKeyUpOptions(t);return this._dispatchEventFn.single(nl.Keyboard,e)},wl.prototype.executeEventSequence=function(t){return this._dispatchEventFn.sequence(t)},wl.prototype.executeInsertText=function(e){return _(this,void 0,void 0,function(){return P(this,function(t){return[2,this._dispatchEventFn.single(nl.InsertText,{text:e})]})})},wl.prototype.createMouseMoveEvent=function(n){return _(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return[4,El.createMouseEventOptions("mouseMoved",{options:{clientX:n.x,clientY:n.y,button:"none"}})];case 1:return e=t.sent(),[2,{type:nl.Mouse,options:e}]}})})},wl);function wl(t){this._dispatchEventFn=t}var _l=(Pl.create=function(t){var n=t.element,i=t.clientPoint,o=t.screenPoint,r=t.isTarget,s=t.inMoving;return _(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return e=null,i?[4,It(i)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,new Pl({element:n,clientPoint:i,screenPoint:o,isTarget:r,inMoving:s,devicePoint:e})]}})})},Pl);function Pl(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u,h=t.devicePoint,f=void 0===h?null:h;this.element=n,this.clientPoint=o,this.screenPoint=s,this.devicePoint=f,this.isTarget=a,this.inMoving=c}var xl,Al=(w(Cl,xl=Ss),Cl.prototype._ensureWindowAndCursorForLegacyTests=function(t){t.window=t.window||bf,t.cursor=ll},Cl.prototype.canUseNativeAutomationEventSimulator=function(t){return!!this.nativeAutomationInput&&!!t&&"select"!==R(t)},Cl.prototype._getElementForEvent=function(n){return _(this,void 0,void 0,function(){var e;return P(this,function(t){return e=_t(this.element,this.options.offsetX,this.options.offsetY)?this.element:null,[2,Vt(n.point,this.window,e)]})})},Cl.prototype._moveToElement=function(){return _(this,void 0,void 0,function(){var e,n=this;return P(this,function(t){switch(t.label){case 0:return e=new Or(m.utils.extend({skipScrolling:!0},this.options),!1),[4,Zs.create(this.element,e,this.window,this.cursor,this.nativeAutomationInput)];case 1:return[2,t.sent().run().then(function(){return Ao(n.automationSettings.mouseActionStepDelay)})]}})})},Cl.prototype._scrollToElement=function(){var e=this,n=!1,t=new gr(this.options,!1);return new Cs(this.element,t).run().then(function(t){return n=!!t,Ao(e.automationSettings.mouseActionStepDelay)}).then(function(){return Vt(e.cursor.getPosition(),e.window)}).then(function(t){return function(s,l,a){return _(this,void 0,y.Promise,function(){var e,n,i,o,r;return P(this,function(t){switch(t.label){case 0:return s&&ul.contains(l,s)&&a?(e=ms(),n=ul.getCommonAncestor(s,e),[4,al.getClientPosition(s)]):[2];case 1:return[4,It(i=t.sent())];case 2:return(o=t.sent())&&(r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:cl.BUTTONS_PARAMETER.leftButton},Ns.leaveElement(s,e,n,r),Ns.enterElement(s,e,n,r),ps(s)),[2]}})})}(t,e.element,n)}).then(function(){return n})},Cl.prototype._getElementOffset=function(){var t=Ot(this.element),e=this.options,n=e.offsetX,i=e.offsetY,o=i||0===i?i:t.offsetY,r=n||0===n?n:t.offsetX;return x.create({x:r,y:o})},Cl.prototype._isTargetElement=function(n,i){return _(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return(e=!i||n===i||n===this.element)||!n?[3,2]:[4,this._contains(this.element,n)];case 1:e=t.sent(),t.label=2;case 2:return[2,e]}})})},Cl.prototype._getCheckedPoints=function(t){for(var e=[t],n=t.x/2,i=t.y/2,o=2*t.x,r=2*t.y,s=i;s<r;s+=i)for(var l=n;l<o;l+=n)e.push(x.create({x:l,y:s}));return e},Cl.prototype._getAvailableOffset=function(r,s){return _(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){switch(t.label){case 0:e=this._getCheckedPoints(s),i=n=null,o=0,t.label=1;case 1:return o<e.length?[4,xt(this.element,e[o])]:[3,7];case 2:return n=t.sent(),[4,Dt(this.element,n)];case 3:return[4,Vt(t.sent(),this.window,r)];case 4:return i=t.sent(),[4,this._isTargetElement(i,r)];case 5:if(t.sent())return[2,e[o]];t.label=6;case 6:return o++,[3,1];case 7:return[2,null]}})})},Cl.prototype._wrapAction=function(m){return _(this,void 0,void 0,function(){var e,n,i,o,r,s,l,a,u,c,h,f,d;return P(this,function(t){switch(t.label){case 0:return e=this._getElementOffset(),[4,_t(this.element,e.x,e.y)];case 1:return n=t.sent()?this.element:null,[4,xt(this.element,e)];case 2:return i=t.sent(),[4,Pt(this.element)];case 3:return o=t.sent(),[4,m()];case 4:return t.sent(),this.options.isDefaultOffset?[4,this._getAvailableOffset(n,e)]:[3,6];case 5:r=t.sent(),e.x=(null==r?void 0:r.x)||e.x,e.y=(null==r?void 0:r.y)||e.y,this.options.offsetX=e.x,this.options.offsetY=e.y,t.label=6;case 6:return[4,xt(this.element,e)];case 7:return s=t.sent(),[4,Pt(this.element)];case 8:return l=t.sent(),[4,Dt(this.element,s)];case 9:return[4,Vt(a=t.sent(),this.window,n)];case 10:return(u=t.sent())?[4,this._isTargetElement(u,n)]:[2,_l.create({element:null,clientPoint:null,screenPoint:null,isTarget:!1,inMoving:!1})];case 11:return c=t.sent(),h=i.x!==s.x||i.y!==s.y,f=o.x!==l.x||o.y!==l.y,d=h&&f,[2,_l.create({element:u,clientPoint:a,screenPoint:s,isTarget:c,inMoving:d})]}})})},Cl.prototype._checkElementState=function(t,e){if(!t.element)throw new si(null,{reason:function t(e,n){void 0===n&&(n="action target");var i=gt(e);if(B(e)){var o=(t(K(Y(e,"map")),"container")||"").replace(/.*The/,"its");return dt.mapContainerNotVisible(i,o)}return dt.elOutsideBounds(i,n)}(this.element)});if(e&&(!t.isTarget||t.inMoving))throw new Yi;return t},Cl.prototype._ensureElement=function(o,e,n){var r=this;return void 0===e&&(e=!1),void 0===n&&(n=!1),this._wrapAction(function(){return r._scrollToElement()}).then(function(t){return r._checkElementState(t,o)}).then(function(t){return n?t:r._wrapAction(function(){return r._moveToElement()})}).then(function(t){return e||r._checkElementState(t,o),t}).then(function(t){var e,n,i=null==t?void 0:t.element;return r.emit(r.TARGET_ELEMENT_FOUND_EVENT,{element:i||null}),o||!i||t.isTarget||(e=gt(r.element),n=gt(i),r.emit(r.WARNING_EVENT,{type:hl,args:[e,n]})),{element:(null==t?void 0:t.element)||null,clientPoint:(null==t?void 0:t.clientPoint)||null,screenPoint:(null==t?void 0:t.screenPoint)||null,devicePoint:(null==t?void 0:t.devicePoint)||null}})},Cl.prototype._contains=function(o,r){return _(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,W(r)];case 1:for(e=t.sent(),n=0,i=e;n<i.length;n++)if(i[n]===o)return[2,!0];return[2,!1]}})})},Cl);function Cl(t,e,n,i,o){var r=xl.call(this)||this;return r.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",r.WARNING_EVENT="automation|warning-event",r.element=t,r.options=e,r.automationSettings=new wo(e.speed||1),r.window=n,r.cursor=i,r.nativeAutomationInput=o?new Sl(o):null,r._ensureWindowAndCursorForLegacyTests(r),r}var Tl,Ml=y.Promise,Dl=(w(Il,Tl=Al),Il.prototype.run=function(t){var e=this,n=Ml.resolve();return this.element!==Sf.scrollingElement&&this.element!==Sf.documentElement&&(n=this._ensureElement(t,!0,!0)),n.then(function(){e.element.scrollLeft=e.scrollLeft,e.element.scrollTop=e.scrollTop})},Il);function Il(t,e,n){var i,o,r,s,l,a=e.x,u=e.y,c=e.position,h=e.byX,f=e.byY,d=Tl.call(this,t,n,bf,ll)||this;return c&&(o=t,r=c,s=Math.floor(o.scrollWidth/2-o.clientWidth/2),l=Math.floor(o.scrollHeight/2-o.clientHeight/2),a=(i={top:[s,0],right:[o.scrollWidth,l],bottom:[s,o.scrollHeight],left:[0,l],topRight:[o.scrollWidth,0],topLeft:[0,0],bottomRight:[o.scrollWidth,o.scrollHeight],bottomLeft:[0,o.scrollHeight],center:[s,l]}[r])[0],u=i[1]),d.scrollLeft="number"==typeof a?a:t.scrollLeft,d.scrollTop="number"==typeof u?u:t.scrollTop,h&&(d.scrollLeft+=h),f&&(d.scrollTop+=f),d}var Ul,kl=(w(Ol,Ul=Al),Ol.prototype.run=function(t){return this._ensureElement(t,!0,!0)},Ol);function Ol(t,e){return Ul.call(this,t,e,bf,ll)||this}var Nl=y.Promise,Bl=y.nativeMethods,Fl=y.utils.browser,Ll=y.eventSandbox.focusBlur,Vl=E.contentEditable,Kl=E.textSelection,Rl=E.domUtils,Yl=E.styleUtils,Wl=y.eventSandbox.message,Xl="automation|iframe|request",Hl="automation|iframe|response";function ql(t,e){var n,i,o=Rl.isTextEditableElement(t),r=Rl.isContentEditableElement(t);o||r?r&&isNaN(parseInt(e,10))?Kl.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Rl.getElementValue(t).length:e,Kl.select(t,n,n)):(i=Vl.findContentEditableParent(t))&&Kl.setCursorToLastVisiblePosition(Vl.findContentEditableParent(i))}function Gl(v,g,y){var t=this;return new Nl(function(p){return _(t,void 0,void 0,function(){var n,i,o,r,s,l,a,u,c,h,f,d,m;return P(this,function(t){switch(t.label){case 0:return gs(bf)?[4,bs({cmd:Xl},Hl,bf.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(n=Rl.getActiveElement(),i=Rl.isTextEditableElement(v),o=Rl.closest(v,"label[for]"),r=Rl.isElementFocusable(v),s=!r&&o,l=Rl.isContentEditableElement(v),a=l?Vl.findContentEditableParent(v):v,g&&Fl.isWebKit&&i&&Kl.select(v,0,0),s)return g&&(e=o,Rl.isElementFocusable(e)?Ll.focus(e,E.noop,!1,!0):jl(e)),p(),[2];if(u=!g,c=!1,!r&&!l){if(h=Rl.findDocument(a),f=Bl.documentActiveElementGetter.call(h),d=Rl.isBodyElement(f),m=Rl.isBodyElement(a)?a:Rl.getFocusableParent(a),f&&!d&&Rl.containsElement(f,a)||d&&Rl.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return Ll.focus(a,function(){!g||l||v===Rl.getActiveElement()?(ql(v,y),g||Rl.getActiveElement()===n?p():Ll.focus(n,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function zl(t){var e=Rl.closest(t,"label[for]"),n=e&&(e.control||Sf.getElementById(e.htmlFor));return n&&Yl.isElementVisible(n)?n:null}function jl(t){var e=zl(t);e&&Rl.getActiveElement()!==e&&Ll.focus(e,E.noop,!1,!0)}Wl.on(Wl.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===Xl&&(e=Rl.findIframeByWindow(t.source),Ll.focus(e,function(){Wl.sendServiceMsg({cmd:Hl},t.source)},!1))});var $l=y.utils.browser,Ql=y.eventSandbox.eventSimulator,Zl=y.eventSandbox.listeners,Jl=y.nativeMethods,ta=E.domUtils,ea=E.styleUtils,na=E.selectController,ia=i.selectElement,oa=(ra.prototype.run=function(){this.eventState.clickElement&&Ql.click(this.eventState.clickElement,this.eventArgs.options),ta.isElementFocusable(this.eventArgs.element)||jl(this.eventArgs.element)},ra);function ra(t,e){this.eventState=t,this.eventArgs=e}var sa,la=(w(aa,sa=oa),aa.prototype.run=function(){function t(t){n=Jl.eventTargetGetter.call(t)===e.input}var e=this,n=!1;Zl.addInternalEventBeforeListener(bf,["focus"],t),sa.prototype.run.call(this),Zl.removeInternalEventBeforeListener(bf,["focus"],t),ta.isElementFocusable(this.targetElement)&&!n&&this._ensureBoundElementFocusRaised()},aa.prototype._ensureBoundElementFocusRaised=function(){Ql.focus(this.input)},aa);function aa(t,e){var n=sa.call(this,t,e)||this;return n.targetElement=n.eventArgs.element,n.input=zl(n.eventArgs.element),n}var ua,ca=(w(ha,ua=oa),ha.prototype.run=function(){ua.prototype.run.call(this),this._toggleSelectOptionList()},ha.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===ea.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(na.isOptionListExpanded(t)?ia.collapseOptionList():ia.expandOptionList(t))},ha);function ha(t,e){return ua.call(this,t,e)||this}var fa,da=(w(ma,fa=oa),ma.prototype.run=function(){return this.eventArgs.element},ma);function ma(t,e){return fa.call(this,t,e)||this}var pa,va=(w(ga,pa=la),ga.prototype.run=function(){function t(){e=!0}var e=!1;Zl.addInternalEventBeforeListener(bf,["change"],t),pa.prototype.run.call(this),Zl.removeInternalEventBeforeListener(bf,["change"],t),!$l.isChrome||e||this.checkbox.disabled||this._isClickableElementInsideLabel(this.targetElement)||this._ensureCheckboxStateChanged()},ga.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,Ql.change(this.checkbox)},ga.prototype._isClickableElementInsideLabel=function(t){var e=ta.isAnchorElement(t)&&t.getAttribute("href"),n=ta.isButtonElement(t);return e||n},ga);function ga(t,e){var n=pa.call(this,t,e)||this;return n.checkbox=n.input,n}var ya=y.Promise,Ea=y.utils.browser,ba=y.utils.featureDetection,Sa=y.eventSandbox.eventSimulator,wa=y.eventSandbox.listeners,_a=E.domUtils,Pa=E.eventUtils,xa=E.arrayUtils,Aa=(Ca.prototype.mousedown=function(t){var e=this;this.targetElementParentNodes=_a.getParents(t.element),this.mouseDownElement=t.element,this._raiseTouchEvents(t);var n=_a.getActiveElement();this.activeElementBeforeMouseDown=n;var i=(Ea.isWebKit||Ea.isIE)&&_a.isSelectElement(this.mouseDownElement);return i&&this._bindMousedownHandler(),this._bindBlurHandler(n),this._isTouchEventWasCancelled()||(this.eventState.simulateDefaultBehavior=Sa.mousedown(t.element,t.options)),!1===this.eventState.simulateDefaultBehavior&&(this.eventState.simulateDefaultBehavior=i&&!this.eventState.mousedownPrevented),this._ensureActiveElementBlur(n).then(function(){return e._focus(t)})},Ca.prototype.mouseup=function(t,e){var n,i,o,r,s;e.element=t,this.eventState.clickElement=(n=this.mouseDownElement,i=t,o=this.targetElementParentNodes,r=_a.getParents(i),s=_a.isTheSameNode(i,n),Ea.isFirefox?s?n:null:s?xa.equals(o,r)?n:null:n.contains(i)&&!_a.isEditableFormElement(i)?n:i.contains(n)?i:xa.getCommonElement(r,o));var l={},a=function(t){l=t.timeStamp,wa.removeInternalEventBeforeListener(bf,["mouseup"],a)};return Ea.isIE||wa.addInternalEventBeforeListener(bf,["mouseup"],a),this._isTouchEventWasCancelled()||Sa.mouseup(t,e.options),e.options&&(e.options.timeStamp=l),this._click(e)},Ca.prototype._click=function(u){return _(this,void 0,y.Promise,function(){var a;return P(this,function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=zl((n=u).element),o=ta.isSelectElement(n.element),r=ta.isOptionElement(n.element),s=ta.isLabelElement(n.element)&&i,l=i&&ta.isCheckboxElement(i),a=new(o?ca:r?da:l?va:s?la:oa)(e,n),this._isTouchEventWasCancelled()||a.run(),[2,u]})})},Ca.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},Ca.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Pa.preventDefault(t),Pa.unbind(e.element,"mousedown",n)};Pa.bind(this.element,"mousedown",n)},Ca.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,Pa.unbind(t,"blur",n,!0)};Pa.bind(t,"blur",n,!0)},Ca.prototype._ensureActiveElementBlur=function(e){var n=this;return new ya(function(t){_a.getActiveElement()===e||n.eventState.blurRaised?t():Ea.isIE&&Ea.version<12?Co().then(function(){n.eventState.blurRaised||Sa.blur(e),t()}):(Sa.blur(e),t())})},Ca.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?ya.resolve():Gl(_a.isContentEditableElement(this.element)?this.element:t.element,!Ea.isIE||this.activeElementBeforeMouseDown===_a.getActiveElement(),this.caretPos)},Ca.prototype._raiseTouchEvents=function(t){ba.isTouchDevice&&(this.eventState.touchStartCancelled=!Sa.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!Sa.touchend(t.element,t.options))},Ca);function Ca(t,e){this.element=t,this.caretPos=e,this.targetElementParentNodes=[],this.activeElementBeforeMouseDown=null,this.mouseDownElement=null,this.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1}}var Ta,Ma=(w(Da,Ta=Al),Da.prototype._mousedown=function(t){return this.canUseNativeAutomationEventSimulator(t.element)?this.nativeAutomationInput.mouseDown(t):this.strategy.mousedown(t)},Da.prototype._mouseup=function(n,t){var i=this;return this.canUseNativeAutomationEventSimulator(t.element)?this.nativeAutomationInput.mouseUp(t).then(function(t){var e=i.options.caretPos;return"number"==typeof e&&ql(n,e),t}):this.strategy.mouseup(n,t)},Da.prototype.run=function(t){var r,s=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return r={point:n,screenPoint:i,element:e,options:m.utils.extend({clientX:null==n?void 0:n.x,clientY:null==n?void 0:n.y,screenX:null==o?void 0:o.x,screenY:null==o?void 0:o.y},s.modifiers)},m.Promise.all([Ao(s.automationSettings.mouseActionStepDelay),s.cursor.leftButtonDown().then(function(){return s._mousedown(r)})])}).then(function(){return s.cursor.buttonUp()}).then(function(){return s._getElementForEvent(r)}).then(function(t){return t?s._mouseup(t,r):null})},Da);function Da(t,e,n,i,o){var r,s,l=Ta.call(this,t,e,n,i,o)||this;return l.modifiers=e.modifiers,l.strategy=(r=l.element,s=e.caretPos,new Aa(r,s)),l}function Ia(t,e,n){var i=function(t,e,n){if(e.y-t.y==0)return 0;var i=(e.x-t.x)/(e.y-t.y),o=t.y*(t.x-e.x)/(e.y-t.y)+t.x;return Math.round(i*n+o)}(t,e,n.top);return i&&i>=n.left&&i<=n.right?new x(i,n.top):null}function Ua(t,e,n){var i=function(t,e,n){if(e.x===t.x)return 0;var i=(e.y-t.y)/(e.x-t.x),o=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(i*n+o)}(t,e,n.left);return i&&i>=n.top&&i<=n.bottom?new x(n.left,i):null}function ka(t,e,n){for(var i=[],o=0,r=[{left:n.left,top:n.top,right:n.left,bottom:n.bottom,isHorizontal:!1},{left:n.right,top:n.top,right:n.right,bottom:n.bottom,isHorizontal:!1},{left:n.left,top:n.top,right:n.right,bottom:n.top,isHorizontal:!0},{left:n.left,top:n.bottom,right:n.right,bottom:n.bottom,isHorizontal:!0}];o<r.length;o++){var s=r[o],l=(s.isHorizontal?Ia:Ua)(t,e,s);l&&i.push(l)}return i.length?1===i.length||i[0].distance(t)<i[1].distance(t)?i[0]:i[1]:null}var Oa=y.eventSandbox.eventSimulator,Na=y.eventSandbox.message,Ba=E.positionUtils,Fa=E.domUtils,La=E.styleUtils,Va="automation|move|response";Na.on(Na.SERVICE_MSG_RECEIVED_EVENT,function(t){var e,n,i,o,r,s,l,a,u,c,h,f,d,m,p,v;"automation|move|request"===t.message.cmd&&(t.source.parent===bf?(e=bf["%testCafeDriverInstance%"],i=(n=t).message.nativeAutomationMove&&e.createDispatchNativeAutomationEventFunctions(),r=new x(n.message.endX,n.message.endY),s=n.source,l=Fa.findIframeByWindow(s),a=La.getBordersWidth(l),u=La.getElementPadding(l),c=Ba.getIframeClientCoordinates(l),h=Ba.getIframePointRelativeToParentFrame(r,s),f=ll.getPosition(),d=Ba.isInRectangle(f,c)?f:ka(f,h,c),m={x:d.x-c.left,y:d.y-c.top},p=new Or({modifiers:n.message.modifiers,offsetX:m.x+a.left+u.left,offsetY:m.y+a.top+u.top,speed:n.message.speed,skipScrolling:!0},!1),v={cmd:Va,x:m.x,y:m.y},ll.getActiveWindow(bf)!==s?(o=null,i&&(o=new Sl(i)),Zs.create(l,p,bf,ll,o).then(function(t){return t.run()}).then(function(){ll.setActiveWindow(s),Na.sendServiceMsg(v,s)})):Na.sendServiceMsg(v,s)):(y.on(y.EVENTS.beforeUnload,function(){return Na.sendServiceMsg({cmd:Va},t.source)}),function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=ms();return a&&(Oa.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),Oa.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),Na.sendServiceMsg({cmd:Va},e)}var u,c=ll.getPosition(),h=ka(x.create(n).add(c),new x(t.message.endX,t.message.endY),n);h?(u=new Or({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),Zs.create(Sf.documentElement,u,bf,ll).then(function(t){return t.run()}).then(function(){var t={cmd:Va,x:h.x,y:h.y};ll.setActiveWindow(e),Na.sendServiceMsg(t,e)})):Na.sendServiceMsg({cmd:Va,x:n.left,y:n.top},e)}(t)))});var Ka=y.Promise,Ra=y.utils.browser,Ya=y.utils.featureDetection,Wa=y.eventSandbox.eventSimulator,Xa=y.eventSandbox.focusBlur,Ha=y.nativeMethods,qa=E.domUtils,Ga=E.styleUtils,za=E.delay,ja=E.selectController,$a=i.selectElement,Qa=Ya.isTouchDevice?0:160,Za=(Ja.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?ja.getEmulatedChildElement(this.element):this.element,e=1<Ga.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Ra.isIE&&e?this.parentSelect:t}},Ja.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=kt(n=ja.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=Sf.documentElement,i=(e=$a.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},Ja.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Or({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return Zs.create(n,s,bf,ll).then(function(t){return t.run()}).then(function(){return za(e.automationSettings.mouseActionStepDelay)})},Ja.prototype._mousedown=function(){var t=this;return Ra.isFirefox?(Wa.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Ra.isIE?(Wa.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return za(Qa)}).then(function(){Wa.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},Ja.prototype._focus=function(){var e=this;return new Ka(function(t){Xa.focus(e.parentSelect,t,!1,!0)})},Ja.prototype._mouseup=function(){var t=Ra.isIE?this.parentSelect:this.eventsArgs.element;Wa.mouseup(t,this.eventsArgs.options),Ra.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Ra.isFirefox||Ra.isSafari||Ra.isChrome&&53<=Ra.version,n=e||Ra.isIE;return e&&this.clickCausesChange&&Wa.input(this.parentSelect),n&&this.clickCausesChange&&Wa.change(this.parentSelect),Ka.resolve()},Ja.prototype._click=function(){Wa.click(this.eventsArgs.element,this.eventsArgs.options)},Ja.prototype.run=function(){var t=this;if(!this.parentSelect)return Wa.click(this.eventsArgs.element,this.eventsArgs.options),Ka.resolve();this.optionListExpanded||$a.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Ga.getSelectElementSize(this.parentSelect)<=1?this._move(e).then(function(){return t._click()}):this._move(e).then(function(){return t._mousedown()}).then(function(){return t._mouseup()}).then(function(){return t._click()})},Ja);function Ja(t,e){var n,i,o,r,s;this.element=t,this.modifiers=e.modifiers,this.caretPos=e.caretPos,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.speed=e.speed,this.automationSettings=new wo(e.speed),this.parentSelect=qa.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&ja.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=qa.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=qa.getElementIndexInParent(this.parentSelect,this.element),o=Ha.nodeParentNodeGetter.call(this.element),r=qa.isOptionGroupElement(o)?o:null,s=this.element.disabled||r&&r.disabled,this.clickCausesChange=n&&!s&&this.childIndex!==i),this.eventsArgs={options:this.modifiers,element:this.element}}var tu,eu=y.utils.featureDetection,nu=y.utils.browser,iu=y.eventSandbox.eventSimulator,ou=E.eventUtils,ru=E.delay,su=eu.isTouchDevice?0:160,lu=(w(au,tu=Al),au.prototype._firstClick=function(t){var e=this,n=new Ir(this.options);n.speed=1;var i=new Ma(this.element,n,bf,ll);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return ru(su).then(function(){return t})})},au.prototype._secondClick=function(t){var e=this;nu.isIE&&ou.bind(Sf,"focus",ou.preventDefault,!0);var n=new Ir({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new Ma(Sf.documentElement,n,bf,ll);return i.run().then(function(t){return e.eventState.dblClickElement=i.strategy.eventState.clickElement,nu.isIE&&ou.unbind(Sf,"focus",ou.preventDefault,!0),t})},au.prototype._dblClick=function(t){this.eventState.dblClickElement&&iu.dblclick(this.eventState.dblClickElement,t.options)},au.prototype.run=function(t){var e=this;return this._firstClick(t).then(function(t){return e._secondClick(t)}).then(function(t){return e._dblClick(t)})},au);function au(t,e){var n=tu.call(this,t,e,bf,ll)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new wo(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var uu,cu=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},hu=y.nativeMethods,fu=y.utils.featureDetection,du=y.utils.html,mu=y.utils.url,pu=y.eventSandbox.DataTransfer,vu=y.eventSandbox.DragDataStore,gu=E.eventUtils,yu=E.domUtils,Eu=(w(bu,uu=Zs),bu.create=function(o,r,s,l){return _(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,Zs.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new bu(n,i,r,s,l)]}})})},bu.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},bu.prototype._getEventSequenceOptions=function(t){var e=uu.prototype._getEventSequenceOptions.call(this,t),n=e.eventOptions,i=e.eventSequenceOptions;return n.dataTransfer=this.dragAndDropState.dataTransfer,n.buttons=gu.BUTTONS_PARAMETER.leftButton,i.holdLeftButton=!0,{eventOptions:n,eventSequenceOptions:i}},bu.prototype._getCorrectedTopElement=function(t){return this.touchMode?this.dragElement:t},bu.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions,o=$s(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(t,ms(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},bu.prototype._needMoveCursorImmediately=function(){return!1},bu.prototype.run=function(){var l=this;return Vt(this.cursor.getPosition()).then(function(t){l.dragElement=t;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=hu.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&fu.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new vu,l.dragAndDropState.dataTransfer=new pu(l.dragAndDropState.dataStore),((e=yu.isAnchorElement(l.dragElement))||yu.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=mu.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=du.cleanUpHtml(hu.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),uu.prototype.run.call(l).then(function(){return l.dragAndDropState})})},bu);function bu(t,e,n,i,o){var r=uu.call(this,t,e,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new cu,r}var Su,wu=y.Promise,_u=y.utils.extend,Pu=y.utils.featureDetection,xu=y.eventSandbox.eventSimulator,Au=y.eventSandbox.focusBlur,Cu=(w(Tu,Su=Al),Tu.prototype._getEndPoint=function(){throw new Error("Not implemented")},Tu.prototype._mousedown=function(t){var e=this;return ll.leftButtonDown().then(function(){return e.simulateDefaultBehavior=xu[e.downEvent](t.element,t.options),e._focus(t)})},Tu.prototype._focus=function(n){var i=this;return new wu(function(t){var e=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;Au.focus(e,t,!1,!0)})},Tu.prototype._getDestination=function(){throw new Error("Not implemented")},Tu.prototype._drag=function(){var r=this;return this._getDestination().then(function(t){var e=t.element,n=t.offsets,i=t.endPoint;r.endPoint=i;var o=new Or({offsetX:n.offsetX,offsetY:n.offsetY,modifiers:r.modifiers,speed:r.speed,minMovingTime:25,skipDefaultDragBehavior:!1===r.simulateDefaultBehavior},!1);return Eu.create(e,o,bf,ll)}).then(function(t){return t.run()}).then(function(t){return r.dragAndDropState=t,g.delay(r.automationSettings.mouseActionStepDelay)})},Tu.prototype._mouseup=function(){var o=this;return ll.buttonUp().then(function(){var e=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=_u({clientX:e.x,clientY:e.y},o.modifiers);return Vt(e).then(function(t){return(n=t)?(o.dragAndDropState.enabled?(i.dataTransfer=o.dragAndDropState.dataTransfer,o.dragAndDropState.dropAllowed&&xu.drop(n,i),xu.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):xu[o.upEvent](n,i),Vt(e)):n}).then(function(t){n&&t===n&&!o.dragAndDropState.enabled&&xu.click(n,i)})})},Tu.prototype.run=function(t){var i,o=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint;return i={point:n,element:e,options:_u({clientX:n.x,clientY:n.y},o.modifiers)},wu.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},Tu);function Tu(t,e){var n=Su.call(this,t,e,bf,ll)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=Pu.isTouchDevice?"touchstart":"mousedown",n.upEvent=Pu.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var Mu,Du=E.styleUtils,Iu=(w(Uu,Mu=Cu),Uu.prototype._getDestination=function(){return _(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){switch(t.label){case 0:return[4,xt(this.element,{x:this.offsetX,y:this.offsetY})];case 1:return e=t.sent(),n=Du.getWidth(Sf),i=Du.getHeight(Sf),o={x:e.x+this.dragOffsetX,y:e.y+this.dragOffsetY},o={x:Math.min(Math.max(0,o.x),n),y:Math.min(Math.max(0,o.y),i)},[2,{element:Sf.documentElement,offsets:{offsetX:o.x,offsetY:o.y},endPoint:o}]}})})},Uu);function Uu(t,e,n,i){var o=Mu.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var ku,Ou=E.positionUtils,Nu=(w(Bu,ku=Cu),Bu.prototype._getDestination=function(){return _(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){return e=this.destinationElement,n=Ou.getElementRectangle(e),i=Ot(e,this.destinationOffsetX,this.destinationOffsetY),o={x:n.left+i.offsetX,y:n.top+i.offsetY},[2,{element:e,offsets:i,endPoint:o}]})})},Bu);function Bu(t,e,n){var i=ku.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var Fu,Lu=(w(Vu,Fu=Al),Vu.prototype.run=function(t){return this._ensureElement(t,!0)},Vu);function Vu(t,e,n){return Fu.call(this,t,e,bf,ll,n)||this}var Ku=y.utils.browser,Ru=y.sandbox.event,Yu=y.eventSandbox.eventSimulator,Wu=y.eventSandbox.listeners,Xu=y.nativeMethods,Hu=E.domUtils,qu=E.contentEditable,Gu=E.textSelection,zu=/ /g;function ju(t){var e=Gu.getSelectionByElement(t),n=Gu.hasInverseSelectionContentEditable(t);return Gu.hasElementContainsSelection(t)?qu.getSelection(t,e,n):{startPos:qu.calculateNodeAndOffsetByPosition(t,0),endPos:qu.calculateNodeAndOffsetByPosition(t,0)}}function $u(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=qu.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=qu.getLastNonWhitespaceSymbolIndex(e.nodeValue);return n<o&&0!==n?(t.startPos.offset=o,t.endPos.offset=i+o-n):r<i&&i!==e.nodeValue.length&&(t.startPos.offset=e.nodeValue.length,t.endPos.offset=i+e.nodeValue.length-n),t}function Qu(t,e,n){return!n||Yu.beforeInput(t,e)}function Zu(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}Ku.isSafari&&(Wu.addInternalEventBeforeListener(bf,["textInput"],i),Ru.on(Ru.EVENT_PREVENTED_EVENT,o));var r=Ku.isFirefox||Yu.textInput(t,e)||n;return Ku.isSafari&&(Wu.removeInternalEventBeforeListener(bf,["textInput"],i),Ru.off(Ru.EVENT_PREVENTED_EVENT,o)),r||Ku.isIE11}function Ju(t,e){var n,i,o,r,s,l,a,u,c,h,f,d=ju(t),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,y=e;function E(){g=!1}function b(t,e,n){n()}e=e.replace(zu,String.fromCharCode(160)),m&&p&&Hu.isContentEditableElement(m)&&Hu.isContentEditableElement(p)&&(Hu.isTheSameNode(m,p)||(Gu.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=Xu.nodeParentNodeGetter.call(o)&&o.parentElement,!(Ku.isChrome&&Ku.version<58||Ku.isSafari)&&r&&Hu.isElementContainsNode(n,o)||(i=ju(n),Gu.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Hu.isContentEditableElement(m)&&Hu.isRenderedNode(m)&&Qu(t,e,Ku.isChrome||Ku.isFirefox)&&(v=Zu(t,y),g=v&&!Ku.isIE11,Wu.addInternalEventBeforeListener(bf,["input"],E),Wu.addInternalEventBeforeListener(bf,["textinput"],b),(v=v&&Qu(t,e,Ku.isSafari))&&(Hu.isElementNode(m)?(s=m,l=e,c=Sf.createTextNode(l),h={node:c,offset:l.length},f=Xu.nodeParentNodeGetter.call(s),"br"===Hu.getTagName(s)?f.insertBefore(c,s):0<a?(u=Xu.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Gu.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;Hu.isElementContainsNode(t,i)||(i=(e=$u(ju(t))).startPos.node);var o=e.startPos.offset,r=e.endPos.offset,s=i.nodeValue,l={node:i,offset:o+n.length};i.nodeValue=s.substring(0,o)+n+s.substring(r,s.length),Gu.selectByNodesAndOffsets(l,l)}(t,$u(d),e)),Co().then(function(){g&&Yu.input(t,e),Wu.removeInternalEventBeforeListener(bf,["input"],E),Wu.removeInternalEventBeforeListener(bf,["textinput"],b)})))}function tc(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Hu.isContentEditableElement(t)&&Ju(t,e),Hu.isElementReadOnly(t)||(Hu.isTextEditableElement(t)?(l=t,a=e,h=Hu.getElementValue(l),f=a.length,d=Gu.getSelectionStart(l),m=Gu.getSelectionEnd(l),p=Hu.isInputElement(l)&&"number"===l.type,Qu(l,a,Ku.isChrome||Ku.isFirefox)&&Zu(l,a)&&Qu(l,a,Ku.isSafari)&&((u=!Ku.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=Ku.isIE&&Ku.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&Ku.isIOS&&"."===h[h.length-1]&&(d+=1),Hu.setElementValue(l,c),Gu.select(l,d+f,d+f)),Yu.input(l,a))):Hu.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=Hu.getElementValue(i),Hu.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Hu.setElementValue(i,o),Yu.change(i),Yu.input(i,o)))}function ec(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var nc=y.nativeMethods,ic=y.utils.browser,oc=y.eventSandbox.focusBlur,rc=y.Promise,sc=g.domUtils.isRadioButtonElement,lc=g.domUtils.getActiveElement,ac=g.domUtils.getTabIndexAttributeIntValue;function uc(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function cc(t){for(var e=t.slice(),n=0;n<t.length;n++){var i=t[n];if("shift"===i.toLowerCase()){var o=t[n+1];if(!o)continue;g.KEY_MAPS.shiftMap[o]?t[n+1]=g.KEY_MAPS.shiftMap[o]:g.KEY_MAPS.reversedShiftMap[o]&&(e[n+1]=g.KEY_MAPS.reversedShiftMap[o])}!g.KEY_MAPS.shiftMap[i]||t[n-1]&&"shift"===t[n-1].toLowerCase()||(t[n]=g.KEY_MAPS.shiftMap[i],t.splice(n,0,"shift"),e.splice(n,0,"shift"),n++)}return{actualKeys:t,eventKeyProperties:e}}function hc(t){var e=lc(t||Sf),n=null;if(e&&g.domUtils.isIframeElement(e)&&nc.contentDocumentGetter.call(e))try{n=hc(nc.contentDocumentGetter.call(e))}catch(t){}return n||e}function fc(t,e,n){if(!sc(e))return t;if(!n&&!e.name&&!ic.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||ic.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return sc(t)&&t.name===i.name}:ic.isChrome&&(o=function(t){return sc(t)&&!t.name}),o);return r&&(t=g.arrayUtils.filter(t,r)),t}function dc(t,e,n){var i,o,r,s,l,a,u,c,h=e?-1:1,f=g.domUtils.getTopSameDomainWindow(bf).document,d=(i=f,o=nc.documentActiveElementGetter.call(i),r=o&&ac(o),!(o&&r<0)),m=fc(m=g.domUtils.getFocusableElements(f,d),t,n),p=sc(t),v=g.arrayUtils.indexOf(m,t);return(e?0===v:v===m.length-1)?!e&&t.tabIndex<0?g.arrayUtils.find(m,function(t){return 0===t.tabIndex}):n||!p?Sf.body:m[m.length-1-v]:e&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=sc(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(t){return sc(t)&&t.name===l.name&&t.checked})),c||l)}function mc(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var pc={SPECIAL_KEYS:{capslock:"CapsLock",delete:"U+007F",end:"End",enter:"Enter",esc:"U+001B",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:"U+0020",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},LETTERS:{a:"U+0041",b:"U+0042",c:"U+0043",d:"U+0044",e:"U+0045",f:"U+0046",g:"U+0047",h:"U+0048",i:"U+0049",j:"U+004A",k:"U+004B",l:"U+004C",m:"U+004D",n:"U+004E",o:"U+004F",p:"U+0050",q:"U+0051",r:"U+0052",s:"U+0053",t:"U+0054",u:"U+0055",v:"U+0056",w:"U+0057",x:"U+0058",y:"U+0059",z:"U+005A"},SYMBOLS:{0:"U+0030",1:"U+0031",2:"U+0032",3:"U+0033",4:"U+0034",5:"U+0035",6:"U+0036",7:"U+0037",8:"U+0038",9:"U+0039"," ":"U+0020","!":"U+0021","@":"U+0040","#":"U+0023",$:"U+0024","%":"U+0025","^":"U+005E","*":"U+002A","(":"U+0028",")":"U+0029",_:"U+005F","|":"U+007C","\\":"U+005C","/":"U+002F","?":"U+003F",".":"U+002E",",":"U+002C","<":"U+003C",">":"U+003E","[":"U+005B","]":"U+005D","{":"U+007B","}":"U+007D","§":"U+00A7","±":"U+00B1","'":"U+0027",'"':"U+0022",":":"U+003A",";":"U+003B","`":"U+0060","~":"U+007E"}};function vc(t){return ec(t)?pc.LETTERS[t.toLowerCase()]:pc.SYMBOLS[t]||pc.SPECIAL_KEYS[t]||t}function gc(t){if(ec(t))return t.toUpperCase().charCodeAt(0);var e=g.KEY_MAPS.shiftMap[t]?g.KEY_MAPS.shiftMap[t].charCodeAt(0):t.charCodeAt(0);return g.KEY_MAPS.symbolCharCodeToKeyCode[e]||e}function yc(t,e){var n,i=g.getSanitizedKey(t),o=1===t.length||"space"===t,r=(n=t,-1<g.KEY_MAPS.newLineKeys.indexOf(n)),s=g.KEY_MAPS.modifiers[i],l=g.KEY_MAPS.specialKeys[i];return e=e||t,{sanitizedKey:i,isChar:o,modifierKeyCode:s,specialKeyCode:l,isNewLine:r,isLetter:ec(t),keyIdentifierProperty:vc(e),keyProperty:g.KEY_MAPS.keyProperty[e]||e,keyCode:function(t,e,n,i,o){var r=null;return e&&"space"!==t?r=gc(n):i?r=i:o&&(r=o),r}(t,o,i,s,l)}}var Ec=y.utils.browser,bc=y.utils.extend,Sc=y.eventSandbox.eventSimulator,wc=(_c._isKeyActivatedInputElement=function(t){return g.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},_c.prototype._type=function(t,e){var n,i=t!==this.storedActiveElement,o=!i,r=t,s=g.domUtils.isEditableElement(t),l=g.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=g.domUtils.isElementInIframe(t)===g.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!Ec.isFirefox||l)&&(!Ec.isWebKit||n))}catch(t){}o&&(!Ec.isIE&&i&&l&&s&&(r=this.storedActiveElement),tc(r,e))},_c.prototype._addKeyPropertyToEventOptions=function(t){return bc(t,mc("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},_c.prototype.down=function(t){this.storedActiveElement=hc(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=uc(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),Sc.keydown(this.storedActiveElement,bc(e,t))},_c.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=hc(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(ec(t))return uc(t);if(g.KEY_MAPS.reversedShiftMap[t])return g.KEY_MAPS.reversedShiftMap[t]}return t}(this.sanitizedKey,t.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=e!==this.storedActiveElement;if(Ec.isWebKit&&o&&g.domUtils.isElementInIframe(e)!==g.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=e;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=Ec.isAndroid||Sc.keypress(e,bc(r,t));if(!s)return s;e=hc(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=_c._isKeyActivatedInputElement(e),a=g.domUtils.isButtonElement(e);return Ec.isSafari&&0<=Ec.compareVersions([Ec.webkitVersion,"603.1.30"])||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},_c.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=Sc.keyup(hc(this.topSameDomainDocument),bc(e,t)),i=hc(this.topSameDomainDocument);return!Ec.isFirefox&&!Ec.isSafari&&(!Ec.isChrome||53<=Ec.version)&&n&&"space"===this.sanitizedKey&&_c._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(_c.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),_c);function _c(t,e){var n=yc(t,e);bc(this,n),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(bf).document,this.storedActiveElement=null}var Pc,xc={ctrlA:"ctrl+a",backspace:"backspace",delete:"delete",left:"left",right:"right",up:"up",down:"down",shiftLeft:"shift+left",shiftRight:"shift+right",shiftUp:"shift+up",shiftDown:"shift+down",shiftHome:"shift+home",shiftEnd:"shift+end",home:"home",end:"end",enter:"enter",tab:"tab",shiftTab:"shift+tab",esc:"esc"},Ac=y.Promise,Cc=y.utils.browser,Tc=y.eventSandbox.eventSimulator,Mc=y.eventSandbox.elementEditingWatcher,Dc=E.textSelection,Ic=E.eventUtils,Uc=E.domUtils,kc=i.selectElement,Oc=null,Nc=null;function Bc(){Nc=Oc=null,Ic.unbind(this,"blur",Bc,!0)}function Fc(t){var e,n,i,o;Uc.isTextAreaElement(t)&&(Oc!==t&&(Ic.bind(t,"blur",Bc,!0),Oc=t),e=t,n=Dc.hasInverseSelection(e),i=Uc.getTextAreaValue(e),o=n?Dc.getSelectionStart(e):Dc.getSelectionEnd(e),Nc=i&&o?Uc.getTextareaIndentInLine(e,o):0)}function Lc(t,e){var n,i,o,r,s,l,a=Uc.getTextAreaValue(t);a&&(n=Dc.getSelectionStart(t),i=Dc.getSelectionEnd(t),o=Dc.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==Nc&&Oc===t||Fc(t),s=l.lastIndexOf("\n"),Kc(t,n,i,o,Math.min(s+1+Nc,l.length),e))}function Vc(t,e){var n,i,o,r,s,l,a,u,c,h,f=Uc.getTextAreaValue(t);f&&(n=Dc.getSelectionStart(t),i=Dc.getSelectionEnd(t),u=(r=(o=Dc.hasInverseSelection(t))?n:i)+(l=-1===(c=(s=f.substring(r)).indexOf("\n"))?s.length:c+1),h=-1===(c=(a=s.substring(l)).indexOf("\n"))?a.length:c,null!==Nc&&Oc===t||Fc(t),Kc(t,n,i,o,u=Math.min(u+Nc,u+h),e))}function Kc(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;Dc.select(t,s,l)}function Rc(t,e,n){Uc.isInputElement(t)&&"number"===t.type&&("-"===e.charAt(0)&&"."===e.charAt(1)&&(e=e.substring(1)),"."===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1))),Uc.setElementValue(t,e),Dc.select(t,n,n),Tc.input(t)}function Yc(t,e){var n,i,o,r,s,l,a,u;return Uc.isTextEditableElement(t)&&(n=Dc.getSelectionStart(t),i=Dc.getSelectionEnd(t),o=Dc.hasInverseSelection(t),s=null,s=(r=!Uc.isTextAreaElement(t)||Uc.getTextareaLineNumberByPosition(t,n)===Uc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=Uc.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,Dc.select(t,u,a)):o?Dc.select(t,i,a):Dc.select(t,n,a)),Ac.resolve()}function Wc(t,e){var n,i,o,r,s,l,a,u,c;return Uc.isTextEditableElement(t)&&(n=Dc.getSelectionStart(t),i=Dc.getSelectionEnd(t),o=Dc.hasInverseSelection(t),s=null,u=s=(r=!Uc.isTextAreaElement(t)||Uc.getTextareaLineNumberByPosition(t,n)===Uc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=Uc.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,Dc.select(t,c,u)):o?Dc.select(t,i,u):Dc.select(t,n,u)),Ac.resolve()}function Xc(t){return Yc(t,!0)}function Hc(t){return Wc(t,!0)}function qc(t){return Uc.isRadioButtonElement(t)}function Gc(t,e){return zc(t,e,!1).then(function(t){t&&(t.checked=!0)})}function zc(t,e,n){return void 0===n&&(n=!0),t?(Uc.isSelectElement(t)&&kc.collapseOptionList(),i=t,o=e,r=n,new rc(function(t){var e=dc(i,o,r);e?oc.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&Uc.isTextEditableInput(t)&&Dc.select(t),t})):Ac.resolve();var i,o,r}var jc=((Pc={})[xc.ctrlA]=function(t){return Uc.isEditableElement(t)&&Dc.select(t),Ac.resolve()},Pc[xc.backspace]=function(t){var e,n,i;return Uc.isTextEditableElementAndEditingAllowed(t)&&(e=Dc.getSelectionStart(t),n=Dc.getSelectionEnd(t),i=Uc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&Rc(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):Rc(t,i.substring(0,e)+i.substring(n,i.length),e)),Uc.isContentEditableElement(t)&&Dc.deleteSelectionContents(t),Ac.resolve()},Pc[xc.delete]=function(t){var e,n,i;return Uc.isTextEditableElementAndEditingAllowed(t)&&(e=Dc.getSelectionStart(t),n=Dc.getSelectionEnd(t),i=Uc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&Rc(t,i.substring(0,e)+i.substring(n+1,i.length),e):Rc(t,i.substring(0,e)+i.substring(n,i.length),e)),Uc.isContentEditableElement(t)&&Dc.deleteSelectionContents(t),Ac.resolve()},Pc[xc.left]=function(t){var e,n,i,o,r=null;return Uc.isSelectElement(t)&&kc.switchOptionsByKeys(t,"left"),qc(t)?Gc(t,!0):(Uc.isTextEditableElement(t)&&(e=(r=Dc.getSelectionStart(t)||0)===Dc.getSelectionEnd(t)?r-1:r,Dc.select(t,e,e),Fc(t)),Uc.isContentEditableElement(t)&&(r=Dc.getSelectionStart(t))!==Dc.getSelectionEnd(t)&&(n=Dc.getSelectionByElement(t),o={node:(i=Dc.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},Dc.selectByNodesAndOffsets(o,o,!0)),Ac.resolve())},Pc[xc.right]=function(t){var e,n,i,o,r=null,s=null;return Uc.isSelectElement(t)&&kc.switchOptionsByKeys(t,"right"),qc(t)?Gc(t,!1):(Uc.isTextEditableElement(t)&&(e=(r=Dc.getSelectionStart(t))===(s=Dc.getSelectionEnd(t))?s+1:s,r===Uc.getElementValue(t).length&&(e=r),Dc.select(t,e,e),Fc(t)),Uc.isContentEditableElement(t)&&(r=Dc.getSelectionStart(t))!==(s=Dc.getSelectionEnd(t))&&(n=Dc.getSelectionByElement(t),o={node:(i=Dc.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},Dc.selectByNodesAndOffsets(o,o,!0)),Ac.resolve())},Pc[xc.up]=function(t){return Uc.isSelectElement(t)&&kc.switchOptionsByKeys(t,"up"),qc(t)?Gc(t,!0):Cc.isWebKit&&Uc.isInputElement(t)?Yc(t):(Uc.isTextAreaElement(t)&&Lc(t,!1),Ac.resolve())},Pc[xc.down]=function(t){return Uc.isSelectElement(t)&&kc.switchOptionsByKeys(t,"down"),qc(t)?Gc(t,!1):Cc.isWebKit&&Uc.isInputElement(t)?Wc(t):(Uc.isTextAreaElement(t)&&Vc(t,!1),Ac.resolve())},Pc[xc.shiftLeft]=function(t){var e,n;return Uc.isTextEditableElement(t)&&((e=Dc.getSelectionStart(t))===(n=Dc.getSelectionEnd(t))||Dc.hasInverseSelection(t)?Dc.select(t,n,Math.max(e-1,0)):Dc.select(t,e,Math.max(n-1,0)),Fc(t)),Ac.resolve()},Pc[xc.shiftRight]=function(t){var e,n,i;return Uc.isTextEditableElement(t)&&(e=Dc.getSelectionStart(t),n=Dc.getSelectionEnd(t),i=Uc.getElementValue(t).length,e!==n&&Dc.hasInverseSelection(t)?Dc.select(t,n,Math.min(e+1,i)):Dc.select(t,e,Math.min(n+1,i)),Fc(t)),Ac.resolve()},Pc[xc.shiftUp]=function(t){return Cc.isWebKit&&Uc.isInputElement(t)?Xc(t):(Uc.isTextAreaElement(t)&&Lc(t,!0),Ac.resolve())},Pc[xc.shiftDown]=function(t){return Cc.isWebKit&&Uc.isInputElement(t)?Hc(t):(Uc.isTextAreaElement(t)&&Vc(t,!0),Ac.resolve())},Pc[xc.shiftHome]=Xc,Pc[xc.shiftEnd]=Hc,Pc[xc.home]=Yc,Pc[xc.end]=Wc,Pc[xc.enter]=function(t){var e,n,i,o,r,s;return Uc.isSelectElement(t)&&kc.collapseOptionList(),Uc.isInputElement(t)?(Cc.isIE||Mc.processElementChanging(t),(e=Uc.getParents(t,"form")[0])&&function(t,e){var n=t.querySelectorAll("input, button"),i=null,o=null;for(o=0;o<n.length;o++)if(!i&&"submit"===n[o].type&&!n[o].disabled){i=n[o];break}if(i)Tc.click(i);else if(Uc.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)Uc.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&Tc.submit(t)&&t.submit()}}(e,t)):Uc.isTextAreaElement(t)?(n=Dc.getSelectionStart(t),o=(i=Uc.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,Rc(t,o+String.fromCharCode(10)+r,s)):t.tagName&&Uc.isAnchorElement(t)&&Tc.click(t),Ac.resolve()},Pc[xc.tab]=function(t){return zc(t,!1)},Pc[xc.shiftTab]=function(t){return zc(t,!0)},Pc[xc.esc]=function(t){return Uc.isSelectElement(t)&&kc.collapseOptionList(),Ac.resolve()},Pc);function $c(t){var e,n;e=t.modifiers,n=m.utils.extend({},fl),e&&(e&ol.ctrl&&(n.ctrl=!0),e&ol.alt&&(n.alt=!0),e&ol.shift&&(n.shift=!0),e&ol.meta&&(n.meta=!0)),n.shift&&t.isLetter&&(t.keyProperty=uc(t.keyProperty),t.keyCode=gc(t.keyProperty))}var Qc=y.Promise,Zc=y.eventSandbox.message,Jc=y.nativeMethods,th="automation|press|request",eh="automation|press|response";Zc.on(Zc.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===th&&(y.on(y.EVENTS.beforeUnload,function(){return Zc.sendServiceMsg({cmd:eh},t.source)}),new nh(t.message.keyCombinations,t.message.options).run().then(function(){return Zc.sendServiceMsg({cmd:eh},t.source)}))});var nh=(ih._getKeyPressSimulators=function(t){var e=cc(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return new wc(t,i[e])})},ih._getShortcuts=function(t){for(var e=g.getKeyArray(t.toLowerCase()),n=[],i=[],o=[],r=0;r<e.length;r++)for(i.push(e[r]),o=i.slice();o.length;){var s=o.join("+");jc[s]?(n.push(s),i=o=[]):o.shift()}return n},ih._getShortcutHandlers=function(t){for(var e,n,i,o=ih._getShortcuts(t.toLowerCase()),r={},s="",l=0;l<o.length;l++)e=o[l],n=t.indexOf(e),i=e.length,r[s+=t.substring(0,n+i)]=jc[e],t=t.substring(n+i);return r},ih.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return Qc.resolve(e)},ih.prototype._press=function(t,e){var n=this;if(e&&!this.isSelectElement)return g.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&"enter"!==t.key||(o=!t.press(this.modifiersState)),o&&!this.isSelectElement||!i?g.delay(this.automationSettings.keyActionStepDelay):i(hc(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},ih.prototype._up=function(t){return t.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},ih.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(hc(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=ih._getShortcutHandlers(t);var e=ih._getKeyPressSimulators(t);return g.promiseUtils.each(e,function(e){return n._down(e).then(function(t){return n._press(e,t)})}).then(function(){return g.arrayUtils.reverse(e),g.promiseUtils.each(e,function(t){return n._up(t)})})},ih.prototype._calculateCDPEventSequence=function(){for(var t=[],e=0,n=this.keyCombinations;e<n.length;e++){for(var i=function(t){var e=cc(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return m.utils.extend({key:t},yc(t,i[e]))})}(n[e]),o=0,r=0,s=i;r<s.length;r++)o|=dl((l=s[r]).key),l.modifiers=o,$c(l),t.push(El.keyDown(l),El.delay(this.automationSettings.keyActionStepDelay));for(var l,a=i.length-1;0<=a;a--)o&=~dl((l=i[a]).key),l.modifiers=o,t.push(El.keyUp(l))}return t},ih.prototype.run=function(){var e=this,t=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(t);if(!gs(bf)&&n&&Jc.contentWindowGetter.call(t)){var i={cmd:th,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,eh,Jc.contentWindowGetter.call(t))}if(this.nativeAutomationInput){var o=this._calculateCDPEventSequence();return this.nativeAutomationInput.executeEventSequence(o)}return g.promiseUtils.each(this.keyCombinations,function(t){return e._runCombination(t).then(function(){return g.delay(e.automationSettings.keyActionStepDelay)})})},ih);function ih(t,e,n){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(bf).document,this.automationSettings=new wo(e.speed),this.options=e,this.nativeAutomationInput=n?new Sl(n):null}var oh,rh=y.Promise,sh=y.utils.extend,lh=y.utils.browser,ah=y.eventSandbox.eventSimulator,uh=E.domUtils,ch=E.eventUtils,hh=E.delay,fh=(w(dh,oh=Al),dh.prototype._mousedown=function(t){var e=this;return ll.rightButtonDown().then(function(){return e.eventState.activeElementBeforeMouseDown=uh.getActiveElement(),e.eventState.simulateDefaultBehavior=ah.mousedown(t.element,t.options),e._focus(t)})},dh.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?Co():Gl(uh.isContentEditableElement(this.element)?this.element:t.element,!lh.isIE||this.eventState.activeElementBeforeMouseDown===uh.getActiveElement(),this.caretPos).then(Co)},dh.prototype._mouseup=function(e){var t=this;return ll.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return ah.mouseup(t,e.options)})},dh.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){ah.contextmenu(t,e.options),uh.isElementFocusable(t)||jl(t)})},dh.prototype.run=function(t){var o=this,r=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.devicePoint;return r={point:n,element:e,options:sh({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:ch.BUTTON.right},o.modifiers)},rh.all([hh(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},dh);function dh(t,e){var n=oh.call(this,t,e,bf,ll)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var mh=y.utils.browser,ph=E.domUtils,vh=E.positionUtils,gh=E.styleUtils,yh=E.contentEditable,Eh=E.arrayUtils,bh=["direction","font-family","font-size","font-size-adjust","font-variant","font-weight","font-style","letter-spacing","line-height","text-align","text-indent","text-transform","word-wrap","word-spacing","padding-top","padding-left","padding-right","padding-bottom","margin-top","margin-left","margin-right","margin-bottom","border-top-width","border-left-width","border-right-width","border-bottom-width"];function Sh(t,e){var n,i,o,r,s,l=gh.getBordersWidth(t),a=vh.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return ph.isTextAreaElement(t)||(i=(n=vh.offsetToClientCoords({x:a.left,y:a.top})).x+l.left+1,o=n.y+l.top+1,r=n.y+l.top+l.bottom+u,s=n.y+l.top+u-1,c=Math.ceil(c<=n.x?i:e.left),h=Math.ceil(h<=n.y?o:e.top),f=Math.floor(r<=f?s:e.bottom)),{left:c,top:h,bottom:f}}function wh(t){var e=gh.getElementScroll(Sf);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function _h(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=Sf.body,r=vh.getOffsetPosition(e),s=gh.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=Sf.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===gh.get(o,"position")&&(t=gh.getElementMargin(o),n=gh.get(o,"left"),i=gh.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),Eh.forEach(bh,function(t){c+="".concat(t,":").concat(gh.get(e,t),";")}),gh.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:e.scrollWidth+"px",height:e.scrollHeight+"px"}),y.nativeMethods.nodeTextContentSetter.call(u,ph.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=ph.getElementValue(t).length;try{var u=Sf.createRange();u.setStart(y.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e,a)),u.setEnd(y.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e+1,a+1)),ph.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return ph.remove(i),o?{width:o.width,height:o.height,top:o.top-s,bottom:o.bottom-s,left:o.left-l,right:o.right-l}:null}function Ph(t,e){var n,i,o,r,s,l,a=null;return(a=ph.isContentEditableElement(t)?(o=t,r=e,s=ph.findDocument(o).createRange(),l=yh.calculateNodeAndOffsetByPosition(o,r),s.setStart(l.node,Math.min(l.offset,l.node.length)),s.setEnd(l.node,Math.min(l.offset,l.node.length)),s.getClientRects()[0]):"function"==typeof t.createTextRange?(n=e,(i=t.createTextRange()).collapse(!0),i.moveStart("character",n),i.moveEnd("character",n),i.collapse(!0),i.getBoundingClientRect()):_h(t,e))?{x:(a=wh(a=Sh(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function xh(t,e){var n=ph.isTextEditableElement(t),i=ph.isContentEditableElement(t);return n&&0<ph.getElementValue(t).length||i&&yh.getContentEditableValue(t).length?Ph(t,e):vh.findCenter(t)}function Ah(t,e,n){var i=ph.findDocument(t).createRange();i.setStart(e,Math.min(n,e.length)),i.setEnd(e,Math.min(n,e.length));var o=i.getClientRects()[0];return o?{x:(o=wh(Sh(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var Ch,Th=y.Promise,Mh=y.utils.browser,Dh=y.utils.featureDetection,Ih=y.eventSandbox.eventSimulator,Uh=y.eventSandbox.focusBlur,kh=E.contentEditable,Oh=E.domUtils,Nh=E.positionUtils,Bh=E.eventUtils,Fh=E.delay,Lh=(w(Vh,Ch=Al),Vh.prototype._calculateEventArguments=function(){var e=this,n=Nh.offsetToClientCoords(this.clientPoint);return Vt(n).then(function(t){if(!t)throw new si(null,{reason:Nh.getElOutsideBoundsReason(e.element)});return{element:t,options:{clientX:n.x,clientY:n.y}}})},Vh.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Or({offsetX:i,offsetY:o,speed:r},!1);return Zs.create(n,s,bf,ll).then(function(t){return t.run()}).then(function(){return Fh(e.automationSettings.mouseActionStepDelay)})},Vh.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Bh.preventDefault(t),Bh.unbind(e.element,"mousedown",n)};Bh.bind(this.element,"mousedown",n)},Vh.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},Vh.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},Vh.prototype._moveToPoint=function(t){!function(t,e){if(ph.isEditableElement(t)){var n=ph.isTextAreaElement(t);if(!ph.isInputElement(t)||!(mh.isFirefox||mh.isIE&&10<mh.version)){var i=vh.getOffsetPosition(t),o=gh.getBordersWidth(t),r=gh.getElementScroll(t),s=e.x-i.left-o.left,l=e.y-i.top-o.top,a=null;if(n)return l<r.top&&(a=l),l>t.clientHeight+r.top&&(a=l-t.clientHeight),null!==a&&gh.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&gh.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=ph.isTextEditableElement(t),i=ph.isInputElement(t);if(!n&&!ph.isContentEditableElement(t))return e;var o=vh.getOffsetPosition(t),r=gh.getBordersWidth(t),s=gh.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(mh.isFirefox||mh.isIE&&10<mh.version)?{x:Math.min(e.x,l),y:e.y}:{x:e.x-s.left,y:e.y-s.top}}(this.element,t);var e={element:Sf.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},Vh.prototype._mousedown=function(){var n=this;return ll.leftButtonDown().then(function(){return n._calculateEventArguments()}).then(function(t){n.eventArgs=t;var e=(Mh.isWebKit||Mh.isIE)&&Oh.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=Ih[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},Vh.prototype._focus=function(){var n=this;return new Th(function(t){var e=Oh.isContentEditableElement(n.element)?kh.findContentEditableParent(n.element):n.element;Uh.focus(e,t,!1,!0)})},Vh.prototype._setSelection=function(){throw new Error("Not implemented")},Vh.prototype._mouseup=function(){var e=this;return ll.buttonUp().then(function(){return e._setSelection(),e._calculateEventArguments()}).then(function(t){e.eventArgs=t,Ih[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},Vh.prototype.run=function(){var t=this;return this.absoluteStartPoint=this._calculateAbsoluteStartPoint(),this.absoluteEndPoint=this._calculateAbsoluteEndPoint(),this._moveToPoint(this.absoluteStartPoint).then(function(){return t._mousedown()}).then(function(){return t._moveToPoint(t.absoluteEndPoint)}).then(function(){return t._mouseup()})},Vh);function Vh(t,e){var n=Ch.call(this,t,e,bf,ll)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=Dh.isTouchDevice?"touchstart":"mousedown",n.upEvent=Dh.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var Kh,Rh=E.textSelection,Yh=E.domUtils,Wh=E.positionUtils,Xh=(w(Hh,Kh=Lh),Hh.prototype._calculateAbsoluteStartPoint=function(){return xh(this.element,this.startPos)||Wh.findCenter(this.element)},Hh.prototype._calculateAbsoluteEndPoint=function(){var t=xh(this.element,this.endPos);return t||(Yh.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=Ph(t,o+=i)););return r=r||Ph(t,e)||vh.findCenter(t)}(this.element,this.startPos,this.endPos):Wh.findCenter(this.element))},Hh.prototype._setSelection=function(){var t=Yh.isTextEditableElement(this.element),e=Yh.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&Rh.select(this.element,this.startPos,this.endPos)},Hh.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return Kh.prototype.run.call(e)})},Hh);function Hh(t,e,n,i){var o=Kh.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var qh,Gh=E.textSelection,zh=E.contentEditable,jh=E.positionUtils,$h=(w(Qh,qh=Lh),Qh.prototype._calculateAbsoluteStartPoint=function(){return Ah(this.element,this.startNode,this.startOffset)||jh.findCenter(this.element)},Qh.prototype._calculateAbsoluteEndPoint=function(){return Ah(this.element,this.endNode,this.endOffset)||jh.findCenter(this.element)},Qh.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Gh.selectByNodesAndOffsets(t,e,!0))},Qh);function Qh(t,e,n){var i=qh.call(this,zh.getNearestCommonAncestor(t,e),n)||this,o=zh.getFirstVisiblePosition(t),r=zh.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=zh.calculatePositionByNodeAndOffset(i.element,s);return zh.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=zh.getLastVisiblePosition(t),r=zh.getFirstVisiblePosition(e)),s=zh.calculateNodeAndOffsetByPosition(t,o),l=zh.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var Zh=y.Promise,Jh=y.utils.extend,tf=y.utils.browser,ef=y.eventSandbox.eventSimulator,nf=y.eventSandbox.elementEditingWatcher,of=E.domUtils,rf=E.promiseUtils,sf=E.contentEditable,lf=E.textSelection,af=E.delay,uf=E.KEY_MAPS.specialKeys,cf=(hf.findTextEditableChild=function(t){var e=null;if(!of.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(of.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},hf.prototype._calculateEventArguments=function(t){var e=of.getActiveElement(),n=of.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=hf.findTextEditableChild(e)||e);var o=Jh({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),Jh(o,mc(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},hf.prototype._calculateTargetElement=function(){var t=of.getActiveElement(),e=of.isContentEditableElement(this.element);if(e){if(t!==sf.findContentEditableParent(this.element))return void(this.eventState.skipType=!0)}else if(t!==this.element)return void(this.eventState.skipType=!0);this.element=e?this.element:t},hf.prototype._click=function(t){var e,n=this,i=of.getActiveElement(),o=of.isTextEditableElementAndEditingAllowed(this.element),r=of.isContentEditableElement(this.element);if(i===this.element)return o&&nf.watchElementEditing(this.element),(o||r)&&(e=lf.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||lf.select(this.element,this.caretPos,this.caretPos)),Zh.resolve();var s=kt(this.element),l=s.offsetX,a=s.offsetY,u=new Ir({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new Ma(this.element,u,bf,ll).run(t).then(function(){return af(n.automationSettings.mouseActionStepDelay)})},hf.prototype._type=function(){var t=this;if(this.eventState.skipType)return Zh.resolve();var e=of.isContentEditableElement(this.element);if(this.replace&&(of.isTextEditableElementAndEditingAllowed(this.element)?lf.select(this.element):e&&lf.deleteSelectionContents(this.element,!0)),this._canUseNativeAutomationInput()){if(this.paste)return this.nativeAutomationInput.executeInsertText(this.typingText);var n=this._calculateCDPEventSequence();return this.nativeAutomationInput.executeEventSequence(n)}return rf.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},hf.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},hf.prototype._getCurrentKey=function(t,e){return t===uf.enter?"Enter":e},hf.prototype._calculateCDPEventSequence=function(){for(var t=[],e=0,n=this.typingText;e<n.length;e++){var i=n[e],o=gc(i),r=this._getCurrentKey(o,i),s=yc(r),l=Jh({key:r},s);t.push(El.keyDown(l),El.keyUp(l),El.delay(this.automationSettings.keyActionStepDelay))}return t},hf.prototype._canUseNativeAutomationInput=function(){return!!this.nativeAutomationInput&&!(!of.isTextEditableElement(this.element)&&of.isInputElement(this.element)||of.isContentEditableElement(this.element))},hf.prototype._performTypingStep=function(){return this._keydown(),this._keypress(),this._keyup()},hf.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=gc(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this._getCurrentKey(this.currentKeyCode,t),this.currentKeyIdentifier=vc(this.currentKey),this.ignoreChangeEvent=of.getElementValue(this.element)===nf.getElementSavedValue(this.element),this._performTypingStep()},hf.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=ef.keydown(this.eventArgs.element,this.eventArgs.options)},hf.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=tf.isAndroid||ef.keypress(this.eventArgs.element,this.eventArgs.options))},hf.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=of.isTextEditableElement(this.element),i=of.isContentEditableElement(this.element),o=this.paste||!n&&!i;return Zh.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){ef.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},hf.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&nf.restartWatchingElementEditing(t),af(this.automationSettings.keyActionStepDelay);var e=this.typingText.charAt(this.currentPos),n=/^\d$/.test(e),i=0===this.currentPos?null:this.typingText.charAt(this.currentPos-1);if(of.isInputElement(t)&&"number"===t.type){var o=lf.getSelectionStart(t),r=of.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return af(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return tc(t,e,null),af(this.automationSettings.keyActionStepDelay)},hf.prototype._typeAllText=function(t){return tc(t,this.typingText,this.caretPos),af(this.automationSettings.keyActionStepDelay)},hf.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},hf);function hf(t,e,n,i){this.element=hf.findTextEditableChild(t)||t,this.typingText=e.toString(),this.modifiers=n.modifiers,this.caretPos=n.caretPos,this.replace=n.replace,this.paste=n.paste,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=n.speed,this.automationSettings=new wo(this.speed),this.elementChanged=t!==this.element,this.currentPos=0,this.currentKeyCode=null,this.currentCharCode=null,this.currentKey=null,this.currentKeyIdentifier=null,this.ignoreChangeEvent=!0,this.eventArgs={options:null,element:null},this.eventState={skipType:!1,simulateKeypress:!0,simulateTypeChar:!0},this.nativeAutomationInput=i?new Sl(i):null}var ff=(df.prototype.run=function(){var i=this;return m.doUpload(this.element,this.paths).then(function(t){if(t.length){var e=g.arrayUtils.map(t,function(t){return t.path}),n=g.arrayUtils.reduce(t,function(t,e){return t.concat(e.resolvedPaths)},[]);throw i.createError(e,n)}})},df);function df(t,e,n){this.element=t,this.paths=e,this.createError=n}var mf=E.domUtils,pf=E.contentEditable,vf={};vf.DispatchEvent=t,vf.SetScroll=Dl,vf.ScrollIntoView=kl,vf.Click=Ma,vf.SelectChildClick=Za,vf.DblClick=lu,vf.DragToOffset=Iu,vf.DragToElement=Nu,vf.Hover=Lu,vf.Press=nh,vf.RClick=fh,vf.SelectText=Xh,vf.SelectEditableContent=$h,vf.Type=cf,vf.Upload=ff,vf.MouseOptions=Tr,vf.ClickOptions=Ir,vf.TypeOptions=Yr,vf.AutomationSettings=wo,vf.getOffsetOptions=Ot,vf.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=mf.isTextEditableElement(t),m=d?0:pf.getFirstVisiblePosition(t),p=d?mf.getElementValue(t).length:pf.getLastVisiblePosition(t),v=e.startPos?Math.min(e.startPos,p):m,g=void 0===e.endPos||null===e.endPos?p:Math.min(e.endPos,p);return void 0!==e.offset?(g=0<=e.offset?Math.min(e.offset,g):(v=g,Math.max(0,g+e.offset)),{startPos:v,endPos:g}):void 0!==e.startLine?(n=t,i=e,o=mf.getTextAreaValue(n),r=o&&o.length?o.split("\n"):[],s=r.length-1,l=i.startLine?Math.min(i.startLine,s):0,a=r[l]?r[l].length:0,u=i.startPos?Math.min(i.startPos,a):0,c=void 0===i.endLine||null===i.endLine?s:Math.min(i.endLine,s),h=r[c]?r[c].length:0,f=void 0===i.endPos||null===i.endPos?h:Math.min(i.endPos,h),{startPos:mf.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:mf.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},vf.cursor=ll,vf.getNextFocusableElement=dc,vf.SHORTCUT_TYPE=xc,vf.getSelectionCoordinatesByPosition=xh,vf.getElementFromPoint=Vt,vf.MoveAutomation=Zs;var gf=y.nativeMethods,yf=y.EVENTS.evalIframeScript;gf.objectDefineProperty(bf,"%testCafeAutomation%",{configurable:!0,value:vf}),y.on(yf,function(t){return Ef(gf.contentWindowGetter.call(t.iframe))})}(bf["%hammerhead%"],bf["%hammerhead%"].Promise,bf["%testCafeCore%"],bf["%testCafeUI%"])}(window);