text: !function(){function initTestCafeCore(window,isIFrameWithoutSrc){var document=window.document;!function(e){"use strict";var t,n,o,i,r,l={".js":[],".json":[],".css":[],".html":[]},u="function"==typeof require?require:null;return i=function(e){var t=new Error("Could not find module '"+e+"'");return t.code="MODULE_NOT_FOUND",t},r=function(e,t,n){var o,i;if("function"==typeof e[t+n])return t+n;for(o=0;i=l[n][o];++o)if("function"==typeof e[t+i])return t+i;return null},t=function(e,o,l,u,a,s){var d,f,c,m,h,p;for(l=l.split(/[\\/]/),d=l.pop(),"."!==d&&".."!==d||(l.push(d),d="");null!=(f=l.shift());)if(f&&"."!==f&&(".."===f?(e=o.pop(),s=s.slice(0,s.lastIndexOf("/"))):(o.push(e),e=e[f],s+="/"+f),!e))throw i(u);if(d&&"function"!=typeof e[d]&&(p=r(e,d,".js"),p||(p=r(e,d,".json")),p||(p=r(e,d,".css")),p||(p=r(e,d,".html")),p?d=p:2!==a&&"object"==typeof e[d]&&(o.push(e),e=e[d],s+="/"+d,d="")),!d)return 1!==a&&e[":mainpath:"]?t(e,o,e[":mainpath:"],u,1,s):t(e,o,"index",u,2,s);if(h=e[d],!h)throw i(u);return h.hasOwnProperty("module")?h.module.exports:(c={},h.module=m={exports:c,id:s+"/"+d},h.call(c,c,m,n(e,o,s)),m.exports)},o=function(n,o,r,l){var a,s=r,d=r.charAt(0),f=0;if("/"===d){if(s=s.slice(1),n=e["/"],!n){if(u)return u(r);throw i(r)}l="/",o=[]}else if("."!==d){if(a=s.split("/",1)[0],n=e[a],!n){if(u)return u(r);throw i(r)}l=a,o=[],s=s.slice(a.length+1),s||(s=n[":mainpath:"],s?f=1:(s="index",f=2))}return t(n,o,s,r,f,l)},(n=function(e,t,n){return function(i){return o(e,[].concat(t),i,n)}})(e,[],"")}({pinkie:{"index.js":function(e,t,n){function o(){for(var e=0;e<N.length;e++)N[e][0](N[e][1]);N=[],g=!1}function i(e,t){N.push([e,t]),g||(g=!0,_(o,0))}function r(e,t){function n(e){a(t,e)}function o(e){d(t,e)}try{e(n,o)}catch(i){o(i)}}function l(e){var t=e.owner,n=t._state,o=t._data,i=e[n],r=e.then;if("function"==typeof i){n=b;try{o=i(o)}catch(l){d(r,l)}}u(r,o)||(n===b&&a(r,o),n===w&&d(r,o))}function u(e,t){var n;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&("function"==typeof t||"object"===("undefined"==typeof t?"undefined":E(t)))){var o=t.then;if("function"==typeof o)return o.call(t,function(o){n||(n=!0,t===o?s(e,o):a(e,o))},function(t){n||(n=!0,d(e,t))}),!0}}catch(i){return n||d(e,i),!0}return!1}function a(e,t){e!==t&&u(e,t)||s(e,t)}function s(e,t){e._state===v&&(e._state=y,e._data=t,i(c,e))}function d(e,t){e._state===v&&(e._state=y,e._data=t,i(m,e))}function f(e){e._then=e._then.forEach(l)}function c(e){e._state=b,f(e)}function m(e){e._state=w,f(e),!e._handled&&x&&global.process.emit("unhandledRejection",e._data,e)}function h(e){global.process.emit("rejectionHandled",e)}function p(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof p==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],r(e,this)}var g,E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v="pending",y="settled",b="fulfilled",w="rejected",S=function(){},x="undefined"!=typeof global&&"undefined"!=typeof global.process&&"function"==typeof global.process.emit,_="undefined"==typeof setImmediate?setTimeout:setImmediate,N=[];p.prototype={constructor:p,_state:v,_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(S),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,this._state===w&&x&&i(h,this)),this._state===b||this._state===w?i(l,n):this._then.push(n),n.then},"catch":function(e){return this.then(null,e)}},p.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new p(function(t,n){function o(e){return l++,function(n){r[e]=n,--l||t(r)}}for(var i,r=[],l=0,u=0;u<e.length;u++)i=e[u],i&&"function"==typeof i.then?i.then(o(u),n):r[u]=i;l||t(r)})},p.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new p(function(t,n){for(var o,i=0;i<e.length;i++)o=e[i],o&&"function"==typeof o.then?o.then(t,n):t(o)})},p.resolve=function(e){return e&&"object"===("undefined"==typeof e?"undefined":E(e))&&e.constructor===p?e:new p(function(t){t(e)})},p.reject=function(e){return new p(function(t,n){n(e)})},t.exports=p}},testcafe:{src:{browser:{connection:{"command.js":function(e,t,n){e.__esModule=!0,e["default"]={run:"run",idle:"idle"},t.exports=e["default"]}}},client:{browser:{"index.js":function(exports,module,require){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function sendXHR(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return new _pinkie2["default"](function(i,r){var l=t();l.open(n,e,!0),l.onreadystatechange=function(){4===l.readyState&&(200===l.status?i(l.responseText?JSON.parse(l.responseText):""):r("disconnected"))},l.send(o)})}function isCurrentLocation(e){return document.location.href.toLowerCase()===e.toLowerCase()}function startHeartbeat(e,t){sendXHR(e,t),window.setInterval(function(){return sendXHR(e,t)},HEARTBEAT_INTERVAL)}function executeInitScript(initScriptUrl,createXHR){allowInitScriptExecution&&sendXHR(initScriptUrl,createXHR).then(function(res){return res.code?sendXHR(initScriptUrl,createXHR,"POST",JSON.stringify(eval(res.code))):null}).then(function(){setTimeout(executeInitScript(initScriptUrl,createXHR),1e3)})}function startInitScriptExecution(e,t){allowInitScriptExecution=!0,executeInitScript(e,t)}function stopInitScriptExecution(){allowInitScriptExecution=!1}function checkStatus(e,t){return sendXHR(e,t).then(function(e){return(e.cmd===_command2["default"].run||e.cmd===_command2["default"].idle&&!isCurrentLocation(e.url))&&(stopInitScriptExecution(),document.location=e.url),e.cmd})}exports.__esModule=!0,exports.startHeartbeat=startHeartbeat,exports.startInitScriptExecution=startInitScriptExecution,exports.stopInitScriptExecution=stopInitScriptExecution,exports.checkStatus=checkStatus;var _pinkie=require("pinkie"),_pinkie2=_interopRequireDefault(_pinkie),_command=require("../../browser/connection/command"),_command2=_interopRequireDefault(_command),HEARTBEAT_INTERVAL=3e4,allowInitScriptExecution=!1}},core:{deps:{"hammerhead.js":function(e,t,n){e.__esModule=!0,e["default"]=window["%hammerhead%"],t.exports=e["default"]}},"index.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}var r=n("./deps/hammerhead"),l=i(r),u=n("./utils/key-maps"),a=i(u),s=n("./utils/node-type-descriptions"),d=i(s),f=n("./request-barrier"),c=i(f),m=n("./page-unload-barrier"),h=o(m),p=n("./prevent-real-events"),g=i(p),E=n("./utils/service"),v=o(E),y=n("./utils/dom"),b=o(y),w=n("./utils/content-editable"),S=o(w),x=n("./utils/position"),_=o(x),N=n("./utils/style"),T=o(N),I=n("./utils/event"),C=o(I),M=n("./utils/array"),R=o(M),O=n("./utils/text-selection"),A=o(O),P=n("./utils/wait-for"),V=i(P),D=n("./utils/delay"),W=i(D),L=n("./utils/noop"),q=i(L),B=n("./utils/get-key-array"),H=i(B),j=n("./utils/get-sanitized-key"),k=i(j),F=n("./utils/parse-key-sequence"),U=i(F),X=n("./utils/send-request-to-frame"),K=i(X),z=n("../browser"),G=o(z);e.RequestBarrier=c["default"],e.pageUnloadBarrier=h,e.preventRealEvents=g["default"],e.serviceUtils=v,e.domUtils=b,e.contentEditable=S,e.positionUtils=_,e.styleUtils=T,e.eventUtils=C,e.arrayUtils=R,e.textSelection=A,e.waitFor=V["default"],e.delay=W["default"],e.noop=q["default"],e.getKeyArray=H["default"],e.getSanitizedKey=k["default"],e.parseKeySequence=U["default"],e.sendRequestToFrame=K["default"],e.KEY_MAPS=a["default"],e.NODE_TYPE_DESCRIPTIONS=d["default"],e.browser=G,e.get=n,Object.defineProperty(window,"%testCafeCore%",{enumerable:!1,configurable:!1,writable:!1,value:e}),l["default"].on(l["default"].EVENTS.evalIframeScript,function(e){return initTestCafeCore(e.iframe.contentWindow,!0)})},"page-unload-barrier.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function r(){return b.isIE?(l(_),void(0,g["default"])(0).then(function(){"loading"!==document.readyState||document.activeElement&&"a"===document.activeElement.tagName.toLowerCase()&&document.activeElement.hasAttribute("download")||(R=!0)})):void(R=!0)}function l(e){C&&w.clearTimeout.call(window,C),I=!0,C=w.setTimeout.call(window,function(){C=null,I=!1,M.forEach(function(e){return e()}),M=[]},e)}function u(){return new y(function(e){w.setTimeout.call(window,function(){S.queuedAsyncServiceMsg({cmd:v["default"].waitForFileDownload}).then(function(t){t&&e()})},N)})}function a(){c["default"].on(c["default"].EVENTS.beforeUnload,r),h.bind(window,"unload",function(){R=!0})}function s(){O=function(){A=!0},c["default"].on(c["default"].EVENTS.pageNavigationTriggered,O)}function d(e){var t=new y(function(t){void 0===e&&(e=!O||A?x:0),O&&(c["default"].off(c["default"].EVENTS.pageNavigationTriggered,O),O=null),(0,g["default"])(e).then(function(){return R?void u().then(function(){R=!1,t()}):void(I?M.push(t):t())})}),n=(0,g["default"])(T).then(function(){R=!1});return y.race([t,n])}e.__esModule=!0,e.init=a,e.watchForPageNavigationTriggers=s,e.wait=d;var f=n("./deps/hammerhead"),c=i(f),m=n("./utils/event"),h=o(m),p=n("./utils/delay"),g=i(p),E=n("../../test-run/client-messages"),v=i(E),y=c["default"].Promise,b=c["default"].utils.browser,w=c["default"].nativeMethods,S=c["default"].transport,x=400,_=30,N=500,T=15e3,I=!1,C=null,M=[],R=!1,O=null,A=!1},"prevent-real-events.js":function(e,t,n){function o(e){return e.shiftKey&&e.ctrlKey||e.altKey&&e.isMacPlatform||e.keyCode===h}function i(e,t,n,i,r){var f=e.target||e.srcElement;if(!t&&!(0,s.isShadowUIElement)(f)){if(/^key/.test(e.type)&&o(e))return void r();if("blur"===e.type)if(d.isIE&&d.version<12){var m=!(0,s.isWindow)(f)&&"none"===(0,u.get)(f,"display"),h=null,p=!1;m||(h=(0,s.getParents)(f),p=(0,a.filter)(h,function(e){return"none"===(0,u.get)(e,"display")})),(m||p.length)&&l.nativeMethods.setTimeout.call(window,function(){c.blur(f)},0)}else if(f!==window&&f!==window.document&&!(0,u.hasDimensions)(f))return;n()}}function r(){f.initElementListening(window,m),f.addFirstInternalHandler(window,m,i)}e.__esModule=!0,e["default"]=r;var l=n("./deps/hammerhead"),u=n("./utils/style"),a=n("./utils/array"),s=n("./utils/dom"),d=l.utils.browser,f=l.eventSandbox.listeners,c=l.eventSandbox.eventSimulator,m=["click","mousedown","mouseup","dblclick","contextmenu","mousemove","mouseover","mouseout","touchstart","touchmove","touchend","keydown","keypress","input","keyup","change","focus","blur","MSPointerDown","MSPointerMove","MSPointerOver","MSPointerOut","MSPointerUp","pointerdown","pointermove","pointerover","pointerout","pointerup"],h=123;t.exports=e["default"]},"request-barrier.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.__esModule=!0;var u=n("./deps/hammerhead"),a=o(u),s=n("./utils/delay"),d=o(s),f=n("./utils/array"),c=n("./utils/service"),m=a["default"].Promise,h=a["default"].nativeMethods,p=50,g="requests-finished",E="testcafe|request-barrier",v=function(e){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var o=r(this,e.call(this));return o.BARRIER_TIMEOUT=3e3,o.delays={requestsCollection:void 0===n.requestsCollection?p:n.requestsCollection,additionalRequestsCollection:void 0===n.additionalRequestsCollection?p:n.additionalRequestsCollection,pageInitialRequestsCollection:void 0===n.pageInitialRequestsCollection?p:n.pageInitialRequestsCollection},o.collectingReqs=!0,o.requests=[],o.watchdog=null,o._unbindHandlers=null,o._init(),o}return l(t,e),t.prototype._init=function(){var e=this,t=function(t){return e._onXhrSend(t.xhr)},n=function(t){return e._onRequestCompleted(t.xhr)},o=function(t){return e._onRequestError(t.xhr,t.err)},i=function(t){return e._onFetchSend(t)};a["default"].on(a["default"].EVENTS.xhrSend,t),a["default"].on(a["default"].EVENTS.xhrCompleted,n),a["default"].on(a["default"].EVENTS.xhrError,o),a["default"].on(a["default"].EVENTS.fetchSend,i),this._unbindHandlers=function(){a["default"].off(a["default"].EVENTS.xhrSend,t),a["default"].off(a["default"].EVENTS.xhrCompleted,n),a["default"].off(a["default"].EVENTS.xhrError,o),a["default"].off(a["default"].EVENTS.fetchSend,i)}},t.prototype._onXhrSend=function(e){this.collectingReqs&&this.requests.push(e)},t.prototype._onRequestCompleted=function(e){var t=this;(0,d["default"])(this.delays.additionalRequestsCollection).then(function(){return t._onRequestFinished(e)})},t.prototype._onRequestError=function(e){this._onRequestFinished(e)},t.prototype._onRequestFinished=function(e){(0,f.indexOf)(this.requests,e)>-1&&((0,f.remove)(this.requests,e),this.collectingReqs||this.requests.length||this.emit(g))},t.prototype._onFetchSend=function(e){var t=this;this.collectingReqs&&(this.requests.push(e),e.then(function(){return t._onRequestCompleted(e)})["catch"](function(){return t._onRequestError(e)}))},t.prototype.wait=function(e){var t=this;return new m(function(n){(0,d["default"])(e?t.delays.pageInitialRequestsCollection:t.delays.requestsCollection).then(function(){t.collectingReqs=!1;var e=function(){t.watchdog&&h.clearTimeout.call(window,t.watchdog),t._unbindHandlers(),n()};t.requests.length?(t.watchdog=h.setTimeout.call(window,e,t.BARRIER_TIMEOUT),t.on(g,e)):e()})})},t}(c.EventEmitter);e["default"]=v,v.GLOBAL_REQUEST_BARRIER_FIELD=E,window[v.GLOBAL_REQUEST_BARRIER_FIELD]=v,t.exports=e["default"]},utils:{"array.js":function(e,t,n){function o(e){for(var t=[],n=e.length,o=0;o<n;o++)t.push(e[o]);return t}function i(e){return w.call(e)}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){for(var n=e.length,o=0;o<n;o++)if(t(e[o],o,e))return e[o];return null}function u(e,t){return g.call(e,t)}function a(e,t){E.call(e,t)}function s(e,t){return v.call(e,t)}function d(e,t){return y.call(e,t)}function f(e,t){return b.call(e,t)}function c(e,t,n){return S.call(e,t,n)}function m(e,t){var n=u(e,t);n>-1&&x.call(e,n,1)}function h(e,t){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0}function p(e,t){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[n]===t[o])return e[n];return null}e.__esModule=!0,e.toArray=o,e.reverse=i,e.isArray=r,e.find=l,e.indexOf=u,e.forEach=a,e.some=s,e.map=d,e.filter=f,e.reduce=c,e.remove=m,e.equals=h,e.getCommonElement=p;var g=Array.prototype.indexOf,E=Array.prototype.forEach,v=Array.prototype.some,y=Array.prototype.map,b=Array.prototype.filter,w=Array.prototype.reverse,S=Array.prototype.reduce,x=Array.prototype.splice},"content-editable.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){var t=e.childNodes;return!t.length&&g(e)?e:W.find(t,function(e){return g(e)})}function r(e){return W.find(e.childNodes,function(e){return g(e)||!E(e)&&r(e)})}function l(e){for(var t=null,n=e;!t&&(n=n.previousSibling);)if(!E(n)&&!p(n)){t=n;break}return t}function u(e){return e.childNodes&&e.childNodes.length}function a(e){return V.isElementNode(e)||u(e)}function s(e,t){var n=null,o=null;return!V.isShadowUIElement(e)&&!V.isShadowUIElement(t)&&(!(V.isTheSameNode(t,e)||!t.childNodes.length||!/div|p/.test(V.getTagName(t)))&&(n=r(e),!(!n||V.isTheSameNode(t,n))&&(o=f(n),!(!o||V.isTheSameNode(t,o))&&i(t))))}function d(e,t){var n=V.isRenderedNode(t),o=null,u=null,a=null;if(V.isShadowUIElement(e)||V.isShadowUIElement(t))return!1;if(!V.isTheSameNode(t,e)&&(n&&V.isElementNode(t)&&t.childNodes.length&&!/div|p/.test(V.getTagName(t))||g(t)&&!V.isTheSameNode(t,e)&&t.nodeValue.length)){if(n&&V.isElementNode(t)){if(o=r(e),!o||V.isTheSameNode(t,o))return!1;if(u=f(o),!u||V.isTheSameNode(t,u))return!1}return a=l(t),a&&V.isElementNode(a)&&/div|p/.test(V.getTagName(a))&&i(a)}return!1}function f(e){var t=e.childNodes,n=t.length,o=null,i=null,r=null;if(!n&&g(e))return e;for(var l=0;l<n;l++){if(o=t[l],r=V.isElementNode(o)&&!V.isContentEditableElement(o),g(o))return o;if(V.isRenderedNode(o)&&a(o)&&!r&&(i=f(o)))return i}return i}function c(e,t){var n=e.childNodes,o=n.length,i=null,r=null,l=null,u=null;if(!o&&g(e))return e;for(var s=o-1;s>=0;s--){if(i=n[s],l=V.isElementNode(i)&&!V.isContentEditableElement(i),u=V.isTextNode(i)&&(!t||!p(i)))return i;if(V.isRenderedNode(i)&&a(i)&&!l&&(r=c(i,!1)))return r}return r}function m(e,t){if(!e||!e.length)return 0;for(var n=e.length,o=t||0,i=o;i<n&&(10===e.charCodeAt(i)||32===e.charCodeAt(i));i++)o++;return o}function h(e){if(!e||!e.length)return 0;for(var t=e.length,n=t,o=t-1;o>=0&&(10===e.charCodeAt(o)||32===e.charCodeAt(o));o--)n--;return n}function p(e){if(!V.isTextNode(e))return!1;var t=e.nodeValue,n=m(t),o=h(t);return n===t.length&&0===o}function g(e){return V.isTextNode(e)&&!p(e)}function E(e){return!V.isRenderedNode(e)||V.isShadowUIElement(e)}function v(e){var t=e.getAttribute?e.getAttribute("contenteditable"):null;return""===t||"true"===t}function y(e){var t=V.getParents(e);if(v(e)&&V.isContentEditableElement(e))return e;var n=V.findDocument(e);return"on"===n.designMode?n.body:W.find(t,function(e){return v(e)&&V.isContentEditableElement(e)})}function b(e,t){if(V.isTheSameNode(e,t))return V.isTheSameNode(t,y(e))?e:e.parentNode;var n=[],o=y(e),i=null;if(!V.isElementContainsNode(o,t))return null;for(i=e;i!==o;i=i.parentNode)n.push(i);for(i=t;i!==o;i=i.parentNode)if(W.indexOf(n,i)!==-1)return i;return o}function w(e,t){var n=null,o=null,i=e.childNodes.length,r=t>=i;if(V.isShadowUIElement(e))return{node:e,offset:t};if(r?n=e.childNodes[i-1]:(n=e.childNodes[t],o=0),V.isShadowUIElement(n)){if(i<=1)return{node:e,offset:0};r=t-1>=i,r?n=e.childNodes[i-2]:(n=e.childNodes[t-1],o=0)}for(;!E(n)&&V.isElementNode(n);){if(!u(n)){o=0;break}n=n.childNodes[r?n.childNodes.length-1:0]}return 0===o||E(n)||(o=n.nodeValue?n.nodeValue.length:0),{node:n,offset:o}}function S(e,t,n){var o=n?t.focusNode:t.anchorNode,i=n?t.focusOffset:t.anchorOffset,r={node:o,offset:i};return(V.isTheSameNode(e,o)||V.isElementNode(o))&&u(o)&&(r=w(o,i)),{node:r.node,offset:r.offset}}function x(e,t,n){var o=n?t.anchorNode:t.focusNode,i=n?t.anchorOffset:t.focusOffset,r={node:o,offset:i};return(V.isTheSameNode(e,o)||V.isElementNode(o))&&u(o)&&(r=w(o,i)),{node:r.node,offset:r.offset}}function _(e,t,n){return{startPos:S(e,t,n),endPos:x(e,t,n)}}function N(e,t,n){var o=S(e,t,n);return C(e,o)}function T(e,t,n){var o=x(e,t,n);return C(e,o)}function I(e,t){function n(t){var i=t.childNodes;if(o.node)return o;if(E(t))return o;if(V.isTextNode(t)){if(o.offset<=t.nodeValue.length)return o.node=t,o;t.nodeValue.length&&(!o.node&&d(e,t)&&o.offset--,o.offset-=t.nodeValue.length)}else if(V.isElementNode(t)){if(0===o.offset&&!A(t).length)return o.node=t,o;o.node||!s(e,t)&&!d(e,t)?!i.length&&V.isElementNode(t)&&"br"===V.getTagName(t)&&o.offset--:o.offset--}return W.forEach(i,function(e){o=n(e)}),o}var o={node:null,offset:t};return n(e)}function C(e,t){function n(t){var u=t.childNodes;return l?r:V.isTheSameNode(o,t)?((s(e,t)||d(e,t))&&r++,l=!0,r+i):E(t)?r:(!u.length&&t.nodeValue&&t.nodeValue.length?(!l&&d(e,t)&&r++,r+=t.nodeValue.length):!u.length&&V.isElementNode(t)&&"br"===V.getTagName(t)?r++:l||!s(e,t)&&!d(e,t)||r++,W.forEach(u,function(e){r=n(e)}),r)}var o=t.node,i=t.offset,r=0,l=!1;return n(e)}function M(e){var t=b(e.anchorNode,e.focusNode);return V.isTextNode(t)?t.parentElement:t}function R(e){var t=V.isTextNode(e)?e:f(e),n=V.findDocument(e),o=n.createRange();return t?(o.selectNodeContents(t),C(e,{node:t,offset:o.startOffset})):0}function O(e){var t=V.isTextNode(e)?e:c(e,!0),n=V.findDocument(e),o=n.createRange();return t?(o.selectNodeContents(t),C(e,{node:t,offset:o.endOffset})):0}function A(e){var t="",n=e.childNodes;return E(e)?t:!n.length&&V.isTextNode(e)?e.nodeValue:1===n.length&&V.isTextNode(n[0])?n[0].nodeValue:(W.forEach(n,function(e){t+=A(e)}),t)}e.__esModule=!0,e.getFirstVisibleTextNode=f,e.getLastTextNode=c,e.getFirstNonWhitespaceSymbolIndex=m,e.getLastNonWhitespaceSymbolIndex=h,e.isInvisibleTextNode=p,e.findContentEditableParent=y,e.getNearestCommonAncestor=b,e.getSelection=_,e.getSelectionStartPosition=N,e.getSelectionEndPosition=T,e.calculateNodeAndOffsetByPosition=I,e.calculatePositionByNodeAndOffset=C,e.getElementBySelection=M,e.getFirstVisiblePosition=R,e.getLastVisiblePosition=O,e.getContentEditableValue=A;var P=n("./dom"),V=o(P),D=n("./array"),W=o(D)},"delay.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0,e["default"]=function(e){return new l(function(t){return u.setTimeout.call(window,t,e)})};var i=n("../deps/hammerhead"),r=o(i),l=r["default"].Promise,u=r["default"].nativeMethods;t.exports=e["default"]},"dom.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function r(e){return q.filter(e,function(e){return e.tabIndex>0})}function l(e){return q.filter(e,function(e){return e.tabIndex<=0})}function u(e){if(!e||!e.length)return[];var t=r(e),n=q.filter(e,function(e){return k(e)});if(!t.length)return n.length&&(e=a(e,n)),e;t=t.sort(d("tabIndex"));var o=l(e);return n.length?a(t,n).concat(a(o,n)):t.concat(o)}function a(e,t){var n=s(t),o=[],i=[],a=[],c=0;for(c=0;c<n.length;c++){try{a=f(n[c].contentDocument)}catch(m){a=[]}i.push(u(a))}for(c=0;c<e.length;c++)if(o.push(e[c]),k(e[c]))if(B.isIE){o.pop();var h=i[q.indexOf(t,e[c])],p=r(h),g=l(h);p=p.sort(d("tabIndex")),o=o.concat(p),o.push(e[c]),o=o.concat(g)}else B.isWebKit&&i[q.indexOf(t,e[c])].length&&o.pop(),o=o.concat(i[q.indexOf(t,e[c])]);return o}function s(e){var t=r(e);return t.length?t.sort(d("tabIndex")).concat(l(e)):e}function d(e){return function(t,n){return t[e]<n[e]?-1:t[e]>n[e]?1:0}}function f(e){for(var t=e.querySelectorAll("*"),n=c(t),o=/^(input|button|select|textarea)$/,i=[],r=null,l=null,u=null,a=!1,s=0;s<t.length;s++)if(r=t[s],l=J(r),u=m(r),a=!1,!r.disabled&&"none"!==W.get(r,"display")&&"hidden"!==W.get(r,"visibility")&&!(B.isIE&&K(r)||null!==u&&u<0)){o.test(l)?a=!0:B.isIE&&k(r)?i.push(r):U(r)&&r.hasAttribute("href")&&(a=""!==r.getAttribute("href")||!B.isIE||null!==u);var d=r.getAttribute("contenteditable");""!==d&&"true"!==d||(a=!0),null!==u&&(a=!0),a&&i.push(r)}return q.filter(i,function(e){return!h(n,e)})}function c(e){for(var t=[],n=0;n<e.length;n++)"none"===W.get(e[n],"display")&&t.push(e[n]);return t}function m(e){var t=e.getAttribute("tabIndex");return null!==t&&(t=parseInt(t,10),t=isNaN(t)?null:t),t}function h(e,t){return e.contains?e.contains(t):q.some(e,function(e){return e.contains(t)})}function p(e,t){if(!e.value)return 0;var n=e.value.substring(0,t),o=n.lastIndexOf("\n")===-1?0:n.lastIndexOf("\n")+1;return t-o}function g(e,t){for(var n=e.value.split("\n"),o=0,i=0,r=0;o<=t;r++){if(t<=o+n[r].length){i=r;break}o+=n[r].length+1}return i}function E(e,t,n){for(var o=e.value.split("\n"),i=0,r=0;r<t;r++)i+=o[r].length+1;return i+n}function v(e){var t=null;return t=B.isSafari?/^(text|password|color|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:B.isFirefox?/^(text|password|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:B.isIE?/^(text|password|color|date|time|datetime|datetime-local|email|file|month|number|search|tel|url|week|image)$/i:/^(text|password|datetime|email|number|search|tel|url|image)$/i,t.test(e.type)}function y(e,t){return t?G(e)||Y(e):z(e)||Y(e)}function b(e,t){function n(e,t){(o||_(t,e))&&(o=!0);for(var i=0;i<e.childNodes.length;i++)if(o=n(e.childNodes[i],t))return o;return o}var o=!1;return n(e,t)}function w(e,t){var n=e.querySelectorAll("option");return q.indexOf(n,t)}function S(e,t){var n=e.querySelectorAll("optgroup");return q.indexOf(n,t)}function x(e){j(e)&&e.setAttribute("unselectable","on");for(var t=e.firstChild;t;)x(t),t=t.nextSibling}function _(e,t){return e&&t&&e.isSameNode?e.isSameNode(t):e===t}function N(e){var t={id:"id",name:"name","class":"className"},n=[];n.push("<"),n.push(J(e));for(var o in t)if(t.hasOwnProperty(o)){var i=e[t[o]];i&&n.push(" "+o+'="'+i+'"')}return n.push(">"),n.join("")}function T(e,t){var n=t?-1:1,o=u(f(H(e)));F(e)&&"radio"===e.type&&""!==e.name&&!B.isFirefox&&(o=q.filter(o,function(t){return!t.name||t===e||t.name!==e.name}));var i=q.indexOf(o,e),r=t?0===i:i===o.length-1;return r?document.body:t&&i===-1?o[o.length-1]:o[i+n]}function I(e){for(var t=Q(e),n=0;n<t.length;n++)if($(t[n]))return t[n];return null}function C(e){e&&e.parentElement&&e.parentElement.removeChild(e)}function M(e){if(!e.setTimeout)return!1;var t=null;try{t=e.frameElement}catch(n){return!!e.top}return!(!B.isFirefox&&!B.isWebKit||e.top===e.self||t)||!(!t||!t.contentDocument)}function R(e){try{return e.top===e.self}catch(t){return!1}}function O(e,t){for(var n=(t||window).document.getElementsByTagName("iframe"),o=0;o<n.length;o++)if(n[o].contentWindow===e)return n[o];return null}function A(e){return z(e)||X(e)}e.__esModule=!0,e.getTopSameDomainWindow=e.getParents=e.closest=e.getTagName=e.getMapContainer=e.getScrollbarSize=e.isHammerheadAttr=e.isElementFocusable=e.isShadowUIElement=e.isDomElement=e.isContentEditableElement=e.isTextEditableElementAndEditingAllowed=e.isTextEditableElement=e.isTextEditableInput=e.isWindow=e.isDocument=e.isHtmlElement=e.isBodyElement=e.isMapElement=e.isSVGElement=e.isOptionElement=e.isSelectElement=e.isFormElement=e.isImgElement=e.isAnchorElement=e.isTextAreaElement=e.isFileInput=e.isInputElement=e.isIframeElement=e.isRenderedNode=e.isTextNode=e.isElementNode=e.getSelectVisibleChildren=e.getChildVisibleIndex=e.getSelectParent=e.isCrossDomainWindows=e.getIframeByElement=e.isElementInIframe=e.isElementInDocument=e.findDocument=e.getActiveElement=void 0,e.containsElement=h,e.getTextareaIndentInLine=p,e.getTextareaLineNumberByPosition=g,e.getTextareaPositionByLineAndOffset=E,e.blocksImplicitSubmission=v,e.isEditableElement=y,e.isElementContainsNode=b,e.getOptionIndex=w,e.getOptionGroupIndex=S,e.setUnselectableAttributeRecursive=x,e.isTheSameNode=_,e.getElementDescription=N,e.getNextFocusableElement=T,e.getFocusableParent=I,e.remove=C,e.isIFrameWindowInDOM=M,e.isTopWindow=R,e.findIframeByWindow=O,e.isEditableFormElement=A;var P=n("../deps/hammerhead"),V=i(P),D=n("./style"),W=o(D),L=n("./array"),q=o(L),B=V["default"].utils.browser,H=(e.getActiveElement=V["default"].utils.dom.getActiveElement,e.findDocument=V["default"].utils.dom.findDocument),j=(e.isElementInDocument=V["default"].utils.dom.isElementInDocument,e.isElementInIframe=V["default"].utils.dom.isElementInIframe,e.getIframeByElement=V["default"].utils.dom.getIframeByElement,e.isCrossDomainWindows=V["default"].utils.dom.isCrossDomainWindows,e.getSelectParent=V["default"].utils.dom.getSelectParent,e.getChildVisibleIndex=V["default"].utils.dom.getChildVisibleIndex,e.getSelectVisibleChildren=V["default"].utils.dom.getSelectVisibleChildren,e.isElementNode=V["default"].utils.dom.isElementNode),k=(e.isTextNode=V["default"].utils.dom.isTextNode,e.isRenderedNode=V["default"].utils.dom.isRenderedNode,e.isIframeElement=V["default"].utils.dom.isIframeElement),F=e.isInputElement=V["default"].utils.dom.isInputElement,U=(e.isFileInput=V["default"].utils.dom.isFileInput,e.isTextAreaElement=V["default"].utils.dom.isTextAreaElement,e.isAnchorElement=V["default"].utils.dom.isAnchorElement),X=(e.isImgElement=V["default"].utils.dom.isImgElement,e.isFormElement=V["default"].utils.dom.isFormElement,e.isSelectElement=V["default"].utils.dom.isSelectElement),K=e.isOptionElement=V["default"].utils.dom.isOptionElement,z=(e.isSVGElement=V["default"].utils.dom.isSVGElement,e.isMapElement=V["default"].utils.dom.isMapElement,e.isBodyElement=V["default"].utils.dom.isBodyElement,e.isHtmlElement=V["default"].utils.dom.isHtmlElement,e.isDocument=V["default"].utils.dom.isDocument,e.isWindow=V["default"].utils.dom.isWindow,e.isTextEditableInput=V["default"].utils.dom.isTextEditableInput,e.isTextEditableElement=V["default"].utils.dom.isTextEditableElement),G=e.isTextEditableElementAndEditingAllowed=V["default"].utils.dom.isTextEditableElementAndEditingAllowed,Y=e.isContentEditableElement=V["default"].utils.dom.isContentEditableElement,$=(e.isDomElement=V["default"].utils.dom.isDomElement,e.isShadowUIElement=V["default"].utils.dom.isShadowUIElement,e.isElementFocusable=V["default"].utils.dom.isElementFocusable),J=(e.isHammerheadAttr=V["default"].utils.dom.isHammerheadAttr,e.getScrollbarSize=V["default"].utils.dom.getScrollbarSize,e.getMapContainer=V["default"].utils.dom.getMapContainer,e.getTagName=V["default"].utils.dom.getTagName),Q=(e.closest=V["default"].utils.dom.closest,e.getParents=V["default"].utils.dom.getParents);e.getTopSameDomainWindow=V["default"].utils.dom.getTopSameDomainWindow},"event.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,n,o){f.isWindow(e)?m.windowAddEventListener.call(e,t,n,o):m.addEventListener.call(e,t,n,o)}function l(e,t,n,o){f.isWindow(e)?m.windowRemoveEventListener.call(e,t,n,o):m.removeEventListener.call(e,t,n,o)}function u(){return new c(function(e){function t(){if(!o){if(!document.body)return void m.setTimeout.call(window,t,1);o=!0,l(window,"load",t),e()}}function n(){(f.isIFrameWindowInDOM(window)||f.isTopWindow(window))&&(l(document,"DOMContentLoaded",n),t())}var o=!1;"complete"===document.readyState?m.setTimeout.call(window,n,1):(r(document,"DOMContentLoaded",n),r(window,"load",t))})}e.__esModule=!0,e.preventDefault=e.WHICH_PARAMETER=e.DOM_EVENTS=e.BUTTONS_PARAMETER=e.BUTTON=e.RECORDING_LISTENED_EVENTS=void 0,e.bind=r,e.unbind=l,e.documentReady=u;var a=n("../deps/hammerhead"),s=i(a),d=n("./dom"),f=o(d),c=s["default"].Promise,m=s["default"].nativeMethods;e.RECORDING_LISTENED_EVENTS=["click","mousedown","mouseup","dblclick","contextmenu","mousemove","mouseover","mouseout","touchstart","touchmove","touchend","keydown","keypress","input","keyup","change","focus","blur","MSPointerDown","MSPointerMove","MSPointerOver","MSPointerOut","MSPointerUp","pointerdown","pointermove","pointerover","pointerout","pointerup"],e.BUTTON=s["default"].utils.event.BUTTON,e.BUTTONS_PARAMETER=s["default"].utils.event.BUTTONS_PARAMETER,e.DOM_EVENTS=s["default"].utils.event.DOM_EVENTS,e.WHICH_PARAMETER=s["default"].utils.event.WHICH_PARAMETER,e.preventDefault=s["default"].utils.event.preventDefault},"get-key-array.js":function(e,t,n){function o(e){var t=e.replace(/^\+/g,"plus").replace(/\+\+/g,"+plus").split("+");return(0,i.map)(t,function(e){return e.replace("plus","+")})}e.__esModule=!0,e["default"]=o;var i=n("./array");t.exports=e["default"]},"get-sanitized-key.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=1===e.length||"space"===e,n=t?e:e.toLowerCase();return l["default"].modifiersMap[n]&&(n=l["default"].modifiersMap[n]),
  n}e.__esModule=!0,e["default"]=i;var r=n("./key-maps"),l=o(r);t.exports=e["default"]},"key-maps.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}e.__esModule=!0;var r=n("../deps/hammerhead"),l=o(r),u=l["default"].utils.browser,a={alt:18,ctrl:17,meta:91,shift:16},s={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]",":":";",'"':"'","|":"\\","<":",",">":".","?":"/","±":"§"},d={backspace:8,capslock:20,"delete":46,down:40,end:35,enter:13,esc:27,home:36,ins:45,left:37,pagedown:34,pageup:33,right:39,space:32,tab:9,up:38};e["default"]={modifiers:a,shiftMap:s,specialKeys:d,reversedModifiers:i(a),reversedShiftMap:i(s),reversedSpecialKeys:i(d),modifiersMap:{option:"alt"},keyProperty:{left:u.isIE?"Left":"ArrowLeft",down:u.isIE?"Down":"ArrowDown",right:u.isIE?"Right":"ArrowRight",up:u.isIE?"Up":"ArrowUp",backspace:"Backspace",capslock:"CapsLock","delete":"Delete",end:"End",enter:"Enter",esc:"Escape",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:" ",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},symbolCharCodeToKeyCode:{96:192,91:219,93:221,92:220,59:186,39:222,44:188,45:u.isFirefox?173:189,46:190,47:191},symbolKeysCharCodes:{109:45,173:45,186:59,187:61,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39,110:46,96:48,97:49,98:50,99:51,100:52,101:53,102:54,103:55,104:56,105:57,107:43,106:42,111:47}},t.exports=e["default"]},"node-type-descriptions.js":function(e,t,n){e.__esModule=!0,e["default"]={1:"element",2:"attribute",3:"text",4:"cdata section",5:"entity reference",6:"entity node",7:"processing instruction",8:"comment",9:"document",10:"document type",11:"document fragment",12:"notation"},t.exports=e["default"]},"noop.js":function(e,t,n){function o(){}e.__esModule=!0,e["default"]=o,t.exports=e["default"]},"parse-key-sequence.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0,e["default"]=function(e){if("string"!=typeof e)return{error:!0};e=m(e).replace(/\s+/g," ");var t=e.length,n=e.charAt(t-1),o=e.charAt(t-2);t>1&&"+"===n&&!/[\+ ]/.test(o)&&(e=e.substring(0,e.length-1));var i=e.split(" "),r=(0,a.some)(i,function(e){var t=(0,d["default"])(e);return(0,a.some)(t,function(e){var t=1===e.length||"space"===e,n=(0,c["default"])(e),o=u["default"].modifiers[n],i=u["default"].specialKeys[n];return!(t||o||i)})});return{combinations:i,error:r,keys:e}};var i=n("../deps/hammerhead"),r=o(i),l=n("./key-maps"),u=o(l),a=n("./array"),s=n("./get-key-array"),d=o(s),f=n("./get-sanitized-key"),c=o(f),m=r["default"].utils.trim;t.exports=e["default"]},"position.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function r(e){var t=C(e),n=t.left,o=t.top,i=M({x:n,y:o}),r=_.getBordersWidth(e),l=_.getElementPadding(e),u=i.x+r.left+l.left,a=i.y+r.top+l.top;return{left:u,top:a,right:u+_.getWidth(e),bottom:a+_.getHeight(e)}}function l(e){if(T.isTextNode(e))return!_.isNotVisibleNode(e);var t=I(e);if(!T.isContentEditableElement(e)&&(0===t.width||0===t.height))return!1;if(T.isMapElement(e)){var n=T.getMapContainer(T.closest(e,"map"));return!!n&&l(n)}if(_.isSelectVisibleChild(e)){var o=T.getSelectParent(e),i=T.getChildVisibleIndex(o,e),r=_.getSelectElementSize(o),u=Math.max(_.getScrollTop(o)/_.getOptionHeight(o),0),a=u+r-1,s=Math.max(i-u,0);return s>=u&&s<=a}return T.isSVGElement(e)?"hidden"!==_.get(e,"visibility")&&"none"!==_.get(e,"display"):_.hasDimensions(e)&&"hidden"!==_.get(e,"visibility")}function u(e){if(!T.isDomElement(e)){var t=M(e);return{width:0,height:0,border:{bottom:0,left:0,right:0,top:0},scroll:{left:0,top:0},left:t.x,right:t.x,top:t.y,bottom:t.y}}var n=/html/i.test(e.tagName),o=n?e.getElementsByTagName("body")[0]:null,i=_.getBordersWidth(e),r=e.getBoundingClientRect(),l=_.getElementScroll(e),u=T.isElementInIframe(e),a=n?0:r.left,s=n?0:r.top,d=n?e.clientHeight:r.height,f=n?e.clientWidth:r.width,c="BackCompat"===e.ownerDocument.compatMode;if(n&&o&&("boolean"==typeof isIFrameWithoutSrc&&isIFrameWithoutSrc||c)&&(d=o.clientHeight,f=o.clientWidth),u){var m=T.getIframeByElement(e);if(m){var h=C(m),p=M({x:h.left,y:h.top}),g=_.getBordersWidth(m);a+=p.x+g.left,s+=p.y+g.top,n&&(i.bottom+=g.bottom,i.left+=g.left,i.right+=g.right,i.top+=g.top)}}var E=n||_.getInnerWidth(e)===e.clientWidth?0:T.getScrollbarSize(),v=n||_.getInnerHeight(e)===e.clientHeight?0:T.getScrollbarSize();return{width:f,height:d,left:a,top:s,border:i,bottom:s+d,right:a+f,scroll:{left:l.left,top:l.top},scrollbar:{right:E,bottom:v}}}function a(e,t,n){var o=u(e),i=Math.max(e.scrollWidth,o.width),r=Math.max(e.scrollHeight,o.height),l=o.scrollbar.right+o.border.left+o.border.right+i,a=o.scrollbar.bottom+o.border.top+o.border.bottom+r;return("undefined"==typeof t||t>=0&&l>=t)&&("undefined"==typeof n||n>=0&&a>=n)}function s(e){var t=e.target||e.srcElement,n=d(e),o=T.findDocument(t),i=0,r=0;if(T.isElementInIframe(o.documentElement)){var l=T.getIframeByElement(o);if(l){var u=C(l),a=_.getBordersWidth(l);i=u.left+a.left,r=u.top+a.top}}return{x:n.x+i,y:n.y+r}}function d(e){var t=/^touch/.test(e.type)&&e.targetTouches?e.targetTouches[0]||e.changedTouches[0]:e,n=0===t.pageX&&0===t.pageY,o=0!==t.clientX||0!==t.clientY;if((null===t.pageX||n&&o)&&null!==t.clientX){var i=T.findDocument(e.target||e.srcElement),r=i.documentElement,l=i.body;return{x:Math.round(t.clientX+(r&&r.scrollLeft||l&&l.scrollLeft||0)-(r.clientLeft||0)),y:Math.round(t.clientY+(r&&r.scrollTop||l&&l.scrollTop||0)-(r.clientTop||0))}}return{x:Math.round(t.pageX),y:Math.round(t.pageY)}}function f(e,t){var n=null,o=document.getElementFromPoint||document.elementFromPoint;try{n=o.call(document,e,t)}catch(i){return null}return null===n&&(n=o.call(document,e-1,t-1)),n}function c(e,t){var n=T.findIframeByWindow(t),o=C(n),i=_.getBordersWidth(n),r=_.getElementPadding(n);return M({x:e.x+o.left+i.left+r.left,y:e.y+o.top+i.top+r.top})}function m(e,t){var n=t||document;return{x:e.x+_.getScrollLeft(n),y:e.y+_.getScrollTop(n)}}function h(e){var t=I(e);return{x:Math.round(t.left+t.width/2),y:Math.round(t.top+t.height/2)}}function p(e){var t=C(e),n=t.left,o=t.top,i=M({x:n,y:o});return i.x=Math.round(i.x),i.y=Math.round(i.y),i}function g(e){var t=I(e),n=M({x:t.left,y:t.top});return{height:t.height,left:n.x,top:n.y,width:t.width}}function E(e,t){return{left:e.left-(t.left+t.border.left),right:t.right-t.border.right-t.scrollbar.right-e.right,top:e.top-(t.top+t.border.top),bottom:t.bottom-t.border.bottom-t.scrollbar.bottom-e.bottom}}function v(e,t){var n=e.x,o=e.y;return n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom}function y(e,t,n){if(t.x-e.x===0)return null;var o=(t.y-e.y)/(t.x-e.x),i=e.x*(e.y-t.y)/(t.x-e.x)+e.y;return Math.round(o*n+i)}function b(e,t,n){if(t.y-e.y===0)return null;var o=(t.x-e.x)/(t.y-e.y),i=e.y*(e.x-t.x)/(t.y-e.y)+e.x;return Math.round(o*n+i)}e.__esModule=!0,e.offsetToClientCoords=e.getOffsetPosition=e.getElementRectangle=void 0,e.getIframeClientCoordinates=r,e.isElementVisible=l,e.getClientDimensions=u,e.containsOffset=a,e.getEventAbsoluteCoordinates=s,e.getEventPageCoordinates=d,e.getElementFromPoint=f,e.getIframePointRelativeToParentFrame=c,e.clientToOffsetCoord=m,e.findCenter=h,e.getClientPosition=p,e.getElementClientRectangle=g,e.calcRelativePosition=E,e.isInRectangle=v,e.getLineYByXCoord=y,e.getLineXByYCoord=b;var w=n("../deps/hammerhead"),S=i(w),x=n("./style"),_=o(x),N=n("./dom"),T=o(N),I=e.getElementRectangle=S["default"].utils.position.getElementRectangle,C=e.getOffsetPosition=S["default"].utils.position.getOffsetPosition,M=e.offsetToClientCoords=S["default"].utils.position.offsetToClientCoords},"send-request-to-frame.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){return new u(function(o){function i(e){e.message.cmd===t&&(a.off(a.SERVICE_MSG_RECEIVED_EVENT,i),o(e.message))}a.on(a.SERVICE_MSG_RECEIVED_EVENT,i),a.sendServiceMsg(e,n)})}e.__esModule=!0,e["default"]=i;var r=n("../deps/hammerhead"),l=o(r),u=l["default"].Promise,a=l["default"].eventSandbox.message;t.exports=e["default"]},"service.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=function(){};n.prototype=t.prototype,l["default"].utils.extend(e.prototype,new n),e.prototype.constructor=e,e.base=t.prototype}e.__esModule=!0,e.EventEmitter=void 0,e.inherit=i;var r=n("../deps/hammerhead"),l=o(r),u=n("./array"),a=e.EventEmitter=function(){this.eventsListeners=[]};a.prototype.emit=function(e){var t=this.eventsListeners[e];if(t)for(var n=0;n<t.length;n++)try{t[n]&&t[n].apply(this,Array.prototype.slice.apply(arguments,[1]))}catch(o){if(!(o.message&&o.message.indexOf("freed script")>-1))throw o;t[n]=null}},a.prototype.off=function(e,t){var n=this.eventsListeners[e];n&&(this.eventsListeners[e]=(0,u.filter)(n,function(e){return e!==t}))},a.prototype.on=function(e,t){this.eventsListeners[e]||(this.eventsListeners[e]=[]),this.eventsListeners[e].push(t)}},"style.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function r(e){return!h.isRenderedNode(e)||w(e)||b(e)}function l(e){var t=h.getParents(e);if(h.isElementInIframe(e)){var n=h.getParents(h.getIframeByElement(e));t.concat(n)}return(0,p.filter)(t,function(e){return!h.isBodyElement(e)&&u(e)})}function u(e){var t=/auto|scroll/i,n=E(e,"overflowX"),o=E(e,"overflowY"),i=t.test(n),r=t.test(o),l=/html/i.test(e.tagName),u=l?e.getElementsByTagName("body")[0]:null;if(l&&"hidden"===n&&"hidden"===o)return!1;if(!l&&!i&&!r)return!1;var a=(r||l)&&e.scrollHeight>e.clientHeight,s=(i||l)&&e.scrollWidth>e.clientWidth;return!(!a&&!s)||!(!l||!u)&&(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)}function a(e){return e&&!(e.offsetHeight<=0&&e.offsetWidth<=0)}function s(e){if("none"===E(e,"display")||!a(e)||e.type&&"hidden"===e.type)return!0;for(var t=h.findDocument(e).querySelectorAll("*"),n=[],o=0;o<t.length;o++)"none"!==E(t[o],"display")&&a(t[o])||n.push(t[o]);return h.containsElement(n,e)}function d(e,t,n){"string"==typeof t&&g.set(e,t,n);for(var o in t)t.hasOwnProperty(o)&&g.set(e,o,t[o])}e.__esModule=!0,e.get=e.setScrollTop=e.setScrollLeft=e.getScrollTop=e.getScrollLeft=e.getInnerHeight=e.getInnerWidth=e.getHeight=e.getWidth=e.isSelectVisibleChild=e.getSelectElementSize=e.getOptionHeight=e.getElementScroll=e.getElementPadding=e.getElementMargin=e.getBordersWidth=void 0,e.isNotVisibleNode=r,e.getScrollableParents=l,e.hasScroll=u,e.hasDimensions=a,e.isElementHidden=s,e.set=d;var f=n("../deps/hammerhead"),c=i(f),m=n("./dom"),h=o(m),p=n("./array"),g=c["default"].utils.style,E=(e.getBordersWidth=c["default"].utils.style.getBordersWidth,e.getElementMargin=c["default"].utils.style.getElementMargin,e.getElementPadding=c["default"].utils.style.getElementPadding,e.getElementScroll=c["default"].utils.style.getElementScroll,e.getOptionHeight=c["default"].utils.style.getOptionHeight,e.getSelectElementSize=c["default"].utils.style.getSelectElementSize,e.isSelectVisibleChild=c["default"].utils.style.isVisibleChild,e.getWidth=c["default"].utils.style.getWidth,e.getHeight=c["default"].utils.style.getHeight,e.getInnerWidth=c["default"].utils.style.getInnerWidth,e.getInnerHeight=c["default"].utils.style.getInnerHeight,e.getScrollLeft=c["default"].utils.style.getScrollLeft,e.getScrollTop=c["default"].utils.style.getScrollTop,e.setScrollLeft=c["default"].utils.style.setScrollLeft,e.setScrollTop=c["default"].utils.style.setScrollTop,e.get=c["default"].utils.style.get),v=function(e){for(var t=[];e.parentNode;)t.unshift(e.parentNode),e=e.parentNode;return t},y=function(e){return v(e).concat([e])},b=function(e){var t=h.isTextNode(e)?e.parentNode:null;return t&&"hidden"===E(t,"visibility")},w=function(e){var t=y(e);return(0,p.some)(t,function(e){return h.isElementNode(e)&&"none"===E(e,"display")})}},"text-selection.js":function(e,t,n){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,n,o,i){if(i)switch(V){case P:t===H&&(e===q||n>L)?V=A:(e<q||t<H)&&(V=O);break;case A:if(e===q&&t===H||e<q&&n>L||t===H&&n===L&&i>B&&e+o!==D)break;(e<q||t<H)&&(V=O);break;case O:if((e<q||t<H)&&i>B)break;t===W&&(e>=D||n>L)&&(V=A)}else D=e,W=t,V=P;L=n,q=e,B=i,H=t}function l(){var e=null,t=null,n=null,o=null,i=null;try{if(this.selection)n=this.selection.createRange();else{if(e=this.activeElement,!e||!_.isTextEditableElement(e))return void(V=P);if(i=f(e),t=c(e),e.createTextRange)n=e.createTextRange(),n.collapse(!0),n.moveStart("character",i),n.moveEnd("character",t-i);else if(document.createRange){n=document.createRange();var l=e.firstChild;n.setStart(l,i),n.setEnd(l,t),o=n.getBoundingClientRect()}}}catch(u){return void(V=P)}var a=o?Math.ceil(o.left):n.offsetLeft,s=o?Math.ceil(o.top):n.offsetTop,d=o?Math.ceil(o.height):n.boundingHeight,m=o?Math.ceil(o.width):n.boundingWidth,h=n.htmlText?n.htmlText.length:0,p=o?n.toString().length:h;r(a,s,d,m,p)}function u(e,t,n,o){var i=null,r=null,l=null,u=null,a=null,s=!1;"undefined"!=typeof t&&"undefined"!=typeof n&&t>n&&(a=t,t=n,n=a,s=!0),"undefined"==typeof t&&(r=T.getFirstVisibleTextNode(e),u={node:r||e,offset:r&&r.nodeValue?T.getFirstNonWhitespaceSymbolIndex(r.nodeValue):0}),"undefined"==typeof n&&(l=T.getLastTextNode(e,!0),i={node:l||e,offset:l&&l.nodeValue?T.getLastNonWhitespaceSymbolIndex(l.nodeValue):0}),u=u||T.calculateNodeAndOffsetByPosition(e,t),i=i||T.calculateNodeAndOffsetByPosition(e,n),u.node&&i.node&&(s?g(i,u,o):g(u,i,o))}function a(e){var t=h(e),n=t.anchorNode,o=t.focusNode,i=t.anchorOffset,r=t.focusOffset,l=T.getFirstNonWhitespaceSymbolIndex(n.nodeValue),u=T.getLastNonWhitespaceSymbolIndex(n.nodeValue),a=T.getFirstNonWhitespaceSymbolIndex(o.nodeValue),s=T.getLastNonWhitespaceSymbolIndex(o.nodeValue),d=null,f=null;if(_.isTextNode(n)&&(i<l&&0!==i?d=0:i!==n.nodeValue.length&&(T.isInvisibleTextNode(n)&&0!==i||i>u)&&(d=n.nodeValue.length)),_.isTextNode(o)&&(r<a&&0!==r?f=0:r!==o.nodeValue.length&&(T.isInvisibleTextNode(o)&&0!==r||r>s)&&(f=o.nodeValue.length)),(M.isWebKit||M.isIE&&M.version>11)&&(null!==d&&(0===d?n.nodeValue=n.nodeValue.substring(l):n.nodeValue=n.nodeValue.substring(0,u)),null!==f&&(0===f?o.nodeValue=o.nodeValue.substring(a):o.nodeValue=o.nodeValue.substring(0,s))),null!==d||null!==f){d=null!==d?0===d?d:n.nodeValue.length:i,f=null!==f?0===f?f:o.nodeValue.length:r;var c={node:n,offset:d},m={node:o,offset:f};g(c,m)}}function s(e){var t=e?_.findDocument(e):document,n=t.getSelection(),o=null,i=!1;return n&&(n.isCollapsed||(o=t.createRange(),o.setStart(n.anchorNode,n.anchorOffset),o.setEnd(n.focusNode,n.focusOffset),i=o.collapsed,o.detach())),i}function d(e,t,n){var o=T.calculatePositionByNodeAndOffset(e,t),i=T.calculatePositionByNodeAndOffset(e,n);return o>i}function f(e){var t=null;return _.isContentEditableElement(e)?b(e)?(t=h(e),T.getSelectionStartPosition(e,t,s(e))):0:R.getSelection(e).start}function c(e){var t=null;return _.isContentEditableElement(e)?b(e)?(t=h(e),T.getSelectionEndPosition(e,t,s(e))):0:R.getSelection(e).end}function m(e){return _.isContentEditableElement(e)?s(e):(R.getSelection(e).direction||V)===O}function h(e){var t=_.findDocument(e);return t?t.getSelection():window.getSelection()}function p(e,t,n){if(_.isContentEditableElement(e))return void u(e,t,n,!0);var o=t||0,i="undefined"==typeof n?e.value.length:n,r=!1,l=null;o>i&&(l=o,o=i,i=l,r=!0),R.setSelection(e,o,i,r?O:A),V=t===n?P:r?O:A}function g(e,t,n){var o=e.node,i=t.node,r=o.nodeValue?o.length:0,l=i.nodeValue?i.length:0,u=Math.min(r,e.offset),a=Math.min(l,t.offset),s=T.findContentEditableParent(o),f=d(s,e,t),c=h(s),m=_.findDocument(s),p=m.createRange(),g=function(){if(c.removeAllRanges(),f)if(M.isIE)p.setStart(i,a),p.setEnd(o,u),c.addRange(p);else if(p.setStart(o,u),p.setEnd(o,u),c.addRange(p),M.isWebKit&&T.isInvisibleTextNode(i))try{c.extend(i,Math.min(a,1))}catch(e){c.extend(i,0)}else c.extend(i,a);else p.setStart(o,u),p.setEnd(i,a),c.addRange(p)};R.wrapSetterSelection(s,g,n,!0)}function E(e){var t=h(e),n=t.rangeCount;if(n)for(var o=0;o<n;o++)t.getRangeAt(o).deleteContents()}function v(e,t){var n=f(e),o=c(e);if(t&&u(e),n!==o){a(e),E(e);var i=h(e),r=null;i.rangeCount&&!i.getRangeAt(0).collapsed&&(r=i.getRangeAt(0),r.collapse(!0))}}function y(e){var t=T.getLastVisiblePosition(e);u(e,t,t)}function b(e){var t=h(e);return!(!t.anchorNode||!t.focusNode)&&(_.isElementContainsNode(e,t.anchorNode)&&_.isElementContainsNode(e,t.focusNode))}e.__esModule=!0,e.hasInverseSelectionContentEditable=s,e.isInverseSelectionContentEditable=d,e.getSelectionStart=f,e.getSelectionEnd=c,e.hasInverseSelection=m,e.getSelectionByElement=h,e.select=p,e.selectByNodesAndOffsets=g,e.deleteSelectionContents=v,e.setCursorToLastVisiblePosition=y,e.hasElementContainsSelection=b;var w=n("../deps/hammerhead"),S=i(w),x=n("./dom"),_=o(x),N=n("./content-editable"),T=o(N),I=n("./event"),C=o(I),M=S["default"].utils.browser,R=S["default"].eventSandbox.selection,O="backward",A="forward",P="none",V=P,D=0,W=0,L=0,q=0,B=0,H=0;M.isIE&&C.bind(document,"selectionchange",l,!0)},"wait-for.js":function(e,t,n){function o(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0,e["default"]=function(e,t,n){return new l(function(o,i){var r=e();if(r)return void o(r);var l=u.setInterval.call(window,function(){r=e(),r&&(u.clearInterval.call(window,l),u.clearTimeout.call(window,a),o(r))},t),a=u.setTimeout.call(window,function(){u.clearInterval.call(window,l),i()},n)})};var i=n("../deps/hammerhead"),r=o(i),l=r["default"].Promise,u=r["default"].nativeMethods;t.exports=e["default"]}}}},"test-run":{"client-messages.js":function(e,t,n){e.__esModule=!0,e["default"]={ready:"ready",readyForBrowserManipulation:"ready-for-browser-manipulation",waitForFileDownload:"wait-for-file-download"},t.exports=e["default"]}}}}})("testcafe/src/client/core/index")}initTestCafeCore(window)}();