testcafe 2.6.2 → 3.0.1

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 (73) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/lib/api/structure/interfaces.js +1 -1
  3. package/lib/api/test-controller/index.js +9 -19
  4. package/lib/browser/connection/gateway/index.js +1 -4
  5. package/lib/cli/argument-parser/index.js +2 -7
  6. package/lib/cli/remotes-wizard.js +3 -1
  7. package/lib/client/automation/index.js +19 -3
  8. package/lib/client/automation/index.min.js +1 -1
  9. package/lib/client/automation/playback/press/shortcut-type.js +24 -0
  10. package/lib/client/browser/idle-page/index.js +5 -1
  11. package/lib/client/core/index.js +36 -35
  12. package/lib/client/core/index.min.js +1 -1
  13. package/lib/client/driver/index.js +10 -35
  14. package/lib/client/driver/index.min.js +1 -1
  15. package/lib/client/driver/status.js +1 -2
  16. package/lib/client/ui/index.js +9 -2
  17. package/lib/client/ui/index.min.js +1 -1
  18. package/lib/client/ui/styles.css +4 -1
  19. package/lib/client-functions/client-function-builder.js +7 -28
  20. package/lib/client-functions/selectors/add-api.js +3 -61
  21. package/lib/client-functions/selectors/selector-builder.js +1 -5
  22. package/lib/configuration/configuration-base.js +10 -8
  23. package/lib/configuration/default-values.js +3 -3
  24. package/lib/configuration/option-names.js +2 -3
  25. package/lib/configuration/run-option-names.js +2 -2
  26. package/lib/configuration/testcafe-configuration.js +4 -12
  27. package/lib/configuration/types.js +1 -1
  28. package/lib/custom-client-scripts/client-script.js +4 -1
  29. package/lib/custom-client-scripts/routing.js +3 -4
  30. package/lib/errors/runtime/index.js +64 -5
  31. package/lib/errors/runtime/templates.js +21 -14
  32. package/lib/errors/test-run/templates.js +2 -2
  33. package/lib/errors/types.js +3 -2
  34. package/lib/index.js +3 -4
  35. package/lib/native-automation/client/event-descriptor.js +2 -1
  36. package/lib/native-automation/client/key-press/utils.js +13 -2
  37. package/lib/native-automation/index.js +3 -2
  38. package/lib/native-automation/request-hooks/event-factory/request-paused-event-based.js +8 -4
  39. package/lib/native-automation/request-hooks/event-provider.js +14 -4
  40. package/lib/native-automation/request-pipeline/index.js +58 -36
  41. package/lib/native-automation/request-pipeline/safe-api.js +3 -3
  42. package/lib/native-automation/types.js +1 -1
  43. package/lib/native-automation/utils/headers.js +2 -10
  44. package/lib/notifications/warning-message.js +3 -4
  45. package/lib/reporter/index.js +16 -19
  46. package/lib/reporter/module-prefix.js +6 -0
  47. package/lib/reporter/plugin-host.js +2 -11
  48. package/lib/runner/bootstrapper.js +15 -15
  49. package/lib/runner/fixture-hook-controller.js +4 -3
  50. package/lib/runner/index.js +4 -19
  51. package/lib/runner/task/index.js +2 -4
  52. package/lib/runner/test-run-controller.js +24 -9
  53. package/lib/screenshots/capturer.js +8 -19
  54. package/lib/screenshots/index.js +4 -23
  55. package/lib/test-run/commands/observation.js +2 -10
  56. package/lib/test-run/commands/service.js +2 -9
  57. package/lib/test-run/commands/type.js +1 -2
  58. package/lib/test-run/index.js +2 -17
  59. package/lib/testcafe.js +3 -2
  60. package/lib/utils/debug-loggers.js +7 -2
  61. package/lib/utils/get-options/index.js +2 -4
  62. package/lib/utils/get-test-and-fixture-info.js +20 -0
  63. package/lib/utils/lowercase-object-keys.js +12 -0
  64. package/lib/utils/reporter.js +8 -4
  65. package/lib/video-recorder/recorder.js +2 -2
  66. package/package.json +6 -7
  67. package/ts-defs/index.d.ts +36 -12
  68. package/ts-defs/selectors.d.ts +34 -8
  69. package/ts-defs/testcafe-scripts.d.ts +34 -8
  70. package/lib/client/driver/command-executors/client-functions/selector-executor/check-element-delay.js +0 -5
  71. package/lib/client-functions/selector-api-execution-mode.js +0 -22
  72. package/lib/custom-client-scripts/get-url.js +0 -8
  73. package/lib/utils/is-repl.js +0 -12
@@ -1 +1 @@
1
- window["%hammerhead%"].utils.removeInjectedScript(),function _f(Pf){var xf=Pf.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:Pf,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 Pf[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)}var _=function(){return(_=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function P(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 x(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 A=(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 T(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)}}T("filter"),T("map"),T("slice"),T("splice"),T("unshift"),T("forEach"),T("indexOf");var M=T("some"),D=(T("reverse"),T("reduce"),T("concat"),T("join"),T("every"),y.utils.browser,y.nativeMethods),I=(y.utils.style.get,y.utils.dom.getActiveElement,y.utils.dom.findDocument),U=y.utils.dom.find,k=(y.utils.dom.isElementInDocument,y.utils.dom.isElementInIframe),O=y.utils.dom.getIframeByElement,N=(y.utils.dom.isCrossDomainWindows,y.utils.dom.getSelectParent,y.utils.dom.getChildVisibleIndex,y.utils.dom.getSelectVisibleChildren,y.utils.dom.isElementNode),B=(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),F=(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),L=y.utils.dom.isBodyElement,K=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),R=y.utils.dom.getMapContainer,Y=y.utils.dom.getTagName,W=y.utils.dom.closest,X=y.utils.dom.getParents,H=y.utils.dom.findParent;function q(t,e){return t.contains?t.contains(e):M(t,function(t){return t.contains(e)})}function G(t){var e=[];U(xf,"*",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(D.contentWindowGetter.call(e[n])===t)return e[n];return null}function z(t){return D.nodeTextContentGetter.call(t)}y.utils.dom.getTopSameDomainWindow,y.utils.dom.getParentExceptShadowRoot;var j=($.create=function(t){return new $(t.top,t.right,t.bottom,t.left)},$.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},$.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},$.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},$.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},$);function $(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 Q=y.utils.style,Z=y.utils.style.getBordersWidth,J=(y.utils.style.getComputedStyle,y.utils.style.getElementMargin,y.utils.style.getElementPadding),tt=y.utils.style.getElementScroll,et=(y.utils.style.getOptionHeight,y.utils.style.getSelectElementSize,y.utils.style.isElementVisible,y.utils.style.isVisibleChild,y.utils.style.getWidth),nt=y.utils.style.getHeight,it=y.utils.style.getInnerWidth,ot=y.utils.style.getInnerHeight,rt=y.utils.style.getScrollLeft,st=y.utils.style.getScrollTop,lt=y.utils.style.setScrollLeft,at=y.utils.style.setScrollTop,ut=y.utils.style.get,ct=y.utils.style.getBordersWidthFloat,ht=y.utils.style.getElementPaddingFloat;function ft(t){return N(t)&&"fixed"===Q.get(t,"position")}y.shadowUI,y.nativeMethods;var dt=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},mt={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 ")}},pt=y.utils.html,vt=y.nativeMethods,gt=10;function yt(t){if(!t)return"";var e,n,i,o=vt.cloneNode.call(t),r=pt.cleanUpHtml(vt.elementOuterHTMLGetter.call(o)),s=(e=vt.nodeTextContentGetter.call(t),n=gt,void 0===i&&(i="..."),e.length<n?e:e.substring(0,n-i.length)+i),l=vt.elementChildrenGetter.call(t);return 0<vt.htmlCollectionLengthGetter.call(l)?r.replace("></",">...</"):s?r.replace("></",">".concat(s,"</")):r}var Et=y.utils.position.getElementRectangle,bt=y.utils.position.getOffsetPosition,St=y.utils.position.offsetToClientCoords;function wt(t){var e,n,i,o,r=K(t),s=r?t.getElementsByTagName("body")[0]:null,l=t.getBoundingClientRect(),a=j.create(Z(t)),u=tt(t),c=k(t),h="BackCompat"===t.ownerDocument.compatMode,f=r?new A(0,0):A.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=bt(e),i=St(A.create(n)),o=Z(e),f.add(i).add(A.create(o)),r&&a.add(o));var p=!r&&it(t)!==t.clientWidth,v=!r&&ot(t)!==t.clientHeight,g={right:p?V():0,bottom:v?V():0};return new dt(m,d,f,a,u,g)}function _t(t){var e=t.x,n=t.y,i=xf.getElementFromPoint||xf.elementFromPoint,o=null;try{o=i.call(xf,e,n)}catch(t){return null}for(null===o&&(o=i.call(xf,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 Pt(t,e,n){var i=wt(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 xt(t){var e=bt(t),n=e.left,i=e.top,o=St({x:n,y:i});return o.x=Math.round(o.x),o.y=Math.round(o.y),o}function At(n,e){return m.Promise.resolve(n===xf.documentElement).then(function(t){if(t)return new A(0,0);var e=m.utils.browser.isFirefox?Math.ceil:Math.round;return m.Promise.resolve(bt(n,e)).then(function(t){return A.create(t)})}).then(function(t){return t.add(e)})}var Ct=/auto|scroll|hidden/i,Tt="visible";function Mt(t){var e,n=ut(t,"overflowX"),i=ut(t,"overflowY"),o=Ct.test(n),r=Ct.test(i),s=I(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 Dt(t){if(L(t))return Mt(t);if(K(t))return function(t){var e=ut(t,"overflowX"),n=ut(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(Mt(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=ut(e=t,"overflowX"),i=ut(e,"overflowY"),o=Ct.test(n),r=Ct.test(i),m.utils.browser.isIE&&(o=o||r&&n===Tt,r=r||o&&i===Tt),new A(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 It(i,o){return P(this,void 0,void 0,function(){var e,n;return x(this,function(t){switch(t.label){case 0:return[4,tt(i)];case 1:return e=t.sent(),n=Dt(i),!/html/i.test(i.tagName)&&n&&(o.x-=e.left,o.y-=e.top),[2,St(o)]}})})}function Ut(t){if(!t)return null;var e,n,i=(e=Pf.screenLeft||Pf.screenX,n=Pf.screenTop||Pf.screenY,new A(e,n)),o=i.x,r=i.y,s=o+t.x,l=r+t.y;return new A(s,l)}function kt(t){var e=t/2;return e<1?0:Math.round(e)}function Ot(t){var e=Et(t);return{offsetX:kt(e.width),offsetY:kt(e.height)}}function Nt(t,e,n){var i=Ot(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=wt(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 Bt=E.positionUtils;function Ft(e,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var t=Bt.getElementFromPoint(e);return i.show(n).then(function(){return t})})}function Lt(t,n){return m.Promise.resolve(_t(t)).then(function(e){return m.Promise.resolve(q(n,e)).then(function(t){return t&&z(e)}).then(function(t){return t||e&&e===n?e:null})})}function Kt(n,i){if(!i||!n||n===i)return n;if("tref"===Y(i))return i;var e,o,t="area"===Y(i)&&B(n);return m.utils.browser.isFirefox&&t?(e=n,o=i,m.Promise.resolve(W(o,"map")).then(function(t){return t&&t.name===e.useMap.substring(1)?o:e})):m.Promise.resolve(W(i,"a")).then(function(t){return!!t}).then(function(t){return!!t&&m.Promise.resolve(q(i,n)).then(function(t){return t&&z(n)}).then(function(t){return!t&&z(i)})}).then(function(t){return t?m.Promise.resolve(wt(i)).then(function(e){return Lt({x:e.right-1,y:e.top+1},i).then(function(t){return t||Lt({x:e.left+1,y:e.bottom-1},i)}).then(function(t){return t||n})}):n})}function Vt(n,i,o){return Ft(n).then(function(t){var e=m.Promise.resolve(t);return!t&&m.utils.dom.isIframeWindow(i||Pf)&&0<n.x&&0<n.y&&(e=e.then(function(){return Ft(n,!0)})),e.then(function(t){return Kt(t,o)})})}function Rt(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var Yt,Wt,Xt,Ht="E1",qt="E4",Gt="E5",zt="E9",jt="E10",$t="E11",Qt="E12",Zt="E24",Jt="E26",te="E27",ee="E28",ne="E29",ie="E30",oe="E31",re="E32",se="E33",le="E34",ae="E35",ue="E36",ce="E37",he="E39",fe="E40",de="E41",me="E42",pe="E43",ve="E44",ge="E45",ye="E46",Ee="E49",be="E50",Se="E51",we="E52",_e="E57",Pe="E64",xe="E65",Ae="E68",Ce="E69",Te="E70",Me="E71",De="E72",Ie="E73",Ue="E74",ke="E76",Oe="E77",Ne="E78",Be="E82",Fe="E83",Le="E90",Ke="E91",Ve="E92",Re="E93",Ye="E94",We="E95",Xe="E97",He="E99",qe="E100",Ge="E101",ze="E102",je=(w($e,Yt=Rt),$e);function $e(t,e,n){var i=Yt.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function Qe(t,e){var n=Wt.call(this,Ee,e)||this;return n.instantiationCallsiteName=t,n}function Ze(t,e){var n=Xt.call(this,be,e)||this;return n.instantiationCallsiteName=t,n}w(Qe,Wt=Rt),w(Ze,Xt=Rt);var Je,tn,en,nn,on,rn,sn,ln,an=(w(un,Je=Rt),un);function un(t,e,n){var i=void 0===e?{}:e,o=i.apiFnChain,r=i.apiFnIndex,s=i.reason,l=Je.call(this,t,n)||this;return l.apiFnChain=o,l.apiFnIndex=r,l.reason=s,l}function cn(t){return tn.call(this,Se,t)||this}function hn(t,e){return en.call(this,we,e,t)||this}function fn(t,e){var n=nn.call(this,Ht)||this;return n.errStack=t,n.pageDestUrl=e,n}function dn(t,e,n){var i=on.call(this,qt,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}function mn(t,e,n,i){var o=rn.call(this,Gt,i)||this;return o.errMsg=String(e),o.property=n,o.instantiationCallsiteName=t,o}function pn(t){var e=sn.call(this,Pe)||this;return e.errMsg=String(t),e}function vn(t,e){var n=ln.call(this,xe)||this;return n.errMsg=String(t),n.moduleName=e,n}w(cn,tn=Rt),w(hn,en=an),w(fn,nn=Rt),w(dn,on=Rt),w(mn,rn=Rt),w(pn,sn=Rt),w(vn,ln=Rt);var gn,yn=(w(En,gn=je),En);function En(t,e){return gn.call(this,zt,t,e)||this}var bn,Sn=(w(wn,bn=je),wn);function wn(t,e){return bn.call(this,jt,t,e)||this}var _n,Pn=(w(xn,_n=je),xn);function xn(t,e){return _n.call(this,$t,t,e)||this}var An,Cn=(w(Tn,An=je),Tn);function Tn(t,e){return An.call(this,Qt,t,e)||this}var Mn,Dn=(w(In,Mn=je),In);function In(t,e){return Mn.call(this,Le,t,e)||this}var Un,kn=(w(On,Un=je),On);function On(t,e){return Un.call(this,Xe,t,e)||this}var Nn,Bn=(w(Fn,Nn=je),Fn);function Fn(t,e){return Nn.call(this,Ke,t,e)||this}var Ln,Kn=(w(Vn,Ln=je),Vn);function Vn(t,e){return Ln.call(this,Ve,t,e)||this}var Rn,Yn=(w(Wn,Rn=je),Wn);function Wn(t,e){return Rn.call(this,Re,t,e)||this}var Xn,Hn=(w(qn,Xn=je),qn);function qn(t,e){return Xn.call(this,Ye,t,e)||this}var Gn,zn=(w(jn,Gn=je),jn);function jn(t,e){return Gn.call(this,We,t,e)||this}var $n,Qn=(w(Zn,$n=je),Zn);function Zn(t,e){return $n.call(this,He,t,e)||this}var Jn,ti,ei=(w(ni,Jn=Rt),ni);function ni(t,e,n){var i=Jn.call(this,qe)||this;return i.objectName=t,i.propertyName=e,i.availableProperties=n,i}function ii(t,e){return ti.call(this,Zt,e,t)||this}w(ii,ti=an);var oi,ri,si,li=(w(ai,oi=an),ai);function ai(t,e){return oi.call(this,Jt,e,t)||this}function ui(t){var e=ri.call(this,te)||this;return e.nodeDescription=t,e}function ci(t,e){var n=si.call(this,ee,e)||this;return n.argumentName=t,n}w(ui,ri=Rt),w(ci,si=an);var 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,Ki,Vi,Ri,Yi,Wi=(w(Xi,hi=Rt),Xi);function Xi(t){return hi.call(this,Ge,t)||this}function Hi(t,e){var n=fi.call(this,ne,e)||this;return n.argumentName=t,n}function qi(t,e){var n=di.call(this,ie)||this;return n.argumentName=t,n.nodeDescription=e,n}function Gi(){return mi.call(this,oe)||this}function zi(){return pi.call(this,re)||this}function ji(t){var e=vi.call(this,se)||this;return e.argumentName=t,e}function $i(){return gi.call(this,ae)||this}function Qi(t){var e=yi.call(this,ue)||this;return e.argumentName=t,e}function Zi(t,e){var n=Ei.call(this,ce)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function Ji(){return bi.call(this,le)||this}function to(t,e){var n=Si.call(this,de)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function eo(t,e){var n=wi.call(this,_e)||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 no(t){return _i.call(this,fe,t)||this}function io(){return Pi.call(this,he)||this}function oo(){return xi.call(this,me)||this}function ro(){return Ai.call(this,Ce)||this}function so(){return Ci.call(this,Ae)||this}function lo(){return Ti.call(this,Te)||this}function ao(){return Mi.call(this,Me)||this}function uo(){return Di.call(this,Ie)||this}function co(){return Ii.call(this,Be)||this}function ho(t){var e=Ui.call(this,Ne)||this;return e.errMsg=t,e}function fo(){return ki.call(this,Ue)||this}function mo(){return Oi.call(this,ke)||this}function po(){return Ni.call(this,Oe)||this}function vo(){return Bi.call(this,De)||this}function go(){return Fi.call(this,Fe)||this}function yo(){return Li.call(this,pe)||this}function Eo(){return Ki.call(this,ve)||this}function bo(t,e){var n=Vi.call(this,ge)||this;return n.dialogType=t,n.pageUrl=e,n}function So(t,e,n){var i=Ri.call(this,ye)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}function wo(){return Yi.call(this,ze)||this}w(Hi,fi=an),w(qi,di=Rt),w(Gi,mi=Rt),w(zi,pi=Rt),w(ji,vi=Rt),w($i,gi=Rt),w(Qi,yi=Rt),w(Zi,Ei=Rt),w(Ji,bi=Rt),w(to,Si=Rt),w(eo,wi=Rt),w(no,_i=Rt),w(io,Pi=Rt),w(oo,xi=Rt),w(ro,Ai=Rt),w(so,Ci=Rt),w(lo,Ti=Rt),w(ao,Mi=Rt),w(uo,Di=Rt),w(co,Ii=Rt),w(ho,Ui=Rt),w(fo,ki=Rt),w(mo,Oi=Rt),w(po,Ni=Rt),w(vo,Bi=Rt),w(go,Fi=Rt),w(yo,Li=Rt),w(Eo,Ki=Rt),w(bo,Vi=Rt),w(So,Ri=Rt),w(wo,Yi=Rt);var _o=(Object.defineProperty(Po.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Po.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Po.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(Po.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),Po);function Po(t){this._speedFactor=t||1}var xo=y.Promise,Ao=y.nativeMethods;function Co(e){return new xo(function(t){return Ao.setTimeout.call(Pf,t,e)})}function To(){return Co(0)}var Mo=Object.prototype.toString,Do=String.prototype.indexOf,Io=String.prototype.endsWith||function(t,e){var n=Mo.call(this);(void 0===e||e>n.length)&&(e=n.length),e-=t.length;var i=Do.call(n,t,e);return-1!==i&&i===e},Uo=Array.prototype.indexOf,ko=Array.prototype.map,Oo=Array.prototype.sort,No=Array.prototype.filter,Bo=Array.prototype.concat,Fo="Command",Lo=(Ko.prototype.getAssignableProperties=function(){return[]},Ko.prototype.getAllAssignableProperties=function(){for(var t=Object.getPrototypeOf(this),e=[];t&&t.getAssignableProperties;)e=Bo.call(e,t.getAssignableProperties()),t=Object.getPrototypeOf(t);return e},Ko.prototype.getNonReportedProperties=function(){return[]},Ko.prototype.getReportedProperties=function(){var t=ko.call(this.getAllAssignableProperties(),function(t){return t.name}),e=this.getNonReportedProperties();return No.call(t,function(t){return!(-1<Uo.call(e,t))})},Ko.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t){e&&function(t,e){var n,i=e.constructor.name,o=ko.call(e.getAllAssignableProperties(),function(t){return t.name}),r=Oo.call(e.getReportedProperties());for(n in t)if(!(-1<Uo.call(o,n)||n in e))throw new ei(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,Io.call(i,Fo)?o:"".concat(i,".").concat(o)),d),this[a]=h?h(a,d,n,e):d)}}},Ko);function Ko(){}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 Ro,Yo,Wo,Xo,Ho,qo,Go,zo,jo,$o,Qo,Zo,Jo,tr=Vo(yn),er=(Yo=Vo(Ro=Sn),function(t,e){if(Yo(t,e),e<0)throw new Ro(t,e)}),nr=(Wo=Pn,function(t,e){var n=typeof e;if("boolean"!=n)throw new Wo(t,n)}),ir=(Xo=Cn,function(t,e){var n=typeof e;if("number"!=n)throw new Xo(t,n);if(isNaN(e)||e<.01||1<e)throw new Xo(t,e)}),or=(Ho=Dn,function(t,e){var n=typeof e;if("string"!=n)throw new Ho(t,n)}),rr=(qo=kn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new qo(t,n)}),sr=(Go=Bn,function(t,e){if(!(e instanceof Date))throw new Go(t,e)}),lr=(zo=Kn,function(t,e){if(isNaN(Number(e)))throw new zo(t,typeof e)}),ar=(jo=Yn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new jo(t,n)}),ur=($o=Hn,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new $o(t,n)}),cr=(Qo=zn,function(t,e){var n=typeof e;if("object"!=n)throw new Qo(t,n)}),hr=(Zo=Qn,function(t,e){var n=typeof e;if("function"!=n)throw new Zo(t,n)}),fr=(w(dr,Jo=Lo),dr.prototype.getAssignableProperties=function(){return[{name:"speed",type:ir}]},dr);function dr(t,e){var n=Jo.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var mr,pr=(w(vr,mr=fr),vr.prototype.getAssignableProperties=function(){return[{name:"offsetX",type:tr},{name:"offsetY",type:tr},{name:"isDefaultOffset",type:nr}]},vr);function vr(t,e){var n=mr.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var gr,yr=(w(Er,gr=pr),Er.prototype.getAssignableProperties=function(){return[{name:"scrollToCenter",type:nr},{name:"skipParentFrames",type:nr}]},Er);function Er(t,e){var n=gr.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var br,Sr,wr=(w(_r,br=Lo),_r.prototype.getAssignableProperties=function(){return[{name:"left",type:tr,defaultValue:null},{name:"right",type:tr,defaultValue:null},{name:"top",type:tr,defaultValue:null},{name:"bottom",type:tr,defaultValue:null}]},_r);function _r(t,e){var n=br.call(this)||this;return n._assignFrom(t,e),n}function Pr(t,e){var n=Sr.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(Pr,Sr=fr),Pr.prototype.getAssignableProperties=function(){return[{name:"scrollTargetX",type:tr},{name:"scrollTargetY",type:tr},{name:"crop",type:cr,init:fs},{name:"includeMargins",type:nr},{name:"includeBorders",type:nr},{name:"includePaddings",type:nr}]};var xr,Ar=(w(Cr,xr=Lo),Cr.prototype.getAssignableProperties=function(){return[{name:"ctrl",type:nr,defaultValue:!1},{name:"alt",type:nr,defaultValue:!1},{name:"shift",type:nr,defaultValue:!1},{name:"meta",type:nr,defaultValue:!1}]},Cr);function Cr(t,e){var n=xr.call(this)||this;return n._assignFrom(t,e),n}var Tr,Mr=(w(Dr,Tr=pr),Dr.prototype.getAssignableProperties=function(){return[{name:"modifiers",type:cr,init:ds}]},Dr);function Dr(t,e){var n=Tr.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Ir,Ur=(w(kr,Ir=Mr),kr.prototype.getAssignableProperties=function(){return[{name:"caretPos",type:er}]},kr);function kr(t,e){var n=Ir.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var Or,Nr=(w(Br,Or=Mr),Br.prototype.getAssignableProperties=function(){return[{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:nr},{name:"skipDefaultDragBehavior",type:nr}]},Br);function Br(t,e){var n=Or.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 Fr,Lr,Kr,Vr,Rr,Yr,Wr=(w(Xr,Fr=Ur),Xr.prototype.getAssignableProperties=function(){return[{name:"replace",type:nr},{name:"paste",type:nr},{name:"confidential",type:nr}]},Xr);function Xr(t,e){var n=Fr.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function Hr(t,e){var n=Lr.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function qr(t,e){var n=Kr.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Gr(t,e){var n=Vr.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function zr(t,e){var n=Rr.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function jr(t,e){var n=Yr.call(this)||this;return n._assignFrom(t,e),n}w(Hr,Lr=Mr),Hr.prototype.getAssignableProperties=function(){return[{name:"destinationOffsetX",type:tr},{name:"destinationOffsetY",type:tr}]},w(qr,Kr=Lo),qr.prototype.getAssignableProperties=function(){return[{name:"portraitOrientation",type:nr}]},w(Gr,Vr=Lo),Gr.prototype.getAssignableProperties=function(){return[{name:"timeout",type:er},{name:"allowUnawaitedPromise",type:nr}]},w(zr,Rr=fr),zr.prototype.getAssignableProperties=function(){return[{name:"confidential",type:nr}]},w(jr,Yr=Lo),jr.prototype.getAssignableProperties=function(){return[{name:"name",type:or},{name:"value",type:or},{name:"domain",type:or},{name:"path",type:or},{name:"expires",type:sr},{name:"maxAge",type:lr},{name:"secure",type:nr},{name:"httpOnly",type:nr},{name:"sameSite",type:or}]};var $r,Qr=(w(Zr,$r=Lo),Zr.prototype.getAssignableProperties=function(){return[{name:"username",type:or,required:!0},{name:"password",type:or}]},Zr);function Zr(t,e){var n=$r.call(this)||this;return n._assignFrom(t,e),n}var Jr,ts,es,ns,is,os=(w(rs,Jr=Lo),rs.prototype.getAssignableProperties=function(){return[{name:"protocol",type:or},{name:"host",type:or,required:!0},{name:"port",type:lr,required:!0},{name:"auth",type:cr,init:cs}]},rs);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){var n=is.call(this)||this;return n._assignFrom(t,e),n}function cs(t,e,n,i){return void 0===i&&(i=!0),new Qr(e,i)}function hs(t,e,n,i){return void 0===i&&(i=!0),new os(e,i)}function fs(t,e,n,i){return void 0===i&&(i=!0),new wr(e,i)}function ds(t,e,n,i){return void 0===i&&(i=!0),new Ar(e,i)}w(ss,ts=Lo),ss.prototype.getAssignableProperties=function(){return[{name:"url",type:ar},{name:"method",type:or},{name:"headers",type:cr},{name:"params",type:ur},{name:"body"},{name:"timeout",type:lr},{name:"withCredentials",type:nr},{name:"auth",type:cr,init:cs},{name:"proxy",type:cr,init:hs},{name:"rawResponse",type:nr}]},w(ls,es=Lo),ls.prototype.getAssignableProperties=function(){return[{name:"credentials",type:lr}]},w(as,ns=Lo),as.prototype.getAssignableProperties=function(){return[{name:"stack",type:rr,required:!1},{name:"message",type:rr,required:!1},{name:"pageUrl",type:rr,required:!1}]},w(us,is=Lo),us.prototype.getAssignableProperties=function(){return[{name:"fn",type:hr,required:!0},{name:"dependencies",type:cr,required:!1}]};var ms=null,ps=function(){return ms},vs=function(t){ms=t},gs=(y.Promise,y.nativeMethods,y.eventSandbox.listeners,y.utils.browser,y.utils.event.BUTTON,y.utils.event.BUTTONS_PARAMETER);function ys(t){return t.top!==t}y.utils.event.DOM_EVENTS,y.utils.event.WHICH_PARAMETER,y.utils.event.preventDefault;var Es=y.Promise,bs=y.eventSandbox.message;function Ss(t,i,e){return new Es(function(n){bs.on(bs.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(bs.off(bs.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),bs.sendServiceMsg(t,e)})}var ws=(_s.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},_s.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)})},_s.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=m.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},_s.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},_s.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])}},_s);function _s(){this._eventsListeners={}}var Ps=ws,xs=m.eventSandbox.listeners;function As(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new Ps}var Cs=(As.prototype._internalListener=function(t,e,n,i,o){this.events.emit("scroll",t),this.stopPropagationFlag&&(i(),o())},As.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,xs.initElementListening(Pf,["scroll"]),xs.addFirstInternalEventBeforeListener(Pf,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n._internalListener.apply(n,t)}))},As.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},As.prototype.handleScrollEvents=function(n,t){var e,i=this;this.events.once("scroll",t),(e=n)&&e.getRootNode&&I(e)!==e.getRootNode()&&(xs.initElementListening(n,["scroll"]),xs.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i._internalListener.apply(i,t),xs.cancelElementListening(n)}))},As.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},As.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new As),Ts=(Ms._isScrollValuesChanged=function(t,e){return rt(t)!==e.left||st(t)!==e.top},Ms.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=K(t)?I(t):t,s={left:rt(r),top:st(r)},i=Math.max(i,0),o=Math.max(o,0),l=Cs.waitForScroll(r);return lt(r,i),at(r,o),Ms._isScrollValuesChanged(r,s)?l=l.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=Ms._isScrollValuesChanged(r,s))}):(l.cancel(),m.Promise.resolve())},Ms.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}},Ms.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,j.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},Ms._getChildPoint=function(t,e,n){return A.create(e).sub(A.create(t)).add(A.create(t.scroll)).add(A.create(e.border)).add(n)},Ms.prototype._getScrollPosition=function(t,e,n,i){var o=Ms._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)}},Ms._getChildPointAfterScroll=function(t,e,n,i){return A.create(e).add(A.create(t.scroll)).sub(A.create(n)).add(i)},Ms.prototype._isChildFullyVisible=function(t,e,n){var i=Ms._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},Ms.prototype._scrollToChild=function(t,e,n){for(var i=wt(t),o=wt(e),r=it(Pf),s=ot(Pf),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this._maxScrollMargin);var u=Ms._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)},Ms.prototype._scrollElement=function(){if(!Dt(this._element))return m.Promise.resolve();var t=wt(this._element),e=this._getScrollToPoint(t,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,e)},Ms.prototype._scrollParents=function(){var t,e,n,i,o,r,s=this,l=(t=this._element,i=X(t),!k(t)||(e=O(t))&&(n=X(e),i.concat(n)),m.nativeMethods.arrayFilter.call(i,Dt)),a=this._element,u=rt(a),c=st(a),h=A.create(this._offsets).sub(new A(u,c).round()),f=function(n,i){return P(this,void 0,void 0,function(){var e;return x(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=wt(a),r=wt(l[t]),h.add(A.create(o)).sub(A.create(r)).add(A.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&&ys(Pf))return d.cmd=Ms.SCROLL_REQUEST_CMD,Ss(d,Ms.SCROLL_RESPONSE_CMD,Pf.parent)}).then(function(){return s._scrollWasPerformed})},Ms._getFixedAncestorOrSelf=function(t){return H(t,!0,ft)},Ms.prototype._isTargetElementObscuredInPoint=function(t){var e=_t(t);if(!e)return!1;var n=Ms._getFixedAncestorOrSelf(e);return!!n&&!n.contains(this._element)},Ms.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()})},Ms.SCROLL_REQUEST_CMD="automation|scroll|request",Ms.SCROLL_RESPONSE_CMD="automation|scroll|response",Ms);function Ms(t,e,n){this._element=t,this._offsets=new A(e.offsetX,e.offsetY),this._scrollToCenter=!!e.scrollToCenter,this._skipParentFrames=!!e.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}var Ds=y.utils.browser,Is=(Us.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Us.prototype.leaveElement=function(){},Us.prototype.move=function(){},Us.prototype.enterElement=function(){},Us.prototype.dragAndDrop=function(){},Us.prototype.teardown=function(){},Us.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),Ds.isIE&&this.move(t,n),l&&g.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Ds.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}},Us);function Us(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var ks=y.eventSandbox.eventSimulator,Os=y.utils.extend,Ns=y.nativeMethods,Bs=(Fs.leaveElement=function(t,e,n,i){ks.mouseout(e,Os({relatedTarget:t},i));for(var o=e;o&&o!==n;)ks.mouseleave(o,Os({relatedTarget:t},i)),o=Ns.nodeParentNodeGetter.call(o)},Fs.enterElement=function(t,e,n,i){ks.mouseover(t,Os({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--)ks.mouseenter(r[s],Os({relatedTarget:e},i))},Fs.move=function(t,e,n){ks[t](e,n)},Fs);function Fs(){}var Ls=(Ks.dragAndDrop=function(t,e,n,i){return ks.drag(t,i),e!==n&&(g.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,ks.dragenter(e,i)),n&&(i.relatedTarget=e,ks.dragleave(n,i))),!ks.dragover(e,i)},Ks);function Ks(){}var Vs,Rs=y.eventSandbox.eventSimulator,Ys=(w(Ws,Vs=Is),Ws.prototype.leaveElement=function(t,e,n,i){Bs.leaveElement(t,e,n,i)},Ws.prototype.enterElement=function(t,e,n,i){Bs.enterElement(t,e,n,i)},Ws.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Bs.move(this.moveEvent,t,e)},Ws.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(t)&&t!==n&&Rs[this.moveEvent](t,e)},Ws.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},Ws);function Ws(t){var e=Vs.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Xs,Hs=(w(qs,Xs=Is),qs.prototype.setup=function(){Xs.prototype.setup.call(this),this.dragAndDropMode=!0},qs.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Ls.dragAndDrop(t,e,n,i)},qs);function qs(){return null!==Xs&&Xs.apply(this,arguments)||this}var Gs,zs=y.eventSandbox.eventSimulator,js=(w($s,Gs=Is),$s.prototype.setup=function(){Gs.prototype.setup.call(this),this.dragAndDropMode=!0},$s.prototype.leaveElement=function(t,e,n,i){Bs.leaveElement(t,e,n,i)},$s.prototype.move=function(t,e){Bs.move(this.moveEvent,t,e)},$s.prototype.enterElement=function(t,e,n,i){Bs.enterElement(t,e,n,i)},$s.prototype.dragAndDrop=function(t,e,n,i,o){var r=zs.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Ls.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},$s.prototype.run=function(t,e,n,i,o){return Gs.prototype.run.call(this,t,null,n,i,o)},$s);function $s(){return null!==Gs&&Gs.apply(this,arguments)||this}function Qs(t,e,n){return new(t?e?Hs:js:Ys)(n)}function Zs(a,u,c){return P(this,void 0,void 0,function(){var e,n,i,o,r,s,l;return x(this,function(t){switch(t.label){case 0:e=!0,n=A.create(a.startPoint),i=A.create(a.endPoint).round(Math.floor),o=A.create(a.startPoint).round(Math.floor),r=A.create(a.startPoint),s=u(),t.label=1;case 1:return o.eql(i)?[3,4]:(r=A.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=A.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 Js=(tl.create=function(o,r,s,l,a){return void 0===a&&(a=null),P(this,void 0,m.Promise,function(){var e,n,i;return x(this,function(t){switch(t.label){case 0:return[4,tl.getTarget(o,s,new A(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new tl(n,i,r,s,l,a)]}})})},tl.getTarget=function(e,n,i){return m.Promise.resolve(Pt(e,i.x,i.y)).then(function(t){return t?{element:e,offset:i}:m.Promise.all([At(e,i),n.document.documentElement]).then(function(t){var e=t[0];return{element:t[1],offset:e}})})},tl.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},tl.prototype._getTargetClientPoint=function(){var o=this;return m.Promise.resolve(tt(this.element)).then(function(i){return K(o.element)?A.create(o.offset).sub(A.create(i)).round(Math.round):m.Promise.resolve(xt(o.element)).then(function(t){var e=L(o.element),n=A.create(t).add(o.offset);return e||n.sub(A.create(i)),n.round(Math.floor)})})},tl.prototype._getEventSequenceOptions=function(t){var e=gs.noButton,n=Ut(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}}},tl.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions;return Qs(!1,this.firstMovingStepOccured,i).run(t,ps(),n,null,null)},tl.prototype._emulateEvents=function(t,e){var n=this._getEventSequenceOptions(e);this._runEventSequence(t,n),this.firstMovingStepOccured=!0,vs(t)},tl.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return Ft(i.cursor.getPosition())}).then(function(t){var e=i._getCorrectedTopElement(t);return e?i._emulateEvents(e,n):null}).then(To)},tl.prototype._getCorrectedTopElement=function(t){return t},tl.prototype._move=function(l){return P(this,void 0,m.Promise,function(){var e,n,i,o,r,s=this;return x(this,function(t){switch(t.label){case 0:return e=this.cursor.getPosition(),n=A.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,Zs(o,m.nativeMethods.dateNow,function(i){return P(s,void 0,void 0,function(){var e,n;return x(this,function(t){switch(t.label){case 0:return[4,null===(n=this.nativeAutomationInput)||void 0===n?void 0:n.createMouseMoveEvent(i,this.modifiers)];case 1:return e=t.sent(),r.push(e),[2,To()]}})})})]):[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,Zs(o,m.nativeMethods.dateNow,function(t){return s._movingStep(t)})];case 5:t.sent(),t.label=6;case 6:return[2]}})})},tl.prototype._needMoveCursorImmediately=function(){return this.touchMode},tl.prototype._scroll=function(){if(this.skipScrolling)return m.Promise.resolve(!1);var t=new yr({offsetX:this.offset.x,offsetY:this.offset.y},!1);return new Ts(this.element,t).run()},tl.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(G(s)).then(function(t){return c=t,m.Promise.resolve((n=bt(e=t),i=n.left,o=n.top,r=St({x:i,y:o}),s=Z(e),l=J(e),a=r.x+s.left+l.left,u=r.y+s.top+l.top,new j(u,a+et(e),u+nt(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 Ft(n.cursor.getPosition())}).then(function(t){return l=t===c,s.parent===n.window&&(h.iframeUnderCursor=l),Ss(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)})},tl.prototype.run=function(){var n=this;return this._scroll().then(function(){return m.Promise.all([n._getTargetClientPoint(),(t=n.window,new j(0,et(t),nt(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)})})},tl);function tl(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 _o(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 el=(nl.prototype._ensureActiveWindow=function(t){this._activeWindow!==t&&this._activeWindow!==t.parent&&this._activeWindow.parent!==t&&(this._activeWindow=t)},nl.prototype.isActive=function(t){return this._ensureActiveWindow(t),this._activeWindow===t},nl.prototype.setActiveWindow=function(t){this._activeWindow=t},nl.prototype.getActiveWindow=function(t){return this._ensureActiveWindow(t),this._activeWindow},nl.prototype.getPosition=function(){return new A(this._x,this._y)},nl.prototype.move=function(t){return this._x=t.x,this._y=t.y,this._ui.move(t)},nl.prototype.hide=function(){return this._ui.hide?this._ui.hide():m.Promise.resolve()},nl.prototype.show=function(){return this._ui.show?this._ui.show():m.Promise.resolve()},nl.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},nl.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},nl.prototype.buttonUp=function(){return this._ui.buttonUp()},nl);function nl(t,e){this._ui=e,this._x=-1,this._y=-1,this._activeWindow=t}var il,ol,rl,sl,ll=ys(Pf)?i.iframeCursorUI:i.cursorUI,al=new el(Pf.top,ll),ul=E.positionUtils,cl=E.domUtils,hl=E.eventUtils,fl="elementOverlapped";(ol=il=il||{})[ol.Mouse=0]="Mouse",ol[ol.Keyboard=1]="Keyboard",ol[ol.Touch=2]="Touch",ol[ol.Delay=3]="Delay",ol[ol.InsertText=4]="InsertText",(sl=rl=rl||{})[sl.alt=1]="alt",sl[sl.ctrl=2]="ctrl",sl[sl.meta=4]="meta";var dl={ctrl:!(sl[sl.shift=8]="shift"),alt:!1,shift:!1,meta:!1};function ml(t){return rl[t]||0}var pl=y.utils,vl=y.eventSandbox,gl=y.nativeMethods,yl=vl.message,El={clickCount:1},bl="native-automation|calculate-top-left-point|request",Sl="native-automation|calculate-top-left-point|response";function wl(){return P(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return Pf===Pf.parent?[3,2]:[4,Ss({cmd:bl},Sl,Pf.parent)];case 1:return[2,t.sent().topLeftPoint];case 2:return[2,{x:0,y:0}]}})})}yl.on(yl.SERVICE_MSG_RECEIVED_EVENT,function(f){return P(void 0,void 0,void 0,function(){var r,s,l,a,u,c,h;return x(this,function(t){switch(t.label){case 0:return f.message.cmd!==bl?[3,2]:(r=f.source,[4,wl()]);case 1:s=t.sent(),l=s.x,a=s.y,u=G(r),n=(e=u).getBoundingClientRect(),i=ct(e),o=ht(e),c={x:n.left+i.left+o.left,y:n.top+i.top+o.top},h={cmd:Sl,topLeftPoint:{x:c.x+l,y:c.y+a}},yl.sendServiceMsg(h,r),t.label=2;case 2:return[2]}var e,n,i,o})})});var _l=(Pl._isNonCharKeyModifier=function(t){var e=[rl.ctrl,rl.alt,rl.meta];return-1<gl.arrayIndexOf.call(e,t)},Pl._getKeyDownEventText=function(t){return t.isNewLine?"\r":1!==t.keyProperty.length||Pl._isNonCharKeyModifier(t.modifiers)?"":t.keyProperty},Pl.createKeyDownOptions=function(t){var e=Pl._getKeyDownEventText(t);return{type:e?"keyDown":"rawKeyDown",modifiers:t.modifiers||0,windowsVirtualKeyCode:t.keyCode,key:t.keyProperty,text:e}},Pl.createKeyUpOptions=function(t){return{type:"keyUp",modifiers:t.modifiers||0,key:t.keyProperty,windowsVirtualKeyCode:t.keyCode}},Pl.createMouseEventOptions=function(l,a){return P(this,void 0,void 0,function(){var o,r,s;return x(this,function(t){switch(t.label){case 0:return[4,wl()];case 1:return o=t.sent(),r=o.x,s=o.y,[2,pl.extend({x:a.options.clientX+r,y:a.options.clientY+s,modifiers:(n=a.options,i=0,n&&(n.ctrl&&(i|=rl.ctrl),n.alt&&(i|=rl.alt),n.shift&&(i|=rl.shift),n.meta&&(i|=rl.meta)),i),button:(e=a.options).button?e.button:"left",type:l},El)]}var e,n,i})})},Pl.delay=function(t){return{type:il.Delay,options:{delay:t}}},Pl.keyDown=function(t){return{type:il.Keyboard,options:Pl.createKeyDownOptions(t)}},Pl.keyUp=function(t){return{type:il.Keyboard,options:Pl.createKeyUpOptions(t)}},Pl);function Pl(){}var xl=(Al.prototype.mouseDown=function(n){return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,_l.createMouseEventOptions("mousePressed",n)];case 1:return e=t.sent(),[2,this._dispatchEventFn.single(il.Mouse,e)]}})})},Al.prototype.mouseUp=function(n){return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,_l.createMouseEventOptions("mouseReleased",n)];case 1:return e=t.sent(),[2,this._dispatchEventFn.single(il.Mouse,e)]}})})},Al.prototype.keyDown=function(t){var e=_l.createKeyDownOptions(t);return this._dispatchEventFn.single(il.Keyboard,e)},Al.prototype.keyUp=function(t){var e=_l.createKeyUpOptions(t);return this._dispatchEventFn.single(il.Keyboard,e)},Al.prototype.executeEventSequence=function(t){return this._dispatchEventFn.sequence(t)},Al.prototype.executeInsertText=function(e){return P(this,void 0,void 0,function(){return x(this,function(t){return[2,this._dispatchEventFn.single(il.InsertText,{text:e})]})})},Al.prototype.createMouseMoveEvent=function(n,i){return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,_l.createMouseEventOptions("mouseMoved",{options:_({clientX:n.x,clientY:n.y,button:"none"},i)})];case 1:return e=t.sent(),[2,{type:il.Mouse,options:e}]}})})},Al);function Al(t){this._dispatchEventFn=t}var Cl=(Tl.create=function(t){var n=t.element,i=t.clientPoint,o=t.screenPoint,r=t.isTarget,s=t.inMoving;return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return e=null,i?[4,Ut(i)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,new Tl({element:n,clientPoint:i,screenPoint:o,isTarget:r,inMoving:s,devicePoint:e})]}})})},Tl);function Tl(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 Ml,Dl=(w(Il,Ml=ws),Il.prototype._ensureWindowAndCursorForLegacyTests=function(t){t.window=t.window||Pf,t.cursor=al},Il.prototype.canUseNativeAutomationEventSimulator=function(t){return!!this.nativeAutomationInput&&!!t&&"select"!==Y(t)},Il.prototype._getElementForEvent=function(n){return P(this,void 0,void 0,function(){var e;return x(this,function(t){return e=Pt(this.element,this.options.offsetX,this.options.offsetY)?this.element:null,[2,Vt(n.point,this.window,e)]})})},Il.prototype._moveToElement=function(){return P(this,void 0,void 0,function(){var e,n=this;return x(this,function(t){switch(t.label){case 0:return e=new Nr(m.utils.extend({skipScrolling:!0},this.options),!1),[4,Js.create(this.element,e,this.window,this.cursor,this.nativeAutomationInput)];case 1:return[2,t.sent().run().then(function(){return Co(n.automationSettings.mouseActionStepDelay)})]}})})},Il.prototype._scrollToElement=function(){var e=this,n=!1,t=new yr(this.options,!1);return new Ts(this.element,t).run().then(function(t){return n=!!t,Co(e.automationSettings.mouseActionStepDelay)}).then(function(){return Vt(e.cursor.getPosition(),e.window)}).then(function(t){return function(s,l,a){return P(this,void 0,y.Promise,function(){var e,n,i,o,r;return x(this,function(t){switch(t.label){case 0:return s&&cl.contains(l,s)&&a?(e=ps(),n=cl.getCommonAncestor(s,e),[4,ul.getClientPosition(s)]):[2];case 1:return[4,Ut(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:hl.BUTTONS_PARAMETER.leftButton},Bs.leaveElement(s,e,n,r),Bs.enterElement(s,e,n,r),vs(s)),[2]}})})}(t,e.element,n)}).then(function(){return n})},Il.prototype._getElementOffset=function(){var t=Nt(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 A.create({x:r,y:o})},Il.prototype._isTargetElement=function(n,i){return P(this,void 0,void 0,function(){var e;return x(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]}})})},Il.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(A.create({x:l,y:s}));return e},Il.prototype._getAvailableOffset=function(r,s){return P(this,void 0,void 0,function(){var e,n,i,o;return x(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,At(this.element,e[o])]:[3,7];case 2:return n=t.sent(),[4,It(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]}})})},Il.prototype._wrapAction=function(m){return P(this,void 0,void 0,function(){var e,n,i,o,r,s,l,a,u,c,h,f,d;return x(this,function(t){switch(t.label){case 0:return e=this._getElementOffset(),[4,Pt(this.element,e.x,e.y)];case 1:return n=t.sent()?this.element:null,[4,At(this.element,e)];case 2:return i=t.sent(),[4,xt(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,At(this.element,e)];case 7:return s=t.sent(),[4,xt(this.element)];case 8:return l=t.sent(),[4,It(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,Cl.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,Cl.create({element:u,clientPoint:a,screenPoint:s,isTarget:c,inMoving:d})]}})})},Il.prototype._checkElementState=function(t,e){if(!t.element)throw new li(null,{reason:function t(e,n){void 0===n&&(n="action target");var i=yt(e);if(F(e)){var o=(t(R(W(e,"map")),"container")||"").replace(/.*The/,"its");return mt.mapContainerNotVisible(i,o)}return mt.elOutsideBounds(i,n)}(this.element)});if(e&&(!t.isTarget||t.inMoving))throw new Wi;return t},Il.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=yt(r.element),n=yt(i),r.emit(r.WARNING_EVENT,{type:fl,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}})},Il.prototype._contains=function(o,r){return P(this,void 0,void 0,function(){var e,n,i;return x(this,function(t){switch(t.label){case 0:return[4,X(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]}})})},Il);function Il(t,e,n,i,o){var r=Ml.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 _o(e.speed||1),r.window=n,r.cursor=i,r.nativeAutomationInput=o?new xl(o):null,r._ensureWindowAndCursorForLegacyTests(r),r}var Ul,kl=y.Promise,Ol=(w(Nl,Ul=Dl),Nl.prototype.run=function(t){var e=this,n=kl.resolve();return this.element!==xf.scrollingElement&&this.element!==xf.documentElement&&(n=this._ensureElement(t,!0,!0)),n.then(function(){e.element.scrollLeft=e.scrollLeft,e.element.scrollTop=e.scrollTop})},Nl);function Nl(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=Ul.call(this,t,n,Pf,al)||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 Bl,Fl=(w(Ll,Bl=Dl),Ll.prototype.run=function(t){return this._ensureElement(t,!0,!0)},Ll);function Ll(t,e){return Bl.call(this,t,e,Pf,al)||this}var Kl=y.Promise,Vl=y.nativeMethods,Rl=y.utils.browser,Yl=y.eventSandbox.focusBlur,Wl=E.contentEditable,Xl=E.textSelection,Hl=E.domUtils,ql=E.styleUtils,Gl=y.eventSandbox.message,zl="automation|iframe|request",jl="automation|iframe|response";function $l(t,e){var n,i,o=Hl.isTextEditableElement(t),r=Hl.isContentEditableElement(t);o||r?r&&isNaN(parseInt(e,10))?Xl.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Hl.getElementValue(t).length:e,Xl.select(t,n,n)):(i=Wl.findContentEditableParent(t))&&Xl.setCursorToLastVisiblePosition(Wl.findContentEditableParent(i))}function Ql(v,g,y){var t=this;return new Kl(function(p){return P(t,void 0,void 0,function(){var n,i,o,r,s,l,a,u,c,h,f,d,m;return x(this,function(t){switch(t.label){case 0:return ys(Pf)?[4,Ss({cmd:zl},jl,Pf.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(n=Hl.getActiveElement(),i=Hl.isTextEditableElement(v),o=Hl.closest(v,"label[for]"),r=Hl.isElementFocusable(v),s=!r&&o,l=Hl.isContentEditableElement(v),a=l?Wl.findContentEditableParent(v):v,g&&Rl.isWebKit&&i&&Xl.select(v,0,0),s)return g&&(e=o,Hl.isElementFocusable(e)?Yl.focus(e,E.noop,!1,!0):Jl(e)),p(),[2];if(u=!g,c=!1,!r&&!l){if(h=Hl.findDocument(a),f=Vl.documentActiveElementGetter.call(h),d=Hl.isBodyElement(f),m=Hl.isBodyElement(a)?a:Hl.getFocusableParent(a),f&&!d&&Hl.containsElement(f,a)||d&&Hl.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return Yl.focus(a,function(){!g||l||v===Hl.getActiveElement()?($l(v,y),g||Hl.getActiveElement()===n?p():Yl.focus(n,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function Zl(t){var e=Hl.closest(t,"label[for]"),n=e&&(e.control||xf.getElementById(e.htmlFor));return n&&ql.isElementVisible(n)?n:null}function Jl(t){var e=Zl(t);e&&Hl.getActiveElement()!==e&&Yl.focus(e,E.noop,!1,!0)}Gl.on(Gl.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===zl&&(e=Hl.findIframeByWindow(t.source),Yl.focus(e,function(){Gl.sendServiceMsg({cmd:jl},t.source)},!1))});var ta=y.utils.browser,ea=y.eventSandbox.eventSimulator,na=y.eventSandbox.listeners,ia=y.nativeMethods,oa=E.domUtils,ra=E.styleUtils,sa=E.selectController,la=i.selectElement,aa=(ua.prototype.run=function(){this.eventState.clickElement&&ea.click(this.eventState.clickElement,this.eventArgs.options),oa.isElementFocusable(this.eventArgs.element)||Jl(this.eventArgs.element)},ua);function ua(t,e){this.eventState=t,this.eventArgs=e}var ca,ha=(w(fa,ca=aa),fa.prototype.run=function(){function t(t){n=ia.eventTargetGetter.call(t)===e.input}var e=this,n=!1;na.addInternalEventBeforeListener(Pf,["focus"],t),ca.prototype.run.call(this),na.removeInternalEventBeforeListener(Pf,["focus"],t),oa.isElementFocusable(this.targetElement)&&!n&&this._ensureBoundElementFocusRaised()},fa.prototype._ensureBoundElementFocusRaised=function(){ea.focus(this.input)},fa);function fa(t,e){var n=ca.call(this,t,e)||this;return n.targetElement=n.eventArgs.element,n.input=Zl(n.eventArgs.element),n}var da,ma=(w(pa,da=aa),pa.prototype.run=function(){da.prototype.run.call(this),this._toggleSelectOptionList()},pa.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===ra.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(sa.isOptionListExpanded(t)?la.collapseOptionList():la.expandOptionList(t))},pa);function pa(t,e){return da.call(this,t,e)||this}var va,ga=(w(ya,va=aa),ya.prototype.run=function(){return this.eventArgs.element},ya);function ya(t,e){return va.call(this,t,e)||this}var Ea,ba=(w(Sa,Ea=ha),Sa.prototype.run=function(){function t(){e=!0}var e=!1;na.addInternalEventBeforeListener(Pf,["change"],t),Ea.prototype.run.call(this),na.removeInternalEventBeforeListener(Pf,["change"],t),!ta.isChrome||e||this.checkbox.disabled||this._isClickableElementInsideLabel(this.targetElement)||this._ensureCheckboxStateChanged()},Sa.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,ea.change(this.checkbox)},Sa.prototype._isClickableElementInsideLabel=function(t){var e=oa.isAnchorElement(t)&&t.getAttribute("href"),n=oa.isButtonElement(t);return e||n},Sa);function Sa(t,e){var n=Ea.call(this,t,e)||this;return n.checkbox=n.input,n}var wa=y.Promise,_a=y.utils.browser,Pa=y.utils.featureDetection,xa=y.eventSandbox.eventSimulator,Aa=y.eventSandbox.listeners,Ca=E.domUtils,Ta=E.eventUtils,Ma=E.arrayUtils,Da=(Ia.prototype.mousedown=function(t){var e=this;this.targetElementParentNodes=Ca.getParents(t.element),this.mouseDownElement=t.element,this._raiseTouchEvents(t);var n=Ca.getActiveElement();this.activeElementBeforeMouseDown=n;var i=(_a.isWebKit||_a.isIE)&&Ca.isSelectElement(this.mouseDownElement);return i&&this._bindMousedownHandler(),this._bindBlurHandler(n),this._isTouchEventWasCancelled()||(this.eventState.simulateDefaultBehavior=xa.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)})},Ia.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=Ca.getParents(i),s=Ca.isTheSameNode(i,n),_a.isFirefox?s?n:null:s?Ma.equals(o,r)?n:null:n.contains(i)&&!Ca.isEditableFormElement(i)?n:i.contains(n)?i:Ma.getCommonElement(r,o));var l={},a=function(t){l=t.timeStamp,Aa.removeInternalEventBeforeListener(Pf,["mouseup"],a)};return _a.isIE||Aa.addInternalEventBeforeListener(Pf,["mouseup"],a),this._isTouchEventWasCancelled()||xa.mouseup(t,e.options),e.options&&(e.options.timeStamp=l),this._click(e)},Ia.prototype._click=function(u){return P(this,void 0,y.Promise,function(){var a;return x(this,function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=Zl((n=u).element),o=oa.isSelectElement(n.element),r=oa.isOptionElement(n.element),s=oa.isLabelElement(n.element)&&i,l=i&&oa.isCheckboxElement(i),a=new(o?ma:r?ga:l?ba:s?ha:aa)(e,n),this._isTouchEventWasCancelled()||a.run(),[2,u]})})},Ia.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},Ia.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Ta.preventDefault(t),Ta.unbind(e.element,"mousedown",n)};Ta.bind(this.element,"mousedown",n)},Ia.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,Ta.unbind(t,"blur",n,!0)};Ta.bind(t,"blur",n,!0)},Ia.prototype._ensureActiveElementBlur=function(e){var n=this;return new wa(function(t){Ca.getActiveElement()===e||n.eventState.blurRaised?t():_a.isIE&&_a.version<12?To().then(function(){n.eventState.blurRaised||xa.blur(e),t()}):(xa.blur(e),t())})},Ia.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?wa.resolve():Ql(Ca.isContentEditableElement(this.element)?this.element:t.element,!_a.isIE||this.activeElementBeforeMouseDown===Ca.getActiveElement(),this.caretPos)},Ia.prototype._raiseTouchEvents=function(t){Pa.isTouchDevice&&(this.eventState.touchStartCancelled=!xa.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!xa.touchend(t.element,t.options))},Ia);function Ia(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 Ua,ka=(w(Oa,Ua=Dl),Oa.prototype._mousedown=function(t){return this.canUseNativeAutomationEventSimulator(t.element)?this.nativeAutomationInput.mouseDown(t):this.strategy.mousedown(t)},Oa.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&&$l(n,e),t}):this.strategy.mouseup(n,t)},Oa.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([Co(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})},Oa);function Oa(t,e,n,i,o){var r,s,l=Ua.call(this,t,e,n,i,o)||this;return l.modifiers=e.modifiers,l.strategy=(r=l.element,s=e.caretPos,new Da(r,s)),l}function Na(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 A(i,n.top):null}function Ba(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 A(n.left,i):null}function Fa(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?Na:Ba)(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 La=y.eventSandbox.eventSimulator,Ka=y.eventSandbox.message,Va=E.positionUtils,Ra=E.domUtils,Ya=E.styleUtils,Wa="automation|move|response";Ka.on(Ka.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===Pf?(e=Pf["%testCafeDriverInstance%"],i=(n=t).message.nativeAutomationMove&&e.createDispatchNativeAutomationEventFunctions(),r=new A(n.message.endX,n.message.endY),s=n.source,l=Ra.findIframeByWindow(s),a=Ya.getBordersWidth(l),u=Ya.getElementPadding(l),c=Va.getIframeClientCoordinates(l),h=Va.getIframePointRelativeToParentFrame(r,s),f=al.getPosition(),d=Va.isInRectangle(f,c)?f:Fa(f,h,c),m={x:d.x-c.left,y:d.y-c.top},p=new Nr({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:Wa,x:m.x,y:m.y},al.getActiveWindow(Pf)!==s?(o=null,i&&(o=new xl(i)),Js.create(l,p,Pf,al,o).then(function(t){return t.run()}).then(function(){al.setActiveWindow(s),Ka.sendServiceMsg(v,s)})):Ka.sendServiceMsg(v,s)):(y.on(y.EVENTS.beforeUnload,function(){return Ka.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=ps();return a&&(La.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),La.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),Ka.sendServiceMsg({cmd:Wa},e)}var u,c=al.getPosition(),h=Fa(A.create(n).add(c),new A(t.message.endX,t.message.endY),n);h?(u=new Nr({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),Js.create(xf.documentElement,u,Pf,al).then(function(t){return t.run()}).then(function(){var t={cmd:Wa,x:h.x,y:h.y};al.setActiveWindow(e),Ka.sendServiceMsg(t,e)})):Ka.sendServiceMsg({cmd:Wa,x:n.left,y:n.top},e)}(t)))});var Xa=y.Promise,Ha=y.utils.browser,qa=y.utils.featureDetection,Ga=y.eventSandbox.eventSimulator,za=y.eventSandbox.focusBlur,ja=y.nativeMethods,$a=E.domUtils,Qa=E.styleUtils,Za=E.delay,Ja=E.selectController,tu=i.selectElement,eu=qa.isTouchDevice?0:160,nu=(iu.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Ja.getEmulatedChildElement(this.element):this.element,e=1<Qa.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Ha.isIE&&e?this.parentSelect:t}},iu.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=Ot(n=Ja.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=xf.documentElement,i=(e=tu.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},iu.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Nr({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return Js.create(n,s,Pf,al).then(function(t){return t.run()}).then(function(){return Za(e.automationSettings.mouseActionStepDelay)})},iu.prototype._mousedown=function(){var t=this;return Ha.isFirefox?(Ga.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Ha.isIE?(Ga.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Za(eu)}).then(function(){Ga.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},iu.prototype._focus=function(){var e=this;return new Xa(function(t){za.focus(e.parentSelect,t,!1,!0)})},iu.prototype._mouseup=function(){var t=Ha.isIE?this.parentSelect:this.eventsArgs.element;Ga.mouseup(t,this.eventsArgs.options),Ha.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Ha.isFirefox||Ha.isSafari||Ha.isChrome&&53<=Ha.version,n=e||Ha.isIE;return e&&this.clickCausesChange&&Ga.input(this.parentSelect),n&&this.clickCausesChange&&Ga.change(this.parentSelect),Xa.resolve()},iu.prototype._click=function(){Ga.click(this.eventsArgs.element,this.eventsArgs.options)},iu.prototype.run=function(){var t=this;if(!this.parentSelect)return Ga.click(this.eventsArgs.element,this.eventsArgs.options),Xa.resolve();this.optionListExpanded||tu.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Qa.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()})},iu);function iu(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 _o(e.speed),this.parentSelect=$a.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Ja.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=$a.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=$a.getElementIndexInParent(this.parentSelect,this.element),o=ja.nodeParentNodeGetter.call(this.element),r=$a.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 ou,ru=y.utils.featureDetection,su=y.utils.browser,lu=y.eventSandbox.eventSimulator,au=E.eventUtils,uu=E.delay,cu=ru.isTouchDevice?0:160,hu=(w(fu,ou=Dl),fu.prototype._firstClick=function(t){var e=this,n=new Ur(this.options);n.speed=1;var i=new ka(this.element,n,Pf,al);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 uu(cu).then(function(){return t})})},fu.prototype._secondClick=function(t){var e=this;su.isIE&&au.bind(xf,"focus",au.preventDefault,!0);var n=new Ur({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new ka(xf.documentElement,n,Pf,al);return i.run().then(function(t){return e.eventState.dblClickElement=i.strategy.eventState.clickElement,su.isIE&&au.unbind(xf,"focus",au.preventDefault,!0),t})},fu.prototype._dblClick=function(t){this.eventState.dblClickElement&&lu.dblclick(this.eventState.dblClickElement,t.options)},fu.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)})},fu);function fu(t,e){var n=ou.call(this,t,e,Pf,al)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new _o(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var du,mu=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},pu=y.nativeMethods,vu=y.utils.featureDetection,gu=y.utils.html,yu=y.utils.url,Eu=y.eventSandbox.DataTransfer,bu=y.eventSandbox.DragDataStore,Su=E.eventUtils,wu=E.domUtils,_u=(w(Pu,du=Js),Pu.create=function(o,r,s,l){return P(this,void 0,void 0,function(){var e,n,i;return x(this,function(t){switch(t.label){case 0:return[4,Js.getTarget(o,s,new A(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new Pu(n,i,r,s,l)]}})})},Pu.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},Pu.prototype._getEventSequenceOptions=function(t){var e=du.prototype._getEventSequenceOptions.call(this,t),n=e.eventOptions,i=e.eventSequenceOptions;return n.dataTransfer=this.dragAndDropState.dataTransfer,n.buttons=Su.BUTTONS_PARAMETER.leftButton,i.holdLeftButton=!0,{eventOptions:n,eventSequenceOptions:i}},Pu.prototype._getCorrectedTopElement=function(t){return this.touchMode?this.dragElement:t},Pu.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions,o=Qs(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(t,ps(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},Pu.prototype._needMoveCursorImmediately=function(){return!1},Pu.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=pu.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&vu.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new bu,l.dragAndDropState.dataTransfer=new Eu(l.dragAndDropState.dataStore),((e=wu.isAnchorElement(l.dragElement))||wu.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=yu.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=gu.cleanUpHtml(pu.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))),du.prototype.run.call(l).then(function(){return l.dragAndDropState})})},Pu);function Pu(t,e,n,i,o){var r=du.call(this,t,e,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new mu,r}var xu,Au=y.Promise,Cu=y.utils.extend,Tu=y.utils.featureDetection,Mu=y.eventSandbox.eventSimulator,Du=y.eventSandbox.focusBlur,Iu=(w(Uu,xu=Dl),Uu.prototype._getEndPoint=function(){throw new Error("Not implemented")},Uu.prototype._mousedown=function(t){var e=this;return al.leftButtonDown().then(function(){return e.simulateDefaultBehavior=Mu[e.downEvent](t.element,t.options),e._focus(t)})},Uu.prototype._focus=function(n){var i=this;return new Au(function(t){var e=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;Du.focus(e,t,!1,!0)})},Uu.prototype._getDestination=function(){throw new Error("Not implemented")},Uu.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 Nr({offsetX:n.offsetX,offsetY:n.offsetY,modifiers:r.modifiers,speed:r.speed,minMovingTime:25,skipDefaultDragBehavior:!1===r.simulateDefaultBehavior},!1);return _u.create(e,o,Pf,al)}).then(function(t){return t.run()}).then(function(t){return r.dragAndDropState=t,g.delay(r.automationSettings.mouseActionStepDelay)})},Uu.prototype._mouseup=function(){var o=this;return al.buttonUp().then(function(){var e=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=Cu({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&&Mu.drop(n,i),Mu.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):Mu[o.upEvent](n,i),Vt(e)):n}).then(function(t){n&&t===n&&!o.dragAndDropState.enabled&&Mu.click(n,i)})})},Uu.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:Cu({clientX:n.x,clientY:n.y},o.modifiers)},Au.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},Uu);function Uu(t,e){var n=xu.call(this,t,e,Pf,al)||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=Tu.isTouchDevice?"touchstart":"mousedown",n.upEvent=Tu.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var ku,Ou=E.styleUtils,Nu=(w(Bu,ku=Iu),Bu.prototype._getDestination=function(){return P(this,void 0,void 0,function(){var e,n,i,o;return x(this,function(t){switch(t.label){case 0:return[4,At(this.element,{x:this.offsetX,y:this.offsetY})];case 1:return e=t.sent(),n=Ou.getWidth(xf),i=Ou.getHeight(xf),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:xf.documentElement,offsets:{offsetX:o.x,offsetY:o.y},endPoint:o}]}})})},Bu);function Bu(t,e,n,i){var o=ku.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var Fu,Lu=E.positionUtils,Ku=(w(Vu,Fu=Iu),Vu.prototype._getDestination=function(){return P(this,void 0,void 0,function(){var e,n,i,o;return x(this,function(t){return e=this.destinationElement,n=Lu.getElementRectangle(e),i=Nt(e,this.destinationOffsetX,this.destinationOffsetY),o={x:n.left+i.offsetX,y:n.top+i.offsetY},[2,{element:e,offsets:i,endPoint:o}]})})},Vu);function Vu(t,e,n){var i=Fu.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var Ru,Yu=(w(Wu,Ru=Dl),Wu.prototype.run=function(t){return this._ensureElement(t,!0)},Wu);function Wu(t,e,n){return Ru.call(this,t,e,Pf,al,n)||this}var Xu=y.utils.browser,Hu=y.sandbox.event,qu=y.eventSandbox.eventSimulator,Gu=y.eventSandbox.listeners,zu=y.nativeMethods,ju=E.domUtils,$u=E.contentEditable,Qu=E.textSelection,Zu=/ /g;function Ju(t){var e=Qu.getSelectionByElement(t),n=Qu.hasInverseSelectionContentEditable(t);return Qu.hasElementContainsSelection(t)?$u.getSelection(t,e,n):{startPos:$u.calculateNodeAndOffsetByPosition(t,0),endPos:$u.calculateNodeAndOffsetByPosition(t,0)}}function tc(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=$u.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=$u.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 ec(t,e,n){return!n||qu.beforeInput(t,e)}function nc(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}Xu.isSafari&&(Gu.addInternalEventBeforeListener(Pf,["textInput"],i),Hu.on(Hu.EVENT_PREVENTED_EVENT,o));var r=Xu.isFirefox||qu.textInput(t,e)||n;return Xu.isSafari&&(Gu.removeInternalEventBeforeListener(Pf,["textInput"],i),Hu.off(Hu.EVENT_PREVENTED_EVENT,o)),r||Xu.isIE11}function ic(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&&ju.isContentEditableElement(m)&&ju.isContentEditableElement(p)&&(ju.isTheSameNode(m,p)||(Qu.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=zu.nodeParentNodeGetter.call(o)&&o.parentElement,!(Xu.isChrome&&Xu.version<58||Xu.isSafari)&&r&&ju.isElementContainsNode(n,o)||(i=Ju(n),Qu.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&ju.isContentEditableElement(m)&&ju.isRenderedNode(m)&&ec(t,e,Xu.isChrome||Xu.isFirefox)&&(v=nc(t,y),g=v&&!Xu.isIE11,Gu.addInternalEventBeforeListener(Pf,["input"],E),Gu.addInternalEventBeforeListener(Pf,["textinput"],b),(v=v&&ec(t,e,Xu.isSafari))&&(ju.isElementNode(m)?(s=m,l=e,c=xf.createTextNode(l),h={node:c,offset:l.length},f=zu.nodeParentNodeGetter.call(s),"br"===ju.getTagName(s)?f.insertBefore(c,s):0<a?(u=zu.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Qu.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;ju.isElementContainsNode(t,i)||(i=(e=tc(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),Qu.selectByNodesAndOffsets(l,l)}(t,tc(d),e)),To().then(function(){g&&qu.input(t,e),Gu.removeInternalEventBeforeListener(Pf,["input"],E),Gu.removeInternalEventBeforeListener(Pf,["textinput"],b)})))}function oc(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;ju.isContentEditableElement(t)&&ic(t,e),ju.isElementReadOnly(t)||(ju.isTextEditableElement(t)?(l=t,a=e,h=ju.getElementValue(l),f=a.length,d=Qu.getSelectionStart(l),m=Qu.getSelectionEnd(l),p=ju.isInputElement(l)&&"number"===l.type,ec(l,a,Xu.isChrome||Xu.isFirefox)&&nc(l,a)&&ec(l,a,Xu.isSafari)&&((u=!Xu.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=Xu.isIE&&Xu.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&Xu.isIOS&&"."===h[h.length-1]&&(d+=1),ju.setElementValue(l,c),Qu.select(l,d+f,d+f)),qu.input(l,a))):ju.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=ju.getElementValue(i),ju.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):ju.setElementValue(i,o),qu.change(i),qu.input(i,o)))}function rc(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var sc=y.nativeMethods,lc=y.utils.browser,ac=y.eventSandbox.focusBlur,uc=y.Promise,cc=g.domUtils.isRadioButtonElement,hc=g.domUtils.getActiveElement,fc=g.domUtils.getTabIndexAttributeIntValue;function dc(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function mc(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 pc(t){var e=hc(t||xf),n=null;if(e&&g.domUtils.isIframeElement(e)&&sc.contentDocumentGetter.call(e))try{n=pc(sc.contentDocumentGetter.call(e))}catch(t){}return n||e}function vc(t,e,n){if(!cc(e))return t;if(!n&&!e.name&&!lc.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||lc.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return cc(t)&&t.name===i.name}:lc.isChrome&&(o=function(t){return cc(t)&&!t.name}),o);return r&&(t=g.arrayUtils.filter(t,r)),t}function gc(t,e,n){var i,o,r,s,l,a,u,c,h=e?-1:1,f=g.domUtils.getTopSameDomainWindow(Pf).document,d=(i=f,o=sc.documentActiveElementGetter.call(i),r=o&&fc(o),!(o&&r<0)),m=vc(m=g.domUtils.getFocusableElements(f,d),t,n),p=cc(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?xf.body:m[m.length-1-v]:e&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=cc(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(t){return cc(t)&&t.name===l.name&&t.checked})),c||l)}function yc(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var Ec={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 bc(t){return rc(t)?Ec.LETTERS[t.toLowerCase()]:Ec.SYMBOLS[t]||Ec.SPECIAL_KEYS[t]||t}function Sc(t){if(rc(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 wc(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:rc(t),keyIdentifierProperty:bc(e),keyProperty:g.KEY_MAPS.keyProperty[e]||e,keyCode:function(t,e,n,i,o){var r=null;return e&&"space"!==t?r=Sc(n):i?r=i:o&&(r=o),r}(t,o,i,s,l)}}var _c=y.utils.browser,Pc=y.utils.extend,xc=y.eventSandbox.eventSimulator,Ac=(Cc._isKeyActivatedInputElement=function(t){return g.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},Cc.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=(!_c.isFirefox||l)&&(!_c.isWebKit||n))}catch(t){}o&&(!_c.isIE&&i&&l&&s&&(r=this.storedActiveElement),oc(r,e))},Cc.prototype._addKeyPropertyToEventOptions=function(t){return Pc(t,yc("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},Cc.prototype.down=function(t){this.storedActiveElement=pc(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=dc(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),xc.keydown(this.storedActiveElement,Pc(e,t))},Cc.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=pc(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(rc(t))return dc(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(_c.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=_c.isAndroid||xc.keypress(e,Pc(r,t));if(!s)return s;e=pc(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=Cc._isKeyActivatedInputElement(e),a=g.domUtils.isButtonElement(e);return _c.isSafari&&0<=_c.compareVersions([_c.webkitVersion,"603.1.30"])||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},Cc.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=xc.keyup(pc(this.topSameDomainDocument),Pc(e,t)),i=pc(this.topSameDomainDocument);return!_c.isSafari&&(!_c.isChrome||53<=_c.version)&&n&&"space"===this.sanitizedKey&&Cc._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(Cc.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),Cc);function Cc(t,e){var n=wc(t,e);Pc(this,n),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(Pf).document,this.storedActiveElement=null}var Tc,Mc={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"},Dc=y.Promise,Ic=y.utils.browser,Uc=y.eventSandbox.eventSimulator,kc=y.eventSandbox.elementEditingWatcher,Oc=E.textSelection,Nc=E.eventUtils,Bc=E.domUtils,Fc=i.selectElement,Lc=null,Kc=null;function Vc(){Kc=Lc=null,Nc.unbind(this,"blur",Vc,!0)}function Rc(t){var e,n,i,o;Bc.isTextAreaElement(t)&&(Lc!==t&&(Nc.bind(t,"blur",Vc,!0),Lc=t),e=t,n=Oc.hasInverseSelection(e),i=Bc.getTextAreaValue(e),o=n?Oc.getSelectionStart(e):Oc.getSelectionEnd(e),Kc=i&&o?Bc.getTextareaIndentInLine(e,o):0)}function Yc(t,e){var n,i,o,r,s,l,a=Bc.getTextAreaValue(t);a&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),o=Oc.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==Kc&&Lc===t||Rc(t),s=l.lastIndexOf("\n"),Xc(t,n,i,o,Math.min(s+1+Kc,l.length),e))}function Wc(t,e){var n,i,o,r,s,l,a,u,c,h,f=Bc.getTextAreaValue(t);f&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),u=(r=(o=Oc.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!==Kc&&Lc===t||Rc(t),Xc(t,n,i,o,u=Math.min(u+Kc,u+h),e))}function Xc(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;Oc.select(t,s,l)}function Hc(t,e,n){Bc.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))),Bc.setElementValue(t,e),Oc.select(t,n,n),Uc.input(t)}function qc(t,e){var n,i,o,r,s,l,a,u;return Bc.isTextEditableElement(t)&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),o=Oc.hasInverseSelection(t),s=null,s=(r=!Bc.isTextAreaElement(t)||Bc.getTextareaLineNumberByPosition(t,n)===Bc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=Bc.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,Oc.select(t,u,a)):o?Oc.select(t,i,a):Oc.select(t,n,a)),Dc.resolve()}function Gc(t,e){var n,i,o,r,s,l,a,u,c;return Bc.isTextEditableElement(t)&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),o=Oc.hasInverseSelection(t),s=null,u=s=(r=!Bc.isTextAreaElement(t)||Bc.getTextareaLineNumberByPosition(t,n)===Bc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=Bc.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,Oc.select(t,c,u)):o?Oc.select(t,i,u):Oc.select(t,n,u)),Dc.resolve()}function zc(t){return qc(t,!0)}function jc(t){return Gc(t,!0)}function $c(t){return Bc.isRadioButtonElement(t)}function Qc(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?(Bc.isSelectElement(t)&&Fc.collapseOptionList(),i=t,o=e,r=n,new uc(function(t){var e=gc(i,o,r);e?ac.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&Bc.isTextEditableInput(t)&&Oc.select(t),t})):Dc.resolve();var i,o,r}var Jc=((Tc={})[Mc.ctrlA]=function(t){return Bc.isEditableElement(t)&&Oc.select(t),Dc.resolve()},Tc[Mc.backspace]=function(t){var e,n,i;return Bc.isTextEditableElementAndEditingAllowed(t)&&(e=Oc.getSelectionStart(t),n=Oc.getSelectionEnd(t),i=Bc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&Hc(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):Hc(t,i.substring(0,e)+i.substring(n,i.length),e)),Bc.isContentEditableElement(t)&&Oc.deleteSelectionContents(t),Dc.resolve()},Tc[Mc.delete]=function(t){var e,n,i;return Bc.isTextEditableElementAndEditingAllowed(t)&&(e=Oc.getSelectionStart(t),n=Oc.getSelectionEnd(t),i=Bc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&Hc(t,i.substring(0,e)+i.substring(n+1,i.length),e):Hc(t,i.substring(0,e)+i.substring(n,i.length),e)),Bc.isContentEditableElement(t)&&Oc.deleteSelectionContents(t),Dc.resolve()},Tc[Mc.left]=function(t){var e,n,i,o,r=null;return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"left"),$c(t)?Qc(t,!0):(Bc.isTextEditableElement(t)&&(e=(r=Oc.getSelectionStart(t)||0)===Oc.getSelectionEnd(t)?r-1:r,Oc.select(t,e,e),Rc(t)),Bc.isContentEditableElement(t)&&(r=Oc.getSelectionStart(t))!==Oc.getSelectionEnd(t)&&(n=Oc.getSelectionByElement(t),o={node:(i=Oc.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},Oc.selectByNodesAndOffsets(o,o,!0)),Dc.resolve())},Tc[Mc.right]=function(t){var e,n,i,o,r=null,s=null;return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"right"),$c(t)?Qc(t,!1):(Bc.isTextEditableElement(t)&&(e=(r=Oc.getSelectionStart(t))===(s=Oc.getSelectionEnd(t))?s+1:s,r===Bc.getElementValue(t).length&&(e=r),Oc.select(t,e,e),Rc(t)),Bc.isContentEditableElement(t)&&(r=Oc.getSelectionStart(t))!==(s=Oc.getSelectionEnd(t))&&(n=Oc.getSelectionByElement(t),o={node:(i=Oc.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},Oc.selectByNodesAndOffsets(o,o,!0)),Dc.resolve())},Tc[Mc.up]=function(t){return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"up"),$c(t)?Qc(t,!0):Ic.isWebKit&&Bc.isInputElement(t)?qc(t):(Bc.isTextAreaElement(t)&&Yc(t,!1),Dc.resolve())},Tc[Mc.down]=function(t){return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"down"),$c(t)?Qc(t,!1):Ic.isWebKit&&Bc.isInputElement(t)?Gc(t):(Bc.isTextAreaElement(t)&&Wc(t,!1),Dc.resolve())},Tc[Mc.shiftLeft]=function(t){var e,n;return Bc.isTextEditableElement(t)&&((e=Oc.getSelectionStart(t))===(n=Oc.getSelectionEnd(t))||Oc.hasInverseSelection(t)?Oc.select(t,n,Math.max(e-1,0)):Oc.select(t,e,Math.max(n-1,0)),Rc(t)),Dc.resolve()},Tc[Mc.shiftRight]=function(t){var e,n,i;return Bc.isTextEditableElement(t)&&(e=Oc.getSelectionStart(t),n=Oc.getSelectionEnd(t),i=Bc.getElementValue(t).length,e!==n&&Oc.hasInverseSelection(t)?Oc.select(t,n,Math.min(e+1,i)):Oc.select(t,e,Math.min(n+1,i)),Rc(t)),Dc.resolve()},Tc[Mc.shiftUp]=function(t){return Ic.isWebKit&&Bc.isInputElement(t)?zc(t):(Bc.isTextAreaElement(t)&&Yc(t,!0),Dc.resolve())},Tc[Mc.shiftDown]=function(t){return Ic.isWebKit&&Bc.isInputElement(t)?jc(t):(Bc.isTextAreaElement(t)&&Wc(t,!0),Dc.resolve())},Tc[Mc.shiftHome]=zc,Tc[Mc.shiftEnd]=jc,Tc[Mc.home]=qc,Tc[Mc.end]=Gc,Tc[Mc.enter]=function(t){var e,n,i,o,r,s;return Bc.isSelectElement(t)&&Fc.collapseOptionList(),Bc.isInputElement(t)?(Ic.isIE||kc.processElementChanging(t),(e=Bc.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)Uc.click(i);else if(Bc.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)Bc.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&Uc.submit(t)&&t.submit()}}(e,t)):Bc.isTextAreaElement(t)?(n=Oc.getSelectionStart(t),o=(i=Bc.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,Hc(t,o+String.fromCharCode(10)+r,s)):t.tagName&&Bc.isAnchorElement(t)&&Uc.click(t),Dc.resolve()},Tc[Mc.tab]=function(t){return Zc(t,!1)},Tc[Mc.shiftTab]=function(t){return Zc(t,!0)},Tc[Mc.esc]=function(t){return Bc.isSelectElement(t)&&Fc.collapseOptionList(),Dc.resolve()},Tc);function th(t){var e,n;e=t.modifiers,n=m.utils.extend({},dl),e&&(e&rl.ctrl&&(n.ctrl=!0),e&rl.alt&&(n.alt=!0),e&rl.shift&&(n.shift=!0),e&rl.meta&&(n.meta=!0)),n.shift&&t.isLetter&&(t.keyProperty=dc(t.keyProperty),t.keyCode=Sc(t.keyProperty))}var eh=y.Promise,nh=y.eventSandbox.message,ih=y.nativeMethods,oh="automation|press|request",rh="automation|press|response";nh.on(nh.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===oh&&(y.on(y.EVENTS.beforeUnload,function(){return nh.sendServiceMsg({cmd:rh},t.source)}),new sh(t.message.keyCombinations,t.message.options).run().then(function(){return nh.sendServiceMsg({cmd:rh},t.source)}))});var sh=(lh._getKeyPressSimulators=function(t){var e=mc(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return new Ac(t,i[e])})},lh._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},lh._getShortcutHandlers=function(t){for(var e,n,i,o=lh._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},lh.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return eh.resolve(e)},lh.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(pc(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},lh.prototype._up=function(t){return t.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},lh.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(pc(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=lh._getShortcutHandlers(t);var e=lh._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)})})},lh.prototype._calculateCDPEventSequence=function(){for(var t=[],e=0,n=this.keyCombinations;e<n.length;e++){for(var i=function(t){var e=mc(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return m.utils.extend({key:t},wc(t,i[e]))})}(n[e]),o=0,r=0,s=i;r<s.length;r++)o|=ml((l=s[r]).key),l.modifiers=o,th(l),t.push(_l.keyDown(l),_l.delay(this.automationSettings.keyActionStepDelay));for(var l,a=i.length-1;0<=a;a--)o&=~ml((l=i[a]).key),l.modifiers=o,t.push(_l.keyUp(l))}return t},lh.prototype.run=function(){var e=this,t=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(t);if(!ys(Pf)&&n&&ih.contentWindowGetter.call(t)){var i={cmd:oh,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,rh,ih.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)})})},lh);function lh(t,e,n){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(Pf).document,this.automationSettings=new _o(e.speed),this.options=e,this.nativeAutomationInput=n?new xl(n):null}var ah,uh=y.Promise,ch=y.utils.extend,hh=y.utils.browser,fh=y.eventSandbox.eventSimulator,dh=E.domUtils,mh=E.eventUtils,ph=E.delay,vh=(w(gh,ah=Dl),gh.prototype._mousedown=function(t){var e=this;return al.rightButtonDown().then(function(){return e.eventState.activeElementBeforeMouseDown=dh.getActiveElement(),e.eventState.simulateDefaultBehavior=fh.mousedown(t.element,t.options),e._focus(t)})},gh.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?To():Ql(dh.isContentEditableElement(this.element)?this.element:t.element,!hh.isIE||this.eventState.activeElementBeforeMouseDown===dh.getActiveElement(),this.caretPos).then(To)},gh.prototype._mouseup=function(e){var t=this;return al.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return fh.mouseup(t,e.options)})},gh.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){fh.contextmenu(t,e.options),dh.isElementFocusable(t)||Jl(t)})},gh.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:ch({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:mh.BUTTON.right},o.modifiers)},uh.all([ph(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},gh);function gh(t,e){var n=ah.call(this,t,e,Pf,al)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var yh=y.utils.browser,Eh=E.domUtils,bh=E.positionUtils,Sh=E.styleUtils,wh=E.contentEditable,_h=E.arrayUtils,Ph=["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 xh(t,e){var n,i,o,r,s,l=Sh.getBordersWidth(t),a=bh.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return Eh.isTextAreaElement(t)||(i=(n=bh.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 Ah(t){var e=Sh.getElementScroll(xf);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function Ch(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=xf.body,r=bh.getOffsetPosition(e),s=Sh.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=xf.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===Sh.get(o,"position")&&(t=Sh.getElementMargin(o),n=Sh.get(o,"left"),i=Sh.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),_h.forEach(Ph,function(t){c+="".concat(t,":").concat(Sh.get(e,t),";")}),Sh.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,Eh.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=Eh.getElementValue(t).length;try{var u=xf.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)),Eh.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return Eh.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 Th(t,e){var n,i,o,r,s,l,a=null;return(a=Eh.isContentEditableElement(t)?(o=t,r=e,s=Eh.findDocument(o).createRange(),l=wh.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()):Ch(t,e))?{x:(a=Ah(a=xh(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function Mh(t,e){var n=Eh.isTextEditableElement(t),i=Eh.isContentEditableElement(t);return n&&0<Eh.getElementValue(t).length||i&&wh.getContentEditableValue(t).length?Th(t,e):bh.findCenter(t)}function Dh(t,e,n){var i=Eh.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=Ah(xh(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var Ih,Uh=y.Promise,kh=y.utils.browser,Oh=y.utils.featureDetection,Nh=y.eventSandbox.eventSimulator,Bh=y.eventSandbox.focusBlur,Fh=E.contentEditable,Lh=E.domUtils,Kh=E.positionUtils,Vh=E.eventUtils,Rh=E.delay,Yh=(w(Wh,Ih=Dl),Wh.prototype._calculateEventArguments=function(){var e=this,n=Kh.offsetToClientCoords(this.clientPoint);return Vt(n).then(function(t){if(!t)throw new li(null,{reason:Kh.getElOutsideBoundsReason(e.element)});return{element:t,options:{clientX:n.x,clientY:n.y}}})},Wh.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Nr({offsetX:i,offsetY:o,speed:r},!1);return Js.create(n,s,Pf,al).then(function(t){return t.run()}).then(function(){return Rh(e.automationSettings.mouseActionStepDelay)})},Wh.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Vh.preventDefault(t),Vh.unbind(e.element,"mousedown",n)};Vh.bind(this.element,"mousedown",n)},Wh.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},Wh.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},Wh.prototype._moveToPoint=function(t){!function(t,e){if(Eh.isEditableElement(t)){var n=Eh.isTextAreaElement(t);if(!Eh.isInputElement(t)||!(yh.isFirefox||yh.isIE&&10<yh.version)){var i=bh.getOffsetPosition(t),o=Sh.getBordersWidth(t),r=Sh.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&&Sh.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&Sh.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=Eh.isTextEditableElement(t),i=Eh.isInputElement(t);if(!n&&!Eh.isContentEditableElement(t))return e;var o=bh.getOffsetPosition(t),r=Sh.getBordersWidth(t),s=Sh.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(yh.isFirefox||yh.isIE&&10<yh.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:xf.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},Wh.prototype._mousedown=function(){var n=this;return al.leftButtonDown().then(function(){return n._calculateEventArguments()}).then(function(t){n.eventArgs=t;var e=(kh.isWebKit||kh.isIE)&&Lh.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=Nh[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},Wh.prototype._focus=function(){var n=this;return new Uh(function(t){var e=Lh.isContentEditableElement(n.element)?Fh.findContentEditableParent(n.element):n.element;Bh.focus(e,t,!1,!0)})},Wh.prototype._setSelection=function(){throw new Error("Not implemented")},Wh.prototype._mouseup=function(){var e=this;return al.buttonUp().then(function(){return e._setSelection(),e._calculateEventArguments()}).then(function(t){e.eventArgs=t,Nh[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},Wh.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()})},Wh);function Wh(t,e){var n=Ih.call(this,t,e,Pf,al)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=Oh.isTouchDevice?"touchstart":"mousedown",n.upEvent=Oh.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var Xh,Hh=E.textSelection,qh=E.domUtils,Gh=E.positionUtils,zh=(w(jh,Xh=Yh),jh.prototype._calculateAbsoluteStartPoint=function(){return Mh(this.element,this.startPos)||Gh.findCenter(this.element)},jh.prototype._calculateAbsoluteEndPoint=function(){var t=Mh(this.element,this.endPos);return t||(qh.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=Th(t,o+=i)););return r=r||Th(t,e)||bh.findCenter(t)}(this.element,this.startPos,this.endPos):Gh.findCenter(this.element))},jh.prototype._setSelection=function(){var t=qh.isTextEditableElement(this.element),e=qh.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&Hh.select(this.element,this.startPos,this.endPos)},jh.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return Xh.prototype.run.call(e)})},jh);function jh(t,e,n,i){var o=Xh.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var $h,Qh=E.textSelection,Zh=E.contentEditable,Jh=E.positionUtils,tf=(w(ef,$h=Yh),ef.prototype._calculateAbsoluteStartPoint=function(){return Dh(this.element,this.startNode,this.startOffset)||Jh.findCenter(this.element)},ef.prototype._calculateAbsoluteEndPoint=function(){return Dh(this.element,this.endNode,this.endOffset)||Jh.findCenter(this.element)},ef.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Qh.selectByNodesAndOffsets(t,e,!0))},ef);function ef(t,e,n){var i=$h.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 nf=y.Promise,of=y.utils.extend,rf=y.utils.browser,sf=y.eventSandbox.eventSimulator,lf=y.eventSandbox.elementEditingWatcher,af=E.domUtils,uf=E.promiseUtils,cf=E.contentEditable,hf=E.textSelection,ff=E.delay,df=E.KEY_MAPS.specialKeys,mf=(pf.findTextEditableChild=function(t){var e=null;if(!af.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(af.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},pf.prototype._calculateEventArguments=function(t){var e=af.getActiveElement(),n=af.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=pf.findTextEditableChild(e)||e);var o=of({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),of(o,yc(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},pf.prototype._calculateTargetElement=function(){var t=af.getActiveElement(),e=af.isContentEditableElement(this.element);if(e){if(t!==cf.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},pf.prototype._click=function(t){var e,n=this,i=af.getActiveElement(),o=af.isTextEditableElementAndEditingAllowed(this.element),r=af.isContentEditableElement(this.element);if(i===this.element)return o&&lf.watchElementEditing(this.element),(o||r)&&(e=hf.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||hf.select(this.element,this.caretPos,this.caretPos)),nf.resolve();var s=Ot(this.element),l=s.offsetX,a=s.offsetY,u=new Ur({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new ka(this.element,u,Pf,al).run(t).then(function(){return ff(n.automationSettings.mouseActionStepDelay)})},pf.prototype._type=function(){var t=this;if(this.eventState.skipType)return nf.resolve();var e=af.isContentEditableElement(this.element);if(this.replace&&(af.isTextEditableElementAndEditingAllowed(this.element)?hf.select(this.element):e&&hf.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 uf.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},pf.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},pf.prototype._getCurrentKey=function(t,e){return t===df.enter?"Enter":e},pf.prototype._calculateCDPEventSequence=function(){for(var t=[],e=0,n=this.typingText;e<n.length;e++){var i=n[e],o=Sc(i),r=this._getCurrentKey(o,i),s=wc(r),l=of({key:r},s);t.push(_l.keyDown(l),_l.keyUp(l),_l.delay(this.automationSettings.keyActionStepDelay))}return t},pf.prototype._canUseNativeAutomationInput=function(){return!!this.nativeAutomationInput&&!(!af.isTextEditableElement(this.element)&&af.isInputElement(this.element)||af.isContentEditableElement(this.element))},pf.prototype._performTypingStep=function(){return this._keydown(),this._keypress(),this._keyup()},pf.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=Sc(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this._getCurrentKey(this.currentKeyCode,t),this.currentKeyIdentifier=bc(this.currentKey),this.ignoreChangeEvent=af.getElementValue(this.element)===lf.getElementSavedValue(this.element),this._performTypingStep()},pf.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=sf.keydown(this.eventArgs.element,this.eventArgs.options)},pf.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=rf.isAndroid||sf.keypress(this.eventArgs.element,this.eventArgs.options))},pf.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=af.isTextEditableElement(this.element),i=af.isContentEditableElement(this.element),o=this.paste||!n&&!i;return nf.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){sf.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},pf.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&lf.restartWatchingElementEditing(t),ff(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(af.isInputElement(t)&&"number"===t.type){var o=hf.getSelectionStart(t),r=af.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return ff(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return oc(t,e,null),ff(this.automationSettings.keyActionStepDelay)},pf.prototype._typeAllText=function(t){return oc(t,this.typingText,this.caretPos),ff(this.automationSettings.keyActionStepDelay)},pf.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},pf);function pf(t,e,n,i){this.element=pf.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 _o(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 xl(i):null}var vf=(gf.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)}})},gf);function gf(t,e,n){this.element=t,this.paths=e,this.createError=n}var yf=E.domUtils,Ef=E.contentEditable,bf={};bf.DispatchEvent=t,bf.SetScroll=Ol,bf.ScrollIntoView=Fl,bf.Click=ka,bf.SelectChildClick=nu,bf.DblClick=hu,bf.DragToOffset=Nu,bf.DragToElement=Ku,bf.Hover=Yu,bf.Press=sh,bf.RClick=vh,bf.SelectText=zh,bf.SelectEditableContent=tf,bf.Type=mf,bf.Upload=vf,bf.MouseOptions=Mr,bf.ClickOptions=Ur,bf.TypeOptions=Wr,bf.AutomationSettings=_o,bf.getOffsetOptions=Nt,bf.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=yf.isTextEditableElement(t),m=d?0:Ef.getFirstVisiblePosition(t),p=d?yf.getElementValue(t).length:Ef.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=yf.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:yf.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:yf.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},bf.cursor=al,bf.getNextFocusableElement=gc,bf.SHORTCUT_TYPE=Mc,bf.getSelectionCoordinatesByPosition=Mh,bf.getElementFromPoint=Vt,bf.MoveAutomation=Js;var Sf=y.nativeMethods,wf=y.EVENTS.evalIframeScript;Sf.objectDefineProperty(Pf,"%testCafeAutomation%",{configurable:!0,value:bf}),y.on(wf,function(t){return _f(Sf.contentWindowGetter.call(t.iframe))})}(Pf["%hammerhead%"],Pf["%hammerhead%"].Promise,Pf["%testCafeCore%"],Pf["%testCafeUI%"])}(window);
1
+ window["%hammerhead%"].utils.removeInjectedScript(),function Af(Cf){var Tf=Cf.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:Cf,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 Cf[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)}var _=function(){return(_=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function P(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 x(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 A=(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 T(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)}}T("filter"),T("map"),T("slice"),T("splice"),T("unshift"),T("forEach"),T("indexOf");var M=T("some"),D=(T("reverse"),T("reduce"),T("concat"),T("join"),T("every"),y.utils.browser,y.nativeMethods),I=(y.utils.style.get,y.utils.dom.getActiveElement,y.utils.dom.findDocument),U=y.utils.dom.find,k=(y.utils.dom.isElementInDocument,y.utils.dom.isElementInIframe),O=y.utils.dom.getIframeByElement,N=(y.utils.dom.isCrossDomainWindows,y.utils.dom.getSelectParent,y.utils.dom.getChildVisibleIndex,y.utils.dom.getSelectVisibleChildren,y.utils.dom.isElementNode),B=(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),F=(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),L=y.utils.dom.isBodyElement,K=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),R=y.utils.dom.getMapContainer,Y=y.utils.dom.getTagName,W=y.utils.dom.closest,X=y.utils.dom.getParents,H=y.utils.dom.findParent;function q(t,e){return t.contains?t.contains(e):M(t,function(t){return t.contains(e)})}function G(t){var e=[];U(Tf,"*",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(D.contentWindowGetter.call(e[n])===t)return e[n];return null}function z(t){return D.nodeTextContentGetter.call(t)}y.utils.dom.getTopSameDomainWindow,y.utils.dom.getParentExceptShadowRoot;var j=($.create=function(t){return new $(t.top,t.right,t.bottom,t.left)},$.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},$.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},$.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},$.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},$);function $(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 Q=y.utils.style,Z=y.utils.style.getBordersWidth,J=(y.utils.style.getComputedStyle,y.utils.style.getElementMargin,y.utils.style.getElementPadding),tt=y.utils.style.getElementScroll,et=(y.utils.style.getOptionHeight,y.utils.style.getSelectElementSize,y.utils.style.isElementVisible,y.utils.style.isVisibleChild,y.utils.style.getWidth),nt=y.utils.style.getHeight,it=y.utils.style.getInnerWidth,ot=y.utils.style.getInnerHeight,rt=y.utils.style.getScrollLeft,st=y.utils.style.getScrollTop,lt=y.utils.style.setScrollLeft,at=y.utils.style.setScrollTop,ut=y.utils.style.get,ct=y.utils.style.getBordersWidthFloat,ht=y.utils.style.getElementPaddingFloat;function ft(t){return N(t)&&"fixed"===Q.get(t,"position")}y.shadowUI,y.nativeMethods;var dt=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},mt={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 ")}},pt=y.utils.html,vt=y.nativeMethods,gt=10;function yt(t){if(!t)return"";var e,n,i,o=vt.cloneNode.call(t),r=pt.cleanUpHtml(vt.elementOuterHTMLGetter.call(o)),s=(e=vt.nodeTextContentGetter.call(t),n=gt,void 0===i&&(i="..."),e.length<n?e:e.substring(0,n-i.length)+i),l=vt.elementChildrenGetter.call(t);return 0<vt.htmlCollectionLengthGetter.call(l)?r.replace("></",">...</"):s?r.replace("></",">".concat(s,"</")):r}var Et=y.utils.position.getElementRectangle,bt=y.utils.position.getOffsetPosition,St=y.utils.position.offsetToClientCoords;function wt(t){var e,n,i,o,r=K(t),s=r?t.getElementsByTagName("body")[0]:null,l=t.getBoundingClientRect(),a=j.create(Z(t)),u=tt(t),c=k(t),h="BackCompat"===t.ownerDocument.compatMode,f=r?new A(0,0):A.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=bt(e),i=St(A.create(n)),o=Z(e),f.add(i).add(A.create(o)),r&&a.add(o));var p=!r&&it(t)!==t.clientWidth,v=!r&&ot(t)!==t.clientHeight,g={right:p?V():0,bottom:v?V():0};return new dt(m,d,f,a,u,g)}function _t(t){var e=t.x,n=t.y,i=Tf.getElementFromPoint||Tf.elementFromPoint,o=null;try{o=i.call(Tf,e,n)}catch(t){return null}for(null===o&&(o=i.call(Tf,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 Pt(t,e,n){var i=wt(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 xt(t){var e=bt(t),n=e.left,i=e.top,o=St({x:n,y:i});return o.x=Math.round(o.x),o.y=Math.round(o.y),o}function At(n,e){return m.Promise.resolve(n===Tf.documentElement).then(function(t){if(t)return new A(0,0);var e=m.utils.browser.isFirefox?Math.ceil:Math.round;return m.Promise.resolve(bt(n,e)).then(function(t){return A.create(t)})}).then(function(t){return t.add(e)})}var Ct=/auto|scroll|hidden/i,Tt="visible";function Mt(t){var e,n=ut(t,"overflowX"),i=ut(t,"overflowY"),o=Ct.test(n),r=Ct.test(i),s=I(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 Dt(t){if(L(t))return Mt(t);if(K(t))return function(t){var e=ut(t,"overflowX"),n=ut(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(Mt(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=ut(e=t,"overflowX"),i=ut(e,"overflowY"),o=Ct.test(n),r=Ct.test(i),m.utils.browser.isIE&&(o=o||r&&n===Tt,r=r||o&&i===Tt),new A(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 It(i,o){return P(this,void 0,void 0,function(){var e,n;return x(this,function(t){switch(t.label){case 0:return[4,tt(i)];case 1:return e=t.sent(),n=Dt(i),!/html/i.test(i.tagName)&&n&&(o.x-=e.left,o.y-=e.top),[2,St(o)]}})})}function Ut(t){if(!t)return null;var e,n,i=(e=Cf.screenLeft||Cf.screenX,n=Cf.screenTop||Cf.screenY,new A(e,n)),o=i.x,r=i.y,s=o+t.x,l=r+t.y;return new A(s,l)}function kt(t){var e=t/2;return e<1?0:Math.round(e)}function Ot(t){var e=Et(t);return{offsetX:kt(e.width),offsetY:kt(e.height)}}function Nt(t,e,n){var i=Ot(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=wt(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 Bt=E.positionUtils;function Ft(e,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var t=Bt.getElementFromPoint(e);return i.show(n).then(function(){return t})})}function Lt(t,n){return m.Promise.resolve(_t(t)).then(function(e){return m.Promise.resolve(q(n,e)).then(function(t){return t&&z(e)}).then(function(t){return t||e&&e===n?e:null})})}function Kt(n,i){if(!i||!n||n===i)return n;if("tref"===Y(i))return i;var e,o,t="area"===Y(i)&&B(n);return m.utils.browser.isFirefox&&t?(e=n,o=i,m.Promise.resolve(W(o,"map")).then(function(t){return t&&t.name===e.useMap.substring(1)?o:e})):m.Promise.resolve(W(i,"a")).then(function(t){return!!t}).then(function(t){return!!t&&m.Promise.resolve(q(i,n)).then(function(t){return t&&z(n)}).then(function(t){return!t&&z(i)})}).then(function(t){return t?m.Promise.resolve(wt(i)).then(function(e){return Lt({x:e.right-1,y:e.top+1},i).then(function(t){return t||Lt({x:e.left+1,y:e.bottom-1},i)}).then(function(t){return t||n})}):n})}function Vt(n,i,o){return Ft(n).then(function(t){var e=m.Promise.resolve(t);return!t&&m.utils.dom.isIframeWindow(i||Cf)&&0<n.x&&0<n.y&&(e=e.then(function(){return Ft(n,!0)})),e.then(function(t){return Kt(t,o)})})}function Rt(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var Yt,Wt,Xt,Ht="E1",qt="E4",Gt="E5",zt="E9",jt="E10",$t="E11",Qt="E12",Zt="E24",Jt="E26",te="E27",ee="E28",ne="E29",ie="E30",oe="E31",re="E32",se="E33",le="E34",ae="E35",ue="E36",ce="E37",he="E39",fe="E40",de="E41",me="E42",pe="E43",ve="E44",ge="E45",ye="E46",Ee="E49",be="E50",Se="E51",we="E52",_e="E57",Pe="E64",xe="E65",Ae="E68",Ce="E69",Te="E70",Me="E71",De="E72",Ie="E73",Ue="E74",ke="E76",Oe="E77",Ne="E78",Be="E82",Fe="E83",Le="E90",Ke="E91",Ve="E92",Re="E93",Ye="E94",We="E95",Xe="E97",He="E99",qe="E100",Ge="E101",ze="E102",je=(w($e,Yt=Rt),$e);function $e(t,e,n){var i=Yt.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function Qe(t,e){var n=Wt.call(this,Ee,e)||this;return n.instantiationCallsiteName=t,n}function Ze(t,e){var n=Xt.call(this,be,e)||this;return n.instantiationCallsiteName=t,n}w(Qe,Wt=Rt),w(Ze,Xt=Rt);var Je,tn,en,nn,on,rn,sn,ln,an=(w(un,Je=Rt),un);function un(t,e,n){var i=void 0===e?{}:e,o=i.apiFnChain,r=i.apiFnIndex,s=i.reason,l=Je.call(this,t,n)||this;return l.apiFnChain=o,l.apiFnIndex=r,l.reason=s,l}function cn(t){return tn.call(this,Se,t)||this}function hn(t,e){return en.call(this,we,e,t)||this}function fn(t,e){var n=nn.call(this,Ht)||this;return n.errStack=t,n.pageDestUrl=e,n}function dn(t,e,n){var i=on.call(this,qt,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}function mn(t,e,n,i){var o=rn.call(this,Gt,i)||this;return o.errMsg=String(e),o.property=n,o.instantiationCallsiteName=t,o}function pn(t){var e=sn.call(this,Pe)||this;return e.errMsg=String(t),e}function vn(t,e){var n=ln.call(this,xe)||this;return n.errMsg=String(t),n.moduleName=e,n}w(cn,tn=Rt),w(hn,en=an),w(fn,nn=Rt),w(dn,on=Rt),w(mn,rn=Rt),w(pn,sn=Rt),w(vn,ln=Rt);var gn,yn=(w(En,gn=je),En);function En(t,e){return gn.call(this,zt,t,e)||this}var bn,Sn=(w(wn,bn=je),wn);function wn(t,e){return bn.call(this,jt,t,e)||this}var _n,Pn=(w(xn,_n=je),xn);function xn(t,e){return _n.call(this,$t,t,e)||this}var An,Cn=(w(Tn,An=je),Tn);function Tn(t,e){return An.call(this,Qt,t,e)||this}var Mn,Dn=(w(In,Mn=je),In);function In(t,e){return Mn.call(this,Le,t,e)||this}var Un,kn=(w(On,Un=je),On);function On(t,e){return Un.call(this,Xe,t,e)||this}var Nn,Bn=(w(Fn,Nn=je),Fn);function Fn(t,e){return Nn.call(this,Ke,t,e)||this}var Ln,Kn=(w(Vn,Ln=je),Vn);function Vn(t,e){return Ln.call(this,Ve,t,e)||this}var Rn,Yn=(w(Wn,Rn=je),Wn);function Wn(t,e){return Rn.call(this,Re,t,e)||this}var Xn,Hn=(w(qn,Xn=je),qn);function qn(t,e){return Xn.call(this,Ye,t,e)||this}var Gn,zn=(w(jn,Gn=je),jn);function jn(t,e){return Gn.call(this,We,t,e)||this}var $n,Qn=(w(Zn,$n=je),Zn);function Zn(t,e){return $n.call(this,He,t,e)||this}var Jn,ti,ei=(w(ni,Jn=Rt),ni);function ni(t,e,n){var i=Jn.call(this,qe)||this;return i.objectName=t,i.propertyName=e,i.availableProperties=n,i}function ii(t,e){return ti.call(this,Zt,e,t)||this}w(ii,ti=an);var oi,ri,si,li=(w(ai,oi=an),ai);function ai(t,e){return oi.call(this,Jt,e,t)||this}function ui(t){var e=ri.call(this,te)||this;return e.nodeDescription=t,e}function ci(t,e){var n=si.call(this,ee,e)||this;return n.argumentName=t,n}w(ui,ri=Rt),w(ci,si=an);var 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,Ki,Vi,Ri,Yi,Wi=(w(Xi,hi=Rt),Xi);function Xi(t){return hi.call(this,Ge,t)||this}function Hi(t,e){var n=fi.call(this,ne,e)||this;return n.argumentName=t,n}function qi(t,e){var n=di.call(this,ie)||this;return n.argumentName=t,n.nodeDescription=e,n}function Gi(){return mi.call(this,oe)||this}function zi(){return pi.call(this,re)||this}function ji(t){var e=vi.call(this,se)||this;return e.argumentName=t,e}function $i(){return gi.call(this,ae)||this}function Qi(t){var e=yi.call(this,ue)||this;return e.argumentName=t,e}function Zi(t,e){var n=Ei.call(this,ce)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function Ji(){return bi.call(this,le)||this}function to(t,e){var n=Si.call(this,de)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function eo(t,e){var n=wi.call(this,_e)||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 no(t){return _i.call(this,fe,t)||this}function io(){return Pi.call(this,he)||this}function oo(){return xi.call(this,me)||this}function ro(){return Ai.call(this,Ce)||this}function so(){return Ci.call(this,Ae)||this}function lo(){return Ti.call(this,Te)||this}function ao(){return Mi.call(this,Me)||this}function uo(){return Di.call(this,Ie)||this}function co(){return Ii.call(this,Be)||this}function ho(t){var e=Ui.call(this,Ne)||this;return e.errMsg=t,e}function fo(){return ki.call(this,Ue)||this}function mo(){return Oi.call(this,ke)||this}function po(){return Ni.call(this,Oe)||this}function vo(){return Bi.call(this,De)||this}function go(){return Fi.call(this,Fe)||this}function yo(){return Li.call(this,pe)||this}function Eo(){return Ki.call(this,ve)||this}function bo(t,e){var n=Vi.call(this,ge)||this;return n.dialogType=t,n.pageUrl=e,n}function So(t,e,n){var i=Ri.call(this,ye)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}function wo(){return Yi.call(this,ze)||this}w(Hi,fi=an),w(qi,di=Rt),w(Gi,mi=Rt),w(zi,pi=Rt),w(ji,vi=Rt),w($i,gi=Rt),w(Qi,yi=Rt),w(Zi,Ei=Rt),w(Ji,bi=Rt),w(to,Si=Rt),w(eo,wi=Rt),w(no,_i=Rt),w(io,Pi=Rt),w(oo,xi=Rt),w(ro,Ai=Rt),w(so,Ci=Rt),w(lo,Ti=Rt),w(ao,Mi=Rt),w(uo,Di=Rt),w(co,Ii=Rt),w(ho,Ui=Rt),w(fo,ki=Rt),w(mo,Oi=Rt),w(po,Ni=Rt),w(vo,Bi=Rt),w(go,Fi=Rt),w(yo,Li=Rt),w(Eo,Ki=Rt),w(bo,Vi=Rt),w(So,Ri=Rt),w(wo,Yi=Rt);var _o=(Object.defineProperty(Po.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Po.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Po.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(Po.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),Po);function Po(t){this._speedFactor=t||1}var xo=y.Promise,Ao=y.nativeMethods;function Co(e){return new xo(function(t){return Ao.setTimeout.call(Cf,t,e)})}function To(){return Co(0)}var Mo=Object.prototype.toString,Do=String.prototype.indexOf,Io=String.prototype.endsWith||function(t,e){var n=Mo.call(this);(void 0===e||e>n.length)&&(e=n.length),e-=t.length;var i=Do.call(n,t,e);return-1!==i&&i===e},Uo=Array.prototype.indexOf,ko=Array.prototype.map,Oo=Array.prototype.sort,No=Array.prototype.filter,Bo=Array.prototype.concat,Fo="Command",Lo=(Ko.prototype.getAssignableProperties=function(){return[]},Ko.prototype.getAllAssignableProperties=function(){for(var t=Object.getPrototypeOf(this),e=[];t&&t.getAssignableProperties;)e=Bo.call(e,t.getAssignableProperties()),t=Object.getPrototypeOf(t);return e},Ko.prototype.getNonReportedProperties=function(){return[]},Ko.prototype.getReportedProperties=function(){var t=ko.call(this.getAllAssignableProperties(),function(t){return t.name}),e=this.getNonReportedProperties();return No.call(t,function(t){return!(-1<Uo.call(e,t))})},Ko.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t){e&&function(t,e){var n,i=e.constructor.name,o=ko.call(e.getAllAssignableProperties(),function(t){return t.name}),r=Oo.call(e.getReportedProperties());for(n in t)if(!(-1<Uo.call(o,n)||n in e))throw new ei(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,Io.call(i,Fo)?o:"".concat(i,".").concat(o)),d),this[a]=h?h(a,d,n,e):d)}}},Ko);function Ko(){}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 Ro,Yo,Wo,Xo,Ho,qo,Go,zo,jo,$o,Qo,Zo,Jo,tr=Vo(yn),er=(Yo=Vo(Ro=Sn),function(t,e){if(Yo(t,e),e<0)throw new Ro(t,e)}),nr=(Wo=Pn,function(t,e){var n=typeof e;if("boolean"!=n)throw new Wo(t,n)}),ir=(Xo=Cn,function(t,e){var n=typeof e;if("number"!=n)throw new Xo(t,n);if(isNaN(e)||e<.01||1<e)throw new Xo(t,e)}),or=(Ho=Dn,function(t,e){var n=typeof e;if("string"!=n)throw new Ho(t,n)}),rr=(qo=kn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new qo(t,n)}),sr=(Go=Bn,function(t,e){if(!(e instanceof Date))throw new Go(t,e)}),lr=(zo=Kn,function(t,e){if(isNaN(Number(e)))throw new zo(t,typeof e)}),ar=(jo=Yn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new jo(t,n)}),ur=($o=Hn,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new $o(t,n)}),cr=(Qo=zn,function(t,e){var n=typeof e;if("object"!=n)throw new Qo(t,n)}),hr=(Zo=Qn,function(t,e){var n=typeof e;if("function"!=n)throw new Zo(t,n)}),fr=(w(dr,Jo=Lo),dr.prototype.getAssignableProperties=function(){return[{name:"speed",type:ir}]},dr);function dr(t,e){var n=Jo.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var mr,pr=(w(vr,mr=fr),vr.prototype.getAssignableProperties=function(){return[{name:"offsetX",type:tr},{name:"offsetY",type:tr},{name:"isDefaultOffset",type:nr}]},vr);function vr(t,e){var n=mr.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var gr,yr=(w(Er,gr=pr),Er.prototype.getAssignableProperties=function(){return[{name:"scrollToCenter",type:nr},{name:"skipParentFrames",type:nr}]},Er);function Er(t,e){var n=gr.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var br,Sr,wr=(w(_r,br=Lo),_r.prototype.getAssignableProperties=function(){return[{name:"left",type:tr,defaultValue:null},{name:"right",type:tr,defaultValue:null},{name:"top",type:tr,defaultValue:null},{name:"bottom",type:tr,defaultValue:null}]},_r);function _r(t,e){var n=br.call(this)||this;return n._assignFrom(t,e),n}function Pr(t,e){var n=Sr.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(Pr,Sr=fr),Pr.prototype.getAssignableProperties=function(){return[{name:"scrollTargetX",type:tr},{name:"scrollTargetY",type:tr},{name:"crop",type:cr,init:fs},{name:"includeMargins",type:nr},{name:"includeBorders",type:nr},{name:"includePaddings",type:nr}]};var xr,Ar=(w(Cr,xr=Lo),Cr.prototype.getAssignableProperties=function(){return[{name:"ctrl",type:nr,defaultValue:!1},{name:"alt",type:nr,defaultValue:!1},{name:"shift",type:nr,defaultValue:!1},{name:"meta",type:nr,defaultValue:!1}]},Cr);function Cr(t,e){var n=xr.call(this)||this;return n._assignFrom(t,e),n}var Tr,Mr=(w(Dr,Tr=pr),Dr.prototype.getAssignableProperties=function(){return[{name:"modifiers",type:cr,init:ds}]},Dr);function Dr(t,e){var n=Tr.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Ir,Ur=(w(kr,Ir=Mr),kr.prototype.getAssignableProperties=function(){return[{name:"caretPos",type:er}]},kr);function kr(t,e){var n=Ir.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var Or,Nr=(w(Br,Or=Mr),Br.prototype.getAssignableProperties=function(){return[{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:nr},{name:"skipDefaultDragBehavior",type:nr}]},Br);function Br(t,e){var n=Or.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 Fr,Lr,Kr,Vr,Rr,Yr,Wr=(w(Xr,Fr=Ur),Xr.prototype.getAssignableProperties=function(){return[{name:"replace",type:nr},{name:"paste",type:nr},{name:"confidential",type:nr}]},Xr);function Xr(t,e){var n=Fr.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function Hr(t,e){var n=Lr.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function qr(t,e){var n=Kr.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Gr(t,e){var n=Vr.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function zr(t,e){var n=Rr.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function jr(t,e){var n=Yr.call(this)||this;return n._assignFrom(t,e),n}w(Hr,Lr=Mr),Hr.prototype.getAssignableProperties=function(){return[{name:"destinationOffsetX",type:tr},{name:"destinationOffsetY",type:tr}]},w(qr,Kr=Lo),qr.prototype.getAssignableProperties=function(){return[{name:"portraitOrientation",type:nr}]},w(Gr,Vr=Lo),Gr.prototype.getAssignableProperties=function(){return[{name:"timeout",type:er},{name:"allowUnawaitedPromise",type:nr}]},w(zr,Rr=fr),zr.prototype.getAssignableProperties=function(){return[{name:"confidential",type:nr}]},w(jr,Yr=Lo),jr.prototype.getAssignableProperties=function(){return[{name:"name",type:or},{name:"value",type:or},{name:"domain",type:or},{name:"path",type:or},{name:"expires",type:sr},{name:"maxAge",type:lr},{name:"secure",type:nr},{name:"httpOnly",type:nr},{name:"sameSite",type:or}]};var $r,Qr=(w(Zr,$r=Lo),Zr.prototype.getAssignableProperties=function(){return[{name:"username",type:or,required:!0},{name:"password",type:or}]},Zr);function Zr(t,e){var n=$r.call(this)||this;return n._assignFrom(t,e),n}var Jr,ts,es,ns,is,os=(w(rs,Jr=Lo),rs.prototype.getAssignableProperties=function(){return[{name:"protocol",type:or},{name:"host",type:or,required:!0},{name:"port",type:lr,required:!0},{name:"auth",type:cr,init:cs}]},rs);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){var n=is.call(this)||this;return n._assignFrom(t,e),n}function cs(t,e,n,i){return void 0===i&&(i=!0),new Qr(e,i)}function hs(t,e,n,i){return void 0===i&&(i=!0),new os(e,i)}function fs(t,e,n,i){return void 0===i&&(i=!0),new wr(e,i)}function ds(t,e,n,i){return void 0===i&&(i=!0),new Ar(e,i)}w(ss,ts=Lo),ss.prototype.getAssignableProperties=function(){return[{name:"url",type:ar},{name:"method",type:or},{name:"headers",type:cr},{name:"params",type:ur},{name:"body"},{name:"timeout",type:lr},{name:"withCredentials",type:nr},{name:"auth",type:cr,init:cs},{name:"proxy",type:cr,init:hs},{name:"rawResponse",type:nr}]},w(ls,es=Lo),ls.prototype.getAssignableProperties=function(){return[{name:"credentials",type:lr}]},w(as,ns=Lo),as.prototype.getAssignableProperties=function(){return[{name:"stack",type:rr,required:!1},{name:"message",type:rr,required:!1},{name:"pageUrl",type:rr,required:!1}]},w(us,is=Lo),us.prototype.getAssignableProperties=function(){return[{name:"fn",type:hr,required:!0},{name:"dependencies",type:cr,required:!1}]};var ms=null,ps=function(){return ms},vs=function(t){ms=t},gs=(y.Promise,y.nativeMethods,y.eventSandbox.listeners,y.utils.browser,y.utils.event.BUTTON,y.utils.event.BUTTONS_PARAMETER);function ys(t){return t.top!==t}y.utils.event.DOM_EVENTS,y.utils.event.WHICH_PARAMETER,y.utils.event.preventDefault;var Es=y.Promise,bs=y.eventSandbox.message;function Ss(t,i,e){return new Es(function(n){bs.on(bs.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(bs.off(bs.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),bs.sendServiceMsg(t,e)})}var ws=(_s.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},_s.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)})},_s.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=m.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},_s.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},_s.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])}},_s);function _s(){this._eventsListeners={}}var Ps=ws,xs=m.eventSandbox.listeners;function As(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new Ps}var Cs=(As.prototype._internalListener=function(t,e,n,i,o){this.events.emit("scroll",t),this.stopPropagationFlag&&(i(),o())},As.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,xs.initElementListening(Cf,["scroll"]),xs.addFirstInternalEventBeforeListener(Cf,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n._internalListener.apply(n,t)}))},As.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},As.prototype.handleScrollEvents=function(n,t){var e,i=this;this.events.once("scroll",t),(e=n)&&e.getRootNode&&I(e)!==e.getRootNode()&&(xs.initElementListening(n,["scroll"]),xs.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i._internalListener.apply(i,t),xs.cancelElementListening(n)}))},As.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},As.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new As),Ts=(Ms._isScrollValuesChanged=function(t,e){return rt(t)!==e.left||st(t)!==e.top},Ms.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=K(t)?I(t):t,s={left:rt(r),top:st(r)},i=Math.max(i,0),o=Math.max(o,0),l=Cs.waitForScroll(r);return lt(r,i),at(r,o),Ms._isScrollValuesChanged(r,s)?l=l.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=Ms._isScrollValuesChanged(r,s))}):(l.cancel(),m.Promise.resolve())},Ms.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}},Ms.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,j.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},Ms._getChildPoint=function(t,e,n){return A.create(e).sub(A.create(t)).add(A.create(t.scroll)).add(A.create(e.border)).add(n)},Ms.prototype._getScrollPosition=function(t,e,n,i){var o=Ms._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)}},Ms._getChildPointAfterScroll=function(t,e,n,i){return A.create(e).add(A.create(t.scroll)).sub(A.create(n)).add(i)},Ms.prototype._isChildFullyVisible=function(t,e,n){var i=Ms._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},Ms.prototype._scrollToChild=function(t,e,n){for(var i=wt(t),o=wt(e),r=it(Cf),s=ot(Cf),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this._maxScrollMargin);var u=Ms._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)},Ms.prototype._scrollElement=function(){if(!Dt(this._element))return m.Promise.resolve();var t=wt(this._element),e=this._getScrollToPoint(t,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,e)},Ms.prototype._scrollParents=function(){var t,e,n,i,o,r,s=this,l=(t=this._element,i=X(t),!k(t)||(e=O(t))&&(n=X(e),i.concat(n)),m.nativeMethods.arrayFilter.call(i,Dt)),a=this._element,u=rt(a),c=st(a),h=A.create(this._offsets).sub(new A(u,c).round()),f=function(n,i){return P(this,void 0,void 0,function(){var e;return x(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=wt(a),r=wt(l[t]),h.add(A.create(o)).sub(A.create(r)).add(A.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&&ys(Cf))return d.cmd=Ms.SCROLL_REQUEST_CMD,Ss(d,Ms.SCROLL_RESPONSE_CMD,Cf.parent)}).then(function(){return s._scrollWasPerformed})},Ms._getFixedAncestorOrSelf=function(t){return H(t,!0,ft)},Ms.prototype._isTargetElementObscuredInPoint=function(t){var e=_t(t);if(!e)return!1;var n=Ms._getFixedAncestorOrSelf(e);return!!n&&!n.contains(this._element)},Ms.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()})},Ms.SCROLL_REQUEST_CMD="automation|scroll|request",Ms.SCROLL_RESPONSE_CMD="automation|scroll|response",Ms);function Ms(t,e,n){this._element=t,this._offsets=new A(e.offsetX,e.offsetY),this._scrollToCenter=!!e.scrollToCenter,this._skipParentFrames=!!e.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}var Ds=y.utils.browser,Is=(Us.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Us.prototype.leaveElement=function(){},Us.prototype.move=function(){},Us.prototype.enterElement=function(){},Us.prototype.dragAndDrop=function(){},Us.prototype.teardown=function(){},Us.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),Ds.isIE&&this.move(t,n),l&&g.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Ds.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}},Us);function Us(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var ks=y.eventSandbox.eventSimulator,Os=y.utils.extend,Ns=y.nativeMethods,Bs=(Fs.leaveElement=function(t,e,n,i){ks.mouseout(e,Os({relatedTarget:t},i));for(var o=e;o&&o!==n;)ks.mouseleave(o,Os({relatedTarget:t},i)),o=Ns.nodeParentNodeGetter.call(o)},Fs.enterElement=function(t,e,n,i){ks.mouseover(t,Os({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--)ks.mouseenter(r[s],Os({relatedTarget:e},i))},Fs.move=function(t,e,n){ks[t](e,n)},Fs);function Fs(){}var Ls=(Ks.dragAndDrop=function(t,e,n,i){return ks.drag(t,i),e!==n&&(g.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,ks.dragenter(e,i)),n&&(i.relatedTarget=e,ks.dragleave(n,i))),!ks.dragover(e,i)},Ks);function Ks(){}var Vs,Rs=y.eventSandbox.eventSimulator,Ys=(w(Ws,Vs=Is),Ws.prototype.leaveElement=function(t,e,n,i){Bs.leaveElement(t,e,n,i)},Ws.prototype.enterElement=function(t,e,n,i){Bs.enterElement(t,e,n,i)},Ws.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Bs.move(this.moveEvent,t,e)},Ws.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(t)&&t!==n&&Rs[this.moveEvent](t,e)},Ws.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},Ws);function Ws(t){var e=Vs.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Xs,Hs=(w(qs,Xs=Is),qs.prototype.setup=function(){Xs.prototype.setup.call(this),this.dragAndDropMode=!0},qs.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Ls.dragAndDrop(t,e,n,i)},qs);function qs(){return null!==Xs&&Xs.apply(this,arguments)||this}var Gs,zs=y.eventSandbox.eventSimulator,js=(w($s,Gs=Is),$s.prototype.setup=function(){Gs.prototype.setup.call(this),this.dragAndDropMode=!0},$s.prototype.leaveElement=function(t,e,n,i){Bs.leaveElement(t,e,n,i)},$s.prototype.move=function(t,e){Bs.move(this.moveEvent,t,e)},$s.prototype.enterElement=function(t,e,n,i){Bs.enterElement(t,e,n,i)},$s.prototype.dragAndDrop=function(t,e,n,i,o){var r=zs.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Ls.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},$s.prototype.run=function(t,e,n,i,o){return Gs.prototype.run.call(this,t,null,n,i,o)},$s);function $s(){return null!==Gs&&Gs.apply(this,arguments)||this}function Qs(t,e,n){return new(t?e?Hs:js:Ys)(n)}function Zs(a,u,c){return P(this,void 0,void 0,function(){var e,n,i,o,r,s,l;return x(this,function(t){switch(t.label){case 0:e=!0,n=A.create(a.startPoint),i=A.create(a.endPoint).round(Math.floor),o=A.create(a.startPoint).round(Math.floor),r=A.create(a.startPoint),s=u(),t.label=1;case 1:return o.eql(i)?[3,4]:(r=A.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=A.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 Js=(tl.create=function(o,r,s,l,a){return void 0===a&&(a=null),P(this,void 0,m.Promise,function(){var e,n,i;return x(this,function(t){switch(t.label){case 0:return[4,tl.getTarget(o,s,new A(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new tl(n,i,r,s,l,a)]}})})},tl.getTarget=function(e,n,i){return m.Promise.resolve(Pt(e,i.x,i.y)).then(function(t){return t?{element:e,offset:i}:m.Promise.all([At(e,i),n.document.documentElement]).then(function(t){var e=t[0];return{element:t[1],offset:e}})})},tl.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},tl.prototype._getTargetClientPoint=function(){var o=this;return m.Promise.resolve(tt(this.element)).then(function(i){return K(o.element)?A.create(o.offset).sub(A.create(i)).round(Math.round):m.Promise.resolve(xt(o.element)).then(function(t){var e=L(o.element),n=A.create(t).add(o.offset);return e||n.sub(A.create(i)),n.round(Math.floor)})})},tl.prototype._getEventSequenceOptions=function(t){var e=gs.noButton,n=Ut(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}}},tl.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions;return Qs(!1,this.firstMovingStepOccured,i).run(t,ps(),n,null,null)},tl.prototype._emulateEvents=function(t,e){var n=this._getEventSequenceOptions(e);this._runEventSequence(t,n),this.firstMovingStepOccured=!0,vs(t)},tl.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return Ft(i.cursor.getPosition())}).then(function(t){var e=i._getCorrectedTopElement(t);return e?i._emulateEvents(e,n):null}).then(To)},tl.prototype._getCorrectedTopElement=function(t){return t},tl.prototype._move=function(l){return P(this,void 0,m.Promise,function(){var e,n,i,o,r,s=this;return x(this,function(t){switch(t.label){case 0:return e=this.cursor.getPosition(),n=A.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,Zs(o,m.nativeMethods.dateNow,function(i){return P(s,void 0,void 0,function(){var e,n;return x(this,function(t){switch(t.label){case 0:return[4,null===(n=this.nativeAutomationInput)||void 0===n?void 0:n.createMouseMoveEvent(i,this.modifiers)];case 1:return e=t.sent(),r.push(e),[2,To()]}})})})]):[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,Zs(o,m.nativeMethods.dateNow,function(t){return s._movingStep(t)})];case 5:t.sent(),t.label=6;case 6:return[2]}})})},tl.prototype._needMoveCursorImmediately=function(){return this.touchMode},tl.prototype._scroll=function(){if(this.skipScrolling)return m.Promise.resolve(!1);var t=new yr({offsetX:this.offset.x,offsetY:this.offset.y},!1);return new Ts(this.element,t).run()},tl.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(G(s)).then(function(t){return c=t,m.Promise.resolve((n=bt(e=t),i=n.left,o=n.top,r=St({x:i,y:o}),s=Z(e),l=J(e),a=r.x+s.left+l.left,u=r.y+s.top+l.top,new j(u,a+et(e),u+nt(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 Ft(n.cursor.getPosition())}).then(function(t){return l=t===c,s.parent===n.window&&(h.iframeUnderCursor=l),Ss(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)})},tl.prototype.run=function(){var n=this;return this._scroll().then(function(){return m.Promise.all([n._getTargetClientPoint(),(t=n.window,new j(0,et(t),nt(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)})})},tl);function tl(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 _o(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 el=(nl.prototype._ensureActiveWindow=function(t){this._activeWindow!==t&&this._activeWindow!==t.parent&&this._activeWindow.parent!==t&&(this._activeWindow=t)},nl.prototype.isActive=function(t){return this._ensureActiveWindow(t),this._activeWindow===t},nl.prototype.setActiveWindow=function(t){this._activeWindow=t},nl.prototype.getActiveWindow=function(t){return this._ensureActiveWindow(t),this._activeWindow},nl.prototype.getPosition=function(){return new A(this._x,this._y)},nl.prototype.move=function(t){return this._x=t.x,this._y=t.y,this._ui.move(t)},nl.prototype.hide=function(){return this._ui.hide?this._ui.hide():m.Promise.resolve()},nl.prototype.show=function(){return this._ui.show?this._ui.show():m.Promise.resolve()},nl.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},nl.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},nl.prototype.buttonUp=function(){return this._ui.buttonUp()},nl);function nl(t,e){this._ui=e,this._x=-1,this._y=-1,this._activeWindow=t}var il,ol,rl,sl,ll=ys(Cf)?i.iframeCursorUI:i.cursorUI,al=new el(Cf.top,ll),ul=E.positionUtils,cl=E.domUtils,hl=E.eventUtils,fl="elementOverlapped";(ol=il=il||{})[ol.Mouse=0]="Mouse",ol[ol.Keyboard=1]="Keyboard",ol[ol.Touch=2]="Touch",ol[ol.Delay=3]="Delay",ol[ol.InsertText=4]="InsertText",(sl=rl=rl||{})[sl.alt=1]="alt",sl[sl.ctrl=2]="ctrl",sl[sl.meta=4]="meta";var dl={ctrl:!(sl[sl.shift=8]="shift"),alt:!1,shift:!1,meta:!1};function ml(t){return rl[t]||0}var pl=y.utils,vl=y.eventSandbox,gl=y.nativeMethods,yl=vl.message,El={clickCount:1},bl="native-automation|calculate-top-left-point|request",Sl="native-automation|calculate-top-left-point|response";function wl(){return P(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return Cf===Cf.parent?[3,2]:[4,Ss({cmd:bl},Sl,Cf.parent)];case 1:return[2,t.sent().topLeftPoint];case 2:return[2,{x:0,y:0}]}})})}yl.on(yl.SERVICE_MSG_RECEIVED_EVENT,function(f){return P(void 0,void 0,void 0,function(){var r,s,l,a,u,c,h;return x(this,function(t){switch(t.label){case 0:return f.message.cmd!==bl?[3,2]:(r=f.source,[4,wl()]);case 1:s=t.sent(),l=s.x,a=s.y,u=G(r),n=(e=u).getBoundingClientRect(),i=ct(e),o=ht(e),c={x:n.left+i.left+o.left,y:n.top+i.top+o.top},h={cmd:Sl,topLeftPoint:{x:c.x+l,y:c.y+a}},yl.sendServiceMsg(h,r),t.label=2;case 2:return[2]}var e,n,i,o})})});var _l=(Pl._isNonCharKeyModifier=function(t){var e=[rl.ctrl,rl.alt,rl.meta];return-1<gl.arrayIndexOf.call(e,t)},Pl._getKeyDownEventText=function(t){return t.isNewLine?"\r":1!==t.keyProperty.length||Pl._isNonCharKeyModifier(t.modifiers)?"":t.keyProperty},Pl.createKeyDownOptions=function(t){var e=Pl._getKeyDownEventText(t);return{type:e?"keyDown":"rawKeyDown",modifiers:t.modifiers||0,windowsVirtualKeyCode:t.keyCode,key:t.keyProperty,commands:t.commands,text:e}},Pl.createKeyUpOptions=function(t){return{type:"keyUp",modifiers:t.modifiers||0,key:t.keyProperty,windowsVirtualKeyCode:t.keyCode}},Pl.createMouseEventOptions=function(l,a){return P(this,void 0,void 0,function(){var o,r,s;return x(this,function(t){switch(t.label){case 0:return[4,wl()];case 1:return o=t.sent(),r=o.x,s=o.y,[2,pl.extend({x:a.options.clientX+r,y:a.options.clientY+s,modifiers:(n=a.options,i=0,n&&(n.ctrl&&(i|=rl.ctrl),n.alt&&(i|=rl.alt),n.shift&&(i|=rl.shift),n.meta&&(i|=rl.meta)),i),button:(e=a.options).button?e.button:"left",type:l},El)]}var e,n,i})})},Pl.delay=function(t){return{type:il.Delay,options:{delay:t}}},Pl.keyDown=function(t){return{type:il.Keyboard,options:Pl.createKeyDownOptions(t)}},Pl.keyUp=function(t){return{type:il.Keyboard,options:Pl.createKeyUpOptions(t)}},Pl);function Pl(){}var xl=(Al.prototype.mouseDown=function(n){return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,_l.createMouseEventOptions("mousePressed",n)];case 1:return e=t.sent(),[2,this._dispatchEventFn.single(il.Mouse,e)]}})})},Al.prototype.mouseUp=function(n){return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,_l.createMouseEventOptions("mouseReleased",n)];case 1:return e=t.sent(),[2,this._dispatchEventFn.single(il.Mouse,e)]}})})},Al.prototype.keyDown=function(t){var e=_l.createKeyDownOptions(t);return this._dispatchEventFn.single(il.Keyboard,e)},Al.prototype.keyUp=function(t){var e=_l.createKeyUpOptions(t);return this._dispatchEventFn.single(il.Keyboard,e)},Al.prototype.executeEventSequence=function(t){return this._dispatchEventFn.sequence(t)},Al.prototype.executeInsertText=function(e){return P(this,void 0,void 0,function(){return x(this,function(t){return[2,this._dispatchEventFn.single(il.InsertText,{text:e})]})})},Al.prototype.createMouseMoveEvent=function(n,i){return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,_l.createMouseEventOptions("mouseMoved",{options:_({clientX:n.x,clientY:n.y,button:"none"},i)})];case 1:return e=t.sent(),[2,{type:il.Mouse,options:e}]}})})},Al);function Al(t){this._dispatchEventFn=t}var Cl=(Tl.create=function(t){var n=t.element,i=t.clientPoint,o=t.screenPoint,r=t.isTarget,s=t.inMoving;return P(this,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return e=null,i?[4,Ut(i)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,new Tl({element:n,clientPoint:i,screenPoint:o,isTarget:r,inMoving:s,devicePoint:e})]}})})},Tl);function Tl(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 Ml,Dl=(w(Il,Ml=ws),Il.prototype._ensureWindowAndCursorForLegacyTests=function(t){t.window=t.window||Cf,t.cursor=al},Il.prototype.canUseNativeAutomationEventSimulator=function(t){return!!this.nativeAutomationInput&&!!t&&"select"!==Y(t)},Il.prototype._getElementForEvent=function(n){return P(this,void 0,void 0,function(){var e;return x(this,function(t){return e=Pt(this.element,this.options.offsetX,this.options.offsetY)?this.element:null,[2,Vt(n.point,this.window,e)]})})},Il.prototype._moveToElement=function(){return P(this,void 0,void 0,function(){var e,n=this;return x(this,function(t){switch(t.label){case 0:return e=new Nr(m.utils.extend({skipScrolling:!0},this.options),!1),[4,Js.create(this.element,e,this.window,this.cursor,this.nativeAutomationInput)];case 1:return[2,t.sent().run().then(function(){return Co(n.automationSettings.mouseActionStepDelay)})]}})})},Il.prototype._scrollToElement=function(){var e=this,n=!1,t=new yr(this.options,!1);return new Ts(this.element,t).run().then(function(t){return n=!!t,Co(e.automationSettings.mouseActionStepDelay)}).then(function(){return Vt(e.cursor.getPosition(),e.window)}).then(function(t){return function(s,l,a){return P(this,void 0,y.Promise,function(){var e,n,i,o,r;return x(this,function(t){switch(t.label){case 0:return s&&cl.contains(l,s)&&a?(e=ps(),n=cl.getCommonAncestor(s,e),[4,ul.getClientPosition(s)]):[2];case 1:return[4,Ut(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:hl.BUTTONS_PARAMETER.leftButton},Bs.leaveElement(s,e,n,r),Bs.enterElement(s,e,n,r),vs(s)),[2]}})})}(t,e.element,n)}).then(function(){return n})},Il.prototype._getElementOffset=function(){var t=Nt(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 A.create({x:r,y:o})},Il.prototype._isTargetElement=function(n,i){return P(this,void 0,void 0,function(){var e;return x(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]}})})},Il.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(A.create({x:l,y:s}));return e},Il.prototype._getAvailableOffset=function(r,s){return P(this,void 0,void 0,function(){var e,n,i,o;return x(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,At(this.element,e[o])]:[3,7];case 2:return n=t.sent(),[4,It(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]}})})},Il.prototype._wrapAction=function(m){return P(this,void 0,void 0,function(){var e,n,i,o,r,s,l,a,u,c,h,f,d;return x(this,function(t){switch(t.label){case 0:return e=this._getElementOffset(),[4,Pt(this.element,e.x,e.y)];case 1:return n=t.sent()?this.element:null,[4,At(this.element,e)];case 2:return i=t.sent(),[4,xt(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,At(this.element,e)];case 7:return s=t.sent(),[4,xt(this.element)];case 8:return l=t.sent(),[4,It(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,Cl.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,Cl.create({element:u,clientPoint:a,screenPoint:s,isTarget:c,inMoving:d})]}})})},Il.prototype._checkElementState=function(t,e){if(!t.element)throw new li(null,{reason:function t(e,n){void 0===n&&(n="action target");var i=yt(e);if(F(e)){var o=(t(R(W(e,"map")),"container")||"").replace(/.*The/,"its");return mt.mapContainerNotVisible(i,o)}return mt.elOutsideBounds(i,n)}(this.element)});if(e&&(!t.isTarget||t.inMoving))throw new Wi;return t},Il.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=yt(r.element),n=yt(i),r.emit(r.WARNING_EVENT,{type:fl,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}})},Il.prototype._contains=function(o,r){return P(this,void 0,void 0,function(){var e,n,i;return x(this,function(t){switch(t.label){case 0:return[4,X(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]}})})},Il);function Il(t,e,n,i,o){var r=Ml.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 _o(e.speed||1),r.window=n,r.cursor=i,r.nativeAutomationInput=o?new xl(o):null,r._ensureWindowAndCursorForLegacyTests(r),r}var Ul,kl=y.Promise,Ol=(w(Nl,Ul=Dl),Nl.prototype.run=function(t){var e=this,n=kl.resolve();return this.element!==Tf.scrollingElement&&this.element!==Tf.documentElement&&(n=this._ensureElement(t,!0,!0)),n.then(function(){e.element.scrollLeft=e.scrollLeft,e.element.scrollTop=e.scrollTop})},Nl);function Nl(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=Ul.call(this,t,n,Cf,al)||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 Bl,Fl=(w(Ll,Bl=Dl),Ll.prototype.run=function(t){return this._ensureElement(t,!0,!0)},Ll);function Ll(t,e){return Bl.call(this,t,e,Cf,al)||this}var Kl=y.Promise,Vl=y.nativeMethods,Rl=y.utils.browser,Yl=y.eventSandbox.focusBlur,Wl=E.contentEditable,Xl=E.textSelection,Hl=E.domUtils,ql=E.styleUtils,Gl=y.eventSandbox.message,zl="automation|iframe|request",jl="automation|iframe|response";function $l(t,e){var n,i,o=Hl.isTextEditableElement(t),r=Hl.isContentEditableElement(t);o||r?r&&isNaN(parseInt(e,10))?Xl.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Hl.getElementValue(t).length:e,Xl.select(t,n,n)):(i=Wl.findContentEditableParent(t))&&Xl.setCursorToLastVisiblePosition(Wl.findContentEditableParent(i))}function Ql(v,g,y){var t=this;return new Kl(function(p){return P(t,void 0,void 0,function(){var n,i,o,r,s,l,a,u,c,h,f,d,m;return x(this,function(t){switch(t.label){case 0:return ys(Cf)?[4,Ss({cmd:zl},jl,Cf.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(n=Hl.getActiveElement(),i=Hl.isTextEditableElement(v),o=Hl.closest(v,"label[for]"),r=Hl.isElementFocusable(v),s=!r&&o,l=Hl.isContentEditableElement(v),a=l?Wl.findContentEditableParent(v):v,g&&Rl.isWebKit&&i&&Xl.select(v,0,0),s)return g&&(e=o,Hl.isElementFocusable(e)?Yl.focus(e,E.noop,!1,!0):Jl(e)),p(),[2];if(u=!g,c=!1,!r&&!l){if(h=Hl.findDocument(a),f=Vl.documentActiveElementGetter.call(h),d=Hl.isBodyElement(f),m=Hl.isBodyElement(a)?a:Hl.getFocusableParent(a),f&&!d&&Hl.containsElement(f,a)||d&&Hl.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return Yl.focus(a,function(){!g||l||v===Hl.getActiveElement()?($l(v,y),g||Hl.getActiveElement()===n?p():Yl.focus(n,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function Zl(t){var e=Hl.closest(t,"label[for]"),n=e&&(e.control||Tf.getElementById(e.htmlFor));return n&&ql.isElementVisible(n)?n:null}function Jl(t){var e=Zl(t);e&&Hl.getActiveElement()!==e&&Yl.focus(e,E.noop,!1,!0)}Gl.on(Gl.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===zl&&(e=Hl.findIframeByWindow(t.source),Yl.focus(e,function(){Gl.sendServiceMsg({cmd:jl},t.source)},!1))});var ta=y.utils.browser,ea=y.eventSandbox.eventSimulator,na=y.eventSandbox.listeners,ia=y.nativeMethods,oa=E.domUtils,ra=E.styleUtils,sa=E.selectController,la=i.selectElement,aa=(ua.prototype.run=function(){this.eventState.clickElement&&ea.click(this.eventState.clickElement,this.eventArgs.options),oa.isElementFocusable(this.eventArgs.element)||Jl(this.eventArgs.element)},ua);function ua(t,e){this.eventState=t,this.eventArgs=e}var ca,ha=(w(fa,ca=aa),fa.prototype.run=function(){function t(t){n=ia.eventTargetGetter.call(t)===e.input}var e=this,n=!1;na.addInternalEventBeforeListener(Cf,["focus"],t),ca.prototype.run.call(this),na.removeInternalEventBeforeListener(Cf,["focus"],t),oa.isElementFocusable(this.targetElement)&&!n&&this._ensureBoundElementFocusRaised()},fa.prototype._ensureBoundElementFocusRaised=function(){ea.focus(this.input)},fa);function fa(t,e){var n=ca.call(this,t,e)||this;return n.targetElement=n.eventArgs.element,n.input=Zl(n.eventArgs.element),n}var da,ma=(w(pa,da=aa),pa.prototype.run=function(){da.prototype.run.call(this),this._toggleSelectOptionList()},pa.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===ra.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(sa.isOptionListExpanded(t)?la.collapseOptionList():la.expandOptionList(t))},pa);function pa(t,e){return da.call(this,t,e)||this}var va,ga=(w(ya,va=aa),ya.prototype.run=function(){return this.eventArgs.element},ya);function ya(t,e){return va.call(this,t,e)||this}var Ea,ba=(w(Sa,Ea=ha),Sa.prototype.run=function(){function t(){e=!0}var e=!1;na.addInternalEventBeforeListener(Cf,["change"],t),Ea.prototype.run.call(this),na.removeInternalEventBeforeListener(Cf,["change"],t),!ta.isChrome||e||this.checkbox.disabled||this._isClickableElementInsideLabel(this.targetElement)||this._ensureCheckboxStateChanged()},Sa.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,ea.change(this.checkbox)},Sa.prototype._isClickableElementInsideLabel=function(t){var e=oa.isAnchorElement(t)&&t.getAttribute("href"),n=oa.isButtonElement(t);return e||n},Sa);function Sa(t,e){var n=Ea.call(this,t,e)||this;return n.checkbox=n.input,n}var wa=y.Promise,_a=y.utils.browser,Pa=y.utils.featureDetection,xa=y.eventSandbox.eventSimulator,Aa=y.eventSandbox.listeners,Ca=E.domUtils,Ta=E.eventUtils,Ma=E.arrayUtils,Da=(Ia.prototype.mousedown=function(t){var e=this;this.targetElementParentNodes=Ca.getParents(t.element),this.mouseDownElement=t.element,this._raiseTouchEvents(t);var n=Ca.getActiveElement();this.activeElementBeforeMouseDown=n;var i=(_a.isWebKit||_a.isIE)&&Ca.isSelectElement(this.mouseDownElement);return i&&this._bindMousedownHandler(),this._bindBlurHandler(n),this._isTouchEventWasCancelled()||(this.eventState.simulateDefaultBehavior=xa.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)})},Ia.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=Ca.getParents(i),s=Ca.isTheSameNode(i,n),_a.isFirefox?s?n:null:s?Ma.equals(o,r)?n:null:n.contains(i)&&!Ca.isEditableFormElement(i)?n:i.contains(n)?i:Ma.getCommonElement(r,o));var l={},a=function(t){l=t.timeStamp,Aa.removeInternalEventBeforeListener(Cf,["mouseup"],a)};return _a.isIE||Aa.addInternalEventBeforeListener(Cf,["mouseup"],a),this._isTouchEventWasCancelled()||xa.mouseup(t,e.options),e.options&&(e.options.timeStamp=l),this._click(e)},Ia.prototype._click=function(u){return P(this,void 0,y.Promise,function(){var a;return x(this,function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=Zl((n=u).element),o=oa.isSelectElement(n.element),r=oa.isOptionElement(n.element),s=oa.isLabelElement(n.element)&&i,l=i&&oa.isCheckboxElement(i),a=new(o?ma:r?ga:l?ba:s?ha:aa)(e,n),this._isTouchEventWasCancelled()||a.run(),[2,u]})})},Ia.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},Ia.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Ta.preventDefault(t),Ta.unbind(e.element,"mousedown",n)};Ta.bind(this.element,"mousedown",n)},Ia.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,Ta.unbind(t,"blur",n,!0)};Ta.bind(t,"blur",n,!0)},Ia.prototype._ensureActiveElementBlur=function(e){var n=this;return new wa(function(t){Ca.getActiveElement()===e||n.eventState.blurRaised?t():_a.isIE&&_a.version<12?To().then(function(){n.eventState.blurRaised||xa.blur(e),t()}):(xa.blur(e),t())})},Ia.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?wa.resolve():Ql(Ca.isContentEditableElement(this.element)?this.element:t.element,!_a.isIE||this.activeElementBeforeMouseDown===Ca.getActiveElement(),this.caretPos)},Ia.prototype._raiseTouchEvents=function(t){Pa.isTouchDevice&&(this.eventState.touchStartCancelled=!xa.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!xa.touchend(t.element,t.options))},Ia);function Ia(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 Ua,ka=(w(Oa,Ua=Dl),Oa.prototype._mousedown=function(t){return this.canUseNativeAutomationEventSimulator(t.element)?this.nativeAutomationInput.mouseDown(t):this.strategy.mousedown(t)},Oa.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&&$l(n,e),t}):this.strategy.mouseup(n,t)},Oa.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([Co(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})},Oa);function Oa(t,e,n,i,o){var r,s,l=Ua.call(this,t,e,n,i,o)||this;return l.modifiers=e.modifiers,l.strategy=(r=l.element,s=e.caretPos,new Da(r,s)),l}function Na(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 A(i,n.top):null}function Ba(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 A(n.left,i):null}function Fa(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?Na:Ba)(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 La=y.eventSandbox.eventSimulator,Ka=y.eventSandbox.message,Va=E.positionUtils,Ra=E.domUtils,Ya=E.styleUtils,Wa="automation|move|response";Ka.on(Ka.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===Cf?(e=Cf["%testCafeDriverInstance%"],i=(n=t).message.nativeAutomationMove&&e.createDispatchNativeAutomationEventFunctions(),r=new A(n.message.endX,n.message.endY),s=n.source,l=Ra.findIframeByWindow(s),a=Ya.getBordersWidth(l),u=Ya.getElementPadding(l),c=Va.getIframeClientCoordinates(l),h=Va.getIframePointRelativeToParentFrame(r,s),f=al.getPosition(),d=Va.isInRectangle(f,c)?f:Fa(f,h,c),m={x:d.x-c.left,y:d.y-c.top},p=new Nr({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:Wa,x:m.x,y:m.y},al.getActiveWindow(Cf)!==s?(o=null,i&&(o=new xl(i)),Js.create(l,p,Cf,al,o).then(function(t){return t.run()}).then(function(){al.setActiveWindow(s),Ka.sendServiceMsg(v,s)})):Ka.sendServiceMsg(v,s)):(y.on(y.EVENTS.beforeUnload,function(){return Ka.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=ps();return a&&(La.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),La.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),Ka.sendServiceMsg({cmd:Wa},e)}var u,c=al.getPosition(),h=Fa(A.create(n).add(c),new A(t.message.endX,t.message.endY),n);h?(u=new Nr({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),Js.create(Tf.documentElement,u,Cf,al).then(function(t){return t.run()}).then(function(){var t={cmd:Wa,x:h.x,y:h.y};al.setActiveWindow(e),Ka.sendServiceMsg(t,e)})):Ka.sendServiceMsg({cmd:Wa,x:n.left,y:n.top},e)}(t)))});var Xa=y.Promise,Ha=y.utils.browser,qa=y.utils.featureDetection,Ga=y.eventSandbox.eventSimulator,za=y.eventSandbox.focusBlur,ja=y.nativeMethods,$a=E.domUtils,Qa=E.styleUtils,Za=E.delay,Ja=E.selectController,tu=i.selectElement,eu=qa.isTouchDevice?0:160,nu=(iu.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Ja.getEmulatedChildElement(this.element):this.element,e=1<Qa.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Ha.isIE&&e?this.parentSelect:t}},iu.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=Ot(n=Ja.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=Tf.documentElement,i=(e=tu.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},iu.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Nr({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return Js.create(n,s,Cf,al).then(function(t){return t.run()}).then(function(){return Za(e.automationSettings.mouseActionStepDelay)})},iu.prototype._mousedown=function(){var t=this;return Ha.isFirefox?(Ga.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Ha.isIE?(Ga.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Za(eu)}).then(function(){Ga.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},iu.prototype._focus=function(){var e=this;return new Xa(function(t){za.focus(e.parentSelect,t,!1,!0)})},iu.prototype._mouseup=function(){var t=Ha.isIE?this.parentSelect:this.eventsArgs.element;Ga.mouseup(t,this.eventsArgs.options),Ha.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Ha.isFirefox||Ha.isSafari||Ha.isChrome&&53<=Ha.version,n=e||Ha.isIE;return e&&this.clickCausesChange&&Ga.input(this.parentSelect),n&&this.clickCausesChange&&Ga.change(this.parentSelect),Xa.resolve()},iu.prototype._click=function(){Ga.click(this.eventsArgs.element,this.eventsArgs.options)},iu.prototype.run=function(){var t=this;if(!this.parentSelect)return Ga.click(this.eventsArgs.element,this.eventsArgs.options),Xa.resolve();this.optionListExpanded||tu.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Qa.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()})},iu);function iu(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 _o(e.speed),this.parentSelect=$a.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Ja.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=$a.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=$a.getElementIndexInParent(this.parentSelect,this.element),o=ja.nodeParentNodeGetter.call(this.element),r=$a.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 ou,ru=y.utils.featureDetection,su=y.utils.browser,lu=y.eventSandbox.eventSimulator,au=E.eventUtils,uu=E.delay,cu=ru.isTouchDevice?0:160,hu=(w(fu,ou=Dl),fu.prototype._firstClick=function(t){var e=this,n=new Ur(this.options);n.speed=1;var i=new ka(this.element,n,Cf,al);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 uu(cu).then(function(){return t})})},fu.prototype._secondClick=function(t){var e=this;su.isIE&&au.bind(Tf,"focus",au.preventDefault,!0);var n=new Ur({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new ka(Tf.documentElement,n,Cf,al);return i.run().then(function(t){return e.eventState.dblClickElement=i.strategy.eventState.clickElement,su.isIE&&au.unbind(Tf,"focus",au.preventDefault,!0),t})},fu.prototype._dblClick=function(t){this.eventState.dblClickElement&&lu.dblclick(this.eventState.dblClickElement,t.options)},fu.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)})},fu);function fu(t,e){var n=ou.call(this,t,e,Cf,al)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new _o(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var du,mu=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},pu=y.nativeMethods,vu=y.utils.featureDetection,gu=y.utils.html,yu=y.utils.url,Eu=y.eventSandbox.DataTransfer,bu=y.eventSandbox.DragDataStore,Su=E.eventUtils,wu=E.domUtils,_u=(w(Pu,du=Js),Pu.create=function(o,r,s,l){return P(this,void 0,void 0,function(){var e,n,i;return x(this,function(t){switch(t.label){case 0:return[4,Js.getTarget(o,s,new A(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new Pu(n,i,r,s,l)]}})})},Pu.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},Pu.prototype._getEventSequenceOptions=function(t){var e=du.prototype._getEventSequenceOptions.call(this,t),n=e.eventOptions,i=e.eventSequenceOptions;return n.dataTransfer=this.dragAndDropState.dataTransfer,n.buttons=Su.BUTTONS_PARAMETER.leftButton,i.holdLeftButton=!0,{eventOptions:n,eventSequenceOptions:i}},Pu.prototype._getCorrectedTopElement=function(t){return this.touchMode?this.dragElement:t},Pu.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions,o=Qs(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(t,ps(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},Pu.prototype._needMoveCursorImmediately=function(){return!1},Pu.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=pu.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&vu.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new bu,l.dragAndDropState.dataTransfer=new Eu(l.dragAndDropState.dataStore),((e=wu.isAnchorElement(l.dragElement))||wu.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=yu.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=gu.cleanUpHtml(pu.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))),du.prototype.run.call(l).then(function(){return l.dragAndDropState})})},Pu);function Pu(t,e,n,i,o){var r=du.call(this,t,e,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new mu,r}var xu,Au=y.Promise,Cu=y.utils.extend,Tu=y.utils.featureDetection,Mu=y.eventSandbox.eventSimulator,Du=y.eventSandbox.focusBlur,Iu=(w(Uu,xu=Dl),Uu.prototype._getEndPoint=function(){throw new Error("Not implemented")},Uu.prototype._mousedown=function(t){var e=this;return al.leftButtonDown().then(function(){return e.simulateDefaultBehavior=Mu[e.downEvent](t.element,t.options),e._focus(t)})},Uu.prototype._focus=function(n){var i=this;return new Au(function(t){var e=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;Du.focus(e,t,!1,!0)})},Uu.prototype._getDestination=function(){throw new Error("Not implemented")},Uu.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 Nr({offsetX:n.offsetX,offsetY:n.offsetY,modifiers:r.modifiers,speed:r.speed,minMovingTime:25,skipDefaultDragBehavior:!1===r.simulateDefaultBehavior},!1);return _u.create(e,o,Cf,al)}).then(function(t){return t.run()}).then(function(t){return r.dragAndDropState=t,g.delay(r.automationSettings.mouseActionStepDelay)})},Uu.prototype._mouseup=function(){var o=this;return al.buttonUp().then(function(){var e=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=Cu({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&&Mu.drop(n,i),Mu.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):Mu[o.upEvent](n,i),Vt(e)):n}).then(function(t){n&&t===n&&!o.dragAndDropState.enabled&&Mu.click(n,i)})})},Uu.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:Cu({clientX:n.x,clientY:n.y},o.modifiers)},Au.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},Uu);function Uu(t,e){var n=xu.call(this,t,e,Cf,al)||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=Tu.isTouchDevice?"touchstart":"mousedown",n.upEvent=Tu.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var ku,Ou=E.styleUtils,Nu=(w(Bu,ku=Iu),Bu.prototype._getDestination=function(){return P(this,void 0,void 0,function(){var e,n,i,o;return x(this,function(t){switch(t.label){case 0:return[4,At(this.element,{x:this.offsetX,y:this.offsetY})];case 1:return e=t.sent(),n=Ou.getWidth(Tf),i=Ou.getHeight(Tf),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:Tf.documentElement,offsets:{offsetX:o.x,offsetY:o.y},endPoint:o}]}})})},Bu);function Bu(t,e,n,i){var o=ku.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var Fu,Lu=E.positionUtils,Ku=(w(Vu,Fu=Iu),Vu.prototype._getDestination=function(){return P(this,void 0,void 0,function(){var e,n,i,o;return x(this,function(t){return e=this.destinationElement,n=Lu.getElementRectangle(e),i=Nt(e,this.destinationOffsetX,this.destinationOffsetY),o={x:n.left+i.offsetX,y:n.top+i.offsetY},[2,{element:e,offsets:i,endPoint:o}]})})},Vu);function Vu(t,e,n){var i=Fu.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var Ru,Yu=(w(Wu,Ru=Dl),Wu.prototype.run=function(t){return this._ensureElement(t,!0)},Wu);function Wu(t,e,n){return Ru.call(this,t,e,Cf,al,n)||this}var Xu=y.utils.browser,Hu=y.sandbox.event,qu=y.eventSandbox.eventSimulator,Gu=y.eventSandbox.listeners,zu=y.nativeMethods,ju=E.domUtils,$u=E.contentEditable,Qu=E.textSelection,Zu=/ /g;function Ju(t){var e=Qu.getSelectionByElement(t),n=Qu.hasInverseSelectionContentEditable(t);return Qu.hasElementContainsSelection(t)?$u.getSelection(t,e,n):{startPos:$u.calculateNodeAndOffsetByPosition(t,0),endPos:$u.calculateNodeAndOffsetByPosition(t,0)}}function tc(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=$u.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=$u.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 ec(t,e,n){return!n||qu.beforeInput(t,e)}function nc(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}Xu.isSafari&&(Gu.addInternalEventBeforeListener(Cf,["textInput"],i),Hu.on(Hu.EVENT_PREVENTED_EVENT,o));var r=Xu.isFirefox||qu.textInput(t,e)||n;return Xu.isSafari&&(Gu.removeInternalEventBeforeListener(Cf,["textInput"],i),Hu.off(Hu.EVENT_PREVENTED_EVENT,o)),r||Xu.isIE11}function ic(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&&ju.isContentEditableElement(m)&&ju.isContentEditableElement(p)&&(ju.isTheSameNode(m,p)||(Qu.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=zu.nodeParentNodeGetter.call(o)&&o.parentElement,!(Xu.isChrome&&Xu.version<58||Xu.isSafari)&&r&&ju.isElementContainsNode(n,o)||(i=Ju(n),Qu.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&ju.isContentEditableElement(m)&&ju.isRenderedNode(m)&&ec(t,e,Xu.isChrome||Xu.isFirefox)&&(v=nc(t,y),g=v&&!Xu.isIE11,Gu.addInternalEventBeforeListener(Cf,["input"],E),Gu.addInternalEventBeforeListener(Cf,["textinput"],b),(v=v&&ec(t,e,Xu.isSafari))&&(ju.isElementNode(m)?(s=m,l=e,c=Tf.createTextNode(l),h={node:c,offset:l.length},f=zu.nodeParentNodeGetter.call(s),"br"===ju.getTagName(s)?f.insertBefore(c,s):0<a?(u=zu.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Qu.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;ju.isElementContainsNode(t,i)||(i=(e=tc(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),Qu.selectByNodesAndOffsets(l,l)}(t,tc(d),e)),To().then(function(){g&&qu.input(t,e),Gu.removeInternalEventBeforeListener(Cf,["input"],E),Gu.removeInternalEventBeforeListener(Cf,["textinput"],b)})))}function oc(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;ju.isContentEditableElement(t)&&ic(t,e),ju.isElementReadOnly(t)||(ju.isTextEditableElement(t)?(l=t,a=e,h=ju.getElementValue(l),f=a.length,d=Qu.getSelectionStart(l),m=Qu.getSelectionEnd(l),p=ju.isInputElement(l)&&"number"===l.type,ec(l,a,Xu.isChrome||Xu.isFirefox)&&nc(l,a)&&ec(l,a,Xu.isSafari)&&((u=!Xu.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=Xu.isIE&&Xu.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&Xu.isIOS&&"."===h[h.length-1]&&(d+=1),ju.setElementValue(l,c),Qu.select(l,d+f,d+f)),qu.input(l,a))):ju.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=ju.getElementValue(i),ju.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):ju.setElementValue(i,o),qu.change(i),qu.input(i,o)))}function rc(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var sc=y.nativeMethods,lc=y.utils.browser,ac=y.eventSandbox.focusBlur,uc=y.Promise,cc=g.domUtils.isRadioButtonElement,hc=g.domUtils.getActiveElement,fc=g.domUtils.getTabIndexAttributeIntValue;function dc(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function mc(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 pc(t){var e=hc(t||Tf),n=null;if(e&&g.domUtils.isIframeElement(e)&&sc.contentDocumentGetter.call(e))try{n=pc(sc.contentDocumentGetter.call(e))}catch(t){}return n||e}function vc(t,e,n){if(!cc(e))return t;if(!n&&!e.name&&!lc.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||lc.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return cc(t)&&t.name===i.name}:lc.isChrome&&(o=function(t){return cc(t)&&!t.name}),o);return r&&(t=g.arrayUtils.filter(t,r)),t}function gc(t,e,n){var i,o,r,s,l,a,u,c,h=e?-1:1,f=g.domUtils.getTopSameDomainWindow(Cf).document,d=(i=f,o=sc.documentActiveElementGetter.call(i),r=o&&fc(o),!(o&&r<0)),m=vc(m=g.domUtils.getFocusableElements(f,d),t,n),p=cc(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?Tf.body:m[m.length-1-v]:e&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=cc(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(t){return cc(t)&&t.name===l.name&&t.checked})),c||l)}function yc(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var Ec={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 bc(t){return rc(t)?Ec.LETTERS[t.toLowerCase()]:Ec.SYMBOLS[t]||Ec.SPECIAL_KEYS[t]||t}function Sc(t){if(rc(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 wc(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:rc(t),keyIdentifierProperty:bc(e),keyProperty:g.KEY_MAPS.keyProperty[e]||e,keyCode:function(t,e,n,i,o){var r=null;return e&&"space"!==t?r=Sc(n):i?r=i:o&&(r=o),r}(t,o,i,s,l)}}var _c=y.utils.browser,Pc=y.utils.extend,xc=y.eventSandbox.eventSimulator,Ac=(Cc._isKeyActivatedInputElement=function(t){return g.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},Cc.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=(!_c.isFirefox||l)&&(!_c.isWebKit||n))}catch(t){}o&&(!_c.isIE&&i&&l&&s&&(r=this.storedActiveElement),oc(r,e))},Cc.prototype._addKeyPropertyToEventOptions=function(t){return Pc(t,yc("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},Cc.prototype.down=function(t){this.storedActiveElement=pc(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=dc(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),xc.keydown(this.storedActiveElement,Pc(e,t))},Cc.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=pc(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(rc(t))return dc(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(_c.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=_c.isAndroid||xc.keypress(e,Pc(r,t));if(!s)return s;e=pc(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=Cc._isKeyActivatedInputElement(e),a=g.domUtils.isButtonElement(e);return _c.isSafari&&0<=_c.compareVersions([_c.webkitVersion,"603.1.30"])||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},Cc.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=xc.keyup(pc(this.topSameDomainDocument),Pc(e,t)),i=pc(this.topSameDomainDocument);return!_c.isSafari&&(!_c.isChrome||53<=_c.version)&&n&&"space"===this.sanitizedKey&&Cc._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(Cc.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),Cc);function Cc(t,e){var n=wc(t,e);Pc(this,n),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(Cf).document,this.storedActiveElement=null}var Tc,Mc={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"},Dc=y.Promise,Ic=y.utils.browser,Uc=y.eventSandbox.eventSimulator,kc=y.eventSandbox.elementEditingWatcher,Oc=E.textSelection,Nc=E.eventUtils,Bc=E.domUtils,Fc=i.selectElement,Lc=null,Kc=null;function Vc(){Kc=Lc=null,Nc.unbind(this,"blur",Vc,!0)}function Rc(t){var e,n,i,o;Bc.isTextAreaElement(t)&&(Lc!==t&&(Nc.bind(t,"blur",Vc,!0),Lc=t),e=t,n=Oc.hasInverseSelection(e),i=Bc.getTextAreaValue(e),o=n?Oc.getSelectionStart(e):Oc.getSelectionEnd(e),Kc=i&&o?Bc.getTextareaIndentInLine(e,o):0)}function Yc(t,e){var n,i,o,r,s,l,a=Bc.getTextAreaValue(t);a&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),o=Oc.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==Kc&&Lc===t||Rc(t),s=l.lastIndexOf("\n"),Xc(t,n,i,o,Math.min(s+1+Kc,l.length),e))}function Wc(t,e){var n,i,o,r,s,l,a,u,c,h,f=Bc.getTextAreaValue(t);f&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),u=(r=(o=Oc.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!==Kc&&Lc===t||Rc(t),Xc(t,n,i,o,u=Math.min(u+Kc,u+h),e))}function Xc(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;Oc.select(t,s,l)}function Hc(t,e,n){Bc.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))),Bc.setElementValue(t,e),Oc.select(t,n,n),Uc.input(t)}function qc(t,e){var n,i,o,r,s,l,a,u;return Bc.isTextEditableElement(t)&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),o=Oc.hasInverseSelection(t),s=null,s=(r=!Bc.isTextAreaElement(t)||Bc.getTextareaLineNumberByPosition(t,n)===Bc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=Bc.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,Oc.select(t,u,a)):o?Oc.select(t,i,a):Oc.select(t,n,a)),Dc.resolve()}function Gc(t,e){var n,i,o,r,s,l,a,u,c;return Bc.isTextEditableElement(t)&&(n=Oc.getSelectionStart(t),i=Oc.getSelectionEnd(t),o=Oc.hasInverseSelection(t),s=null,u=s=(r=!Bc.isTextAreaElement(t)||Bc.getTextareaLineNumberByPosition(t,n)===Bc.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=Bc.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,Oc.select(t,c,u)):o?Oc.select(t,i,u):Oc.select(t,n,u)),Dc.resolve()}function zc(t){return qc(t,!0)}function jc(t){return Gc(t,!0)}function $c(t){return Bc.isRadioButtonElement(t)}function Qc(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?(Bc.isSelectElement(t)&&Fc.collapseOptionList(),i=t,o=e,r=n,new uc(function(t){var e=gc(i,o,r);e?ac.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&Bc.isTextEditableInput(t)&&Oc.select(t),t})):Dc.resolve();var i,o,r}var Jc,th=((Tc={})[Mc.ctrlA]=function(t){return Bc.isEditableElement(t)&&Oc.select(t),Dc.resolve()},Tc[Mc.backspace]=function(t){var e,n,i;return Bc.isTextEditableElementAndEditingAllowed(t)&&(e=Oc.getSelectionStart(t),n=Oc.getSelectionEnd(t),i=Bc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&Hc(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):Hc(t,i.substring(0,e)+i.substring(n,i.length),e)),Bc.isContentEditableElement(t)&&Oc.deleteSelectionContents(t),Dc.resolve()},Tc[Mc.delete]=function(t){var e,n,i;return Bc.isTextEditableElementAndEditingAllowed(t)&&(e=Oc.getSelectionStart(t),n=Oc.getSelectionEnd(t),i=Bc.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&Hc(t,i.substring(0,e)+i.substring(n+1,i.length),e):Hc(t,i.substring(0,e)+i.substring(n,i.length),e)),Bc.isContentEditableElement(t)&&Oc.deleteSelectionContents(t),Dc.resolve()},Tc[Mc.left]=function(t){var e,n,i,o,r=null;return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"left"),$c(t)?Qc(t,!0):(Bc.isTextEditableElement(t)&&(e=(r=Oc.getSelectionStart(t)||0)===Oc.getSelectionEnd(t)?r-1:r,Oc.select(t,e,e),Rc(t)),Bc.isContentEditableElement(t)&&(r=Oc.getSelectionStart(t))!==Oc.getSelectionEnd(t)&&(n=Oc.getSelectionByElement(t),o={node:(i=Oc.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},Oc.selectByNodesAndOffsets(o,o,!0)),Dc.resolve())},Tc[Mc.right]=function(t){var e,n,i,o,r=null,s=null;return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"right"),$c(t)?Qc(t,!1):(Bc.isTextEditableElement(t)&&(e=(r=Oc.getSelectionStart(t))===(s=Oc.getSelectionEnd(t))?s+1:s,r===Bc.getElementValue(t).length&&(e=r),Oc.select(t,e,e),Rc(t)),Bc.isContentEditableElement(t)&&(r=Oc.getSelectionStart(t))!==(s=Oc.getSelectionEnd(t))&&(n=Oc.getSelectionByElement(t),o={node:(i=Oc.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},Oc.selectByNodesAndOffsets(o,o,!0)),Dc.resolve())},Tc[Mc.up]=function(t){return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"up"),$c(t)?Qc(t,!0):Ic.isWebKit&&Bc.isInputElement(t)?qc(t):(Bc.isTextAreaElement(t)&&Yc(t,!1),Dc.resolve())},Tc[Mc.down]=function(t){return Bc.isSelectElement(t)&&Fc.switchOptionsByKeys(t,"down"),$c(t)?Qc(t,!1):Ic.isWebKit&&Bc.isInputElement(t)?Gc(t):(Bc.isTextAreaElement(t)&&Wc(t,!1),Dc.resolve())},Tc[Mc.shiftLeft]=function(t){var e,n;return Bc.isTextEditableElement(t)&&((e=Oc.getSelectionStart(t))===(n=Oc.getSelectionEnd(t))||Oc.hasInverseSelection(t)?Oc.select(t,n,Math.max(e-1,0)):Oc.select(t,e,Math.max(n-1,0)),Rc(t)),Dc.resolve()},Tc[Mc.shiftRight]=function(t){var e,n,i;return Bc.isTextEditableElement(t)&&(e=Oc.getSelectionStart(t),n=Oc.getSelectionEnd(t),i=Bc.getElementValue(t).length,e!==n&&Oc.hasInverseSelection(t)?Oc.select(t,n,Math.min(e+1,i)):Oc.select(t,e,Math.min(n+1,i)),Rc(t)),Dc.resolve()},Tc[Mc.shiftUp]=function(t){return Ic.isWebKit&&Bc.isInputElement(t)?zc(t):(Bc.isTextAreaElement(t)&&Yc(t,!0),Dc.resolve())},Tc[Mc.shiftDown]=function(t){return Ic.isWebKit&&Bc.isInputElement(t)?jc(t):(Bc.isTextAreaElement(t)&&Wc(t,!0),Dc.resolve())},Tc[Mc.shiftHome]=zc,Tc[Mc.shiftEnd]=jc,Tc[Mc.home]=qc,Tc[Mc.end]=Gc,Tc[Mc.enter]=function(t){var e,n,i,o,r,s;return Bc.isSelectElement(t)&&Fc.collapseOptionList(),Bc.isInputElement(t)?(Ic.isIE||kc.processElementChanging(t),(e=Bc.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)Uc.click(i);else if(Bc.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)Bc.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&Uc.submit(t)&&t.submit()}}(e,t)):Bc.isTextAreaElement(t)?(n=Oc.getSelectionStart(t),o=(i=Bc.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,Hc(t,o+String.fromCharCode(10)+r,s)):t.tagName&&Bc.isAnchorElement(t)&&Uc.click(t),Dc.resolve()},Tc[Mc.tab]=function(t){return Zc(t,!1)},Tc[Mc.shiftTab]=function(t){return Zc(t,!0)},Tc[Mc.esc]=function(t){return Bc.isSelectElement(t)&&Fc.collapseOptionList(),Dc.resolve()},Tc),eh=((Jc={})[Mc.ctrlA]="selectAll",Jc);function nh(r){var t=mc(g.getKeyArray(r)),e=t.actualKeys,s=t.eventKeyProperties;return g.arrayUtils.map(e,function(t,e){var n,i,o=(n=e,i=r.toLowerCase(),1===n&&eh[i]?[eh[i]]:[]);return m.utils.extend({key:t,commands:o},wc(t,s[e]))})}function ih(t){var e,n;e=t.modifiers,n=m.utils.extend({},dl),e&&(e&rl.ctrl&&(n.ctrl=!0),e&rl.alt&&(n.alt=!0),e&rl.shift&&(n.shift=!0),e&rl.meta&&(n.meta=!0)),n.shift&&t.isLetter&&(t.keyProperty=dc(t.keyProperty),t.keyCode=Sc(t.keyProperty))}var oh=y.Promise,rh=y.eventSandbox.message,sh=y.nativeMethods,lh="automation|press|request",ah="automation|press|response";rh.on(rh.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===lh&&(y.on(y.EVENTS.beforeUnload,function(){return rh.sendServiceMsg({cmd:ah},t.source)}),new uh(t.message.keyCombinations,t.message.options).run().then(function(){return rh.sendServiceMsg({cmd:ah},t.source)}))});var uh=(ch._getKeyPressSimulators=function(t){var e=mc(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return new Ac(t,i[e])})},ch._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("+");th[s]?(n.push(s),i=o=[]):o.shift()}return n},ch._getShortcutHandlers=function(t){for(var e,n,i,o=ch._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)]=th[e],t=t.substring(n+i);return r},ch.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return oh.resolve(e)},ch.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(pc(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},ch.prototype._up=function(t){return t.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},ch.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(pc(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=ch._getShortcutHandlers(t);var e=ch._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)})})},ch.prototype._calculateCDPEventSequence=function(){for(var t=[],e=0,n=this.keyCombinations;e<n.length;e++){for(var i=nh(n[e]),o=0,r=0,s=i;r<s.length;r++)o|=ml((l=s[r]).key),l.modifiers=o,ih(l),t.push(_l.keyDown(l),_l.delay(this.automationSettings.keyActionStepDelay));for(var l,a=i.length-1;0<=a;a--)o&=~ml((l=i[a]).key),l.modifiers=o,t.push(_l.keyUp(l))}return t},ch.prototype.run=function(){var e=this,t=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(t);if(!ys(Cf)&&n&&sh.contentWindowGetter.call(t)){var i={cmd:lh,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,ah,sh.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)})})},ch);function ch(t,e,n){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(Cf).document,this.automationSettings=new _o(e.speed),this.options=e,this.nativeAutomationInput=n?new xl(n):null}var hh,fh=y.Promise,dh=y.utils.extend,mh=y.utils.browser,ph=y.eventSandbox.eventSimulator,vh=E.domUtils,gh=E.eventUtils,yh=E.delay,Eh=(w(bh,hh=Dl),bh.prototype._mousedown=function(t){var e=this;return al.rightButtonDown().then(function(){return e.eventState.activeElementBeforeMouseDown=vh.getActiveElement(),e.eventState.simulateDefaultBehavior=ph.mousedown(t.element,t.options),e._focus(t)})},bh.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?To():Ql(vh.isContentEditableElement(this.element)?this.element:t.element,!mh.isIE||this.eventState.activeElementBeforeMouseDown===vh.getActiveElement(),this.caretPos).then(To)},bh.prototype._mouseup=function(e){var t=this;return al.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return ph.mouseup(t,e.options)})},bh.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){ph.contextmenu(t,e.options),vh.isElementFocusable(t)||Jl(t)})},bh.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:dh({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:gh.BUTTON.right},o.modifiers)},fh.all([yh(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},bh);function bh(t,e){var n=hh.call(this,t,e,Cf,al)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var Sh=y.utils.browser,wh=E.domUtils,_h=E.positionUtils,Ph=E.styleUtils,xh=E.contentEditable,Ah=E.arrayUtils,Ch=["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 Th(t,e){var n,i,o,r,s,l=Ph.getBordersWidth(t),a=_h.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return wh.isTextAreaElement(t)||(i=(n=_h.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 Mh(t){var e=Ph.getElementScroll(Tf);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function Dh(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=Tf.body,r=_h.getOffsetPosition(e),s=Ph.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=Tf.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===Ph.get(o,"position")&&(t=Ph.getElementMargin(o),n=Ph.get(o,"left"),i=Ph.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),Ah.forEach(Ch,function(t){c+="".concat(t,":").concat(Ph.get(e,t),";")}),Ph.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,wh.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=wh.getElementValue(t).length;try{var u=Tf.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)),wh.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return wh.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 Ih(t,e){var n,i,o,r,s,l,a=null;return(a=wh.isContentEditableElement(t)?(o=t,r=e,s=wh.findDocument(o).createRange(),l=xh.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()):Dh(t,e))?{x:(a=Mh(a=Th(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function Uh(t,e){var n=wh.isTextEditableElement(t),i=wh.isContentEditableElement(t);return n&&0<wh.getElementValue(t).length||i&&xh.getContentEditableValue(t).length?Ih(t,e):_h.findCenter(t)}function kh(t,e,n){var i=wh.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=Mh(Th(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var Oh,Nh=y.Promise,Bh=y.utils.browser,Fh=y.utils.featureDetection,Lh=y.eventSandbox.eventSimulator,Kh=y.eventSandbox.focusBlur,Vh=E.contentEditable,Rh=E.domUtils,Yh=E.positionUtils,Wh=E.eventUtils,Xh=E.delay,Hh=(w(qh,Oh=Dl),qh.prototype._calculateEventArguments=function(){var e=this,n=Yh.offsetToClientCoords(this.clientPoint);return Vt(n).then(function(t){if(!t)throw new li(null,{reason:Yh.getElOutsideBoundsReason(e.element)});return{element:t,options:{clientX:n.x,clientY:n.y}}})},qh.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Nr({offsetX:i,offsetY:o,speed:r},!1);return Js.create(n,s,Cf,al).then(function(t){return t.run()}).then(function(){return Xh(e.automationSettings.mouseActionStepDelay)})},qh.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Wh.preventDefault(t),Wh.unbind(e.element,"mousedown",n)};Wh.bind(this.element,"mousedown",n)},qh.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},qh.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},qh.prototype._moveToPoint=function(t){!function(t,e){if(wh.isEditableElement(t)){var n=wh.isTextAreaElement(t);if(!wh.isInputElement(t)||!(Sh.isFirefox||Sh.isIE&&10<Sh.version)){var i=_h.getOffsetPosition(t),o=Ph.getBordersWidth(t),r=Ph.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&&Ph.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&Ph.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=wh.isTextEditableElement(t),i=wh.isInputElement(t);if(!n&&!wh.isContentEditableElement(t))return e;var o=_h.getOffsetPosition(t),r=Ph.getBordersWidth(t),s=Ph.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(Sh.isFirefox||Sh.isIE&&10<Sh.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:Tf.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},qh.prototype._mousedown=function(){var n=this;return al.leftButtonDown().then(function(){return n._calculateEventArguments()}).then(function(t){n.eventArgs=t;var e=(Bh.isWebKit||Bh.isIE)&&Rh.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=Lh[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},qh.prototype._focus=function(){var n=this;return new Nh(function(t){var e=Rh.isContentEditableElement(n.element)?Vh.findContentEditableParent(n.element):n.element;Kh.focus(e,t,!1,!0)})},qh.prototype._setSelection=function(){throw new Error("Not implemented")},qh.prototype._mouseup=function(){var e=this;return al.buttonUp().then(function(){return e._setSelection(),e._calculateEventArguments()}).then(function(t){e.eventArgs=t,Lh[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},qh.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()})},qh);function qh(t,e){var n=Oh.call(this,t,e,Cf,al)||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 Gh,zh=E.textSelection,jh=E.domUtils,$h=E.positionUtils,Qh=(w(Zh,Gh=Hh),Zh.prototype._calculateAbsoluteStartPoint=function(){return Uh(this.element,this.startPos)||$h.findCenter(this.element)},Zh.prototype._calculateAbsoluteEndPoint=function(){var t=Uh(this.element,this.endPos);return t||(jh.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=Ih(t,o+=i)););return r=r||Ih(t,e)||_h.findCenter(t)}(this.element,this.startPos,this.endPos):$h.findCenter(this.element))},Zh.prototype._setSelection=function(){var t=jh.isTextEditableElement(this.element),e=jh.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&zh.select(this.element,this.startPos,this.endPos)},Zh.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return Gh.prototype.run.call(e)})},Zh);function Zh(t,e,n,i){var o=Gh.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var Jh,tf=E.textSelection,ef=E.contentEditable,nf=E.positionUtils,of=(w(rf,Jh=Hh),rf.prototype._calculateAbsoluteStartPoint=function(){return kh(this.element,this.startNode,this.startOffset)||nf.findCenter(this.element)},rf.prototype._calculateAbsoluteEndPoint=function(){return kh(this.element,this.endNode,this.endOffset)||nf.findCenter(this.element)},rf.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},tf.selectByNodesAndOffsets(t,e,!0))},rf);function rf(t,e,n){var i=Jh.call(this,ef.getNearestCommonAncestor(t,e),n)||this,o=ef.getFirstVisiblePosition(t),r=ef.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=ef.calculatePositionByNodeAndOffset(i.element,s);return ef.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=ef.getLastVisiblePosition(t),r=ef.getFirstVisiblePosition(e)),s=ef.calculateNodeAndOffsetByPosition(t,o),l=ef.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var sf=y.Promise,lf=y.utils.extend,af=y.utils.browser,uf=y.eventSandbox.eventSimulator,cf=y.eventSandbox.elementEditingWatcher,hf=E.domUtils,ff=E.promiseUtils,df=E.contentEditable,mf=E.textSelection,pf=E.delay,vf=E.KEY_MAPS.specialKeys,gf=(yf.findTextEditableChild=function(t){var e=null;if(!hf.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(hf.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},yf.prototype._calculateEventArguments=function(t){var e=hf.getActiveElement(),n=hf.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=yf.findTextEditableChild(e)||e);var o=lf({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),lf(o,yc(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},yf.prototype._calculateTargetElement=function(){var t=hf.getActiveElement(),e=hf.isContentEditableElement(this.element);if(e){if(t!==df.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},yf.prototype._click=function(t){var e,n=this,i=hf.getActiveElement(),o=hf.isTextEditableElementAndEditingAllowed(this.element),r=hf.isContentEditableElement(this.element);if(i===this.element)return o&&cf.watchElementEditing(this.element),(o||r)&&(e=mf.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||mf.select(this.element,this.caretPos,this.caretPos)),sf.resolve();var s=Ot(this.element),l=s.offsetX,a=s.offsetY,u=new Ur({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new ka(this.element,u,Cf,al).run(t).then(function(){return pf(n.automationSettings.mouseActionStepDelay)})},yf.prototype._type=function(){var t=this;if(this.eventState.skipType)return sf.resolve();var e=hf.isContentEditableElement(this.element);if(this.replace&&(hf.isTextEditableElementAndEditingAllowed(this.element)?mf.select(this.element):e&&mf.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 ff.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},yf.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},yf.prototype._getCurrentKey=function(t,e){return t===vf.enter?"Enter":e},yf.prototype._calculateCDPEventSequence=function(){for(var t=[],e=0,n=this.typingText;e<n.length;e++){var i=n[e],o=Sc(i),r=this._getCurrentKey(o,i),s=wc(r),l=lf({key:r},s);t.push(_l.keyDown(l),_l.keyUp(l),_l.delay(this.automationSettings.keyActionStepDelay))}return t},yf.prototype._canUseNativeAutomationInput=function(){return!!this.nativeAutomationInput&&!(!hf.isTextEditableElement(this.element)&&hf.isInputElement(this.element)||hf.isContentEditableElement(this.element))},yf.prototype._performTypingStep=function(){return this._keydown(),this._keypress(),this._keyup()},yf.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=Sc(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this._getCurrentKey(this.currentKeyCode,t),this.currentKeyIdentifier=bc(this.currentKey),this.ignoreChangeEvent=hf.getElementValue(this.element)===cf.getElementSavedValue(this.element),this._performTypingStep()},yf.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=uf.keydown(this.eventArgs.element,this.eventArgs.options)},yf.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=af.isAndroid||uf.keypress(this.eventArgs.element,this.eventArgs.options))},yf.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=hf.isTextEditableElement(this.element),i=hf.isContentEditableElement(this.element),o=this.paste||!n&&!i;return sf.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){uf.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},yf.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&cf.restartWatchingElementEditing(t),pf(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(hf.isInputElement(t)&&"number"===t.type){var o=mf.getSelectionStart(t),r=hf.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return pf(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return oc(t,e,null),pf(this.automationSettings.keyActionStepDelay)},yf.prototype._typeAllText=function(t){return oc(t,this.typingText,this.caretPos),pf(this.automationSettings.keyActionStepDelay)},yf.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},yf);function yf(t,e,n,i){this.element=yf.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 _o(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 xl(i):null}var Ef=(bf.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)}})},bf);function bf(t,e,n){this.element=t,this.paths=e,this.createError=n}var Sf=E.domUtils,wf=E.contentEditable,_f={};_f.DispatchEvent=t,_f.SetScroll=Ol,_f.ScrollIntoView=Fl,_f.Click=ka,_f.SelectChildClick=nu,_f.DblClick=hu,_f.DragToOffset=Nu,_f.DragToElement=Ku,_f.Hover=Yu,_f.Press=uh,_f.RClick=Eh,_f.SelectText=Qh,_f.SelectEditableContent=of,_f.Type=gf,_f.Upload=Ef,_f.MouseOptions=Mr,_f.ClickOptions=Ur,_f.TypeOptions=Wr,_f.AutomationSettings=_o,_f.getOffsetOptions=Nt,_f.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=Sf.isTextEditableElement(t),m=d?0:wf.getFirstVisiblePosition(t),p=d?Sf.getElementValue(t).length:wf.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=Sf.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:Sf.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:Sf.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},_f.cursor=al,_f.getNextFocusableElement=gc,_f.SHORTCUT_TYPE=Mc,_f.getSelectionCoordinatesByPosition=Uh,_f.getElementFromPoint=Vt,_f.MoveAutomation=Js;var Pf=y.nativeMethods,xf=y.EVENTS.evalIframeScript;Pf.objectDefineProperty(Cf,"%testCafeAutomation%",{configurable:!0,value:_f}),y.on(xf,function(t){return Af(Pf.contentWindowGetter.call(t.iframe))})}(Cf["%hammerhead%"],Cf["%hammerhead%"].Promise,Cf["%testCafeCore%"],Cf["%testCafeUI%"])}(window);