diff --git a/CMakeLists.txt b/CMakeLists.txt index c23e11f497..f49e5f9622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ include_directories(src/qcommandline) set(EXTRA_LIBS dl) -add_executable(${PROJECT_NAME} src/phantomjs.qrc src/ghostdriver/ghostdriver.qrc ${PHANTOMJS_SOURCES} ${THIRDPARTY_SOURCES}) +add_executable(${PROJECT_NAME} src/phantomjs.qrc ${PHANTOMJS_SOURCES} ${THIRDPARTY_SOURCES}) target_link_libraries(${PROJECT_NAME} ${EXTRA_LIBS} Qt5::Core Qt5::Network Qt5::WebKitWidgets Threads::Threads) install(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/src/bootstrap.js b/src/bootstrap.js index 1042ceb6ae..b54a794fde 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -218,7 +218,7 @@ phantom.callback = function(callback) { var _paths = [], dir; if (request[0] === '.') { - _paths.push(fs.absolute(joinPath(phantom.webdriverMode ? ":/ghostdriver" : this.dirname, request))); + _paths.push(fs.absolute(joinPath(this.dirname, request))); } else if (fs.isAbsolute(request)) { _paths.push(fs.absolute(request)); } else { diff --git a/src/config.cpp b/src/config.cpp index 661d6c8c98..5ca0af7d1d 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -76,13 +76,8 @@ static const struct QCommandLineConfigEntry flags[] = { { QCommandLine::Option, '\0', "ssl-client-certificate-file", "Sets the location of a client certificate", QCommandLine::Optional }, { QCommandLine::Option, '\0', "ssl-client-key-file", "Sets the location of a clients' private key", QCommandLine::Optional }, { QCommandLine::Option, '\0', "ssl-client-key-passphrase", "Sets the passphrase for the clients' private key", QCommandLine::Optional }, - { QCommandLine::Option, '\0', "webdriver", "Starts in 'Remote WebDriver mode' (embedded GhostDriver): '[[:]]' (default '127.0.0.1:8910') ", QCommandLine::Optional }, - { QCommandLine::Option, '\0', "webdriver-logfile", "File where to write the WebDriver's Log (default 'none') (NOTE: needs '--webdriver') ", QCommandLine::Optional }, - { QCommandLine::Option, '\0', "webdriver-loglevel", "WebDriver Logging Level: (supported: 'ERROR', 'WARN', 'INFO', 'DEBUG') (default 'INFO') (NOTE: needs '--webdriver') ", QCommandLine::Optional }, - { QCommandLine::Option, '\0', "webdriver-selenium-grid-hub", "URL to the Selenium Grid HUB: 'URL_TO_HUB' (default 'none') (NOTE: needs '--webdriver') ", QCommandLine::Optional }, { QCommandLine::Param, '\0', "script", "Script", QCommandLine::Flags(QCommandLine::Optional | QCommandLine::ParameterFence)}, { QCommandLine::Param, '\0', "argument", "Script argument", QCommandLine::OptionalMultiple }, - { QCommandLine::Switch, 'w', "wd", "Equivalent to '--webdriver' option above", QCommandLine::Optional }, { QCommandLine::Switch, 'h', "help", "Shows this message and quits", QCommandLine::Optional }, { QCommandLine::Switch, 'v', "version", "Prints out PhantomJS version", QCommandLine::Optional }, QCOMMANDLINE_CONFIG_ENTRY_END @@ -123,29 +118,6 @@ void Config::processArgs(const QStringList& args) m_cmdLine->setConfig(flags); m_cmdLine->parse(); - // Inject command line parameters to be picked up by GhostDriver - if (isWebdriverMode()) { - QStringList argsForGhostDriver; - - m_scriptFile = "main.js"; //< launch script - - argsForGhostDriver << QString("--ip=%1").arg(m_webdriverIp); //< "--ip=IP" - argsForGhostDriver << QString("--port=%1").arg(m_webdriverPort); //< "--port=PORT" - - if (!m_webdriverSeleniumGridHub.isEmpty()) { - argsForGhostDriver << QString("--hub=%1").arg(m_webdriverSeleniumGridHub); //< "--hub=SELENIUM_GRID_HUB_URL" - } - - if (!m_webdriverLogFile.isEmpty()) { - argsForGhostDriver << QString("--logFile=%1").arg(m_webdriverLogFile); //< "--logFile=LOG_FILE" - argsForGhostDriver << "--logColor=false"; //< Force no-color-output in Log File - } - - argsForGhostDriver << QString("--logLevel=%1").arg(m_webdriverLogLevel); //< "--logLevel=LOG_LEVEL" - - // Clear current args and override with those - setScriptArgs(argsForGhostDriver); - } } void Config::loadJsonFile(const QString& filePath) @@ -520,60 +492,6 @@ bool Config::javascriptCanCloseWindows() const return m_javascriptCanCloseWindows; } -void Config::setWebdriver(const QString& webdriverConfig) -{ - // Parse and validate the configuration - bool isValidPort; - QStringList wdCfg = webdriverConfig.split(':'); - if (wdCfg.length() == 1 && wdCfg[0].toInt(&isValidPort) && isValidPort) { - // Only a PORT was provided - m_webdriverPort = wdCfg[0]; - } else if (wdCfg.length() == 2 && !wdCfg[0].isEmpty() && wdCfg[1].toInt(&isValidPort) && isValidPort) { - // Both IP and PORT provided - m_webdriverIp = wdCfg[0]; - m_webdriverPort = wdCfg[1]; - } -} - -QString Config::webdriver() const -{ - return QString("%1:%2").arg(m_webdriverIp).arg(m_webdriverPort); -} - -bool Config::isWebdriverMode() const -{ - return !m_webdriverPort.isEmpty(); -} - -void Config::setWebdriverLogFile(const QString& webdriverLogFile) -{ - m_webdriverLogFile = webdriverLogFile; -} - -QString Config::webdriverLogFile() const -{ - return m_webdriverLogFile; -} - -void Config::setWebdriverLogLevel(const QString& webdriverLogLevel) -{ - m_webdriverLogLevel = webdriverLogLevel; -} - -QString Config::webdriverLogLevel() const -{ - return m_webdriverLogLevel; -} - -void Config::setWebdriverSeleniumGridHub(const QString& hubUrl) -{ - m_webdriverSeleniumGridHub = hubUrl; -} - -QString Config::webdriverSeleniumGridHub() const -{ - return m_webdriverSeleniumGridHub; -} // private: void Config::resetToDefaults() @@ -634,11 +552,6 @@ void Config::resetToDefaults() m_sslClientCertificateFile.clear(); m_sslClientKeyFile.clear(); m_sslClientKeyPassphrase.clear(); - m_webdriverIp = QString(); - m_webdriverPort = QString(); - m_webdriverLogFile = QString(); - m_webdriverLogLevel = "INFO"; - m_webdriverSeleniumGridHub = QString(); } void Config::setProxyAuthPass(const QString& value) @@ -685,10 +598,6 @@ void Config::handleSwitch(const QString& sw) { setHelpFlag(sw == "help"); setVersionFlag(sw == "version"); - - if (sw == "wd") { - setWebdriver(DEFAULT_WEBDRIVER_CONFIG); - } } void Config::handleOption(const QString& option, const QVariant& value) @@ -822,18 +731,6 @@ void Config::handleOption(const QString& option, const QVariant& value) if (option == "ssl-client-key-passphrase") { setSslClientKeyPassphrase(value.toByteArray()); } - if (option == "webdriver") { - setWebdriver(value.toString().length() > 0 ? value.toString() : DEFAULT_WEBDRIVER_CONFIG); - } - if (option == "webdriver-logfile") { - setWebdriverLogFile(value.toString()); - } - if (option == "webdriver-loglevel") { - setWebdriverLogLevel(value.toString()); - } - if (option == "webdriver-selenium-grid-hub") { - setWebdriverSeleniumGridHub(value.toString()); - } } void Config::handleParam(const QString& param, const QVariant& value) diff --git a/src/config.h b/src/config.h index 9fda022471..9fe063c5c2 100644 --- a/src/config.h +++ b/src/config.h @@ -67,10 +67,6 @@ class Config: public QObject Q_PROPERTY(QString sslClientCertificateFile READ sslClientCertificateFile WRITE setSslClientCertificateFile) Q_PROPERTY(QString sslClientKeyFile READ sslClientKeyFile WRITE setSslClientKeyFile) Q_PROPERTY(QByteArray sslClientKeyPassphrase READ sslClientKeyPassphrase WRITE setSslClientKeyPassphrase) - Q_PROPERTY(QString webdriver READ webdriver WRITE setWebdriver) - Q_PROPERTY(QString webdriverLogFile READ webdriverLogFile WRITE setWebdriverLogFile) - Q_PROPERTY(QString webdriverLogLevel READ webdriverLogLevel WRITE setWebdriverLogLevel) - Q_PROPERTY(QString webdriverSeleniumGridHub READ webdriverSeleniumGridHub WRITE setWebdriverSeleniumGridHub) public: Config(QObject* parent = 0); @@ -195,19 +191,6 @@ class Config: public QObject void setSslClientKeyPassphrase(const QByteArray& sslClientKeyPassphrase); QByteArray sslClientKeyPassphrase() const; - void setWebdriver(const QString& webdriverConfig); - QString webdriver() const; - bool isWebdriverMode() const; - - void setWebdriverLogFile(const QString& webdriverLogFile); - QString webdriverLogFile() const; - - void setWebdriverLogLevel(const QString& webdriverLogLevel); - QString webdriverLogLevel() const; - - void setWebdriverSeleniumGridHub(const QString& hubUrl); - QString webdriverSeleniumGridHub() const; - public slots: void handleSwitch(const QString& sw); void handleOption(const QString& option, const QVariant& value); @@ -262,11 +245,6 @@ public slots: QString m_sslClientCertificateFile; QString m_sslClientKeyFile; QByteArray m_sslClientKeyPassphrase; - QString m_webdriverIp; - QString m_webdriverPort; - QString m_webdriverLogFile; - QString m_webdriverLogLevel; - QString m_webdriverSeleniumGridHub; }; #endif // CONFIG_H diff --git a/src/consts.h b/src/consts.h index 88c559c825..5873d02f12 100644 --- a/src/consts.h +++ b/src/consts.h @@ -69,6 +69,4 @@ #define PAGE_SETTINGS_JS_CAN_CLOSE_WINDOWS "javascriptCanCloseWindows" #define PAGE_SETTINGS_DPI "dpi" -#define DEFAULT_WEBDRIVER_CONFIG "127.0.0.1:8910" - #endif // CONSTS_H diff --git a/src/ghostdriver/README.md b/src/ghostdriver/README.md deleted file mode 100644 index 56b44b0e76..0000000000 --- a/src/ghostdriver/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# PLEASE DON'T CHANGE THIS FILE -This file is auto-generated by export scripts **from GhostDriver to PhantomJS**. -If you want to make changes to GhostDriver source, -please refer to that project instead: `https://github.com/detro/ghostdriver`. - -Thanks, -[Ivan De Marino](http://ivandemarino.me) diff --git a/src/ghostdriver/config.js b/src/ghostdriver/config.js deleted file mode 100644 index acc3861a8d..0000000000 --- a/src/ghostdriver/config.js +++ /dev/null @@ -1,106 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -// Default configuration -var defaultConfig = { - "ip" : "127.0.0.1", - "port" : "8910", - "hub" : null, - "proxy" : "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", - "version" : "", - "logFile" : null, - "logLevel" : "INFO", - "logColor" : false, - "remoteHost": null - }, - config = { - "ip" : defaultConfig.ip, - "port" : defaultConfig.port, - "hub" : defaultConfig.hub, - "proxy" : defaultConfig.proxy, - "version" : defaultConfig.version, - "logFile" : defaultConfig.logFile, - "logLevel" : defaultConfig.logLevel, - "logColor" : defaultConfig.logColor, - "remoteHost": defaultConfig.remoteHost - }, - logOutputFile = null, - logger = require("./logger.js"), - _log = logger.create("Config"); - -function apply () { - // Normalise and Set Console Logging Level - config.logLevel = config.logLevel.toUpperCase(); - if (!logger.console.LEVELS.hasOwnProperty(config.logLevel)) { - config.logLevel = defaultConfig.logLevel; - } - logger.console.setLevel(logger.console.LEVELS[config.logLevel]); - - // Normalise and Set Console Color - try { - config.logColor = JSON.parse(config.logColor); - } catch (e) { - config.logColor = defaultConfig.logColor; - } - if (config.logColor) { - logger.console.enableColor(); - } else { - logger.console.disableColor(); - } - - // Add a Log File (if any) - if (config.logFile !== null) { - logger.addLogFile(config.logFile); - } -} - -exports.init = function(cliArgs) { - var i, k, - regexp = new RegExp("^--([a-z]+)=([^\x00-\x1f\x7f\u2028\u2029]+)$", "i"), - regexpRes; - - // Loop over all the Command Line Arguments - // If any of the form '--param=value' is found, it's compared against - // the 'config' object to see if 'config.param' exists. - for (i = cliArgs.length -1; i >= 1; --i) { - // Apply Regular Expression - regexpRes = regexp.exec(cliArgs[i]); - if (regexpRes !== null && regexpRes.length === 3 && - config.hasOwnProperty(regexpRes[1])) { - config[regexpRes[1]] = regexpRes[2]; - } - } - - // Apply/Normalize the Configuration before returning - apply(); - - _log.debug("config.init", JSON.stringify(config)); -}; - -exports.get = function() { - return config; -}; diff --git a/src/ghostdriver/errors.js b/src/ghostdriver/errors.js deleted file mode 100644 index 225f64f3ac..0000000000 --- a/src/ghostdriver/errors.js +++ /dev/null @@ -1,235 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -//------------------------------------------------------- Invalid Request Errors -//----- http://code.google.com/p/selenium/wiki/JsonWireProtocol#Invalid_Requests -exports.INVALID_REQ = { - "UNKNOWN_COMMAND" : "Unknown Command", - "UNIMPLEMENTED_COMMAND" : "Unimplemented Command", - "VARIABLE_RESOURCE_NOT_FOUND" : "Variable Resource Not Found", - "INVALID_COMMAND_METHOD" : "Invalid Command Method", - "MISSING_COMMAND_PARAMETER" : "Missing Command Parameter" -}; - -var _invalidReqHandle = function(res) { - // Set the right Status Code - switch(this.name) { - case exports.INVALID_REQ.UNIMPLEMENTED_COMMAND: - res.statusCode = 501; //< 501 Not Implemented - break; - case exports.INVALID_REQ.INVALID_COMMAND_METHOD: - res.statusCode = 405; //< 405 Method Not Allowed - break; - case exports.INVALID_REQ.MISSING_COMMAND_PARAMETER: - res.statusCode = 400; //< 400 Bad Request - break; - default: - res.statusCode = 404; //< 404 Not Found - break; - } - - res.setHeader("Content-Type", "text/plain"); - res.writeAndClose(this.name + " - " + this.message); -}; - -// Invalid Request Error Handler -exports.createInvalidReqEH = function(errorName, req) { - var e = new Error(); - - e.name = errorName; - e.message = JSON.stringify(req); - e.handle = _invalidReqHandle; - - return e; -}; -exports.handleInvalidReqEH = function(errorName, req, res) { - exports.createInvalidReqEH(errorName, req).handle(res); -}; - -// Invalid Request Unknown Command Error Handler -exports.createInvalidReqUnknownCommandEH = function(req) { - return exports.createInvalidReqEH ( - exports.INVALID_REQ.UNKNOWN_COMMAND, - req); -}; -exports.handleInvalidReqUnknownCommandEH = function(req, res) { - exports.createInvalidReqUnknownCommandEH(req).handle(res); -}; - -// Invalid Request Unimplemented Command Error Handler -exports.createInvalidReqUnimplementedCommandEH = function(req) { - return exports.createInvalidReqEH ( - exports.INVALID_REQ.UNIMPLEMENTED_COMMAND, - req); -}; -exports.handleInvalidReqUnimplementedCommandEH = function(req, res) { - exports.createInvalidReqUnimplementedCommandEH(req).handle(res); -}; - -// Invalid Request Variable Resource Not Found Error Handler -exports.createInvalidReqVariableResourceNotFoundEH = function(req) { - return exports.createInvalidReqEH ( - exports.INVALID_REQ.VARIABLE_RESOURCE_NOT_FOUND, - req); -}; -exports.handleInvalidReqVariableResourceNotFoundEH = function(req, res) { - exports.createInvalidReqVariableResourceNotFoundEH(req).handle(res); -}; - -// Invalid Request Invalid Command Method Error Handler -exports.createInvalidReqInvalidCommandMethodEH = function(req) { - return exports.createInvalidReqEH ( - exports.INVALID_REQ.INVALID_COMMAND_METHOD, - req); -}; -exports.handleInvalidReqInvalidCommandMethodEH = function(req, res) { - exports.createInvalidReqInvalidCommandMethodEH(req).handle(res); -}; - -// Invalid Request Missing Command Parameter Error Handler -exports.createInvalidReqMissingCommandParameterEH = function(req) { - return exports.createInvalidReqEH ( - exports.INVALID_REQ.MISSING_COMMAND_PARAMETER, - req); -}; -exports.handleInvalidReqMissingCommandParameterEH = function(req, res) { - exports.createInvalidReqMissingCommandParameterEH(req).handle(res); -}; - -//-------------------------------------------------------- Failed Command Errors -//------ http://code.google.com/p/selenium/wiki/JsonWireProtocol#Failed_Commands - -// Possible Failed Status Codes -exports.FAILED_CMD_STATUS_CODES = { - "Success" : 0, - "NoSuchElement" : 7, - "NoSuchFrame" : 8, - "UnknownCommand" : 9, - "StaleElementReference" : 10, - "ElementNotVisible" : 11, - "InvalidElementState" : 12, - "UnknownError" : 13, - "ElementIsNotSelectable" : 15, - "JavaScriptError" : 17, - "XPathLookupError" : 19, - "Timeout" : 21, - "NoSuchWindow" : 23, - "InvalidCookieDomain" : 24, - "UnableToSetCookie" : 25, - "UnexpectedAlertOpen" : 26, - "NoAlertOpenError" : 27, - "ScriptTimeout" : 28, - "InvalidElementCoordinates" : 29, - "IMENotAvailable" : 30, - "IMEEngineActivationFailed" : 31, - "InvalidSelector" : 32 -}; - -// Possible Failed Status Code Names -exports.FAILED_CMD_STATUS_CODES_NAMES = []; -exports.FAILED_CMD_STATUS_CODES_NAMES[0] = "Success"; -exports.FAILED_CMD_STATUS_CODES_NAMES[7] = "NoSuchElement"; -exports.FAILED_CMD_STATUS_CODES_NAMES[8] = "NoSuchFrame"; -exports.FAILED_CMD_STATUS_CODES_NAMES[9] = "UnknownCommand"; -exports.FAILED_CMD_STATUS_CODES_NAMES[10] = "StaleElementReference"; -exports.FAILED_CMD_STATUS_CODES_NAMES[11] = "ElementNotVisible"; -exports.FAILED_CMD_STATUS_CODES_NAMES[12] = "InvalidElementState"; -exports.FAILED_CMD_STATUS_CODES_NAMES[13] = "UnknownError"; -exports.FAILED_CMD_STATUS_CODES_NAMES[15] = "ElementIsNotSelectable"; -exports.FAILED_CMD_STATUS_CODES_NAMES[17] = "JavaScriptError"; -exports.FAILED_CMD_STATUS_CODES_NAMES[19] = "XPathLookupError"; -exports.FAILED_CMD_STATUS_CODES_NAMES[21] = "Timeout"; -exports.FAILED_CMD_STATUS_CODES_NAMES[23] = "NoSuchWindow"; -exports.FAILED_CMD_STATUS_CODES_NAMES[24] = "InvalidCookieDomain"; -exports.FAILED_CMD_STATUS_CODES_NAMES[25] = "UnableToSetCookie"; -exports.FAILED_CMD_STATUS_CODES_NAMES[26] = "UnexpectedAlertOpen"; -exports.FAILED_CMD_STATUS_CODES_NAMES[27] = "NoAlertOpenError"; -exports.FAILED_CMD_STATUS_CODES_NAMES[28] = "ScriptTimeout"; -exports.FAILED_CMD_STATUS_CODES_NAMES[29] = "InvalidElementCoordinates"; -exports.FAILED_CMD_STATUS_CODES_NAMES[30] = "IMENotAvailable"; -exports.FAILED_CMD_STATUS_CODES_NAMES[31] = "IMEEngineActivationFailed"; -exports.FAILED_CMD_STATUS_CODES_NAMES[32] = "InvalidSelector"; - -// Possible Failed Status Classnames -exports.FAILED_CMD_STATUS_CLASSNAMES = []; -exports.FAILED_CMD_STATUS_CLASSNAMES[7] = "org.openqa.selenium.NoSuchElementException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[8] = "org.openqa.selenium.NoSuchFrameException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[9] = "org.openqa.selenium.UnsupportedCommandException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[10] = "org.openqa.selenium.StaleElementReferenceException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[11] = "org.openqa.selenium.ElementNotVisibleException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[12] = "org.openqa.selenium.InvalidElementStateException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[13] = "org.openqa.selenium.WebDriverException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[15] = "org.openqa.selenium.InvalidSelectorException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[17] = "org.openqa.selenium.WebDriverException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[19] = "org.openqa.selenium.InvalidSelectorException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[21] = "org.openqa.selenium.TimeoutException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[23] = "org.openqa.selenium.NoSuchWindowException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[24] = "org.openqa.selenium.InvalidCookieDomainException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[25] = "org.openqa.selenium.UnableToSetCookieException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[26] = "org.openqa.selenium.UnhandledAlertException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[27] = "org.openqa.selenium.NoAlertPresentException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[28] = "org.openqa.selenium.WebDriverException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[29] = "org.openqa.selenium.interactions.InvalidCoordinatesException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[30] = "org.openqa.selenium.ImeNotAvailableException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[31] = "org.openqa.selenium.ImeActivationFailedException"; -exports.FAILED_CMD_STATUS_CLASSNAMES[32] = "org.openqa.selenium.InvalidSelectorException"; - -var _failedCommandHandle = function(res) { - // Generate response body - var body = { - "sessionId" : this.errorSessionId, - "status" : this.errorStatusCode, - "value" : { - "message" : this.message, - "screen" : this.errorScreenshot, - "class" : this.errorClassName - } - }; - - // Send it - res.statusCode = 500; //< 500 Internal Server Error - res.writeJSONAndClose(body); -}; - -// Failed Command Error Handler -exports.createFailedCommandEH = function (errorCode, errorMsg, req, session) { - var e = new Error(); - - e.errorStatusCode = isNaN(errorCode) ? exports.FAILED_CMD_STATUS_CODES.UnknownError : errorCode; - e.name = exports.FAILED_CMD_STATUS_CODES_NAMES[e.errorStatusCode]; - e.message = JSON.stringify({ "errorMessage" : errorMsg, "request" : req }); - e.errorSessionId = session.getId() || null; - e.errorClassName = exports.FAILED_CMD_STATUS_CLASSNAMES[e.errorStatusCode] || "unknown"; - e.errorScreenshot = (session.getCapabilities().takesScreenshot && session.getCurrentWindow() !== null) ? - session.getCurrentWindow().renderBase64("png") : ""; - e.handle = _failedCommandHandle; - - return e; -}; -exports.handleFailedCommandEH = function (errorCode, errorMsg, req, res, session) { - exports.createFailedCommandEH(errorCode, errorMsg, req, session).handle(res); -}; diff --git a/src/ghostdriver/ghostdriver.qrc b/src/ghostdriver/ghostdriver.qrc deleted file mode 100644 index 127a5d3a33..0000000000 --- a/src/ghostdriver/ghostdriver.qrc +++ /dev/null @@ -1,53 +0,0 @@ - - - webdriver_atoms.js - session.js - inputs.js - main.js - hub_register.js - third_party/webdriver-atoms/get_location_in_view_chrome.js - third_party/webdriver-atoms/find_element.js - third_party/webdriver-atoms/type.js - third_party/webdriver-atoms/get_name.js - third_party/webdriver-atoms/is_file_input.js - third_party/webdriver-atoms/frame_name.js - third_party/webdriver-atoms/execute_async_script.js - third_party/webdriver-atoms/scroll_into_view.js - third_party/webdriver-atoms/get_text.js - third_party/webdriver-atoms/get_attribute_value.js - third_party/webdriver-atoms/get_size.js - third_party/webdriver-atoms/lastupdate - third_party/webdriver-atoms/get_location_in_view.js - third_party/webdriver-atoms/get_page_zoom_chrome.js - third_party/webdriver-atoms/click.js - third_party/webdriver-atoms/find_elements.js - third_party/webdriver-atoms/execute_script.js - third_party/webdriver-atoms/is_enabled.js - third_party/webdriver-atoms/is_selected.js - third_party/webdriver-atoms/submit.js - third_party/webdriver-atoms/is_content_editable.js - third_party/webdriver-atoms/clear.js - third_party/webdriver-atoms/active_element.js - third_party/webdriver-atoms/get_location.js - third_party/webdriver-atoms/get_first_client_rect_chrome.js - third_party/webdriver-atoms/is_element_clickable_chrome.js - third_party/webdriver-atoms/is_displayed.js - third_party/webdriver-atoms/get_value_of_css_property.js - third_party/parseuri.js - third_party/har.js - third_party/uuid.js - third_party/console++.js - request_handlers/session_request_handler.js - request_handlers/request_handler.js - request_handlers/status_request_handler.js - request_handlers/router_request_handler.js - request_handlers/webelement_request_handler.js - request_handlers/shutdown_request_handler.js - request_handlers/session_manager_request_handler.js - webelementlocator.js - errors.js - webdriver_logger.js - config.js - logger.js - - diff --git a/src/ghostdriver/hub_register.js b/src/ghostdriver/hub_register.js deleted file mode 100644 index d439e153b0..0000000000 --- a/src/ghostdriver/hub_register.js +++ /dev/null @@ -1,112 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* generate node configuration for this node */ -var nodeconf = function(ip, port, hub, proxy, version, remoteHost) { - var ref$, hubHost, hubPort; - - ref$ = hub.match(/([\w\d\.]+):(\d+)/); - hubHost = ref$[1]; - hubPort = +ref$[2]; //< ensure it's of type "number" - var platform; - if(ghostdriver && ghostdriver.system){ - platform = ghostdriver.system.os.name.toUpperCase(); - } - else{ - // The prior behavior was to just assume Linux. - // Worst case scenario, we get the status quo, but - // this block is really just a guard condition anyway - platform = "LINUX"; - } - - var returnHost = "http://" + ip + ":" + port; - if (remoteHost) { - returnHost = remoteHost; - } - - return { - capabilities: [{ - browserName: "phantomjs", - version: version, - platform: platform, - maxInstances: 1, - seleniumProtocol: "WebDriver" - }], - configuration: { - hub: hub, - hubHost: hubHost, - hubPort: hubPort, - host: ip, - port: port, - proxy: proxy, - // Note that multiple webdriver sessions or instances within a single - // Ghostdriver process will interact in unexpected and undesirable ways. - maxSession: 1, - register: true, - registerCycle: 5000, - role: "wd", - url: "http://" + ip + ":" + port, - remoteHost: returnHost - } - }; - }, - _log = require("./logger.js").create("HUB Register"); - -module.exports = { - register: function(ip, port, hub, proxy, version, remoteHost) { - var page; - - try { - page = require('webpage').create(); - port = +port; //< ensure it's of type "number" - if(!hub.match(/\/$/)) { - hub += '/'; - } - - /* Register with selenium grid server */ - page.open(hub + 'grid/register', { - operation: 'post', - data: JSON.stringify(nodeconf(ip, port, hub, proxy, version, remoteHost)), - headers: { - 'Content-Type': 'application/json' - } - }, function(status) { - if(status !== 'success') { - _log.error("register", "Unable to contact grid " + hub + ": " + status); - phantom.exit(1); - } - if(page.framePlainText !== "ok") { - _log.error("register", "Problem registering with grid " + hub + ": " + page.content); - phantom.exit(1); - } - _log.info("register", "Registered with grid hub: " + hub + " (" + page.framePlainText + ")"); - }); - } catch (e) { - throw new Error("Could not register to Selenium Grid Hub: " + hub); - } - } -}; diff --git a/src/ghostdriver/inputs.js b/src/ghostdriver/inputs.js deleted file mode 100644 index 1775aeb8ea..0000000000 --- a/src/ghostdriver/inputs.js +++ /dev/null @@ -1,352 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2014, Jim Evans - Salesforce.com -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.Inputs = function () { - // private: - const - _specialKeys = { - '\uE000': "Escape", // NULL - '\uE001': "Cancel", // Cancel - '\uE002': "F1", // Help - '\uE003': "Backspace", // Backspace - '\uE004': "Tab", // Tab - '\uE005': "Clear", // Clear - '\uE006': "\n", - '\uE007': "Enter", - '\uE008': "Shift", // Shift - '\uE009': "Control", // Control - '\uE00A': "Alt", // Alt - '\uE00B': "Pause", // Pause - '\uE00C': "Escape", // Escape - '\uE00D': "Space", // Space - '\uE00E': "PageUp", // PageUp - '\uE00F': "PageDown", // PageDown - '\uE010': "End", // End - '\uE011': "Home", // Home - '\uE012': "Left", // Left arrow - '\uE013': "Up", // Up arrow - '\uE014': "Right", // Right arrow - '\uE015': "Down", // Down arrow - '\uE016': "Insert", // Insert - '\uE017': "Delete", // Delete - '\uE018': ";", // Semicolon - '\uE019': "=", // Equals - '\uE01A': "0", // Numpad 0 - '\uE01B': "1", // Numpad 1 - '\uE01C': "2", // Numpad 2 - '\uE01D': "3", // Numpad 3 - '\uE01E': "4", // Numpad 4 - '\uE01F': "5", // Numpad 5 - '\uE020': "6", // Numpad 6 - '\uE021': "7", // Numpad 7 - '\uE022': "8", // Numpad 8 - '\uE023': "9", // Numpad 9 - '\uE024': "*", // Multiply - '\uE025': "+", // Add - '\uE026': ",", // Separator - '\uE027': "-", // Subtract - '\uE028': ".", // Decimal - '\uE029': "/", // Divide - '\uE031': "F1", // F1 - '\uE032': "F2", // F2 - '\uE033': "F3", // F3 - '\uE034': "F4", // F4 - '\uE035': "F5", // F5 - '\uE036': "F6", // F6 - '\uE037': "F7", // F7 - '\uE038': "F8", // F8 - '\uE039': "F9", // F9 - '\uE03A': "F10", // F10 - '\uE03B': "F11", // F11 - '\uE03C': "F12", // F12 - '\uE03D': "Meta" // Command/Meta - }, - - _implicitShiftKeys = { - "A": "a", - "B": "b", - "C": "c", - "D": "d", - "E": "e", - "F": "f", - "G": "g", - "H": "h", - "I": "i", - "J": "j", - "K": "k", - "L": "l", - "M": "m", - "N": "n", - "O": "o", - "P": "p", - "Q": "q", - "R": "r", - "S": "s", - "T": "t", - "U": "u", - "V": "v", - "W": "w", - "X": "x", - "Y": "y", - "Z": "z", - "!": "1", - "@": "2", - "#": "3", - "$": "4", - "%": "5", - "^": "6", - "&": "7", - "*": "8", - "(": "9", - ")": "0", - "_": "-", - "+": "=", - "{": "[", - "}": "]", - "|": "\\", - ":": ";", - "<": ",", - ">": ".", - "?": "/", - "~": "`", - "\"": "'" - }, - - _shiftKeys = { - "a": "A", - "b": "B", - "c": "C", - "d": "D", - "e": "E", - "f": "F", - "g": "G", - "h": "H", - "i": "I", - "j": "J", - "k": "K", - "l": "L", - "m": "M", - "n": "N", - "o": "O", - "p": "P", - "q": "Q", - "r": "R", - "s": "S", - "t": "T", - "u": "U", - "v": "V", - "w": "W", - "x": "X", - "y": "Y", - "z": "Z", - "1": "!", - "2": "@", - "3": "#", - "4": "$", - "5": "%", - "6": "^", - "7": "&", - "8": "*", - "9": "(", - "0": ")", - "-": "_", - "=": "+", - "[": "{", - "]": "}", - "\\": "|", - ";": ":", - ",": "<", - ".": ">", - "/": "?", - "`": "~", - "'": "\"" - }, - - _modifierKeyValues = { - "SHIFT": 0x02000000, // A Shift key on the keyboard is pressed. - "CONTROL": 0x04000000, // A Ctrl key on the keyboard is pressed. - "ALT": 0x08000000, // An Alt key on the keyboard is pressed. - "META": 0x10000000, // A Meta key on the keyboard is pressed. - "NUMPAD": 0x20000000 // Keypad key. - }; - - var - _mousePos = { x: 0, y: 0 }, - _keyboardState = {}, - _currentModifierKeys = 0, - - _isModifierKey = function (key) { - return key === "\uE008" || key === "\uE009" || key === "\uE00A" || key === "\uE03D"; - }, - - _isModifierKeyPressed = function (key) { - return _currentModifierKeys & _modifierKeyValues[_specialKeys[key].toUpperCase()]; - }, - - _sendKeys = function (session, keys) { - var keySequence = keys.split(''); - for (var i = 0; i < keySequence.length; i++) { - var key = keys[i]; - var actualKey = _translateKey(session, key); - - if (key === '\uE000') { - _clearModifierKeys(session); - } else { - if (_isModifierKey(key)) { - if (_isModifierKeyPressed(key)) { - _keyUp(session, actualKey); - } else { - _keyDown(session, actualKey); - } - } else { - if (_implicitShiftKeys.hasOwnProperty(actualKey)) { - session.getCurrentWindow().sendEvent("keydown", _translateKey(session, "\uE008")); - _pressKey(session, actualKey); - session.getCurrentWindow().sendEvent("keyup", _translateKey(session, "\uE008")); - } else { - if ((_currentModifierKeys & _modifierKeyValues.SHIFT) && _shiftKeys.hasOwnProperty(actualKey)) { - _pressKey(session, _shiftKeys[actualKey]); - } else { - _pressKey(session, actualKey); - } - } - } - } - } - }, - - _clearModifierKeys = function (session) { - if (_currentModifierKeys & _modifierKeyValues.SHIFT) { - _keyUp(session, _translateKey(session, "\uE008")); - } - if (_currentModifierKeys & _modifierKeyValues.CONTROL) { - _keyUp(session, _translateKey(session, "\uE009")); - } - if (_currentModifierKeys & _modifierKeyValues.ALT) { - _keyUp(session, _translateKey(session, "\uE00A")); - } - }, - - _updateModifierKeys = function (modifierKeyValue, on) { - if (on) { - _currentModifierKeys = _currentModifierKeys | modifierKeyValue; - } else { - _currentModifierKeys = _currentModifierKeys & ~modifierKeyValue; - } - }, - - _translateKey = function (session, key) { - var - actualKey = key, - phantomjskeys = session.getCurrentWindow().event.key; - if (_specialKeys.hasOwnProperty(key)) { - actualKey = _specialKeys[key]; - if (phantomjskeys.hasOwnProperty(actualKey)) { - actualKey = phantomjskeys[actualKey]; - } - } - return actualKey; - }, - - _pressKey = function (session, key) { - // translate WebDriver key value to key code. - _keyEvent(session, "keypress", key); - }, - - _keyDown = function (session, key) { - _keyEvent(session, "keydown", key); - if (key == _translateKey(session, "\uE008")) { - _updateModifierKeys(_modifierKeyValues.SHIFT, true); - } else if (key == _translateKey(session, "\uE009")) { - _updateModifierKeys(_modifierKeyValues.CONTROL, true); - } else if (key == _translateKey(session, "\uE00A")) { - _updateModifierKeys(_modifierKeyValues.ALT, true); - } - }, - - _keyUp = function (session, key) { - if (key == _translateKey(session, "\uE008")) { - _updateModifierKeys(_modifierKeyValues.SHIFT, false); - } else if (key == _translateKey(session, "\uE009")) { - _updateModifierKeys(_modifierKeyValues.CONTROL, false); - } else if (key == _translateKey(session, "\uE00A")) { - _updateModifierKeys(_modifierKeyValues.ALT, false); - } - _keyEvent(session, "keyup", key); - }, - - _mouseClick = function (session, coords) { - _mouseMove(session, coords); - _mouseButtonEvent(session, "click", "left"); - }, - - _mouseMove = function (session, coords) { - session.getCurrentWindow().sendEvent("mousemove", coords.x, coords.y); - _mousePos = { x: coords.x, y: coords.y }; - }, - - _mouseButtonDown = function (session, button) { - _mouseButtonEvent(session, "mousedown", button); - }, - - _mouseButtonUp = function (session, button) { - _mouseButtonEvent(session, "mouseup", button); - }, - - _keyEvent = function (session, eventType, keyCode) { - eventType = eventType || "keypress"; - session.getCurrentWindow().sendEvent(eventType, keyCode, null, null, _currentModifierKeys); - }, - - _mouseButtonEvent = function (session, eventType, button) { - button = button || "left"; - eventType = eventType || "click"; - if (button == "right" && eventType == "click") { - session.getCurrentWindow().sendEvent("contextmenu", - _mousePos.x, _mousePos.y, //< x, y - _currentModifierKeys); - return; - } - session.getCurrentWindow().sendEvent(eventType, - _mousePos.x, _mousePos.y, //< x, y - button, _currentModifierKeys); - }; - - return { - getCurrentCoordinates: function () { return _mousePos; }, - mouseClick: _mouseClick, - mouseMove: _mouseMove, - mouseButtonDown: _mouseButtonDown, - mouseButtonUp: _mouseButtonUp, - mouseButtonClick: _mouseButtonEvent, - sendKeys: _sendKeys, - clearModifierKeys: _clearModifierKeys - }; -}; diff --git a/src/ghostdriver/lastupdate b/src/ghostdriver/lastupdate deleted file mode 100644 index 7a86db378d..0000000000 --- a/src/ghostdriver/lastupdate +++ /dev/null @@ -1,7 +0,0 @@ -2017-03-31 16:18:12 - -commit be7ffd9d47c1e76c7bfa1d47cdcde9164fd40db8 (HEAD -> refs/heads/master, refs/remotes/origin/master, refs/remotes/origin/HEAD) -Author: jesg -Date: Wed Mar 22 05:08:21 2017 -0700 - - allow all resources in whitelist (#514) diff --git a/src/ghostdriver/logger.js b/src/ghostdriver/logger.js deleted file mode 100644 index 03369a8a41..0000000000 --- a/src/ghostdriver/logger.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -// Init Console++ -require("./third_party/console++.js"); - -// Constants -const -separator = " - "; - -/** - * (Super-simple) Logger - * - * @param context {String} Logger context - */ -function Logger (context) { - var loggerObj, i; - - if (!context || context.length === 0) { - throw new Error("Invalid 'context' for Logger: " + context); - } - - loggerObj = { - debug : function(scope, message) { - console.debug(context + separator + - scope + - (message && message.length > 0 ? separator + message : "") - ); - }, - info : function(scope, message) { - console.info(context + separator + - scope + - (message && message.length > 0 ? separator + message : "") - ); - }, - warn : function(scope, message) { - console.warn(context + separator + - scope + - (message && message.length > 0 ? separator + message : "") - ); - }, - error : function(scope, message) { - console.error(context + separator + - scope + - (message && message.length > 0 ? separator + message : "") - ); - } - }; - - - return loggerObj; -} - -/** - * Export: Create Logger with Context - * - * @param context {String} Context of the new Logger - */ -exports.create = function (context) { - return new Logger(context); -}; - -/** - * Export: Add Log File. - * - * @param logFileName {String Name of the file were to output (append) the Logs. - */ -exports.addLogFile = function(logFileName) { - var fs = require("fs"), - f = fs.open(fs.absolute(logFileName), 'a'); - - // Append line to Log File - console.onOutput(function(msg, levelName) { - f.writeLine(msg); - f.flush(); - }); - - // Flush the Log File when process exits - phantom.aboutToExit.connect(f.flush); -}; - -/** - * Export: Console object - */ -exports.console = console; diff --git a/src/ghostdriver/main.js b/src/ghostdriver/main.js deleted file mode 100644 index fde3eb040d..0000000000 --- a/src/ghostdriver/main.js +++ /dev/null @@ -1,95 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var server = require("webserver").create(), //< webserver - router, //< router request handler - _log; //< logger for "main.js" - -// "ghostdriver" global namespace -ghostdriver = { - system : require("system"), - hub : require("./hub_register.js"), - logger : require("./logger.js"), - webdriver_logger : require("./webdriver_logger.js"), - config : null, //< this will be set below - version : "2.0.0" -}; - -// create logger -_log = ghostdriver.logger.create("GhostDriver"); - -// Initialize the configuration -require("./config.js").init(ghostdriver.system.args); -ghostdriver.config = require("./config.js").get(); - -// Enable "strict mode" for the 'parseURI' library -require("./third_party/parseuri.js").options.strictMode = true; - -// Load all the core dependencies -// NOTE: We need to provide PhantomJS with the "require" module ASAP. This is a pretty s**t way to load dependencies -phantom.injectJs("session.js"); -phantom.injectJs("inputs.js"); -phantom.injectJs("request_handlers/request_handler.js"); -phantom.injectJs("request_handlers/status_request_handler.js"); -phantom.injectJs("request_handlers/shutdown_request_handler.js"); -phantom.injectJs("request_handlers/session_manager_request_handler.js"); -phantom.injectJs("request_handlers/session_request_handler.js"); -phantom.injectJs("request_handlers/webelement_request_handler.js"); -phantom.injectJs("request_handlers/router_request_handler.js"); -phantom.injectJs("webelementlocator.js"); - -try { - _log.info("Main", "Ghost Driver Version " + ghostdriver.version); - // HTTP Request Router - router = new ghostdriver.RouterReqHand(); - - // Start the server - if (server.listen(ghostdriver.config.ip+":"+ghostdriver.config.port, { "keepAlive" : true }, router.handle)) { - _log.info("Main", "running on port " + server.port); - - // If a Selenium Grid HUB was provided, register to it! - if (ghostdriver.config.hub !== null) { - _log.info("Main", "registering to Selenium HUB"+ - " '" + ghostdriver.config.hub + "' version: " + ghostdriver.config.version + - " using '" + ghostdriver.config.ip + ":" + ghostdriver.config.port + "' with " + - (ghostdriver.config.remoteHost ? "remoteHost:" + ghostdriver.config.remoteHost + " " : "") + - ghostdriver.config.proxy + " as remote proxy."); - ghostdriver.hub.register(ghostdriver.config.ip, - ghostdriver.config.port, - ghostdriver.config.hub, - ghostdriver.config.proxy, - ghostdriver.config.version, - ghostdriver.config.remoteHost); - } - } else { - throw new Error("Could not start Ghost Driver"); - phantom.exit(1); - } -} catch (e) { - _log.error("main.fail", JSON.stringify(e)); - phantom.exit(1); -} diff --git a/src/ghostdriver/request_handlers/request_handler.js b/src/ghostdriver/request_handlers/request_handler.js deleted file mode 100644 index 0d55acad7b..0000000000 --- a/src/ghostdriver/request_handlers/request_handler.js +++ /dev/null @@ -1,197 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.RequestHandler = function() { - // private: - var - _errors = require("./errors.js"), - _handle = function(request, response) { - // NOTE: Some language bindings result in a malformed "post" object. - // This might have to do with PhantomJS poor WebServer implementation. - // Here we override "request.post" with the "request.postRaw" that - // is usually left intact. - if (request.hasOwnProperty("postRaw")) { - request["post"] = request["postRaw"]; - } - - _decorateRequest(request); - _decorateResponse(response); - }, - - _reroute = function(request, response, prefixToRemove) { - // Store the original URL before re-routing in 'request.urlOriginal': - // This is done only for requests never re-routed. - // We don't want to override the original URL during a second re-routing. - if (typeof(request.urlOriginal) === "undefined") { - request.urlOriginal = request.url; - } - - // Rebase the "url" to start from AFTER the given prefix to remove - request.url = request.urlParsed.source.substr((prefixToRemove).length); - // Re-decorate the Request object - _decorateRequest(request); - - // Handle the re-routed request - this.handle(request, response); - }, - - _decorateRequest = function(request) { - // Normalize URL first - request.url = request.url.replace(/^\/wd\/hub/, ''); - // Then parse it - request.urlParsed = require("./third_party/parseuri.js").parse(request.url); - }, - - _writeJSONDecorator = function(obj) { - this.write(JSON.stringify(obj)); - }, - - _successDecorator = function(sessionId, value) { - this.statusCode = 200; - if (arguments.length > 0) { - // write something, only if there is something to write - this.writeJSONAndClose(_buildSuccessResponseBody(sessionId, value)); - } else { - this.closeGracefully(); - } - }, - - _writeAndCloseDecorator = function(body) { - this.setHeader("Content-Length", unescape(encodeURIComponent(body)).length); - this.write(body); - this.close(); - }, - - _writeJSONAndCloseDecorator = function(obj) { - var objStr = JSON.stringify(obj); - this.setHeader("Content-Length", unescape(encodeURIComponent(objStr)).length); - this.write(objStr); - this.close(); - }, - - _respondBasedOnResultDecorator = function(session, req, result) { - // Convert string to JSON - if (typeof(result) === "string") { - try { - result = JSON.parse(result); - } catch (e) { - // In case the conversion fails, report and "Invalid Command Method" error - _errors.handleInvalidReqInvalidCommandMethodEH(req, this); - } - } - - // In case the JSON doesn't contain the expected fields - if (result === null || - typeof(result) === "undefined" || - typeof(result) !== "object" || - typeof(result.status) === "undefined" || - typeof(result.value) === "undefined") { - _errors.handleFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.UnknownError, - "Command failed without producing the expected error report", - req, - this, - session); - return; - } - - // An error occurred but we got an error report to use - if (result.status !== 0) { - _errors.handleFailedCommandEH(result.status, - result.value.message, - req, - this, - session); - return; - } - - // If we arrive here, everything should be fine, birds are singing, the sky is blue - this.success(session.getId(), result.value); - }, - - _decorateResponse = function(response) { - response.setHeader("Cache", "no-cache"); - response.setHeader("Content-Type", "application/json;charset=UTF-8"); - response.writeAndClose = _writeAndCloseDecorator; - response.writeJSON = _writeJSONDecorator; - response.writeJSONAndClose = _writeJSONAndCloseDecorator; - response.success = _successDecorator; - response.respondBasedOnResult = _respondBasedOnResultDecorator; - }, - - _buildResponseBody = function(sessionId, value, statusCode) { - // Need to check for undefined to prevent errors when trying to return boolean false - if(typeof(value) === "undefined") value = {}; - return { - "sessionId" : sessionId || null, - "status" : statusCode || 0, //< '0' is Success - "value" : value - }; - }, - - _buildSuccessResponseBody = function(sessionId, value) { - return _buildResponseBody(sessionId, value, 0); //< '0' is Success - }, - - _getSessionCurrWindow = function(session, req) { - return _getSessionWindow(null, session, req); - }, - - _getSessionWindow = function(handleOrName, session, req) { - var win, - errorMsg; - - // Fetch the right window - win = handleOrName === null ? - session.getCurrentWindow() : //< current window - session.getWindow(handleOrName); //< window by handle - if (win !== null) { - return win; - } - - errorMsg = handleOrName === null ? - "Currently Window handle/name is invalid (closed?)" : - "Window handle/name '"+handleOrName+"' is invalid (closed?)"; - - // Report the error throwing the appropriate exception - throw _errors.createFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.NoSuchWindow, errorMsg, req, session); - }; - - // public: - return { - handle : _handle, - reroute : _reroute, - buildResponseBody : _buildResponseBody, - buildSuccessResponseBody : _buildSuccessResponseBody, - decorateRequest : _decorateRequest, - decorateResponse : _decorateResponse, - errors : _errors, - getSessionWindow : _getSessionWindow, - getSessionCurrWindow : _getSessionCurrWindow - }; -}; diff --git a/src/ghostdriver/request_handlers/router_request_handler.js b/src/ghostdriver/request_handlers/router_request_handler.js deleted file mode 100644 index 05a3d5d3e8..0000000000 --- a/src/ghostdriver/request_handlers/router_request_handler.js +++ /dev/null @@ -1,105 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -/** - * This Class does first level routing: based on the REST Path, sends Request and Response to the right Request Handler. - */ -ghostdriver.RouterReqHand = function() { - // private: - const - _const = { - STATUS : "status", - SESSION : "session", - SESSIONS : "sessions", - SESSION_DIR : "/session/", - SHUTDOWN : "shutdown" - }; - - var - _protoParent = ghostdriver.RouterReqHand.prototype, - _statusRH = new ghostdriver.StatusReqHand(), - _shutdownRH = new ghostdriver.ShutdownReqHand(), - _sessionManRH = new ghostdriver.SessionManagerReqHand(), - _errors = _protoParent.errors, - _log = ghostdriver.logger.create("RouterReqHand"), - - _handle = function(req, res) { - var session, - sessionRH; - - // Invoke parent implementation - _protoParent.handle.call(this, req, res); - - _log.debug("_handle", JSON.stringify(req)); - - try { - if (req.urlParsed.chunks.length === 1 && req.urlParsed.file === _const.STATUS) { // GET '/status' - _statusRH.handle(req, res); - } else if (req.urlParsed.chunks.length === 1 && req.urlParsed.file === _const.SHUTDOWN) { // GET '/shutdown' - _shutdownRH.handle(req, res); - phantom.exit(); - } else if ((req.urlParsed.chunks.length === 1 && req.urlParsed.file === _const.SESSION) || // POST '/session' - (req.urlParsed.chunks.length === 1 && req.urlParsed.file === _const.SESSIONS) || // GET '/sessions' - req.urlParsed.directory === _const.SESSION_DIR) { // GET or DELETE '/session/:id' - _sessionManRH.handle(req, res); - } else if (req.urlParsed.chunks[0] === _const.SESSION) { // GET, POST or DELETE '/session/:id/...' - // Retrieve session - session = _sessionManRH.getSession(req.urlParsed.chunks[1]); - - if (session !== null) { - // Create a new Session Request Handler and re-route the request to it - sessionRH = _sessionManRH.getSessionReqHand(req.urlParsed.chunks[1]); - _protoParent.reroute.call(sessionRH, req, res, _const.SESSION_DIR + session.getId()); - } else { - throw _errors.createInvalidReqVariableResourceNotFoundEH(req); - } - } else { - throw _errors.createInvalidReqUnknownCommandEH(req); - } - } catch (e) { - _log.error("_handle.error", JSON.stringify(e)); - - if (typeof(e.handle) === "function") { - e.handle(res); - } else { - // This should never happen, if we handle all the possible error scenario - res.statusCode = 404; //< "404 Not Found" - res.setHeader("Content-Type", "text/plain"); - res.writeAndClose(e.name + " - " + e.message); - } - } - }; - - // public: - return { - handle : _handle - }; -}; -// prototype inheritance: -ghostdriver.RouterReqHand.prototype = new ghostdriver.RequestHandler(); diff --git a/src/ghostdriver/request_handlers/session_manager_request_handler.js b/src/ghostdriver/request_handlers/session_manager_request_handler.js deleted file mode 100644 index 6d3bdde3da..0000000000 --- a/src/ghostdriver/request_handlers/session_manager_request_handler.js +++ /dev/null @@ -1,186 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.SessionManagerReqHand = function() { - // private: - var - _protoParent = ghostdriver.SessionManagerReqHand.prototype, - _sessions = {}, //< will store key/value pairs like 'SESSION_ID : SESSION_OBJECT' - _sessionRHs = {}, - _errors = _protoParent.errors, - _CLEANUP_WINDOWLESS_SESSIONS_TIMEOUT = 300000, // 5 minutes - _log = ghostdriver.logger.create("SessionManagerReqHand"), - - _handle = function(req, res) { - _protoParent.handle.call(this, req, res); - - if (req.urlParsed.chunks.length === 1 && req.urlParsed.file === "session" && req.method === "POST") { - _postNewSessionCommand(req, res); - return; - } else if (req.urlParsed.chunks.length === 1 && req.urlParsed.file === "sessions" && req.method === "GET") { - _getActiveSessionsCommand(req, res); - return; - } else if (req.urlParsed.directory === "/session/") { - if (req.method === "GET") { - _getSessionCapabilitiesCommand(req, res); - } else if (req.method === "DELETE") { - _deleteSessionCommand(req, res); - } - return; - } - - throw _errors.createInvalidReqInvalidCommandMethodEH(req); - }, - - _postNewSessionCommand = function(req, res) { - var newSession, - postObj, - redirectToHost; - - try { - postObj = JSON.parse(req.post); - } catch (e) { - // If the parsing has failed, the error is reported at the end - } - - if (typeof(postObj) === "object" && - typeof(postObj.desiredCapabilities) === "object") { - // Create and store a new Session - newSession = new ghostdriver.Session(postObj.desiredCapabilities); - _sessions[newSession.getId()] = newSession; - - _log.info("_postNewSessionCommand", "New Session Created: " + newSession.getId()); - - // Return newly created Session Capabilities - res.success(newSession.getId(), newSession.getCapabilities()); - return; - } - - throw _errors.createInvalidReqMissingCommandParameterEH(req); - }, - - _getActiveSessionsCommand = function(req, res) { - var activeSessions = [], - sessionId; - - // Create array of format '[{ "id" : SESSION_ID, "capabilities" : SESSION_CAPABILITIES_OBJECT }]' - for (sessionId in _sessions) { - activeSessions.push({ - "id" : sessionId, - "capabilities" : _sessions[sessionId].getCapabilities() - }); - } - - res.success(null, activeSessions); - }, - - _deleteSession = function(sessionId) { - if (typeof(_sessions[sessionId]) !== "undefined") { - // Prepare the session to be deleted - _sessions[sessionId].aboutToDelete(); - // Delete the session and the handler - delete _sessions[sessionId]; - delete _sessionRHs[sessionId]; - } - }, - - _deleteSessionCommand = function(req, res) { - var sId = req.urlParsed.file; - - if (sId === "") - throw _errors.createInvalidReqMissingCommandParameterEH(req); - - if (typeof(_sessions[sId]) !== "undefined") { - _deleteSession(sId); - res.success(sId); - } else { - throw _errors.createInvalidReqVariableResourceNotFoundEH(req); - } - }, - - _getSessionCapabilitiesCommand = function(req, res) { - var sId = req.urlParsed.file, - session; - - if (sId === "") - throw _errors.createInvalidReqMissingCommandParameterEH(req); - - session = _getSession(sId); - if (session !== null) { - res.success(sId, _sessions[sId].getCapabilities()); - } else { - throw _errors.createInvalidReqVariableResourceNotFoundEH(req); - } - }, - - _getSession = function(sessionId) { - if (typeof(_sessions[sessionId]) !== "undefined") { - return _sessions[sessionId]; - } - return null; - }, - - _getSessionReqHand = function(sessionId) { - if (_getSession(sessionId) !== null) { - // The session exists: what about the relative Session Request Handler? - if (typeof(_sessionRHs[sessionId]) === "undefined") { - _sessionRHs[sessionId] = new ghostdriver.SessionReqHand(_getSession(sessionId)); - } - return _sessionRHs[sessionId]; - } - return null; - }, - - _cleanupWindowlessSessions = function() { - var sId; - - // Do this cleanup only if there are sessions - if (Object.keys(_sessions).length > 0) { - _log.info("_cleanupWindowlessSessions", "Asynchronous Sessions clean-up phase starting NOW"); - for (sId in _sessions) { - if (_sessions[sId].getWindowsCount() === 0) { - _deleteSession(sId); - _log.info("_cleanupWindowlessSessions", "Deleted Session '"+sId+"', because windowless"); - } - } - } - }; - - // Regularly cleanup un-used sessions - setInterval(_cleanupWindowlessSessions, _CLEANUP_WINDOWLESS_SESSIONS_TIMEOUT); - - // public: - return { - handle : _handle, - getSession : _getSession, - getSessionReqHand : _getSessionReqHand - }; -}; -// prototype inheritance: -ghostdriver.SessionManagerReqHand.prototype = new ghostdriver.RequestHandler(); diff --git a/src/ghostdriver/request_handlers/session_request_handler.js b/src/ghostdriver/request_handlers/session_request_handler.js deleted file mode 100644 index 450bb5ce5c..0000000000 --- a/src/ghostdriver/request_handlers/session_request_handler.js +++ /dev/null @@ -1,935 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -Copyright (c) 2014, Alex Anderson <@alxndrsn> -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.SessionReqHand = function(session) { - // private: - const - _const = { - URL : "url", - ELEMENT : "element", - ELEMENTS : "elements", - ELEMENT_DIR : "/element/", - ACTIVE : "active", - TITLE : "title", - WINDOW : "window", - CURRENT : "current", - SIZE : "size", - POSITION : "position", - MAXIMIZE : "maximize", - FORWARD : "forward", - BACK : "back", - REFRESH : "refresh", - EXECUTE : "execute", - EXECUTE_ASYNC : "execute_async", - SCREENSHOT : "screenshot", - TIMEOUTS : "timeouts", - TIMEOUTS_DIR : "/timeouts/", - ASYNC_SCRIPT : "async_script", - IMPLICIT_WAIT : "implicit_wait", - WINDOW_HANDLE : "window_handle", - WINDOW_HANDLES : "window_handles", - FRAME : "frame", - FRAME_DIR : "/frame/", - SOURCE : "source", - COOKIE : "cookie", - KEYS : "keys", - FILE : "file", - MOVE_TO : "moveto", - CLICK : "click", - BUTTON_DOWN : "buttondown", - BUTTON_UP : "buttonup", - DOUBLE_CLICK : "doubleclick", - PHANTOM_DIR : "/phantom/", - PHANTOM_EXEC : "execute", - LOG : "log", - TYPES : "types" - }; - - var - _session = session, - _protoParent = ghostdriver.SessionReqHand.prototype, - _locator = new ghostdriver.WebElementLocator(session), - _errors = _protoParent.errors, - _log = ghostdriver.logger.create("SessionReqHand"), - - _handle = function(req, res) { - var element; - - _protoParent.handle.call(this, req, res); - - // Handle "/url" GET and POST - if (req.urlParsed.file === _const.URL) { //< ".../url" - if (req.method === "GET") { - _getUrlCommand(req, res); - } else if (req.method === "POST") { - _postUrlCommand(req, res); - } - return; - } else if (req.urlParsed.file === _const.SCREENSHOT && req.method === "GET") { - _getScreenshotCommand(req, res); - return; - } else if (req.urlParsed.file === _const.WINDOW) { //< ".../window" - if (req.method === "DELETE") { - _deleteWindowCommand(req, res); //< close window - } else if (req.method === "POST") { - _postWindowCommand(req, res); //< change focus to the given window - } - return; - } else if (req.urlParsed.chunks[0] === _const.WINDOW) { - _doWindowHandleCommands(req, res); - return; - } else if (req.urlParsed.file === _const.ELEMENT && req.method === "POST" && req.urlParsed.chunks.length === 1) { //< ".../element" - _locator.handleLocateCommand(req, res, _locator.locateElement); - return; - } else if (req.urlParsed.file === _const.ELEMENTS && req.method === "POST" && req.urlParsed.chunks.length === 1) { //< ".../elements" - _locator.handleLocateCommand(req, res, _locator.locateElements); - return; - } else if (req.urlParsed.chunks[0] === _const.ELEMENT && req.urlParsed.chunks[1] === _const.ACTIVE && req.method === "POST") { //< ".../element/active" - _locator.handleLocateCommand(req, res, _locator.locateActiveElement); - return; - } else if (req.urlParsed.chunks[0] === _const.ELEMENT) { //< ".../element/:elementId/COMMAND" - // Get the WebElementRH and, if found, re-route request to it - element = new ghostdriver.WebElementReqHand(req.urlParsed.chunks[1], _session); - if (element !== null) { - _protoParent.reroute.call(element, req, res, _const.ELEMENT_DIR + req.urlParsed.chunks[1]); - } else { - throw _errors.createInvalidReqVariableResourceNotFoundEH(req); - } - return; - } else if (req.urlParsed.file === _const.TITLE && req.method === "GET") { //< ".../title" - // Get the current Page title - _getTitleCommand(req, res); - return; - } else if (req.urlParsed.file === _const.KEYS && req.method === "POST") { - _postKeysCommand(req, res); - return; - } else if (req.urlParsed.file === _const.FORWARD && req.method === "POST") { - _forwardCommand(req, res); - return; - } else if (req.urlParsed.file === _const.BACK && req.method === "POST") { - _backCommand(req, res); - return; - } else if (req.urlParsed.file === _const.REFRESH && req.method === "POST") { - _refreshCommand(req, res); - return; - } else if (req.urlParsed.file === _const.EXECUTE && req.urlParsed.directory === "/" && req.method == "POST") { - _executeCommand(req, res); - return; - } else if (req.urlParsed.file === _const.EXECUTE_ASYNC && req.method === "POST") { - _executeAsyncCommand(req, res); - return; - } else if ((req.urlParsed.file === _const.TIMEOUTS || req.urlParsed.directory === _const.TIMEOUTS_DIR) && req.method === "POST") { - _postTimeout(req, res); - return; - } else if (req.urlParsed.file === _const.WINDOW_HANDLE && req.method === "GET") { - _getWindowHandle(req, res); - return; - } else if (req.urlParsed.file === _const.WINDOW_HANDLES && req.method === "GET") { - _getWindowHandles(req, res); - return; - } else if (req.urlParsed.file === _const.FRAME && req.method === "POST") { - _postFrameCommand(req, res); - return; - } else if (req.urlParsed.directory == _const.FRAME_DIR && req.method === "POST") { - _postFrameParentCommand(req, res); - return; - } else if (req.urlParsed.file === _const.SOURCE && req.method === "GET") { - _getSourceCommand(req, res); - return; - } else if (req.urlParsed.file === _const.MOVE_TO && req.method === "POST") { - _postMouseMoveToCommand(req, res); - return; - } else if (req.urlParsed.file === _const.PHANTOM_EXEC && req.urlParsed.directory === _const.PHANTOM_DIR && req.method === "POST") { - _executePhantomJS(req, res); - return; - } else if (req.urlParsed.file === _const.CLICK && req.method === "POST") { - _postMouseClickCommand(req, res, "click"); - return; - } else if (req.urlParsed.file === _const.BUTTON_DOWN && req.method === "POST") { - _postMouseClickCommand(req, res, "mousedown"); - return; - } else if (req.urlParsed.file === _const.BUTTON_UP && req.method === "POST") { - _postMouseClickCommand(req, res, "mouseup"); - return; - } else if (req.urlParsed.file === _const.DOUBLE_CLICK && req.method === "POST") { - _postMouseClickCommand(req, res, "doubleclick"); - return; - } else if (req.urlParsed.chunks[0] === _const.COOKIE) { - if (req.method === "POST") { - _postCookieCommand(req, res); - } else if (req.method === "GET") { - _getCookieCommand(req, res); - } else if(req.method === "DELETE") { - _deleteCookieCommand(req, res); - } - return; - } else if (req.urlParsed.chunks[0] === _const.LOG && req.method === "POST") { //< ".../log" - _postLog(req, res); - return; - } else if (req.urlParsed.chunks[0] === _const.LOG && req.urlParsed.chunks[1] === _const.TYPES && req.method === "GET") { //< ".../log/types" - _getLogTypes(req, res); - return; - } else if (req.urlParsed.chunks[0] === _const.LOG && _session.getLogTypes().indexOf(req.urlParsed.chunks[1]) >= 0 && req.method === "GET") { //< ".../log/LOG_TYPE" - _getLog(req, res, req.urlParsed.chunks[1]); - } else if (req.urlParsed.file == _const.FILE && req.method === "POST") { - _postUploadFileCommand(req, res); - return; - } - - throw _errors.createInvalidReqInvalidCommandMethodEH(req); - }, - - _postUploadFileCommand = function(req, res) { - var postObj = JSON.parse(req.post), - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - inputFileSelector = postObj.selector, - filePath = postObj.filepath; - - _log.debug("_postUploadFileCommand about to upload file", inputFileSelector, filePath) - currWindow.uploadFile(inputFileSelector, filePath); - res.success(_session.getId()) - }, - - _createOnSuccessHandler = function(res) { - return function (status) { - _log.debug("_SuccessHandler", "status: " + status); - res.success(_session.getId()); - }; - }, - - _doWindowHandleCommands = function(req, res) { - var windowHandle, - command, - targetWindow; - - _log.debug("_doWindowHandleCommands", JSON.stringify(req)); - - // Ensure all the parameters are provided - if (req.urlParsed.chunks.length === 3) { - windowHandle = req.urlParsed.chunks[1]; - command = req.urlParsed.chunks[2]; - - // Fetch the right window - if (windowHandle === _const.CURRENT) { - targetWindow = _protoParent.getSessionCurrWindow.call(this, _session, req); - } else { - targetWindow = _protoParent.getSessionWindow.call(this, windowHandle, _session, req); - } - - // Act on the window (page) - if(command === _const.SIZE && req.method === "POST") { - _postWindowSizeCommand(req, res, targetWindow); - return; - } else if(command === _const.SIZE && req.method === "GET") { - _getWindowSizeCommand(req, res, targetWindow); - return; - } else if(command === _const.POSITION && req.method === "POST") { - _postWindowPositionCommand(req, res, targetWindow); - return; - } else if(command === _const.POSITION && req.method === "GET") { - _getWindowPositionCommand(req, res, targetWindow); - return; - } else if(command === _const.MAXIMIZE && req.method === "POST") { - _postWindowMaximizeCommand(req, res, targetWindow); - return; - } - - // No command matched: error - throw _errors.createInvalidReqInvalidCommandMethodEH(req); - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _postWindowSizeCommand = function(req, res, targetWindow) { - var params = JSON.parse(req.post), - newWidth = params.width, - newHeight = params.height; - - // If width/height are passed in string, force them to numbers - if (typeof(params.width) === "string") { - newWidth = parseInt(params.width, 10); - } - if (typeof(params.height) === "string") { - newHeight = parseInt(params.height, 10); - } - - // If a number was not found, the command is - if (isNaN(newWidth) || isNaN(newHeight)) { - throw _errors.createInvalidReqInvalidCommandMethodEH(req); - } - - targetWindow.viewportSize = { - width : newWidth, - height : newHeight - }; - res.success(_session.getId()); - }, - - _getWindowSizeCommand = function(req, res, targetWindow) { - // Returns response in the format "{width: number, height: number}" - res.success(_session.getId(), targetWindow.viewportSize); - }, - - _postWindowPositionCommand = function(req, res, targetWindow) { - var params = JSON.parse(req.post), - newX = params.x, - newY = params.y; - - // If width/height are passed in string, force them to numbers - if (typeof(params.x) === "string") { - newX = parseInt(params.x, 10); - } - if (typeof(params.y) === "string") { - newY = parseInt(params.y, 10); - } - - // If a number was not found, the command is - if (isNaN(newX) || isNaN(newY)) { - throw _errors.createInvalidReqInvalidCommandMethodEH(req); - } - - // NOTE: Nothing to do! PhantomJS is headless. :) - res.success(_session.getId()); - }, - - _getWindowPositionCommand = function(req, res, targetWindow) { - // Returns response in the format "{width: number, height: number}" - res.success(_session.getId(), { x : 0, y : 0 }); - }, - - _postWindowMaximizeCommand = function(req, res, targetWindow) { - // NOTE: PhantomJS is headless, so there is no "screen" to maximize to - // or "window" resize to that. - // - // NOTE: The most common desktop screen resolution used online is currently: 1366x768 - // See http://gs.statcounter.com/#resolution-ww-monthly-201307-201312. - // Jan 2017 - targetWindow.viewportSize = { - width : 1920, - height : 1080 - }; - - res.success(_session.getId()); - }, - - _postKeysCommand = function(req, res) { - var activeEl = _locator.locateActiveElement(); - var elReqHand = new ghostdriver.WebElementReqHand(activeEl.value, _session); - elReqHand.postValueCommand(req, res); - }, - - _refreshCommand = function(req, res) { - var successHand = _createOnSuccessHandler(res), - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req); - - currWindow.execFuncAndWaitForLoad( - function() { currWindow.reload(); }, - successHand, - successHand); //< We don't care if 'refresh' fails - }, - - _backCommand = function(req, res) { - var successHand = _createOnSuccessHandler(res), - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req); - - if (currWindow.canGoBack) { - currWindow.execFuncAndWaitForLoad( - function() { currWindow.goBack(); }, - successHand, - successHand); //< We don't care if 'back' fails - } else { - // We can't go back, and that's ok - successHand(); - } - }, - - _forwardCommand = function(req, res) { - var successHand = _createOnSuccessHandler(res), - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req); - - if (currWindow.canGoForward) { - currWindow.execFuncAndWaitForLoad( - function() { currWindow.goForward(); }, - successHand, - successHand); //< We don't care if 'forward' fails - } else { - // We can't go forward, and that's ok - successHand(); - } - }, - - _executeCommand = function(req, res) { - var postObj = JSON.parse(req.post), - result, - timer, - scriptTimeout = _session.getScriptTimeout(), - timedOut = false; - - if (typeof(postObj) === "object" && postObj.script && postObj.args) { - // Execute script, but within a limited timeframe - timer = setTimeout(function() { - // The script didn't return within the expected timeframe - timedOut = true; - _errors.handleFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.Timeout, - "Script didn't return within " + scriptTimeout + "ms", - req, - res, - _session); - }, scriptTimeout); - - // Launch the actual script - result = _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("execute_script"), - postObj.script, - postObj.args, - true); - - // If we are here, we don't need the timer anymore - clearTimeout(timer); - - // Respond with result ONLY if this hasn't ALREADY timed-out - if (!timedOut) { - res.respondBasedOnResult(_session, req, result); - } - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _executeAsyncCommand = function(req, res) { - var postObj = JSON.parse(req.post); - - _log.debug("_executeAsyncCommand", JSON.stringify(postObj)); - - if (typeof(postObj) === "object" && postObj.script && postObj.args) { - _protoParent.getSessionCurrWindow.call(this, _session, req).setOneShotCallback("onCallback", function() { - _log.debug("_executeAsyncCommand.callbackArguments", JSON.stringify(arguments)); - - res.respondBasedOnResult(_session, req, arguments[0]); - }); - - _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - "function(script, args, timeout) { " + - "return (" + require("./webdriver_atoms.js").get("execute_async_script") + ")" + - "(script, args, timeout, callPhantom, true); " + - "}", - postObj.script, - postObj.args, - _session.getScriptTimeout()); - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _getWindowHandle = function (req, res) { - var handle; - - // Get current window handle - handle = _session.getCurrentWindowHandle(); - - if (handle !== null) { - res.success(_session.getId(), handle); - } else { - throw _errors.createFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.NoSuchWindow, - "Current window handle invalid (closed?)", - req, - _session); - } - }, - - _getWindowHandles = function(req, res) { - res.success(_session.getId(), _session.getWindowHandles()); - }, - - _getScreenshotCommand = function(req, res) { - var rendering = _protoParent.getSessionCurrWindow.call(this, _session, req).renderBase64("png"); - res.success(_session.getId(), rendering); - }, - - _getUrlCommand = function(req, res) { - // Get the URL at which the Page currently is - var result = _protoParent.getSessionCurrWindow.call(this, _session, req).url; - - res.respondBasedOnResult(_session, res, {status: 0, value: result}); - }, - - _postUrlCommand = function(req, res) { - // Load the given URL in the Page - var postObj = JSON.parse(req.post), - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req); - - _log.debug("_postUrlCommand", "Session '"+ _session.getId() +"' is about to load URL: " + postObj.url); - - if (typeof(postObj) === "object" && postObj.url) { - // Switch to the main frame first - currWindow.switchToMainFrame(); - - // Load URL and wait for load to finish (or timeout) - currWindow.execFuncAndWaitForLoad(function() { - currWindow.open(postObj.url.trim()); - }, - _createOnSuccessHandler(res), //< success - function(errMsg) { //< failure/timeout - var errCode = errMsg === "timeout" - ? _errors.FAILED_CMD_STATUS_CODES.Timeout - : _errors.FAILED_CMD_STATUS_CODES.UnknownError; - - // Report error - _errors.handleFailedCommandEH(errCode, - "URL '" + postObj.url + "' didn't load. Error: '" + errMsg + "'", - req, - res, - _session); - }); - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _postTimeout = function(req, res) { - var postObj = JSON.parse(req.post); - - // Normalize the call: the "type" is read from the URL, not a POST parameter - if (req.urlParsed.file === _const.IMPLICIT_WAIT) { - postObj["type"] = _session.timeoutNames.IMPLICIT; - } else if (req.urlParsed.file === _const.ASYNC_SCRIPT) { - postObj["type"] = _session.timeoutNames.SCRIPT; - } - - if (typeof(postObj["type"]) === "string" && typeof(postObj["ms"]) === "number") { - - _log.debug("_postTimeout", JSON.stringify(postObj)); - - // Set the right timeout on the Session - switch(postObj["type"]) { - case _session.timeoutNames.SCRIPT: - _session.setScriptTimeout(postObj["ms"]); - break; - case _session.timeoutNames.IMPLICIT: - _session.setImplicitTimeout(postObj["ms"]); - break; - case _session.timeoutNames.PAGE_LOAD: - _session.setPageLoadTimeout(postObj["ms"]); - break; - default: - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - - res.success(_session.getId()); - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _postFrameCommand = function(req, res) { - var postObj = JSON.parse(req.post), - frameName, - framePos, - switched = false, - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req); - - _log.debug("_postFrameCommand", "Current frames count: " + currWindow.framesCount); - - if (typeof(postObj) === "object" && typeof(postObj.id) !== "undefined") { - if(postObj.id === null) { - _log.debug("_postFrameCommand", "Switching to 'null' (main frame)"); - - // Reset focus on the topmost (main) Frame - currWindow.switchToMainFrame(); - switched = true; - } else if (typeof(postObj.id) === "number") { - _log.debug("_postFrameCommand", "Switching to frame number: " + postObj.id); - - // Switch frame by "index" - switched = currWindow.switchToFrame(postObj.id); - } else if (typeof(postObj.id) === "string") { - // Switch frame by "name" or by "id" - _log.debug("_postFrameCommand", "Switching to frame #id: " + postObj.id); - - switched = currWindow.switchToFrame(postObj.id); - - // If we haven't switched, let's try to find the frame "name" using it's "id" - if (!switched) { - // fetch the frame "name" via "id" - frameName = currWindow.evaluate(function(frameId) { - var el = null; - el = document.querySelector('#'+frameId); - if (el !== null) { - return el.name; - } - - return null; - }, postObj.id); - - _log.debug("_postFrameCommand", "Failed to switch by #id, trying by name: " + frameName); - - // Switch frame by "name" - if (frameName !== null) { - switched = currWindow.switchToFrame(frameName); - } - - if (!switched) { - // fetch the frame "position" via "id" - framePos = currWindow.evaluate(function(frameIdOrName) { - var allFrames = document.querySelectorAll("frame,iframe"), - theFrame = document.querySelector('#'+frameIdOrName) || document.querySelector('[name='+frameIdOrName+']'), - i; - - for (i = allFrames.length -1; i >= 0; --i) { - if (allFrames[i].contentWindow === theFrame.contentWindow) { - return i; - } - } - }, postObj.id); - - if (framePos >= 0) { - _log.debug("_postFrameCommand", "Failed to switch by #id or name, trying by position: "+framePos); - switched = currWindow.switchToFrame(framePos); - } else { - _log.warn("_postFrameCommand", "Unable to locate the Frame!"); - } - } - } - } else if (typeof(postObj.id) === "object" && typeof(postObj.id["ELEMENT"]) === "string") { - _log.debug("_postFrameCommand.element", JSON.stringify(postObj.id)); - - // Will use the Element JSON to find the frame name - frameName = JSON.parse(currWindow.evaluate( - require("./webdriver_atoms.js").get("frame_name"), - postObj.id)); - - _log.debug("_postFrameCommand.frameName", frameName.value); - - // If a frame name (or id) is found for the given ELEMENT, we - // "re-call" this very function, changing the `post` property - // on the `req` object. The `post` will contain this time - // the frame name (or id) that was found. - if (frameName && frameName.value) { - req.post = "{\"id\" : \"" + frameName.value + "\"}"; - _postFrameCommand.call(this, req, res); - return; - } - } else { - throw _errors.createInvalidReqInvalidCommandMethodEH(req); - } - - // Send a positive response if the switch was successful - if (switched) { - res.success(_session.getId()); - } else { - // ... otherwise, throw the appropriate exception - throw _errors.createFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.NoSuchFrame, - "Unable to switch to frame", - req, - _session); - } - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _postFrameParentCommand = function(req, res) { - - var currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - switched; - - _log.debug("_postFrameParentCommand"); - - switched = currWindow.switchToParentFrame(); - - if (switched) { - res.success(_session.getId()); - } else { - // ... otherwise, throw the appropriate exception - throw _errors.createFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.NoSuchFrame, - "Unable to switch to frame", - req, - _session); - } - }, - - _getSourceCommand = function(req, res) { - var source = _protoParent.getSessionCurrWindow.call(this, _session, req).frameContent; - res.success(_session.getId(), source); - }, - - _postMouseMoveToCommand = function(req, res) { - var postObj = JSON.parse(req.post), - coords = { x: 0, y: 0 }, - elementLocation, - elementSize, - elementSpecified = false, - offsetSpecified = false; - - if (typeof postObj === "object") { - elementSpecified = postObj.element && postObj.element != null; - offsetSpecified = typeof postObj.xoffset !== "undefined" && typeof postObj.yoffset !== "undefined"; - } - // Check that either an Element ID or an X-Y Offset was provided - if (elementSpecified || offsetSpecified) { - _log.debug("_postMouseMoveToCommand", "element: " + elementSpecified + ", offset: " + offsetSpecified); - - // If an Element was provided... - if (elementSpecified) { - // Get Element's Location and add it to the coordinates - var requestHandler = new ghostdriver.WebElementReqHand(postObj.element, _session); - elementLocation = requestHandler.getLocationInView(); - elementSize = requestHandler.getSize(); - // If the Element has a valid location - if (elementLocation !== null) { - coords.x = elementLocation.x; - coords.y = elementLocation.y; - } - } else { - coords = _session.inputs.getCurrentCoordinates(); - } - - _log.debug("_postMouseMoveToCommand", "initial coordinates: (" + coords.x + "," + coords.y + ")"); - - if (elementSpecified && !offsetSpecified && elementSize !== null) { - coords.x += Math.floor(elementSize.width / 2); - coords.y += Math.floor(elementSize.height / 2); - } else { - // Add up the offset (if any) - coords.x += postObj.xoffset || 0; - coords.y += postObj.yoffset || 0; - } - - _log.debug("_postMouseMoveToCommand", "coordinates adjusted to: (" + coords.x + "," + coords.y + ")"); - - // Send the Mouse Move as native event - _session.inputs.mouseMove(_session, coords); - res.success(_session.getId()); - } else { - // Neither "element" nor "xoffset/yoffset" were provided - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _postMouseClickCommand = function(req, res, clickType) { - var postObj = {}, - mouseButton = "left"; - // normalize click - clickType = clickType || "click"; - - // The protocol allows language bindings to send an empty string (or no data at all) - if (req.post && req.post.length > 0) { - postObj = JSON.parse(req.post); - } - - // Check that either an Element ID or an X-Y Offset was provided - if (typeof(postObj) === "object") { - // Determine which button to click - if (typeof(postObj.button) === "number") { - // 0 is left, 1 is middle, 2 is right - mouseButton = (postObj.button === 2) ? "right" : (postObj.button === 1) ? "middle" : "left"; - } - // Send the Mouse Click as native event - _session.inputs.mouseButtonClick(_session, clickType, mouseButton); - res.success(_session.getId()); - } else { - // Neither "element" nor "xoffset/yoffset" were provided - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _postCookieCommand = function(req, res) { - var postObj = JSON.parse(req.post || "{}"), - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req); - - // If the page has not loaded anything yet, setting cookies is forbidden - if (currWindow.url.indexOf("about:blank") === 0) { - // Something else went wrong - _errors.handleFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.UnableToSetCookie, - "Unable to set Cookie: no URL has been loaded yet", - req, - res, - _session); - return; - } - - if (postObj.cookie) { - - // set default values - if (!postObj.cookie.path) { - postObj.cookie.path = "/"; - } - - if (!postObj.cookie.secure) { - postObj.cookie.secure = false; - } - - if (!postObj.cookie.domain) { - postObj.cookie.domain = require("./third_party/parseuri.js").parse(currWindow.url).host; - } - - if (postObj.cookie.hasOwnProperty('httpOnly')) { - postObj.cookie.httponly = postObj.cookie.httpOnly; - delete postObj.cookie['httpOnly']; - } else { - postObj.cookie.httponly = false; - } - - // JavaScript deals with Timestamps in "milliseconds since epoch": normalize! - if (postObj.cookie.expiry) { - postObj.cookie.expiry *= 1000; - } - - if (!postObj.cookie.expiry) { - // 24*60*60*365*20*1000 = 630720000 number of milliseconds in 20 years - postObj.cookie.expiry = Date.now() + 630720000000; - } - - // If the cookie is expired OR if it was successfully added - if ((postObj.cookie.expiry && postObj.cookie.expiry <= new Date().getTime()) || - currWindow.addCookie(postObj.cookie)) { - // Notify success - res.success(_session.getId()); - } else { - // Something went wrong while trying to set the cookie - if (currWindow.url.indexOf(postObj.cookie.domain) < 0) { - // Domain mismatch - _errors.handleFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.InvalidCookieDomain, - "Can only set Cookies for the current domain", - req, - res, - _session); - } else { - // Something else went wrong - _errors.handleFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.UnableToSetCookie, - "Unable to set Cookie", - req, - res, - _session); - } - } - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _getCookieCommand = function(req, res) { - // Get all the cookies the session at current URL can see/access - res.success( - _session.getId(), - _protoParent.getSessionCurrWindow.call(this, _session, req).cookies); - }, - - _deleteCookieCommand = function(req, res) { - if (req.urlParsed.chunks.length === 2) { - // delete only 1 cookie among the one visible to this page - _protoParent.getSessionCurrWindow.call(this, _session, req).deleteCookie(req.urlParsed.chunks[1]); - } else { - // delete all the cookies visible to this page - _protoParent.getSessionCurrWindow.call(this, _session, req).clearCookies(); - } - res.success(_session.getId()); - }, - - _deleteWindowCommand = function(req, res) { - var params = JSON.parse(req.post || "{}"), //< in case nothing is posted at all - closed = false; - - // Use the "name" parameter if it was provided - if (typeof(params) === "object" && params.name) { - closed = _session.closeWindow(params.name); - } else { - closed = _session.closeCurrentWindow(); - } - - // Report a success if we manage to close the window, - // otherwise throw a Failed Command Error - if (closed) { - res.success(_session.getId()); - } else { - throw _errors.createFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.NoSuchWindow, - "Unable to close window (closed already?)", - req, - _session); - } - }, - - _postWindowCommand = function(req, res) { - var params = JSON.parse(req.post); - - if (typeof(params) === "object" && typeof(params.name) === "string") { - // Report a success if we manage to switch the current window, - // otherwise throw a Failed Command Error - if (_session.switchToWindow(params.name)) { - res.success(_session.getId()); - } else { - throw _errors.createFailedCommandEH(_errors.FAILED_CMD_STATUS_CODES.NoSuchWindow, - "Unable to switch to window (closed?)", - req, - _session); - } - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _getTitleCommand = function(req, res) { - res.success(_session.getId(), _protoParent.getSessionCurrWindow.call(this, _session, req).title); - }, - - _executePhantomJS = function(req, res) { - var params = JSON.parse(req.post); - if (typeof(params) === "object" && params.script && params.args) { - res.success(_session.getId(), _session.executePhantomJS(_protoParent.getSessionCurrWindow.call(this, _session, req), params.script, params.args)); - } else { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - }, - - _postLog = function (req, res) { - var params = JSON.parse(req.post); - if (!params.type || _session.getLogTypes().indexOf(params.type) < 0) { - throw _errors.createInvalidReqMissingCommandParameterEH(req); - } - _getLog(req, res, params.type); - }, - - _getLogTypes = function (req, res) { - res.success(_session.getId(), _session.getLogTypes()); - }, - - _getLog = function (req, res, logType) { - res.success(_session.getId(), _session.getLog(logType)); - }; - - // public: - return { - handle : _handle, - getSessionId : function() { return _session.getId(); } - }; -}; -// prototype inheritance: -ghostdriver.SessionReqHand.prototype = new ghostdriver.RequestHandler(); \ No newline at end of file diff --git a/src/ghostdriver/request_handlers/shutdown_request_handler.js b/src/ghostdriver/request_handlers/shutdown_request_handler.js deleted file mode 100644 index 865c2323d8..0000000000 --- a/src/ghostdriver/request_handlers/shutdown_request_handler.js +++ /dev/null @@ -1,61 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -Copyright (c) 2014, Jim Evans - Salesforce.com -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.ShutdownReqHand = function() { - // private: - var - _protoParent = ghostdriver.ShutdownReqHand.prototype, - _log = ghostdriver.logger.create("ShutdownReqHand"), - - _handle = function(req, res) { - _log.info("_handle", "About to shutdown"); - - _protoParent.handle.call(this, req, res); - - // Any HTTP Request Method will be accepted for this command. Some drivers like HEAD for example... - if (req.urlParsed.file === "shutdown") { - res.statusCode = 200; - res.setHeader("Content-Type", "text/html;charset=UTF-8"); - res.setHeader("Content-Length", 36); - res.write("Closing..."); - res.close(); - return; - } - - throw _protoParent.errors.createInvalidReqInvalidCommandMethodEH(req); - }; - - // public: - return { - handle : _handle - }; -}; -// prototype inheritance: -ghostdriver.ShutdownReqHand.prototype = new ghostdriver.RequestHandler(); diff --git a/src/ghostdriver/request_handlers/status_request_handler.js b/src/ghostdriver/request_handlers/status_request_handler.js deleted file mode 100644 index 386810281c..0000000000 --- a/src/ghostdriver/request_handlers/status_request_handler.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.StatusReqHand = function() { - // private: - const - _statusObj = { - "build" : { - "version" : ghostdriver.version - }, - "os" : { - "name" : ghostdriver.system.os.name, - "version" : ghostdriver.system.os.version, - "arch" : ghostdriver.system.os.architecture - } - }; - - var - _protoParent = ghostdriver.StatusReqHand.prototype, - - _handle = function(req, res) { - _protoParent.handle.call(this, req, res); - - if (req.method === "GET" && req.urlParsed.file === "status") { - res.success(null, _statusObj); - return; - } - - throw _protoParent.errors.createInvalidReqInvalidCommandMethodEH(req); - }; - - // public: - return { - handle : _handle - }; -}; -// prototype inheritance: -ghostdriver.StatusReqHand.prototype = new ghostdriver.RequestHandler(); diff --git a/src/ghostdriver/request_handlers/webelement_request_handler.js b/src/ghostdriver/request_handlers/webelement_request_handler.js deleted file mode 100644 index 4288789f71..0000000000 --- a/src/ghostdriver/request_handlers/webelement_request_handler.js +++ /dev/null @@ -1,612 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -Copyright (c) 2014, Alex Anderson <@alxndrsn> -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.WebElementReqHand = function(idOrElement, session) { - // private: - const - _const = { - ELEMENT : "element", - ELEMENTS : "elements", - VALUE : "value", - SUBMIT : "submit", - DISPLAYED : "displayed", - ENABLED : "enabled", - ATTRIBUTE : "attribute", - NAME : "name", - CLICK : "click", - SELECTED : "selected", - CLEAR : "clear", - CSS : "css", - TEXT : "text", - EQUALS : "equals", - LOCATION : "location", - LOCATION_IN_VIEW : "location_in_view", - SIZE : "size" - }; - - var - _id = ((typeof(idOrElement) === "object") ? idOrElement["ELEMENT"] : idOrElement), - _session = session, - _locator = new ghostdriver.WebElementLocator(_session), - _protoParent = ghostdriver.WebElementReqHand.prototype, - _errors = _protoParent.errors, - _log = ghostdriver.logger.create("WebElementReqHand"), - - _handle = function(req, res) { - _protoParent.handle.call(this, req, res); - - if (req.urlParsed.file === _const.ELEMENT && req.method === "POST") { - _locator.handleLocateCommand(req, res, _locator.locateElement, _getJSON()); - return; - } else if (req.urlParsed.file === _const.ELEMENTS && req.method === "POST") { - _locator.handleLocateCommand(req, res, _locator.locateElements, _getJSON()); - return; - } else if (req.urlParsed.file === _const.VALUE && req.method === "POST") { - _postValueCommand(req, res); - return; - } else if (req.urlParsed.file === _const.SUBMIT && req.method === "POST") { - _postSubmitCommand(req, res); - return; - } else if (req.urlParsed.file === _const.DISPLAYED && req.method === "GET") { - _getDisplayedCommand(req, res); - return; - } else if (req.urlParsed.file === _const.ENABLED && req.method === "GET") { - _getEnabledCommand(req, res); - return; - } else if (req.urlParsed.chunks[0] === _const.ATTRIBUTE && req.method === "GET") { - _getAttributeCommand(req, res); - return; - } else if (req.urlParsed.file === _const.NAME && req.method === "GET") { - _getNameCommand(req, res); - return; - } else if (req.urlParsed.file === _const.CLICK && req.method === "POST") { - _postClickCommand(req, res); - return; - } else if (req.urlParsed.file === _const.SELECTED && req.method === "GET") { - _getSelectedCommand(req, res); - return; - } else if (req.urlParsed.file === _const.CLEAR && req.method === "POST") { - _postClearCommand(req, res); - return; - } else if (req.urlParsed.chunks[0] === _const.CSS && req.method === "GET") { - _getCssCommand(req, res); - return; - } else if (req.urlParsed.file === _const.TEXT && req.method === "GET") { - _getTextCommand(req, res); - return; - } else if (req.urlParsed.chunks[0] === _const.EQUALS && req.method === "GET") { - _getEqualsCommand(req, res); - return; - } else if (req.urlParsed.file === _const.LOCATION && req.method === "GET") { - _getLocationCommand(req, res); - return; - } else if (req.urlParsed.file === _const.LOCATION_IN_VIEW && req.method === "GET") { - _getLocationInViewCommand(req, res); - return; - } else if (req.urlParsed.file === _const.SIZE && req.method === "GET") { - _getSizeCommand(req, res); - return; - } else if (req.urlParsed.file === "" && req.method === "GET") { //< GET "/session/:id/element/:id" - // The response to this command is not defined in the specs: - // here we just return the Element JSON ID. - res.success(_session.getId(), _getJSON()); - return; - } // else ... - - throw _errors.createInvalidReqInvalidCommandMethodEH(req); - }, - - _getDisplayedCommand = function(req, res) { - var displayed = _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("is_displayed"), - _getJSON()); - res.respondBasedOnResult(_session, req, displayed); - }, - - _getEnabledCommand = function(req, res) { - var enabled = _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("is_enabled"), - _getJSON()); - res.respondBasedOnResult(_session, req, enabled); - }, - - _getLocationResult = function(req) { - return JSON.parse(_protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("get_location"), - _getJSON())); - }, - - _getLocation = function(req) { - var result = _getLocationResult(req); - - _log.debug("_getLocation", JSON.stringify(result)); - - if (result.status === 0) { - return result.value; - } else { - return null; - } - }, - - _getLocationCommand = function(req, res) { - var locationRes = _getLocationResult(req); - - _log.debug("_getLocationCommand", JSON.stringify(locationRes)); - - res.respondBasedOnResult(_session, req, locationRes); - }, - - // scrolls the element into view - _getLocationInViewResult = function (req) { - var currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - frameOffset = _session.getFrameOffset(currWindow), - locationRes; - - locationRes = JSON.parse(_protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("get_location_in_view"), - _getJSON(), true)); - - if(locationRes && locationRes.status !== 0) { - return locationRes; - } - - locationRes.value.x += frameOffset.left; - locationRes.value.y += frameOffset.top; - return locationRes; - }, - - _getLocationInView = function (req) { - var result = _getLocationInViewResult(req); - - _log.debug("_getLocationInView", JSON.stringify(result)); - - if (result.status === 0) { - return result.value; - } else { - return null; - } - }, - - _getLocationInViewCommand = function (req, res) { - var locationInViewRes = _getLocationInViewResult(req); - - _log.debug("_getLocationInViewCommand", JSON.stringify(locationInViewRes)); - - // Something went wrong: report the error - res.respondBasedOnResult(_session, req, locationInViewRes); - }, - - _getSizeResult = function (req) { - return _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("get_size"), - _getJSON()); - }, - - _getSize = function (req) { - var result = JSON.parse(_getSizeResult(req)); - - _log.debug("_getSize", JSON.stringify(result)); - - if (result.status === 0) { - return result.value; - } else { - return null; - } - }, - - _getSizeCommand = function (req, res) { - var sizeRes = _getSizeResult(req); - - _log.debug("_getSizeCommand", JSON.stringify(sizeRes)); - - res.respondBasedOnResult(_session, req, sizeRes); - }, - - - // coordinates for native click events - _getPosition = function(req) { - var currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - locationRes = _getLocationInViewResult(req), - sizeRes = JSON.parse(_getSizeResult(req)); - - if(locationRes && locationRes.status !== 0) { - return locationRes; - } - - if(sizeRes && sizeRes.status !== 0) { - return sizeRes; - } - - return {status: 0, - x: (locationRes.value.x + sizeRes.value.width/2), - y: (locationRes.value.y + sizeRes.value.height/2)}; - }, - - _nativeClick = function(req) { - var currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - clickRes, - coords; - - currWindow.evaluate(require("./webdriver_atoms.js").get("scroll_into_view"),_getJSON()); - var interactableRes = currWindow.evaluate(require("./webdriver_atoms.js").get("is_displayed"), _getJSON()); - interactableRes = JSON.parse(interactableRes); - if (interactableRes && interactableRes.status !== 0) { - return interactableRes; - } - - if (!interactableRes.value) { - return { - status: _errors.FAILED_CMD_STATUS_CODES.ElementNotVisible, - value: {message: "Element is not displayed"} - }; - } - - coords = _getPosition(); - if (coords && coords.status !== 0) { - return coords; - } - _session.inputs.mouseMove(_session, coords); - _session.inputs.mouseButtonClick(_session, "click", "left"); - _log.debug("Click at: " + JSON.stringify(coords)); - - return {status: 0, value: null}; - }, - - _normalizeSpecialChars = function(str) { - var resultStr = "", - i, ilen; - - for(i = 0, ilen = str.length; i < ilen; ++i) { - switch(str[i]) { - case '\b': - resultStr += '\uE003'; //< Backspace - break; - case '\t': - resultStr += '\uE004'; // Tab - break; - case '\r': - resultStr += '\uE006'; // Return - if (str.length > i+1 && str[i+1] === '\n') { //< Return on Windows - ++i; //< skip the next '\n' - } - break; - case '\n': - resultStr += '\uE007'; // Enter - break; - default: - resultStr += str[i]; - break; - } - } - - return resultStr; - }, - - _postValueCommand = function(req, res) { - var postObj = JSON.parse(req.post), - currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - typeRes, - text, - isFileInputRes, - isContentEditableRes, - fsModule = require("fs"), - abortCallback = false, - multiFileText; - - isFileInputRes = currWindow.evaluate(require("./webdriver_atoms.js").get("is_file_input"), _getJSON()); - isFileInputRes = JSON.parse(isFileInputRes); - if (isFileInputRes && isFileInputRes.status !== 0) { - res.respondBasedOnResult(_session, req, isFileInputRes); - return; - } - - // Ensure all required parameters are available - if (typeof(postObj) === "object" && typeof(postObj.value) === "object") { - // Normalize input: some binding might send an array of single characters - text = postObj.value.join(""); - - // Detect if it's an Input File type (that requires special behaviour), and the File actually exists - if (isFileInputRes.value) { - - // split files by \n like chromedriver - multiFileText = text.split("\n"); - - // abort if file does not exist - for (var i = 0; i < multiFileText.length; ++i) { - if (!fsModule.exists(multiFileText[i])) { - _log.debug("File does not exist: " + multiFileText[i]); - res.success(_session.getId()); - return; - } - } - - // this indirectly clicks on the head element - // hack to workaround phantomjs uploadFile api which requires a selector - currWindow.uploadFile("head", multiFileText); - - // Click on the element! - typeRes = _nativeClick(); - res.respondBasedOnResult(_session, req, typeRes); - return; - - } else { - // Normalize for special characters - text = _normalizeSpecialChars(text); - - // Execute the "type" atom on an empty string only to force focus to the element. - // TODO: This is a hack that needs to be corrected with a proper method to set focus. - isContentEditableRes = currWindow.evaluate(require("./webdriver_atoms.js").get("is_content_editable"), _getJSON()); - isContentEditableRes = JSON.parse(isContentEditableRes); - if (isContentEditableRes && isContentEditableRes.status !== 0) { - res.respondBasedOnResult(_session, req, isContentEditableRes); - return; - } - if (isContentEditableRes.value) { - // must use native click to focus on content editable element - typeRes = _nativeClick(); - } else { - typeRes = currWindow.evaluate(require("./webdriver_atoms.js").get("type"), _getJSON(), ""); - typeRes = JSON.parse(typeRes); - } - - if (typeRes && typeRes.status !== 0) { - abortCallback = true; //< handling the error here - res.respondBasedOnResult(_session, req, typeRes); - return; - } - - currWindow.execFuncAndWaitForLoad(function() { - - // Send keys to the page, using Native Events - _session.inputs.sendKeys(_session, text); - - // Only clear the modifier keys if this was called using element.sendKeys(). - // Calling this from the Advanced Interactions API doesn't clear the modifier keys. - if (req.urlParsed.file === _const.VALUE) { - _session.inputs.clearModifierKeys(_session); - } - }, - function(status) { //< onLoadFinished - // Report Load Finished, only if callbacks were not "aborted" - if (!abortCallback) { - res.success(_session.getId()); - } - }, - function(errMsg) { - var errCode = errMsg === "timeout" - ? _errors.FAILED_CMD_STATUS_CODES.Timeout - : _errors.FAILED_CMD_STATUS_CODES.UnknownError; - - // Report Load Error, only if callbacks were not "aborted" - if (!abortCallback) { - _errors.handleFailedCommandEH(errCode, "Pageload initiated by click failed. Cause: " + errMsg, req, res, _session); - } - }); - } - return; - } - - throw _errors.createInvalidReqMissingCommandParameterEH(req); - }, - - _getNameCommand = function(req, res) { - var result = JSON.parse(_protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("get_name"), - _getJSON())); - - res.respondBasedOnResult(_session, req, result); - }, - - _getAttributeCommand = function(req, res) { - var attributeValueAtom = require("./webdriver_atoms.js").get("get_attribute_value"), - result; - - if (typeof(req.urlParsed.file) === "string" && req.urlParsed.file.length > 0) { - // Read the attribute - result = _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - attributeValueAtom, // < Atom to read an attribute - _getJSON(), // < Element to read from - req.urlParsed.file); // < Attribute to read - - res.respondBasedOnResult(_session, req, result); - return; - } - - throw _errors.createInvalidReqMissingCommandParameterEH(req); - }, - - _getTextCommand = function(req, res) { - var result = _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("get_text"), - _getJSON()); - res.respondBasedOnResult(_session, req, result); - }, - - _getEqualsCommand = function(req, res) { - var result; - - if (typeof(req.urlParsed.file) === "string" && req.urlParsed.file.length > 0) { - result = JSON.parse(_protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("equals"), - _getJSON(), _getJSON(req.urlParsed.file))); - - res.respondBasedOnResult(_session, req, result); - return; - } - - throw _errors.createInvalidReqMissingCommandParameterEH(req); - }, - - _postSubmitCommand = function(req, res) { - var currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - submitRes, - abortCallback = false; - - currWindow.execFuncAndWaitForLoad(function() { - // do the submit - submitRes = currWindow.evaluate(require("./webdriver_atoms.js").get("submit"), _getJSON()); - - // If Submit was NOT positive, status will be set to something else than '0' - submitRes = JSON.parse(submitRes); - if (submitRes && submitRes.status !== 0) { - abortCallback = true; //< handling the error here - res.respondBasedOnResult(_session, req, submitRes); - } - }, - function(status) { //< onLoadFinished - // Report about the Load, only if it was not already handled - if (!abortCallback) { - res.success(_session.getId()); - } - }, - function(errMsg) { - var errCode = errMsg === "timeout" - ? _errors.FAILED_CMD_STATUS_CODES.Timeout - : _errors.FAILED_CMD_STATUS_CODES.UnknownError; - - // Report Submit Error, only if callbacks were not "aborted" - if (!abortCallback) { - _errors.handleFailedCommandEH(errCode, "Submit failed: " + errMsg, req, res, _session); - } - }); - }, - - _postClickCommand = function(req, res) { - var currWindow = _protoParent.getSessionCurrWindow.call(this, _session, req), - clickRes, - abortCallback = false; - - // Clicking on Current Element can cause a page load, hence we need to wait for it to happen - currWindow.execFuncAndWaitForLoad(function() { - // do the click - clickRes = currWindow.evaluate(require("./webdriver_atoms.js").get("click"), _getJSON()); - - // If Click was NOT positive, status will be set to something else than '0' - clickRes = JSON.parse(clickRes); - if (clickRes && clickRes.status !== 0) { - abortCallback = true; //< handling the error here - res.respondBasedOnResult(_session, req, clickRes); - } - }, - function(status) { //< onLoadFinished - // Report Load Finished, only if callbacks were not "aborted" - if (!abortCallback) { - res.success(_session.getId()); - } - }, - function(errMsg) { - var errCode = errMsg === "timeout" - ? _errors.FAILED_CMD_STATUS_CODES.Timeout - : _errors.FAILED_CMD_STATUS_CODES.UnknownError; - - // Report Load Error, only if callbacks were not "aborted" - if (!abortCallback) { - _errors.handleFailedCommandEH(errCode, "Pageload initiated by click failed. Cause: " + errMsg, req, res, _session); - } - }); - }, - - _getSelectedCommand = function(req, res) { - var result = JSON.parse(_protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("is_selected"), - _getJSON())); - - res.respondBasedOnResult(_session, req, result); - }, - - _postClearCommand = function(req, res) { - var result = _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("clear"), - _getJSON()); - res.respondBasedOnResult(_session, req, result); - }, - - _getCssCommand = function(req, res) { - var cssPropertyName = req.urlParsed.file, - result; - - // Check that a property name was indeed provided - if (typeof(cssPropertyName) === "string" || cssPropertyName.length > 0) { - result = _protoParent.getSessionCurrWindow.call(this, _session, req).evaluate( - require("./webdriver_atoms.js").get("get_value_of_css_property"), - _getJSON(), - cssPropertyName); - - res.respondBasedOnResult(_session, req, result); - return; - } - - throw _errors.createInvalidReqMissingCommandParameterEH(req); - }, - - _getAttribute = function(currWindow, attributeName) { - var attributeValueAtom = require("./webdriver_atoms.js").get("get_attribute_value"), - result = currWindow.evaluate( - attributeValueAtom, // < Atom to read an attribute - _getJSON(), // < Element to read from - attributeName); // < Attribute to read - - return JSON.parse(result).value; - }, - - - /** - * This method can generate any Element JSON: just provide an ID. - * Will return the one of the current Element if no ID is provided. - * @param elementId ID of the Element to describe in JSON format, - * or undefined to get the one fo the current Element. - */ - _getJSON = function(elementId) { - return { - "ELEMENT" : elementId || _getId() - }; - }, - - _getId = function() { - return _id; - }, - _getSession = function() { - return _session; - }; - - // public: - return { - handle : _handle, - getId : _getId, - getJSON : _getJSON, - getSession : _getSession, - postValueCommand : _postValueCommand, - getLocation : _getLocation, - getLocationInView: _getLocationInView, - getSize: _getSize - }; -}; -// prototype inheritance: -ghostdriver.WebElementReqHand.prototype = new ghostdriver.RequestHandler(); diff --git a/src/ghostdriver/session.js b/src/ghostdriver/session.js deleted file mode 100644 index f579917d86..0000000000 --- a/src/ghostdriver/session.js +++ /dev/null @@ -1,911 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.Session = function(desiredCapabilities) { - // private: - const - _const = { - TIMEOUT_NAMES : { - SCRIPT : "script", - IMPLICIT : "implicit", - PAGE_LOAD : "page load" - }, - ONE_SHOT_POSTFIX : "OneShot", - LOG_TYPES : { - HAR : "har", - BROWSER : "browser" - }, - PROXY_TYPES : { - MANUAL : "manual", - DIRECT : "direct" - } - }; - - var - _defaultCapabilities = { // TODO - Actually try to match the "desiredCapabilities" instead of ignoring them - "browserName" : "phantomjs", - "version" : phantom.version.major + '.' + phantom.version.minor + '.' + phantom.version.patch, - "driverName" : "ghostdriver", - "driverVersion" : ghostdriver.version, - "platform" : ghostdriver.system.os.name + '-' + ghostdriver.system.os.version + '-' + ghostdriver.system.os.architecture, - "javascriptEnabled" : true, - "takesScreenshot" : true, - "handlesAlerts" : false, //< TODO - "databaseEnabled" : false, //< TODO - "locationContextEnabled" : false, //< TODO Target is 1.1 - "applicationCacheEnabled" : false, //< TODO Support for AppCache (?) - "browserConnectionEnabled" : false, //< TODO - "cssSelectorsEnabled" : true, - "webStorageEnabled" : false, //< TODO support for LocalStorage/SessionStorage - "rotatable" : false, //< TODO Target is 1.1 - "acceptSslCerts" : false, //< TODO - "nativeEvents" : true, //< TODO Only some commands are Native Events currently - "unhandledPromptBehavior" : null, - "proxy" : { //< TODO Support more proxy options - PhantomJS does allow setting from command line - "proxyType" : _const.PROXY_TYPES.DIRECT - }, - "webSecurityEnabled" : true - }, - _negotiatedCapabilities = { - "browserName" : _defaultCapabilities.browserName, - "version" : _defaultCapabilities.version, - "driverName" : _defaultCapabilities.driverName, - "driverVersion" : _defaultCapabilities.driverVersion, - "platform" : _defaultCapabilities.platform, - "javascriptEnabled" : _defaultCapabilities.javascriptEnabled, - "takesScreenshot" : typeof(desiredCapabilities.takesScreenshot) === "undefined" ? - _defaultCapabilities.takesScreenshot : - desiredCapabilities.takesScreenshot, - "handlesAlerts" : _defaultCapabilities.handlesAlerts, - "databaseEnabled" : _defaultCapabilities.databaseEnabled, - "locationContextEnabled" : _defaultCapabilities.locationContextEnabled, - "applicationCacheEnabled" : _defaultCapabilities.applicationCacheEnabled, - "browserConnectionEnabled" : _defaultCapabilities.browserConnectionEnabled, - "cssSelectorsEnabled" : _defaultCapabilities.cssSelectorsEnabled, - "webStorageEnabled" : _defaultCapabilities.webStorageEnabled, - "rotatable" : _defaultCapabilities.rotatable, - "acceptSslCerts" : _defaultCapabilities.acceptSslCerts, - "nativeEvents" : _defaultCapabilities.nativeEvents, - "unhandledPromptBehavior" : typeof(desiredCapabilities.unhandledPromptBehavior) === "undefined" ? - _defaultCapabilities.unhandledPromptBehavior : - desiredCapabilities.unhandledPromptBehavior, - "proxy" : typeof(desiredCapabilities.proxy) === "undefined" ? - _defaultCapabilities.proxy : - desiredCapabilities.proxy, - "webSecurityEnabled" : typeof(desiredCapabilities.webSecurityEnabled) === "undefined" ? - _defaultCapabilities.webSecurityEnabled : - desiredCapabilities.webSecurityEnabled - }, - // NOTE: This value is needed for Timeouts Upper-bound limit. - // "setTimeout/setInterval" accept only 32 bit integers, even though Number are all Doubles (go figure!) - // Interesting details here: {@link http://stackoverflow.com/a/4995054}. - _max32bitInt = Math.pow(2, 31) -1, //< Max 32bit Int - _timeouts = { - "script" : 30000, - "implicit" : 0, - "page load" : 300000, - }, - _windows = {}, //< NOTE: windows are "webpage" in Phantom-dialect - _currentWindowHandle = null, - _cookieJar = require('cookiejar').create(), - _id = require("./third_party/uuid.js").v1(), - _inputs = ghostdriver.Inputs(), - _capsPageSettingsPref = "phantomjs.page.settings.", - _capsPageCustomHeadersPref = "phantomjs.page.customHeaders.", - _capsPageZoomFactor = "phantomjs.page.zoomFactor", - _capsPageBlacklistPref = "phantomjs.page.blacklist", - _capsPageWhitelistPref = "phantomjs.page.whitelist", - _capsUnhandledPromptBehavior = "unhandledPromptBehavior", - _capsLoggingPref = "loggingPrefs", - _capsBrowserLoggerPref = "OFF", - _capsHarLoggerPref = "OFF", - _pageBlacklistFilter, - _pageWhitelistFilter, - _capsPageSettingsProxyPref = "proxy", - _pageSettings = {}, - _pageZoomFactor = 1, - _additionalPageSettings = { - resourceTimeout: null, - userName: null, - password: null - }, - _pageCustomHeaders = {}, - _log = ghostdriver.logger.create("Session [" + _id + "]"), - k, settingKey, headerKey, proxySettings; - - var - /** - * Parses proxy JSON object and return proxy settings for phantom - * - * @param proxyCapability proxy JSON Object: @see https://code.google.com/p/selenium/wiki/DesiredCapabilities - */ - _getProxySettingsFromCapabilities = function(proxyCapability) { - var proxySettings = {}; - if (proxyCapability["proxyType"].toLowerCase() == _const.PROXY_TYPES.MANUAL) { //< TODO: support other options - if (proxyCapability["httpProxy"] !== "null") { //< TODO: support other proxy types - var urlParts = proxyCapability["httpProxy"].split(':'); - proxySettings["ip"] = urlParts[0]; - proxySettings["port"] = urlParts[1]; - proxySettings["proxyType"] = "http"; - proxySettings["user"] = ""; - proxySettings["password"] = ""; - - return proxySettings; - } - } - return proxySettings; - }; - - // Searching for `phantomjs.settings.* and phantomjs.customHeaders.* phantomjs.page.zoomFactor` in the Desired Capabilities and merging with the Negotiated Capabilities - // Possible values for settings: @see http://phantomjs.org/api/webpage/property/settings.html. - // Possible values for customHeaders: @see http://phantomjs.org/api/webpage/property/custom-headers.html. - for (k in desiredCapabilities) { - if (k.indexOf(_capsPageSettingsPref) === 0) { - settingKey = k.substring(_capsPageSettingsPref.length); - if (settingKey.length > 0) { - _negotiatedCapabilities[k] = desiredCapabilities[k]; - _pageSettings[settingKey] = desiredCapabilities[k]; - } - } - if (k.indexOf(_capsPageCustomHeadersPref) === 0) { - headerKey = k.substring(_capsPageCustomHeadersPref.length); - if (headerKey.length > 0) { - _negotiatedCapabilities[k] = desiredCapabilities[k]; - _pageCustomHeaders[headerKey] = desiredCapabilities[k]; - } - } - if (k.indexOf(_capsPageZoomFactor) === 0){ - _negotiatedCapabilities[k] = desiredCapabilities[k]; - _pageZoomFactor = desiredCapabilities[k]; - } - if (k.indexOf(_capsPageBlacklistPref) === 0) { - const pageBlacklist = []; - const pageBlacklistLength = desiredCapabilities[k].length; - for(var i = 0; i < pageBlacklistLength; i++) { - pageBlacklist.push(new RegExp(desiredCapabilities[k][i])); - } - _pageBlacklistFilter = function(url, net) { - for(var i = 0; i < pageBlacklistLength; i++) { - if(url.search(pageBlacklist[i]) !== -1) { - net.abort(); - _log.debug("blacklist abort " + url); - } - } - } - } - if (k.indexOf(_capsPageWhitelistPref) === 0) { - const pageWhitelist = []; - const pageWhitelistLength = desiredCapabilities[k].length; - for(var i = 0; i < pageWhitelistLength; i++) { - pageWhitelist.push(new RegExp(desiredCapabilities[k][i])); - } - _pageWhitelistFilter = function(url, net) { - for(var i = 0; i < pageWhitelistLength; i++) { - if(url.search(pageWhitelist[i]) !== -1) { - return; - } - } - net.abort(); - _log.debug("whitelist abort " + url); - } - } - if (k.indexOf(_capsPageSettingsProxyPref) === 0) { - proxySettings = _getProxySettingsFromCapabilities(desiredCapabilities[k]); - phantom.setProxy(proxySettings["ip"], proxySettings["port"], proxySettings["proxyType"], proxySettings["user"], proxySettings["password"]); - } - if (k.indexOf(_capsLoggingPref) === 0) { - if (desiredCapabilities[k][_const.LOG_TYPES.BROWSER]) { - _capsBrowserLoggerPref = desiredCapabilities[k][_const.LOG_TYPES.BROWSER] || _capsBrowserLoggerPref; - } - if (desiredCapabilities[k][_const.LOG_TYPES.HAR]) { - _capsHarLoggerPref = desiredCapabilities[k][_const.LOG_TYPES.HAR] || _capsHarLoggerPref; - } - } - } - - var - /** - * Executes a function and waits for Load to happen. - * - * @param code Code to execute: a Function or just plain code - * @param onLoadFunc Function to execute when page finishes Loading - * @param onErrorFunc Function to execute in case of error - * (eg. Javascript error, page load problem or timeout). - * @param execTypeOpt Decides if to "apply" the function directly or page."eval" it. - * Optional. Default value is "apply". - */ - _execFuncAndWaitForLoadDecorator = function(code, onLoadFunc, onErrorFunc, execTypeOpt) { - // convert 'arguments' to a real Array - var args = Array.prototype.splice.call(arguments, 0), - thisPage = this, - onLoadFinishedArgs = null, - onErrorArgs = null; - - // Normalize "execTypeOpt" value - if (typeof(execTypeOpt) === "undefined" || - (execTypeOpt !== "apply" && execTypeOpt !== "eval")) { - execTypeOpt = "apply"; - } - - thisPage._onLoadFinishedLatch = false; - // Execute "code" - if (execTypeOpt === "eval") { - // Remove arguments used by this function before providing them to the target code. - // NOTE: Passing 'code' (to evaluate) and '0' (timeout) to 'evaluateAsync'. - args.splice(0, 3, code, 0); - // Invoke the Page Eval with the provided function - this.evaluateAsync.apply(this, args); - } else { - // Remove arguments used by this function before providing them to the target function. - args.splice(0, 3); - // "Apply" the provided function - code.apply(this, args); - } - - // Wait 10ms before proceeding any further: in this window of time - // the page can react and start loading (if it has to). - setTimeout(function() { - var loadingStartedTs = new Date().getTime(), - checkLoadingFinished; - - checkLoadingFinished = function() { - if (!_isLoading()) { //< page finished loading - _log.debug("_execFuncAndWaitForLoadDecorator", "Page Loading in Session: false"); - - if (!thisPage && thisPage._onLoadFinishedLatch) { - _log.debug("_execFuncAndWaitForLoadDecorator", "Handle Load Finish Event"); - // Report the result of the "Load Finished" event - onLoadFunc.apply(thisPage, Array.prototype.slice.call(arguments)); - } else { - _log.debug("_execFuncAndWaitForLoadDecorator", "No Load Finish Event Detected"); - // No page load was caused: just report "success" - onLoadFunc.call(thisPage, "success"); - } - - return; - } // else: - _log.debug("_execFuncAndWaitForLoadDecorator", "Page Loading in Session: true"); - - // Timeout error? - if (new Date().getTime() - loadingStartedTs > _getPageLoadTimeout()) { - // Report the "Timeout" event - onErrorFunc.call(thisPage, "timeout"); - return; - } - - // Retry in 100ms - setTimeout(checkLoadingFinished, 100); - }; - checkLoadingFinished(); - }, 10); //< 10ms - }, - - /** - * Wait for Page to be done Loading before executing of callback. - * Also, it considers "Page Timeout" to avoid waiting indefinitely. - * NOTE: This is useful for cases where it's not certain a certain action - * just executed MIGHT cause a page to start loading. - * It's a "best effort" approach and the user is given the use of - * "Page Timeout" to tune to their needs. - * - * @param callback Function to execute when done or timed out - */ - _waitIfLoadingDecorator = function(callback) { - var thisPage = this, - waitStartedTs = new Date().getTime(), - checkDoneLoading; - - checkDoneLoading = function() { - if (!_isLoading() //< Session is not loading (any more?) - || (new Date().getTime() - waitStartedTs > _getPageLoadTimeout())) { //< OR Page Timeout expired - callback.call(thisPage); - return; - } - - _log.debug("_waitIfLoading", "Still loading (wait using Implicit Timeout)"); - - // Retry in 10ms - setTimeout(checkDoneLoading, 10); - }; - checkDoneLoading(); - }, - - _oneShotCallbackFactory = function(page, callbackName) { - return function() { - var oneShotCallbackName = callbackName + _const.ONE_SHOT_POSTFIX, - i, retVal; - - try { - // If there are callback functions registered - if (page[oneShotCallbackName] instanceof Array - && page[oneShotCallbackName].length > 0) { - _log.debug("_oneShotCallback", callbackName); - - // Invoke all the callback functions (once) - for (i = page[oneShotCallbackName].length -1; i >= 0; --i) { - retVal = page[oneShotCallbackName][i].apply(page, arguments); - } - - // Remove all the callback functions now - page[oneShotCallbackName] = []; - } - } catch (e) { - // In case the "page" object has been closed, - // the code above will fail: that's OK. - } - - // Return (latest) value - return retVal; - }; - }, - - _setOneShotCallbackDecorator = function(callbackName, handlerFunc) { - var oneShotCallbackName = callbackName + _const.ONE_SHOT_POSTFIX; - - // Initialize array of One Shot Callbacks - if (!(this[oneShotCallbackName] instanceof Array)) { - this[oneShotCallbackName] = []; - } - this[oneShotCallbackName].push(handlerFunc); - }, - - _decoratePromptBehavior = function(newPage) { - var _unhandledPromptBehavior = _negotiatedCapabilities["unhandledPromptBehavior"], - confirmValue; - - if (_unhandledPromptBehavior !== "accept" && _unhandledPromptBehavior !== "dismiss") { - return; - } - - _log.info("_decoratePromptBehavior"); - - newPage.onAlert = function(msg) { - _log.debug("ALERT: " + msg); - } - - newPage.onPrompt = function(msg, val) { - _log.debug("PROMPT: " + msg); - return val; - } - - if (_unhandledPromptBehavior === "accept") { - confirmValue = true; - } else { - confirmValue = false; - } - - newPage.onConfirm = function(msg) { - _log.debug("CONFIRM: " + msg); - return confirmValue; - } - }, - - // Add any new page to the "_windows" container of this session - _addNewPage = function(newPage) { - _log.debug("_addNewPage"); - - // decorate the new Window/Page - newPage = _decorateNewWindow(newPage); - // set session-specific CookieJar - newPage.cookieJar = _cookieJar; - // store the Window/Page by WindowHandle - _windows[newPage.windowHandle] = newPage; - }, - - // Delete any closing page from the "_windows" container of this session - _deleteClosingPage = function(closingPage) { - _log.debug("_deleteClosingPage"); - - // Need to be defensive, as the "closing" can be cause by Client Commands - if (_windows.hasOwnProperty(closingPage.windowHandle)) { - delete _windows[closingPage.windowHandle]; - } - }, - - _decorateNewWindow = function(page) { - var k; - - // Decorating: - // 0. Pages lifetime will be managed by Driver, not the pages - page.ownsPages = false; - - // 1. Random Window Handle - page.windowHandle = require("./third_party/uuid.js").v1(); - - // 2. Initialize the One-Shot Callbacks - page["onUrlChanged"] = _oneShotCallbackFactory(page, "onUrlChanged"); - page["onFilePicker"] = _oneShotCallbackFactory(page, "onFilePicker"); - page["onCallback"] = _oneShotCallbackFactory(page, "onCallback"); - - // 3. Utility methods - page.execFuncAndWaitForLoad = _execFuncAndWaitForLoadDecorator; - page.setOneShotCallback = _setOneShotCallbackDecorator; - page.waitIfLoading = _waitIfLoadingDecorator; - - // 4. Store every newly created page - page.onPageCreated = _addNewPage; - - // 5. Remove every closing page - page.onClosing = _deleteClosingPage; - - // 6. Applying Page settings received via capabilities - for (k in _pageSettings) { - // Apply setting only if really supported by PhantomJS - if (page.settings.hasOwnProperty(k) || _additionalPageSettings.hasOwnProperty(k)) { - page.settings[k] = _pageSettings[k]; - } - } - - // 7. Applying Page custom headers received via capabilities - // fix custom headers per ariya/phantomjs#13621 and detro/ghostdriver#489 - if ("Accept-Encoding" in _pageCustomHeaders) { - _log.warn("Custom header \"Accept-Encoding\" is not supported. see ariya/phantomjs#13621"); - delete _pageCustomHeaders["Accept-Encoding"] - } - page.customHeaders = _pageCustomHeaders; - - // 8. Applying Page zoomFactor - page.zoomFactor = _pageZoomFactor; - - // 9. Log Page internal errors - page.browserLog = ghostdriver.webdriver_logger.create(_capsBrowserLoggerPref); - page.onError = function(errorMsg, errorStack) { - var stack = ''; - - // Prep the "stack" part of the message - errorStack.forEach(function (stackEntry, idx, arr) { - stack += " " //< a bit of indentation - + (stackEntry.function || "(anonymous function)") - + " (" + stackEntry.file + ":" + stackEntry.line + ")"; - stack += idx < arr.length - 1 ? "\n" : ""; - }); - - // Log as error - _log.error("page.onError", "msg: " + errorMsg); - _log.error("page.onError", "stack:\n" + stack); - - // Register as part of the "browser" log - page.browserLog.push(_createLogEntry("WARNING", errorMsg + "\n" + stack)); - }; - - // 10. Log Page console messages - page.onConsoleMessage = function(msg, lineNum, sourceId) { - // Log as debug - // Register as part of the "browser" log - page.browserLog.push(_createLogEntry("INFO", msg + " (" + sourceId + ":" + lineNum + ")")); - }; - - // 11. Log Page network activity - page.resources = ghostdriver.webdriver_logger.create(_capsHarLoggerPref); - page.startTime = null; - page.endTime = null; - - // register onLoad callbacks to detect page load - page._onLoadLatch = false; - page._onLoadFinishedLatch = false; - page.onLoadStarted = function() { - page._onLoadLatch = true; - page.startTime = new Date(); - _log.debug("page.onLoadStarted"); - }; - page.onLoadFinished = function() { - page._onLoadLatch = false; - page._onLoadFinishedLatch = true; - page.endTime = new Date(); - _log.debug("page.onLoadFinished"); - }; - - page.onResourceRequested = function (req, net) { - if(_pageWhitelistFilter) { _pageWhitelistFilter(req.url, net); } - if(_pageBlacklistFilter) { _pageBlacklistFilter(req.url, net); } - - _log.debug("page.onResourceRequested", JSON.stringify(req)); - - // Register HTTP Request - page.resources.push({ - id: req.id, - request: req - }); - }; - page.onResourceReceived = function (res) { - _log.debug("page.onResourceReceived", JSON.stringify(res)); - - // Register HTTP Response - if (res.stage === 'start') { - page.resources.push({ - id: res.id, - startReply: res - }); - } else if (res.stage === 'end') { - page.resources.push({ - id: res.id, - endReply: res - }); - } - }; - page.onResourceError = function(resError) { - _log.debug("page.onResourceError", JSON.stringify(resError)); - - // Register HTTP Error - page.resources.push({ - id: resError.id, - error: resError - }); - }; - page.onResourceTimeout = function(req) { - _log.debug("page.onResourceTimeout", JSON.stringify(req)); - - // Register HTTP Timeout - page.resources.push({ - id: req.id, - error: req - }); - }; - page.onNavigationRequested = function(url, type, willNavigate, main) { - // Clear page log before page loading - if (main && willNavigate) { - _clearPageLog(page); - } - }; - - _decoratePromptBehavior(page); - - // NOTE: The most common desktop screen resolution used online is currently: 1366x768 - // See http://gs.statcounter.com/#resolution-ww-monthly-201307-201312. - // Jan 2017 - page.viewportSize = { - width : 1366, - height : 768 - }; - - _log.info("page.settings", JSON.stringify(page.settings)); - _log.info("page.customHeaders: ", JSON.stringify(page.customHeaders)); - _log.info("page.zoomFactor: ", JSON.stringify(page.zoomFactor)); - - return page; - }, - - _createLogEntry = function(level, message) { - return { - "level" : level, - "message" : message, - "timestamp" : (new Date()).getTime() - }; - }, - - /** - * Is any window in this Session Loading? - * @returns "true" if at least 1 window is loading. - */ - _isLoading = function() { - var wHandle, _window; - - for (wHandle in _windows) { - _window = _windows[wHandle]; - if (_window._onLoadLatch || (_window.loadingProgress > 0 && _window.loadingProgress < 100)) { - return true; - } - } - - return false; - }, - - /** - * According to log method specification we have to clear log after each page refresh. - * https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/log - * @param {Object} page - * @private - */ - _clearPageLog = function (page) { - page.resources.log = []; - page.browserLog.log = []; - }, - - _getWindow = function(handleOrName) { - var page = null, - k; - - if (_isValidWindowHandle(handleOrName)) { - // Search by "handle" - page = _windows[handleOrName]; - } else { - // Search by "name" - for (k in _windows) { - if (_windows[k].windowName === handleOrName) { - page = _windows[k]; - break; - } - } - } - - return page; - }, - - _init = function() { - var page; - - // Ensure a Current Window is available, if it's found to be `null` - if (_currentWindowHandle === null) { - // Create the first Window/Page - page = require("webpage").create(); - // Decorate it with listeners and helpers - page = _decorateNewWindow(page); - // set session-specific CookieJar - page.cookieJar = _cookieJar; - // Make the new Window, the Current Window - _currentWindowHandle = page.windowHandle; - // Store by WindowHandle - _windows[_currentWindowHandle] = page; - } - }, - - _getCurrentWindow = function() { - var page = null; - - if (_windows.hasOwnProperty(_currentWindowHandle)) { - page = _windows[_currentWindowHandle]; - } - - // TODO Handle "null" cases throwing a "no such window" error - - return page; - }, - - _switchToWindow = function(handleOrName) { - var page = _getWindow(handleOrName); - - if (page !== null) { - // Switch current window and return "true" - _currentWindowHandle = page.windowHandle; - // Switch to the Main Frame of that window - page.switchToMainFrame(); - return true; - } - - // Couldn't find the window, so return "false" - return false; - }, - - _closeCurrentWindow = function() { - if (_currentWindowHandle !== null) { - return _closeWindow(_currentWindowHandle); - } - return false; - }, - - _closeWindow = function(handleOrName) { - var page = _getWindow(handleOrName), - handle; - - if (page !== null) { - handle = page.windowHandle; - _windows[handle].close(); - delete _windows[handle]; - return true; - } - return false; - }, - - _getWindowsCount = function() { - return Object.keys(_windows).length; - }, - - _getCurrentWindowHandle = function() { - if (!_isValidWindowHandle(_currentWindowHandle)) { - return null; - } - return _currentWindowHandle; - }, - - _isValidWindowHandle = function(handle) { - return _windows.hasOwnProperty(handle); - }, - - _getWindowHandles = function() { - return Object.keys(_windows); - }, - - _setTimeout = function(type, ms) { - // In case the chosen timeout is less than 0, we reset it to `_max32bitInt` - if (ms < 0) { - _timeouts[type] = _max32bitInt; - } else { - _timeouts[type] = ms; - } - }, - - _getTimeout = function(type) { - return _timeouts[type]; - }, - - _getScriptTimeout = function() { - return _getTimeout(_const.TIMEOUT_NAMES.SCRIPT); - }, - - _getImplicitTimeout = function() { - return _getTimeout(_const.TIMEOUT_NAMES.IMPLICIT); - }, - - _getPageLoadTimeout = function() { - return _getTimeout(_const.TIMEOUT_NAMES.PAGE_LOAD); - }, - - _setScriptTimeout = function(ms) { - _setTimeout(_const.TIMEOUT_NAMES.SCRIPT, ms); - }, - - _setImplicitTimeout = function(ms) { - _setTimeout(_const.TIMEOUT_NAMES.IMPLICIT, ms); - }, - - _setPageLoadTimeout = function(ms) { - _setTimeout(_const.TIMEOUT_NAMES.PAGE_LOAD, ms); - }, - - _executePhantomJS = function(page, script, args) { - try { - var code = new Function(script); - return code.apply(page, args); - } catch (e) { - return e; - } - }, - - _aboutToDelete = function() { - var k; - - // Close current window first - _closeCurrentWindow(); - - // Releasing page resources and deleting the objects - for (k in _windows) { - _closeWindow(k); - } - - // Release CookieJar resources - _cookieJar.close(); - }, - - _getLog = function (type) { - var har, i, entry, attrName, - page, tmp, tmpResMap; - - // Return "HAR" as Log Type "har" - if (type === _const.LOG_TYPES.HAR) { - har = require('./third_party/har.js'); - page = _getCurrentWindow(); - - tmpResMap = {}; - for (i = 0; i < page.resources.log.length; i++) { - entry = page.resources.log[i]; - if (!tmpResMap[entry.id]) { - tmpResMap[entry.id] = { - id: entry.id, - request: null, - startReply: null, - endReply: null, - error: null - } - } - for (attrName in entry) { - tmpResMap[entry.id][attrName] = entry[attrName]; - } - } - page.resources.log = []; - tmp = Object.keys(tmpResMap).sort(); - for (i in tmp) { - page.resources.push(tmpResMap[tmp[i]]); - } - - tmp = []; - tmp.push(_createLogEntry( - "INFO", - JSON.stringify(har.createHar(page, page.resources.log)))); - page.resources.log = []; - return tmp; - } - - // Return Browser Console Log - if (type === _const.LOG_TYPES.BROWSER) { - page = _getCurrentWindow(); - tmp = page.browserLog.log; - page.browserLog.log = []; - return tmp; - } - - // Return empty Log - return []; - }, - - _getLogTypes = function () { - var logTypes = [], k; - - for (k in _const.LOG_TYPES) { - logTypes.push(_const.LOG_TYPES[k]); - } - - return logTypes; - }, - - _getFrameOffset = function(page) { - return page.evaluate(function() { - var win = window, - offset = {top: 0, left: 0}, - style, - rect; - - while(win.frameElement) { - rect = win.frameElement.getClientRects()[0]; - style = win.getComputedStyle(win.frameElement); - win = win.parent; - - offset.top += rect.top + parseInt(style.getPropertyValue('padding-top'), 10); - offset.left += rect.left + parseInt(style.getPropertyValue('padding-left'), 10); - } - - return offset; - }); - }; - - // Initialize the Session. - // Particularly, create the first empty page/window. - _init(); - - _log.debug("Session.desiredCapabilities", JSON.stringify(desiredCapabilities)); - _log.info("Session.negotiatedCapabilities", JSON.stringify(_negotiatedCapabilities)); - - // public: - return { - getCapabilities : function() { return _negotiatedCapabilities; }, - getId : function() { return _id; }, - switchToWindow : _switchToWindow, - getCurrentWindow : _getCurrentWindow, - closeCurrentWindow : _closeCurrentWindow, - getWindow : _getWindow, - closeWindow : _closeWindow, - getWindowsCount : _getWindowsCount, - getCurrentWindowHandle : _getCurrentWindowHandle, - getWindowHandles : _getWindowHandles, - isValidWindowHandle : _isValidWindowHandle, - aboutToDelete : _aboutToDelete, - inputs : _inputs, - setScriptTimeout : _setScriptTimeout, - setImplicitTimeout : _setImplicitTimeout, - setPageLoadTimeout : _setPageLoadTimeout, - getScriptTimeout : _getScriptTimeout, - getImplicitTimeout : _getImplicitTimeout, - getPageLoadTimeout : _getPageLoadTimeout, - executePhantomJS : _executePhantomJS, - timeoutNames : _const.TIMEOUT_NAMES, - isLoading : _isLoading, - getLog: _getLog, - getLogTypes: _getLogTypes, - getFrameOffset: _getFrameOffset - }; -}; diff --git a/src/ghostdriver/third_party/console++.js b/src/ghostdriver/third_party/console++.js deleted file mode 100755 index 3a854ada34..0000000000 --- a/src/ghostdriver/third_party/console++.js +++ /dev/null @@ -1,290 +0,0 @@ -/* -This file is part of the Console++ by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -if (console.LEVELS) { - // Already loaded. No need to manipulate the "console" further. - // NOTE: NodeJS already caches modules. This is just defensive coding. - exports = console; - return; -} - -// private: -var _ANSICODES = { - 'reset' : '\033[0m', - 'bold' : '\033[1m', - 'italic' : '\033[3m', - 'underline' : '\033[4m', - 'blink' : '\033[5m', - 'black' : '\033[30m', - 'red' : '\033[31m', - 'green' : '\033[32m', - 'yellow' : '\033[33m', - 'blue' : '\033[34m', - 'magenta' : '\033[35m', - 'cyan' : '\033[36m', - 'white' : '\033[37m' - }, - _LEVELS = { - NONE : 0, - OFF : 0, //< alias for "NONE" - ERROR : 1, - WARN : 2, - WARNING : 2, //< alias for "WARN" - INFO : 3, - INFORMATION : 3, //< alias for "INFO" - DEBUG : 4 - }, - _LEVELS_COLOR = [ //< _LEVELS_COLOR position matches the _LEVELS values - "red", - "yellow", - "cyan", - "green" - ], - _LEVELS_NAME = [ //< _LEVELS_NAME position matches the _LEVELS values - "NONE", - "ERROR", - "WARN ", - "INFO ", - "DEBUG" - ], - _console = { - error : console.error, - warn : console.warn, - info : console.info, - debug : console.log, - log : console.log - }, - _level = _LEVELS.DEBUG, - _colored = true, - _messageColored = false, - _timed = true, - _onOutput = null; - -/** - * Take a string and apply console ANSI colors for expressions "#color{msg}" - * NOTE: Does nothing if "console.colored === false". - * - * @param str Input String - * @returns Same string but with colors applied - */ -var _applyColors = function(str) { - var tag = /#([a-z]+)\{|\}/, - cstack = [], - matches = null, - orig = null, - name = null, - code = null; - - while (tag.test(str)) { - matches = tag.exec(str); - orig = matches[0]; - - if (console.isColored()) { - if (orig === '}') { - cstack.pop(); - } else { - name = matches[1]; - if (name in _ANSICODES) { - code = _ANSICODES[name]; - cstack.push(code); - } - } - - str = str.replace(orig, _ANSICODES.reset + cstack.join('')); - } else { - str = str.replace(orig, ''); - } - } - return str; -}; - -/** - * Decorate the Arguments passed to the console methods we override. - * First element, the message, is now colored, timed and more (based on config). - * - * @param argsArray Array of arguments to decorate - * @param level Logging level to apply (regulates coloring and text) - * @returns Array of Arguments, decorated. - */ -var _decorateArgs = function(argsArray, level) { - var args = Array.prototype.slice.call(argsArray, 1), - msg = argsArray[0], - levelMsg; - - if (console.isColored()) { - levelMsg = _applyColors("#" + console.getLevelColor(level) + "{" + console.getLevelName(level) + "}"); - msg = _applyColors(msg); - - if (console.isMessageColored()) { - msg = _applyColors("#" + console.getLevelColor(level) + "{" + msg + "}"); - } - } else { - levelMsg = console.getLevelName(level); - } - - msg = _formatMessage(msg, levelMsg); - - args.splice(0, 0, msg); - - return args; -}; - -/** - * Formats the Message content. - * @param msg The message itself - * @param levelMsg The portion of message that contains the Level (maybe colored) - * @retuns The formatted message - */ -var _formatMessage = function(msg, levelMsg) { - if (console.isTimestamped()) { - return "[" + levelMsg + " - " + new Date().toJSON() + "] " + msg; - } else { - return "[" + levelMsg + "] " + msg; - } -}; - -/** - * Invokes the "console.onOutput()" callback, if it was set by user. - * This is useful in case the user wants to write the console output to another media as well. - * - * The callback is invoked with 2 parameters: - * - formattedMessage: formatted message, ready for output - * - levelName: the name of the logging level, to inform the user - * - * @param msg The Message itself - * @param level The Message Level (Number) - */ -var _invokeOnOutput = function(msg, level) { - var formattedMessage, - levelName; - - if (_onOutput !== null && typeof(_onOutput) === "function") { - levelName = console.getLevelName(level); - formattedMessage = _formatMessage(msg, levelName); - - _onOutput.call(null, formattedMessage, levelName); - } -}; - - -// public: -// CONSTANT: Logging Levels -console.LEVELS = _LEVELS; - -// Set/Get Level -console.setLevel = function(level) { - _level = level; -}; -console.getLevel = function() { - return _level; -}; -console.getLevelName = function(level) { - return _LEVELS_NAME[typeof(level) === "undefined" ? _level : level]; -}; -console.getLevelColor = function(level) { - return _LEVELS_COLOR[typeof(level) === "undefined" ? _level : level]; -}; -console.isLevelVisible = function(levelToCompare) { - return _level >= levelToCompare; -}; - -// Enable/Disable Colored Output -console.enableColor = function() { - _colored = true; -}; -console.disableColor = function() { - _colored = false; -}; -console.isColored = function() { - return _colored; -}; - -// Enable/Disable Colored Message Output -console.enableMessageColor = function() { - _messageColored = true; -}; -console.disableMessageColor = function() { - _messageColored = false; -}; -console.isMessageColored = function() { - return _messageColored; -}; - -// Enable/Disable Timestamped Output -console.enableTimestamp = function() { - _timed = true; -}; -console.disableTimestamp = function() { - _timed = false; -}; -console.isTimestamped = function() { - return _timed; -}; - -// Set OnOutput Callback (useful to write to file or something) -// Callback: `function(formattedMessage, levelName)` -console.onOutput = function(callback) { - _onOutput = callback; -}; - -// Decodes coloring markup in string -console.str2clr = function(str) { - return console.isColored() ? _applyColors(str): str; -}; - -// Overrides some key "console" Object methods -console.error = function(msg) { - if (arguments.length > 0 && this.isLevelVisible(_LEVELS.ERROR)) { - _console.error.apply(this, _decorateArgs(arguments, _LEVELS.ERROR)); - _invokeOnOutput(msg, _LEVELS.ERROR); - } -}; -console.warn = function(msg) { - if (arguments.length > 0 && this.isLevelVisible(_LEVELS.WARN)) { - _console.warn.apply(this, _decorateArgs(arguments, _LEVELS.WARN)); - _invokeOnOutput(msg, _LEVELS.WARN); - } -}; -console.info = function(msg) { - if (arguments.length > 0 && this.isLevelVisible(_LEVELS.INFO)) { - _console.info.apply(this, _decorateArgs(arguments, _LEVELS.INFO)); - _invokeOnOutput(msg, _LEVELS.INFO); - } -}; -console.debug = function(msg) { - if (arguments.length > 0 && this.isLevelVisible(_LEVELS.DEBUG)) { - _console.debug.apply(this, _decorateArgs(arguments, _LEVELS.DEBUG)); - _invokeOnOutput(msg, _LEVELS.DEBUG); - } -}; -console.log = function(msg) { - if (arguments.length > 0) { - _console.log.apply(this, arguments); - } -}; - -exports = console; diff --git a/src/ghostdriver/third_party/har.js b/src/ghostdriver/third_party/har.js deleted file mode 100644 index 232c8b8257..0000000000 --- a/src/ghostdriver/third_party/har.js +++ /dev/null @@ -1,173 +0,0 @@ -/** - * Page object - * @typedef {Object} PageObject - * @property {String} title - contents of tag - * @property {String} url - page URL - * @property {Date} startTime - time when page starts loading - * @property {Date} endTime - time when onLoad event fires - */ - -/** - * Resource object - * @typedef {Object} ResourceObject - * @property {Object} request - PhantomJS request object - * @property {Object} startReply - PhantomJS response object - * @property {Object} endReply - PhantomJS response object - */ - -/** - * This function is based on PhantomJS network logging example: - * https://github.com/ariya/phantomjs/blob/master/examples/netsniff.js - * - * @param {PageObject} page - * @param {ResourceObject} resources - * @returns {{log: {version: string, creator: {name: string, version: string}, pages: Array, entries: Array}}} - */ -exports.createHar = function (page, resources) { - var entries = []; - - resources.forEach(function (resource) { - var request = resource.request, - startReply = resource.startReply, - endReply = resource.endReply, - error = resource.error; - - if (!request) { - return; - } - - // Exclude Data URI from HAR file because - // they aren't included in specification - if (request.url.match(/(^data:image\/.*)/i)) { - return; - } - - if (error) { - // according to http://qt-project.org/doc/qt-4.8/qnetworkreply.html - switch (error.errorCode) { - case 1: - error.errorString = '(refused)'; - break; - case 2: - error.errorString = '(closed)'; - break; - case 3: - error.errorString = '(host not found)'; - break; - case 4: - error.errorString = '(timeout)'; - break; - case 5: - error.errorString = '(canceled)'; - break; - case 6: - error.errorString = '(ssl failure)'; - break; - case 7: - error.errorString = '(net failure)'; - break; - } - } - - if (startReply && endReply) { - entries.push({ - startedDateTime: request.time.toISOString(), - time: endReply.time - request.time, - request: { - method: request.method, - url: request.url, - httpVersion: "HTTP/1.1", - cookies: [], - headers: request.headers, - queryString: [], - headersSize: -1, - bodySize: -1 - }, - response: { - status: error ? null : endReply.status, - statusText: error ? error.errorString : endReply.statusText, - httpVersion: "HTTP/1.1", - cookies: [], - headers: endReply.headers, - redirectURL: "", - headersSize: -1, - bodySize: startReply.bodySize, - content: { - size: startReply.bodySize, - mimeType: endReply.contentType - } - }, - cache: {}, - timings: { - blocked: 0, - dns: -1, - connect: -1, - send: 0, - wait: startReply.time - request.time, - receive: endReply.time - startReply.time, - ssl: -1 - }, - pageref: page.url - }); - } else if (error) { - entries.push({ - startedDateTime: request.time.toISOString(), - time: 0, - request: { - method: request.method, - url: request.url, - httpVersion: "HTTP/1.1", - cookies: [], - headers: request.headers, - queryString: [], - headersSize: -1, - bodySize: -1 - }, - response: { - status: null, - statusText: error.errorString, - httpVersion: "HTTP/1.1", - cookies: [], - headers: [], - redirectURL: "", - headersSize: -1, - bodySize: 0, - content: {} - }, - cache: {}, - timings: { - blocked: 0, - dns: -1, - connect: -1, - send: 0, - wait: 0, - receive: 0, - ssl: -1 - }, - pageref: page.url - }); - } - }); - - return { - log: { - version: '1.2', - creator: { - name: "PhantomJS", - version: phantom.version.major + '.' + phantom.version.minor + - '.' + phantom.version.patch - }, - pages: [{ - startedDateTime: (page.startTime instanceof Date) - ? page.startTime.toISOString() : null, - id: page.url, - title: page.title, - pageTimings: { - onLoad: (page.startTime instanceof Date && page.endTime instanceof Date) - ? page.endTime.getTime() - page.startTime.getTime() : null - } - }], - entries: entries - } - }; -}; diff --git a/src/ghostdriver/third_party/parseuri.js b/src/ghostdriver/third_party/parseuri.js deleted file mode 100644 index fba2d2051d..0000000000 --- a/src/ghostdriver/third_party/parseuri.js +++ /dev/null @@ -1,70 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>. - -Copyright (c) 2012-2014, Ivan De Marino <http://ivandemarino.me> -Copyright (c) 2014, Steven Levithan <stevenlevithan.com> -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -// parseUri 1.3 -// This code was modified to fit the purpose of GhostDriver -// URL: http://blog.stevenlevithan.com/archives/parseuri - -function parseUri (str) { - var o = parseUri.options, - m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), - uri = {}, - i = 14; - - while (i--) uri[o.key[i]] = m[i] || ""; - - uri[o.q.name] = {}; - uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { - if ($1) uri[o.q.name][$1] = $2; - }); - - uri["chunks"] = (uri["source"].charAt(0) === '/') - ? uri["source"].substr(1).split('/') - : uri["source"].split('/'); - - return uri; -}; - -parseUri.options = { - strictMode: false, - key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], - q: { - name: "queryKey", - parser: /(?:^|&)([^&=]*)=?([^&]*)/g - }, - parser: { - strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, - loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ - } -}; - -// Adapt this to CommonJS Module Require -if (exports) { - exports.options = parseUri.options; - exports.parse = parseUri; -} diff --git a/src/ghostdriver/third_party/uuid.js b/src/ghostdriver/third_party/uuid.js deleted file mode 100644 index b7820ae02a..0000000000 --- a/src/ghostdriver/third_party/uuid.js +++ /dev/null @@ -1,249 +0,0 @@ -// node-uuid/uuid.js -// -// Copyright (c) 2010 Robert Kieffer -// Dual licensed under the MIT and GPL licenses. -// Documentation and details at https://github.com/broofa/node-uuid -(function() { - var _global = this; - - // Unique ID creation requires a high quality random # generator, but - // Math.random() does not guarantee "cryptographic quality". So we feature - // detect for more robust APIs, normalizing each method to return 128-bits - // (16 bytes) of random data. - var mathRNG, nodeRNG, whatwgRNG; - - // Math.random()-based RNG. All platforms, very fast, unknown quality - var _rndBytes = new Array(16); - mathRNG = function() { - var r, b = _rndBytes, i = 0; - - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) == 0) r = Math.random() * 0x100000000; - b[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return b; - } - - // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto - // WebKit only (currently), moderately fast, high quality - if (_global.crypto && crypto.getRandomValues) { - var _rnds = new Uint32Array(4); - whatwgRNG = function() { - crypto.getRandomValues(_rnds); - - for (var c = 0 ; c < 16; c++) { - _rndBytes[c] = _rnds[c >> 2] >>> ((c & 0x03) * 8) & 0xff; - } - return _rndBytes; - } - } - - // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html - // Node.js only, moderately fast, high quality - try { - var _rb = require('crypto').randomBytes; - nodeRNG = _rb && function() { - return _rb(16); - }; - } catch (e) {} - - // Select RNG with best quality - var _rng = nodeRNG || whatwgRNG || mathRNG; - - // Buffer class to use - var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; - - // Maps for number <-> hex string conversion - var _byteToHex = []; - var _hexToByte = {}; - for (var i = 0; i < 256; i++) { - _byteToHex[i] = (i + 0x100).toString(16).substr(1); - _hexToByte[_byteToHex[i]] = i; - } - - // **`parse()` - Parse a UUID into it's component bytes** - function parse(s, buf, offset) { - var i = (buf && offset) || 0, ii = 0; - - buf = buf || []; - s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { - if (ii < 16) { // Don't overflow! - buf[i + ii++] = _hexToByte[oct]; - } - }); - - // Zero out remaining bytes if string was short - while (ii < 16) { - buf[i + ii++] = 0; - } - - return buf; - } - - // **`unparse()` - Convert UUID byte array (ala parse()) into a string** - function unparse(buf, offset) { - var i = offset || 0, bth = _byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; - } - - // **`v1()` - Generate time-based UUID** - // - // Inspired by https://github.com/LiosK/UUID.js - // and http://docs.python.org/library/uuid.html - - // random #'s we need to init node and clockseq - var _seedBytes = _rng(); - - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] - ]; - - // Per 4.2.2, randomize (14 bit) clockseq - var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - - // Previous uuid creation time - var _lastMSecs = 0, _lastNSecs = 0; - - // See https://github.com/broofa/node-uuid for API details - function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq != null ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs != null ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq == null) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; n++) { - b[i + n] = node[n]; - } - - return buf ? buf : unparse(b); - } - - // **`v4()` - Generate random UUID** - - // See https://github.com/broofa/node-uuid for API details - function v4(options, buf, offset) { - // Deprecated - 'format' argument, as supported in v1.2 - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || _rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ii++) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || unparse(rnds); - } - - // Export public API - var uuid = v4; - uuid.v1 = v1; - uuid.v4 = v4; - uuid.parse = parse; - uuid.unparse = unparse; - uuid.BufferClass = BufferClass; - - // Export RNG options - uuid.mathRNG = mathRNG; - uuid.nodeRNG = nodeRNG; - uuid.whatwgRNG = whatwgRNG; - - if (typeof(module) != 'undefined') { - // Play nice with node.js - module.exports = uuid; - } else { - // Play nice with browsers - var _previousRoot = _global.uuid; - - // **`noConflict()` - (browser only) to reset global 'uuid' var** - uuid.noConflict = function() { - _global.uuid = _previousRoot; - return uuid; - } - _global.uuid = uuid; - } -}()); diff --git a/src/ghostdriver/third_party/webdriver-atoms/active_element.js b/src/ghostdriver/third_party/webdriver-atoms/active_element.js deleted file mode 100644 index ee43df9cf8..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/active_element.js +++ /dev/null @@ -1,83 +0,0 @@ -function(){return function(){var k=this;function aa(a,b){var c=a.split("."),d=k;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function l(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ba(a){var b=l(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function fa(a,b,c){return a.call.apply(a.bind,arguments)} -function ga(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ha(a,b,c){ha=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ga;return ha.apply(null,arguments)} -function ia(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ja=Date.now||function(){return+new Date};function n(a,b){function c(){}c.prototype=b.prototype;a.H=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.G=function(a,c,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[c].apply(a,g)}};function ka(a,b){this.code=a;this.a=p[a]||la;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}n(ka,Error);var la="unknown error",p={15:"element not selectable",11:"element not visible"};p[31]=la;p[30]=la;p[24]="invalid cookie domain";p[29]="invalid element coordinates";p[12]="invalid element state"; -p[32]="invalid selector";p[51]="invalid selector";p[52]="invalid selector";p[17]="javascript error";p[405]="unsupported operation";p[34]="move target out of bounds";p[27]="no such alert";p[7]="no such element";p[8]="no such frame";p[23]="no such window";p[28]="script timeout";p[33]="session not created";p[10]="stale element reference";p[21]="timeout";p[25]="unable to set cookie";p[26]="unexpected alert open";p[13]=la;p[9]="unknown command";ka.prototype.toString=function(){return this.name+": "+this.message};var ma=window;var na=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function oa(a,b){for(var c=0,d=na(String(a)).split("."),e=na(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var h=d[g]||"",u=e[g]||"",B=RegExp("(\\d*)(\\D*)","g"),N=RegExp("(\\d*)(\\D*)","g");do{var ca=B.exec(h)||["","",""],da=N.exec(u)||["","",""];if(0==ca[0].length&&0==da[0].length)break;c=pa(0==ca[1].length?0:parseInt(ca[1],10),0==da[1].length?0:parseInt(da[1],10))||pa(0==ca[2].length,0==da[2].length)||pa(ca[2],da[2])}while(0==c)}return c} -function pa(a,b){return a<b?-1:a>b?1:0};function q(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function qa(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d}function ra(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function r(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function sa(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ta(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function ua(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function va(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var t;a:{var wa=k.navigator;if(wa){var xa=wa.userAgent;if(xa){t=xa;break a}}t=""}function v(a){return-1!=t.indexOf(a)};function ya(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function za(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return v("Opera")||v("OPR")}function Ca(){return(v("Chrome")||v("CriOS"))&&!Ba()&&!v("Edge")};function Da(){return v("iPhone")&&!v("iPod")&&!v("iPad")};var Ea=Ba(),x=v("Trident")||v("MSIE"),Fa=v("Edge"),Ga=v("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!v("Edge"))&&!(v("Trident")||v("MSIE"))&&!v("Edge"),Ha=-1!=t.toLowerCase().indexOf("webkit")&&!v("Edge");function Ia(){var a=t;if(Ga)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ha)return/WebKit\/(\S+)/.exec(a)}function Ja(){var a=k.document;return a?a.documentMode:void 0} -var Ka=function(){if(Ea&&k.opera){var a;var b=k.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ia())&&(a=b?b[1]:"");return x&&(b=Ja(),null!=b&&b>parseFloat(a))?String(b):a}(),La={};function Ma(a){return La[a]||(La[a]=0<=oa(Ka,a))}var Na=k.document,y=Na&&x?Ja()||("CSS1Compat"==Na.compatMode?parseInt(Ka,10):5):void 0;!Ga&&!x||x&&9<=Number(y)||Ga&&Ma("1.9.1");x&&Ma("9");function Oa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Pa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(y))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Qa(a,b):!c&&Oa(e,b)?-1*Ra(a,b):!d&&Oa(f,a)?Ra(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,d)}function Ra(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Qa(d,a)}function Qa(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};var Sa=v("Firefox"),Ta=Da()||v("iPod"),Ua=v("iPad"),Va=v("Android")&&!(Ca()||v("Firefox")||Ba()||v("Silk")),Wa=Ca(),Xa=v("Safari")&&!(Ca()||v("Coast")||Ba()||v("Edge")||v("Silk")||v("Android"))&&!(Da()||v("iPad")||v("iPod"));function Ya(a){return(a=a.exec(t))?a[1]:""}var Za=function(){if(Sa)return Ya(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return Ka;if(Wa)return Ya(/Chrome\/([0-9.]+)/);if(Xa&&!(Da()||v("iPad")||v("iPod")))return Ya(/Version\/([0-9.]+)/);if(Ta||Ua){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(Va)return(a=Ya(/Android\s+([0-9.]+)/))?a:Ya(/Version\/([0-9.]+)/);return""}();var $a,ab;function bb(a){cb?ab(a):Va?oa(db,a):oa(Za,a)}var cb=function(){if(!Ga)return!1;var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;$a=function(a){return 0<=c.compare(d,""+a)};ab=function(a){c.compare(e,""+a)};return!0}(),eb; -if(Va){var fb=/Android\s+([0-9\.]+)/.exec(t);eb=fb?fb[1]:"0"}else eb="0";var db=eb;Va&&bb(2.3);Va&&bb(4);Xa&&bb(6);/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function z(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var A=x&&!(9<=Number(y)),gb=x&&!(8<=Number(y));function C(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function hb(a,b){var c=gb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new C(b,a,b.nodeName,c)};function ib(a){this.b=a;this.a=0}function jb(a){a=a.match(kb);for(var b=0;b<a.length;b++)lb.test(a[b])&&a.splice(b,1);return new ib(a)}var kb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),lb=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function mb(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function G(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}gb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function nb(a,b,c,d,e){return(A?ob:pb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new H)} -function ob(a,b,c,d,e){if(a instanceof I||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=qb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)G(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||J(e,b);return e}rb(a,b,c,d,e);return e} -function pb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&J(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&J(e,b)})):a instanceof K?rb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),q(b,function(a){G(a,c,d)&&J(e,a)}));return e} -function sb(a,b,c,d,e){var f;if((a instanceof I||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=qb(a);if("*"!=g&&(f=qa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=qa(f,function(a){return G(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||J(e,a)});return e}return tb(a,b,c,d,e)}function tb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&J(e,b);return e} -function rb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&J(e,b),rb(a,b,c,d,e)}function qb(a){if(a instanceof K){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function H(){this.b=this.a=null;this.l=0}function ub(a){this.node=a;this.a=this.b=null}function vb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,h=d.node;f==h||f instanceof C&&h instanceof C&&f.a==h.a?(f=c,c=c.a,d=d.a):0<Pa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}H.prototype.unshift=function(a){a=new ub(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++}; -function J(a,b){var c=new ub(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function wb(a){return(a=a.a)?a.node:null}function xb(a){return(a=wb(a))?F(a):""}function L(a,b){return new yb(a,!!b)}function yb(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function M(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function O(a){this.i=a;this.b=this.g=!1;this.f=null}function P(a){return"\n "+a.toString().split("\n").join("\n ")}function zb(a,b){a.g=b}function Ab(a,b){a.b=b}function Q(a,b){var c=a.a(b);return c instanceof H?+xb(c):+c}function R(a,b){var c=a.a(b);return c instanceof H?xb(c):""+c}function S(a,b){var c=a.a(b);return c instanceof H?!!c.l:!!c};function Bb(a,b,c){O.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==Cb&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,s:b}):this.f={name:b.f.name,s:c})}n(Bb,O); -function T(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof H&&c instanceof H){b=L(b);for(d=M(b);d;d=M(b))for(e=L(c),f=M(e);f;f=M(e))if(a(F(d),F(f)))return!0;return!1}if(b instanceof H||c instanceof H){b instanceof H?(e=b,d=c):(e=c,d=b);f=L(e);for(var g=typeof d,h=M(f);h;h=M(f)){switch(g){case "number":h=+F(h);break;case "boolean":h=!!F(h);break;case "string":h=F(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Bb.prototype.a=function(a){return this.c.m(this.h,this.o,a)};Bb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+P(this.h);return a+=P(this.o)};function Db(a,b,c,d){this.a=a;this.A=b;this.i=c;this.m=d}Db.prototype.toString=function(){return this.a};var Eb={}; -function U(a,b,c,d){if(Eb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Db(a,b,c,d);return Eb[a.toString()]=a}U("div",6,1,function(a,b,c){return Q(a,c)/Q(b,c)});U("mod",6,1,function(a,b,c){return Q(a,c)%Q(b,c)});U("*",6,1,function(a,b,c){return Q(a,c)*Q(b,c)});U("+",5,1,function(a,b,c){return Q(a,c)+Q(b,c)});U("-",5,1,function(a,b,c){return Q(a,c)-Q(b,c)});U("<",4,2,function(a,b,c){return T(function(a,b){return a<b},a,b,c)}); -U(">",4,2,function(a,b,c){return T(function(a,b){return a>b},a,b,c)});U("<=",4,2,function(a,b,c){return T(function(a,b){return a<=b},a,b,c)});U(">=",4,2,function(a,b,c){return T(function(a,b){return a>=b},a,b,c)});var Cb=U("=",3,2,function(a,b,c){return T(function(a,b){return a==b},a,b,c,!0)});U("!=",3,2,function(a,b,c){return T(function(a,b){return a!=b},a,b,c,!0)});U("and",2,2,function(a,b,c){return S(a,c)&&S(b,c)});U("or",1,2,function(a,b,c){return S(a,c)||S(b,c)});function Fb(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");O.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}n(Fb,O);Fb.prototype.a=function(a){a=this.c.a(a);return Gb(this.h,a)};Fb.prototype.toString=function(){var a;a="Filter:"+P(this.c);return a+=P(this.h)};function Hb(a,b){if(b.length<a.B)throw Error("Function "+a.j+" expects at least"+a.B+" arguments, "+b.length+" given");if(null!==a.w&&b.length>a.w)throw Error("Function "+a.j+" expects at most "+a.w+" arguments, "+b.length+" given");a.C&&q(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});O.call(this,a.i);this.h=a;this.c=b;zb(this,a.g||sa(b,function(a){return a.g}));Ab(this,a.F&&!b.length||a.D&&!!b.length||sa(b,function(a){return a.b}))} -n(Hb,O);Hb.prototype.a=function(a){return this.h.m.apply(null,ua(a,this.c))};Hb.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=r(this.c,function(a,b){return a+P(b)},"Arguments:"),a=a+P(b);return a};function Ib(a,b,c,d,e,f,g,h,u){this.j=a;this.i=b;this.g=c;this.F=d;this.D=e;this.m=f;this.B=g;this.w=void 0!==h?h:g;this.C=!!u}Ib.prototype.toString=function(){return this.j};var Jb={}; -function V(a,b,c,d,e,f,g,h){if(Jb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Jb[a]=new Ib(a,b,c,d,!1,e,f,g,h)}V("boolean",2,!1,!1,function(a,b){return S(b,a)},1);V("ceiling",1,!1,!1,function(a,b){return Math.ceil(Q(b,a))},1);V("concat",3,!1,!1,function(a,b){return r(va(arguments,1),function(b,d){return b+R(d,a)},"")},2,null);V("contains",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return-1!=b.indexOf(a)},2);V("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); -V("false",2,!1,!1,function(){return!1},0);V("floor",1,!1,!1,function(a,b){return Math.floor(Q(b,a))},1); -V("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ta(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=R(b,a).split(/\s+/),f=[];q(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(m(f))b=m(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Pa);var g=new H;q(f,function(a){J(g,a)});return g},1); -V("lang",2,!1,!1,function(){return!1},1);V("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);V("local-name",3,!1,!0,function(a,b){var c=b?wb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);V("name",3,!1,!0,function(a,b){var c=b?wb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);V("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -V("normalize-space",3,!1,!0,function(a,b){return(b?R(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);V("not",2,!1,!1,function(a,b){return!S(b,a)},1);V("number",1,!1,!0,function(a,b){return b?Q(b,a):+F(a.a)},0,1);V("position",1,!0,!1,function(a){return a.b},0);V("round",1,!1,!1,function(a,b){return Math.round(Q(b,a))},1);V("starts-with",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return 0==b.lastIndexOf(a,0)},2);V("string",3,!1,!0,function(a,b){return b?R(b,a):F(a.a)},0,1); -V("string-length",1,!1,!0,function(a,b){return(b?R(b,a):F(a.a)).length},0,1);V("substring",3,!1,!1,function(a,b,c,d){c=Q(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?Q(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=R(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);V("substring-after",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -V("substring-before",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);V("sum",1,!1,!1,function(a,b){for(var c=L(b.a(a)),d=0,e=M(c);e;e=M(c))d+=+F(e);return d},1,1,!0);V("translate",3,!1,!1,function(a,b,c,d){b=R(b,a);c=R(c,a);var e=R(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);V("true",2,!1,!1,function(){return!0},0);function K(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Kb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}K.prototype.a=function(a){return null===this.b||this.b==a.nodeType};K.prototype.f=function(){return this.h}; -K.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=P(this.c));return a};function Lb(a){O.call(this,3);this.c=a.substring(1,a.length-1)}n(Lb,O);Lb.prototype.a=function(){return this.c};Lb.prototype.toString=function(){return"Literal: "+this.c};function I(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}I.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};I.prototype.f=function(){return this.j};I.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function Mb(a){O.call(this,1);this.c=a}n(Mb,O);Mb.prototype.a=function(){return this.c};Mb.prototype.toString=function(){return"Number: "+this.c};function Nb(a,b){O.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.v||c.c!=Ob||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}n(Nb,O);function Pb(){O.call(this,4)}n(Pb,O);Pb.prototype.a=function(a){var b=new H;a=a.a;9==a.nodeType?J(b,a):J(b,a.ownerDocument);return b};Pb.prototype.toString=function(){return"Root Helper Expression"};function Qb(){O.call(this,4)}n(Qb,O);Qb.prototype.a=function(a){var b=new H;J(b,a.a);return b};Qb.prototype.toString=function(){return"Context Helper Expression"}; -function Rb(a){return"/"==a||"//"==a}Nb.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof H))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=L(b,e.c.a),g;if(e.g||e.c!=Sb)if(e.g||e.c!=Tb)for(g=M(f),b=e.a(new z(g));null!=(g=M(f));)g=e.a(new z(g)),b=vb(b,g);else g=M(f),b=e.a(new z(g));else{for(g=M(f);(b=M(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new z(g))}}return b}; -Nb.prototype.toString=function(){var a;a="Path Expression:"+P(this.h);if(this.c.length){var b=r(this.c,function(a,b){return a+P(b)},"Steps:");a+=P(b)}return a};function Ub(a,b){this.a=a;this.b=!!b} -function Gb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=L(b),f=b.l,g,h=0;g=M(e);h++){var u=a.b?f-h:h+1;g=d.a(new z(g,u,f));if("number"==typeof g)u=u==g;else if("string"==typeof g||"boolean"==typeof g)u=!!g;else if(g instanceof H)u=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!u){u=e;g=u.f;var B=u.a;if(!B)throw Error("Next must be called at least once before remove.");var N=B.b,B=B.a;N?N.a=B:g.a=B;B?B.b=N:g.b=N;g.l--;u.a=null}}return b} -Ub.prototype.toString=function(){return r(this.a,function(a,b){return a+P(b)},"Predicates:")};function W(a,b,c,d){O.call(this,4);this.c=a;this.o=b;this.h=c||new Ub([]);this.v=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.f={name:a,s:b.s});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}n(W,O); -W.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.s?R(c.s,a):null,f=1);if(this.v)if(this.g||this.c!=Vb)if(a=L((new W(Wb,new K("node"))).a(a)),b=M(a))for(c=this.m(b,d,e,f);null!=(b=M(a));)c=vb(c,this.m(b,d,e,f));else c=new H;else c=nb(this.o,b,d,e),c=Gb(this.h,c,f);else c=this.m(a.a,d,e,f);return c};W.prototype.m=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=Gb(this.h,a,d)}; -W.prototype.toString=function(){var a;a="Step:"+P("Operator: "+(this.v?"//":"/"));this.c.j&&(a+=P("Axis: "+this.c));a+=P(this.o);if(this.h.a.length){var b=r(this.h.a,function(a,b){return a+P(b)},"Predicates:");a+=P(b)}return a};function Xb(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Xb.prototype.toString=function(){return this.j};var Yb={};function X(a,b,c,d){if(Yb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Xb(a,b,c,!!d);return Yb[a]=b} -X("ancestor",function(a,b){for(var c=new H,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);X("ancestor-or-self",function(a,b){var c=new H,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Ob=X("attribute",function(a,b){var c=new H,d=a.f();if("style"==d&&b.style&&A)return J(c,new C(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof K&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&J(c,hb(b,f)):J(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&J(c,hb(b,f)):J(c,f));return c},!1),Vb=X("child",function(a,b,c,d,e){return(A?sb:tb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new H)},!1,!0);X("descendant",nb,!1,!0); -var Wb=X("descendant-or-self",function(a,b,c,d){var e=new H;G(b,c,d)&&a.a(b)&&J(e,b);return nb(a,b,c,d,e)},!1,!0),Sb=X("following",function(a,b,c,d){var e=new H;do for(var f=b;f=f.nextSibling;)G(f,c,d)&&a.a(f)&&J(e,f),e=nb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);X("following-sibling",function(a,b){for(var c=new H,d=b;d=d.nextSibling;)a.a(d)&&J(c,d);return c},!1);X("namespace",function(){return new H},!1); -var Zb=X("parent",function(a,b){var c=new H;if(9==b.nodeType)return c;if(2==b.nodeType)return J(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&J(c,d);return c},!1),Tb=X("preceding",function(a,b,c,d){var e=new H,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var u=[];for(b=f[g];b=b.previousSibling;)u.unshift(b);for(var B=0,N=u.length;B<N;B++)b=u[B],G(b,c,d)&&a.a(b)&&J(e,b),e=nb(a,b,c,d,e)}return e},!0,!0); -X("preceding-sibling",function(a,b){for(var c=new H,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var $b=X("self",function(a,b){var c=new H;a.a(b)&&J(c,b);return c},!1);function ac(a){O.call(this,1);this.c=a;this.g=a.g;this.b=a.b}n(ac,O);ac.prototype.a=function(a){return-Q(this.c,a)};ac.prototype.toString=function(){return"Unary Expression: -"+P(this.c)};function bc(a){O.call(this,4);this.c=a;zb(this,sa(this.c,function(a){return a.g}));Ab(this,sa(this.c,function(a){return a.b}))}n(bc,O);bc.prototype.a=function(a){var b=new H;q(this.c,function(c){c=c.a(a);if(!(c instanceof H))throw Error("Path expression must evaluate to NodeSet.");b=vb(b,c)});return b};bc.prototype.toString=function(){return r(this.c,function(a,b){return a+P(b)},"Union Expression:")};function cc(a,b){this.a=a;this.b=b}function dc(a){for(var b,c=[];;){Y(a,"Missing right hand side of binary expression.");b=ec(a);var d=E(a.a);if(!d)break;var e=(d=Eb[d]||null)&&d.A;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].A;)b=new Bb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Bb(c.pop(),c.pop(),b);return b}function Y(a,b){if(mb(a.a))throw Error(b);}function fc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function gc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function hc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Lb(a)} -function ic(a){var b,c=[],d;if(Rb(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(mb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Pb;d=new Pb;Y(a,"Missing next location step.");b=jc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=dc(a);Y(a,'unclosed "("');fc(a,")");break;case '"':case "'":b=hc(a);break;default:if(isNaN(+b))if(!Kb(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a); -b=Jb[b]||null;E(a.a);for(d=[];")"!=D(a.a);){Y(a,"Missing function argument list.");d.push(dc(a));if(","!=D(a.a))break;E(a.a)}Y(a,"Unclosed function argument list.");gc(a);b=new Hb(b,d)}else{b=null;break a}else b=new Mb(+E(a.a))}"["==D(a.a)&&(d=new Ub(kc(a)),b=new Fb(b,d))}if(b)if(Rb(D(a.a)))d=b;else return b;else b=jc(a,"/"),d=new Qb,c.push(b)}for(;Rb(D(a.a));)b=E(a.a),Y(a,"Missing next location step."),b=jc(a,b),c.push(b);return new Nb(d,c)} -function jc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new W($b,new K("node")),E(a.a),d;if(".."==D(a.a))return d=new W(Zb,new K("node")),E(a.a),d;var f;if("@"==D(a.a))f=Ob,E(a.a),Y(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=Yb[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);Y(a,"Missing node name")}else f=Vb;c=D(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -D(a.a,1)){if(!Kb(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!Kb(c))throw Error("Invalid type name: "+c);fc(a,"(");Y(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=hc(a);Y(a,"Bad nodetype");gc(a);c=new K(c,g)}else if(c=E(a.a),e=c.indexOf(":"),-1==e)c=new I(c);else{var g=c.substring(0,e),h;if("*"==g)h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new I(c,h)}else throw Error("Bad token: "+E(a.a));e=new Ub(kc(a),f.a);return d|| -new W(f,c,e,"//"==b)}function kc(a){for(var b=[];"["==D(a.a);){E(a.a);Y(a,"Missing predicate expression.");var c=dc(a);b.push(c);Y(a,"Unclosed predicate expression.");fc(a,"]")}return b}function ec(a){if("-"==D(a.a))return E(a.a),new ac(ec(a));var b=ic(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)Y(a,"Missing next union location path."),b.push(ic(a));a.a.a--;a=new bc(b)}return a};function lc(a){switch(a.nodeType){case 1:return ia(mc,a);case 9:return lc(a.documentElement);case 11:case 10:case 6:case 12:return nc;default:return a.parentNode?lc(a.parentNode):nc}}function nc(){return null}function mc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?mc(a.parentNode,b):null};function oc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=jb(a);if(mb(c))throw Error("Invalid XPath expression.");b?"function"==l(b)||(b=ha(b.lookupNamespaceURI,b)):b=function(){return null};var d=dc(new cc(c,b));if(!mb(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new z(a));return new Z(c,b)}} -function Z(a,b){if(0==b)if(a instanceof H)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof H))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof H?xb(a):""+a;break;case 1:this.numberValue=a instanceof H?+xb(a):+a;break;case 3:this.booleanValue=a instanceof H?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d= -L(a);c=[];for(var e=M(d);e;e=M(d))c.push(e instanceof C?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:d=wb(a);this.singleNodeValue=d instanceof C?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}Z.ANY_TYPE=0;Z.NUMBER_TYPE=1;Z.STRING_TYPE=2;Z.BOOLEAN_TYPE=3;Z.UNORDERED_NODE_ITERATOR_TYPE=4;Z.ORDERED_NODE_ITERATOR_TYPE=5;Z.UNORDERED_NODE_SNAPSHOT_TYPE=6;Z.ORDERED_NODE_SNAPSHOT_TYPE=7;Z.ANY_UNORDERED_NODE_TYPE=8;Z.FIRST_ORDERED_NODE_TYPE=9;function pc(a){this.lookupNamespaceURI=lc(a)} -aa("wgxpath.install",function(a,b){var c=a||k,d=c.document;if(!d.evaluate||b)c.XPathResult=Z,d.evaluate=function(a,b,c,d){return(new oc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new oc(a,b)},d.createNSResolver=function(a){return new pc(a)}});function qc(){return document.activeElement||document.body};function rc(){} -function sc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==l(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),sc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),tc(d,c),c.push(":"),sc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":tc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var uc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},vc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function tc(a,b){b.push('"',a.replace(vc,function(a){var b=uc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),uc[a]=b);return b}),'"')};Ha||Ga&&(cb?$a(3.5):x?0<=oa(y,3.5):Ma(3.5))||x&&(cb?$a(8):x?oa(y,8):Ma(8));function wc(a){switch(l(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return ra(a,wc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=xc(a);return b}if(w(a,"document"))return b={},b.WINDOW=xc(a),b;if(ba(a))return ra(a,wc);a=ya(a,function(a,b){return"number"==typeof b||m(b)});return za(a,wc);default:return null}} -function yc(a,b){return"array"==l(a)?ra(a,function(a){return yc(a,b)}):ea(a)?"function"==typeof a?a:w(a,"ELEMENT")?zc(a.ELEMENT,b):w(a,"WINDOW")?zc(a.WINDOW,b):za(a,function(a){return yc(a,b)}):a}function Ac(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.u=ja());b.u||(b.u=ja());return b}function xc(a){var b=Ac(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.u++,b[c]=a);return c} -function zc(a,b){a=decodeURIComponent(a);var c=b||document,d=Ac(c);if(!w(d,a))throw new ka(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new ka(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new ka(10,"Element is no longer attached to the DOM");};aa("_",function(){var a=qc,b=[],c=window||ma,d;try{a:{var e=a;if(m(e))try{a=new c.Function(e);break a}catch(h){if(x&&c.execScript){c.execScript(";");a=new c.Function(e);break a}throw h;}a=c==window?e:new c.Function("return ("+e+").apply(null,arguments);")}var f=yc(b,c.document),g=a.apply(null,f);d={status:0,value:wc(g)}}catch(h){d={status:w(h,"code")?h.code:13,value:{message:h.message}}}a=[];sc(new rc,d,a);return a.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/clear.js b/src/ghostdriver/third_party/webdriver-atoms/clear.js deleted file mode 100644 index 1ddabac66e..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/clear.js +++ /dev/null @@ -1,156 +0,0 @@ -function(){return function(){var h,aa=this;function l(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){return"function"==ca(a)}function ga(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ha="closure_uid_"+(1E9*Math.random()>>>0),ia=0;function ja(a,b,c){return a.call.apply(a.bind,arguments)} -function ka(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function la(a,b,c){la=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ja:ka;return la.apply(null,arguments)} -function ma(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var na=Date.now||function(){return+new Date};function p(a,b){function c(){}c.prototype=b.prototype;a.X=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.W=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var oa=window;var pa;function qa(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var ra=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function sa(a,b){for(var c=0,d=ra(String(a)).split("."),e=ra(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",n=e[g]||"",v=RegExp("(\\d*)(\\D*)","g"),u=RegExp("(\\d*)(\\D*)","g");do{var G=v.exec(k)||["","",""],y=u.exec(n)||["","",""];if(0==G[0].length&&0==y[0].length)break;c=ta(0==G[1].length?0:parseInt(G[1],10),0==y[1].length?0:parseInt(y[1],10))||ta(0==G[2].length,0==y[2].length)||ta(G[2],y[2])}while(0==c)}return c}function ta(a,b){return a<b?-1:a>b?1:0} -function ua(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function q(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)}function va(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}function wa(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function xa(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function ya(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function za(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0}function Aa(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]} -function Ba(a,b){var c;a:if(m(a))c=m(b)&&1==b.length?a.indexOf(b,0):-1;else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function Ca(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function Da(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Ea={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Fa="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ga=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ha=/^#(?:[0-9a-f]{3}){1,2}$/i,Ia=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ja=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function r(a,b){this.code=a;this.a=t[a]||Ka;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}p(r,Error);var Ka="unknown error",t={15:"element not selectable",11:"element not visible"};t[31]=Ka;t[30]=Ka;t[24]="invalid cookie domain";t[29]="invalid element coordinates";t[12]="invalid element state"; -t[32]="invalid selector";t[51]="invalid selector";t[52]="invalid selector";t[17]="javascript error";t[405]="unsupported operation";t[34]="move target out of bounds";t[27]="no such alert";t[7]="no such element";t[8]="no such frame";t[23]="no such window";t[28]="script timeout";t[33]="session not created";t[10]="stale element reference";t[21]="timeout";t[25]="unable to set cookie";t[26]="unexpected alert open";t[13]=Ka;t[9]="unknown command";r.prototype.toString=function(){return this.name+": "+this.message};var La;a:{var Ma=aa.navigator;if(Ma){var Na=Ma.userAgent;if(Na){La=Na;break a}}La=""}function w(a){return-1!=La.indexOf(a)};function Oa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Pa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Qa(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ra(a,b){return null!==a&&b in a}function Sa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ta(){return w("Opera")||w("OPR")}function Ua(){return(w("Chrome")||w("CriOS"))&&!Ta()&&!w("Edge")};function Va(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Wa=Ta(),x=w("Trident")||w("MSIE"),Xa=w("Edge"),z=w("Gecko")&&!(-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Ya=-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"),Za=Ya&&w("Mobile"),$a=w("Macintosh"),ab=w("Windows");function bb(){var a=La;if(z)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Xa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ya)return/WebKit\/(\S+)/.exec(a)} -function cb(){var a=aa.document;return a?a.documentMode:void 0}var db=function(){if(Wa&&aa.opera){var a;var b=aa.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=bb())&&(a=b?b[1]:"");return x&&(b=cb(),null!=b&&b>parseFloat(a))?String(b):a}(),eb={};function fb(a){return eb[a]||(eb[a]=0<=sa(db,a))}var gb=aa.document,hb=gb&&x?cb()||("CSS1Compat"==gb.compatMode?parseInt(db,10):5):void 0;!z&&!x||x&&9<=Number(hb)||z&&fb("1.9.1");x&&fb("9");function ib(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}h=ib.prototype;h.clone=function(){return new ib(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=ea(b)?b:a;this.x*=a;this.y*=c;return this};function jb(a,b){this.width=a;this.height=b}h=jb.prototype;h.clone=function(){return new jb(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.width*=a;this.height*=c;return this};function kb(a){return a?new lb(A(a)):pa||(pa=new lb)}function mb(a){return a?a.parentWindow||a.defaultView:window}function nb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function ob(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function pb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(hb))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?qb(a,b):!c&&ob(e,b)?-1*rb(a,b):!d&&ob(f,a)?rb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=A(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function rb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return qb(d,a)}function qb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function A(a){return 9==a.nodeType?a:a.ownerDocument||a.document}var sb={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},tb={IMG:" ",BR:"\n"}; -function ub(a,b,c){if(!(a.nodeName in sb))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in tb)b.push(tb[a.nodeName]);else for(a=a.firstChild;a;)ub(a,b,c),a=a.nextSibling}function vb(a,b,c){c||(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function lb(a){this.a=a||aa.document||document} -function wb(a,b,c,d){a=d||a.a;b=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(b||c))c=a.querySelectorAll(b+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(a=a.getElementsByClassName(c),b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g.nodeName&&(d[e++]=g);d.length=e;c=d}else c=a;else if(a=a.getElementsByTagName(b||"*"),c){d={};for(f=e=0;g=a[f];f++)b=g.className,"function"==typeof b.split&&Ba(b.split(/\s+/),c)&&(d[e++]=g);d.length=e;c=d}else c=a;return c} -lb.prototype.contains=ob;var xb=w("Firefox"),yb=Va()||w("iPod"),zb=w("iPad"),Ab=w("Android")&&!(Ua()||w("Firefox")||Ta()||w("Silk")),Bb=Ua(),Cb=w("Safari")&&!(Ua()||w("Coast")||Ta()||w("Edge")||w("Silk")||w("Android"))&&!(Va()||w("iPad")||w("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Db(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var Eb=x&&!(9<=Number(hb)),Fb=x&&!(8<=Number(hb));function Gb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Hb(a,b){var c=Fb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Gb(b,a,b.nodeName,c)};function Ib(a){this.b=a;this.a=0}function Kb(a){a=a.match(Lb);for(var b=0;b<a.length;b++)Mb.test(a[b])&&a.splice(b,1);return new Ib(a)}var Lb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Mb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function C(a){return a.b[a.a++]}function Nb(a){return a.b.length<=a.a};function Ob(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(Eb&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),Eb&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function Pb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Fb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Qb(a,b,c,d,e){return(Eb?Rb:Sb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)} -function Rb(a,b,c,d,e){if(a instanceof Tb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Ub(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)Pb(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||E(e,b);return e}Vb(a,b,c,d,e);return e} -function Sb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&E(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&E(e,b)})):a instanceof Wb?Vb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),q(b,function(a){Pb(a,c,d)&&E(e,a)}));return e} -function Xb(a,b,c,d,e){var f;if((a instanceof Tb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ub(a);if("*"!=g&&(f=va(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=va(f,function(a){return Pb(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||E(e,a)});return e}return Yb(a,b,c,d,e)}function Yb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&E(e,b);return e} -function Vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&E(e,b),Vb(a,b,c,d,e)}function Ub(a){if(a instanceof Wb){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function D(){this.b=this.a=null;this.o=0}function Zb(a){this.node=a;this.a=this.b=null}function $b(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof Gb&&k instanceof Gb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<pb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.o=g;return a} -D.prototype.unshift=function(a){a=new Zb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.o++};function E(a,b){var c=new Zb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.o++}function ac(a){return(a=a.a)?a.node:null}function bc(a){return(a=ac(a))?Ob(a):""}function cc(a,b){return new dc(a,!!b)}function dc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function F(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function H(a){this.l=a;this.b=this.j=!1;this.f=null}function I(a){return"\n "+a.toString().split("\n").join("\n ")}function ec(a,b){a.j=b}function fc(a,b){a.b=b}function J(a,b){var c=a.a(b);return c instanceof D?+bc(c):+c}function K(a,b){var c=a.a(b);return c instanceof D?bc(c):""+c}function gc(a,b){var c=a.a(b);return c instanceof D?!!c.o:!!c};function hc(a,b,c){H.call(this,a.l);this.c=a;this.i=b;this.v=c;this.j=b.j||c.j;this.b=b.b||c.b;this.c==ic&&(c.b||c.j||4==c.l||0==c.l||!b.f?b.b||b.j||4==b.l||0==b.l||!c.f||(this.f={name:c.f.name,B:b}):this.f={name:b.f.name,B:c})}p(hc,H); -function jc(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof D&&c instanceof D){b=cc(b);for(d=F(b);d;d=F(b))for(e=cc(c),f=F(e);f;f=F(e))if(a(Ob(d),Ob(f)))return!0;return!1}if(b instanceof D||c instanceof D){b instanceof D?(e=b,d=c):(e=c,d=b);f=cc(e);for(var g=typeof d,k=F(f);k;k=F(f)){switch(g){case "number":k=+Ob(k);break;case "boolean":k=!!Ob(k);break;case "string":k=Ob(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}hc.prototype.a=function(a){return this.c.u(this.i,this.v,a)};hc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+I(this.i);return a+=I(this.v)};function kc(a,b,c,d){this.a=a;this.N=b;this.l=c;this.u=d}kc.prototype.toString=function(){return this.a};var lc={}; -function L(a,b,c,d){if(lc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new kc(a,b,c,d);return lc[a.toString()]=a}L("div",6,1,function(a,b,c){return J(a,c)/J(b,c)});L("mod",6,1,function(a,b,c){return J(a,c)%J(b,c)});L("*",6,1,function(a,b,c){return J(a,c)*J(b,c)});L("+",5,1,function(a,b,c){return J(a,c)+J(b,c)});L("-",5,1,function(a,b,c){return J(a,c)-J(b,c)});L("<",4,2,function(a,b,c){return jc(function(a,b){return a<b},a,b,c)}); -L(">",4,2,function(a,b,c){return jc(function(a,b){return a>b},a,b,c)});L("<=",4,2,function(a,b,c){return jc(function(a,b){return a<=b},a,b,c)});L(">=",4,2,function(a,b,c){return jc(function(a,b){return a>=b},a,b,c)});var ic=L("=",3,2,function(a,b,c){return jc(function(a,b){return a==b},a,b,c,!0)});L("!=",3,2,function(a,b,c){return jc(function(a,b){return a!=b},a,b,c,!0)});L("and",2,2,function(a,b,c){return gc(a,c)&&gc(b,c)});L("or",1,2,function(a,b,c){return gc(a,c)||gc(b,c)});function mc(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");H.call(this,a.l);this.c=a;this.i=b;this.j=a.j;this.b=a.b}p(mc,H);mc.prototype.a=function(a){a=this.c.a(a);return nc(this.i,a)};mc.prototype.toString=function(){var a;a="Filter:"+I(this.c);return a+=I(this.i)};function oc(a,b){if(b.length<a.O)throw Error("Function "+a.m+" expects at least"+a.O+" arguments, "+b.length+" given");if(null!==a.G&&b.length>a.G)throw Error("Function "+a.m+" expects at most "+a.G+" arguments, "+b.length+" given");a.V&&q(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.m+" is not of type Nodeset: "+b);});H.call(this,a.l);this.i=a;this.c=b;ec(this,a.j||ya(b,function(a){return a.j}));fc(this,a.U&&!b.length||a.T&&!!b.length||ya(b,function(a){return a.b}))} -p(oc,H);oc.prototype.a=function(a){return this.i.u.apply(null,Ca(a,this.c))};oc.prototype.toString=function(){var a="Function: "+this.i;if(this.c.length)var b=xa(this.c,function(a,b){return a+I(b)},"Arguments:"),a=a+I(b);return a};function pc(a,b,c,d,e,f,g,k,n){this.m=a;this.l=b;this.j=c;this.U=d;this.T=e;this.u=f;this.O=g;this.G=l(k)?k:g;this.V=!!n}pc.prototype.toString=function(){return this.m};var qc={}; -function N(a,b,c,d,e,f,g,k){if(qc.hasOwnProperty(a))throw Error("Function already created: "+a+".");qc[a]=new pc(a,b,c,d,!1,e,f,g,k)}N("boolean",2,!1,!1,function(a,b){return gc(b,a)},1);N("ceiling",1,!1,!1,function(a,b){return Math.ceil(J(b,a))},1);N("concat",3,!1,!1,function(a,b){return xa(Da(arguments,1),function(b,d){return b+K(d,a)},"")},2,null);N("contains",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return-1!=b.indexOf(a)},2);N("count",1,!1,!1,function(a,b){return b.a(a).o},1,1,!0); -N("false",2,!1,!1,function(){return!1},0);N("floor",1,!1,!1,function(a,b){return Math.floor(J(b,a))},1);N("id",4,!1,!1,function(a,b){function c(a){if(Eb){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return Aa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=K(b,a).split(/\s+/),f=[];q(d,function(a){(a=c(a))&&!Ba(f,a)&&f.push(a)});f.sort(pb);var g=new D;q(f,function(a){E(g,a)});return g},1); -N("lang",2,!1,!1,function(){return!1},1);N("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);N("local-name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);N("name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);N("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -N("normalize-space",3,!1,!0,function(a,b){return(b?K(b,a):Ob(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);N("not",2,!1,!1,function(a,b){return!gc(b,a)},1);N("number",1,!1,!0,function(a,b){return b?J(b,a):+Ob(a.a)},0,1);N("position",1,!0,!1,function(a){return a.b},0);N("round",1,!1,!1,function(a,b){return Math.round(J(b,a))},1);N("starts-with",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return 0==b.lastIndexOf(a,0)},2);N("string",3,!1,!0,function(a,b){return b?K(b,a):Ob(a.a)},0,1); -N("string-length",1,!1,!0,function(a,b){return(b?K(b,a):Ob(a.a)).length},0,1);N("substring",3,!1,!1,function(a,b,c,d){c=J(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?J(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=K(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);N("substring-after",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -N("substring-before",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);N("sum",1,!1,!1,function(a,b){for(var c=cc(b.a(a)),d=0,e=F(c);e;e=F(c))d+=+Ob(e);return d},1,1,!0);N("translate",3,!1,!1,function(a,b,c,d){b=K(b,a);c=K(c,a);var e=K(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);N("true",2,!1,!1,function(){return!0},0);function Wb(a,b){this.i=a;this.c=l(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function rc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}Wb.prototype.a=function(a){return null===this.b||this.b==a.nodeType};Wb.prototype.f=function(){return this.i}; -Wb.prototype.toString=function(){var a="Kind Test: "+this.i;null===this.c||(a+=I(this.c));return a};function sc(a){H.call(this,3);this.c=a.substring(1,a.length-1)}p(sc,H);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Literal: "+this.c};function Tb(a,b){this.m=a.toLowerCase();var c;c="*"==this.m?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Tb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.m&&this.m!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Tb.prototype.f=function(){return this.m};Tb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.m};function tc(a){H.call(this,1);this.c=a}p(tc,H);tc.prototype.a=function(){return this.c};tc.prototype.toString=function(){return"Number: "+this.c};function uc(a,b){H.call(this,a.l);this.i=a;this.c=b;this.j=a.j;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.D||c.c!=vc||(c=c.v,"*"!=c.f()&&(this.f={name:c.f(),B:null}))}}p(uc,H);function wc(){H.call(this,4)}p(wc,H);wc.prototype.a=function(a){var b=new D;a=a.a;9==a.nodeType?E(b,a):E(b,a.ownerDocument);return b};wc.prototype.toString=function(){return"Root Helper Expression"};function xc(){H.call(this,4)}p(xc,H);xc.prototype.a=function(a){var b=new D;E(b,a.a);return b};xc.prototype.toString=function(){return"Context Helper Expression"}; -function yc(a){return"/"==a||"//"==a}uc.prototype.a=function(a){var b=this.i.a(a);if(!(b instanceof D))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.o;c++){var e=a[c],f=cc(b,e.c.a),g;if(e.j||e.c!=zc)if(e.j||e.c!=Ac)for(g=F(f),b=e.a(new Db(g));null!=(g=F(f));)g=e.a(new Db(g)),b=$b(b,g);else g=F(f),b=e.a(new Db(g));else{for(g=F(f);(b=F(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Db(g))}}return b}; -uc.prototype.toString=function(){var a;a="Path Expression:"+I(this.i);if(this.c.length){var b=xa(this.c,function(a,b){return a+I(b)},"Steps:");a+=I(b)}return a};function Bc(a,b){this.a=a;this.b=!!b} -function nc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=cc(b),f=b.o,g,k=0;g=F(e);k++){var n=a.b?f-k:k+1;g=d.a(new Db(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof D)n=0<g.o;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var v=n.a;if(!v)throw Error("Next must be called at least once before remove.");var u=v.b,v=v.a;u?u.a=v:g.a=v;v?v.b=u:g.b=u;g.o--;n.a=null}}return b} -Bc.prototype.toString=function(){return xa(this.a,function(a,b){return a+I(b)},"Predicates:")};function Cc(a,b,c,d){H.call(this,4);this.c=a;this.v=b;this.i=c||new Bc([]);this.D=!!d;b=this.i;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=Eb?a.toLowerCase():a,this.f={name:a,B:b.B});a:{a=this.i;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.j||1==c.l||0==c.l){a=!0;break a}a=!1}this.j=a}p(Cc,H); -Cc.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.B?K(c.B,a):null,f=1);if(this.D)if(this.j||this.c!=Dc)if(a=cc((new Cc(Ec,new Wb("node"))).a(a)),b=F(a))for(c=this.u(b,d,e,f);null!=(b=F(a));)c=$b(c,this.u(b,d,e,f));else c=new D;else c=Qb(this.v,b,d,e),c=nc(this.i,c,f);else c=this.u(a.a,d,e,f);return c};Cc.prototype.u=function(a,b,c,d){a=this.c.f(this.v,a,b,c);return a=nc(this.i,a,d)}; -Cc.prototype.toString=function(){var a;a="Step:"+I("Operator: "+(this.D?"//":"/"));this.c.m&&(a+=I("Axis: "+this.c));a+=I(this.v);if(this.i.a.length){var b=xa(this.i.a,function(a,b){return a+I(b)},"Predicates:");a+=I(b)}return a};function Fc(a,b,c,d){this.m=a;this.f=b;this.a=c;this.b=d}Fc.prototype.toString=function(){return this.m};var Gc={};function O(a,b,c,d){if(Gc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Fc(a,b,c,!!d);return Gc[a]=b} -O("ancestor",function(a,b){for(var c=new D,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);O("ancestor-or-self",function(a,b){var c=new D,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var vc=O("attribute",function(a,b){var c=new D,d=a.f();if("style"==d&&b.style&&Eb)return E(c,new Gb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof Wb&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)Eb?f.nodeValue&&E(c,Hb(b,f)):E(c,f);else(f=e.getNamedItem(d))&&(Eb?f.nodeValue&&E(c,Hb(b,f)):E(c,f));return c},!1),Dc=O("child",function(a,b,c,d,e){return(Eb?Xb:Yb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)},!1,!0);O("descendant",Qb,!1,!0); -var Ec=O("descendant-or-self",function(a,b,c,d){var e=new D;Pb(b,c,d)&&a.a(b)&&E(e,b);return Qb(a,b,c,d,e)},!1,!0),zc=O("following",function(a,b,c,d){var e=new D;do for(var f=b;f=f.nextSibling;)Pb(f,c,d)&&a.a(f)&&E(e,f),e=Qb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);O("following-sibling",function(a,b){for(var c=new D,d=b;d=d.nextSibling;)a.a(d)&&E(c,d);return c},!1);O("namespace",function(){return new D},!1); -var Hc=O("parent",function(a,b){var c=new D;if(9==b.nodeType)return c;if(2==b.nodeType)return E(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&E(c,d);return c},!1),Ac=O("preceding",function(a,b,c,d){var e=new D,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var v=0,u=n.length;v<u;v++)b=n[v],Pb(b,c,d)&&a.a(b)&&E(e,b),e=Qb(a,b,c,d,e)}return e},!0,!0); -O("preceding-sibling",function(a,b){for(var c=new D,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Ic=O("self",function(a,b){var c=new D;a.a(b)&&E(c,b);return c},!1);function Jc(a){H.call(this,1);this.c=a;this.j=a.j;this.b=a.b}p(Jc,H);Jc.prototype.a=function(a){return-J(this.c,a)};Jc.prototype.toString=function(){return"Unary Expression: -"+I(this.c)};function Kc(a){H.call(this,4);this.c=a;ec(this,ya(this.c,function(a){return a.j}));fc(this,ya(this.c,function(a){return a.b}))}p(Kc,H);Kc.prototype.a=function(a){var b=new D;q(this.c,function(c){c=c.a(a);if(!(c instanceof D))throw Error("Path expression must evaluate to NodeSet.");b=$b(b,c)});return b};Kc.prototype.toString=function(){return xa(this.c,function(a,b){return a+I(b)},"Union Expression:")};function Lc(a,b){this.a=a;this.b=b}function Mc(a){for(var b,c=[];;){P(a,"Missing right hand side of binary expression.");b=Nc(a);var d=C(a.a);if(!d)break;var e=(d=lc[d]||null)&&d.N;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].N;)b=new hc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new hc(c.pop(),c.pop(),b);return b}function P(a,b){if(Nb(a.a))throw Error(b);}function Oc(a,b){var c=C(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function Pc(a){a=C(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Qc(a){a=C(a.a);if(2>a.length)throw Error("Unclosed literal string");return new sc(a)} -function Rc(a){var b,c=[],d;if(yc(B(a.a))){b=C(a.a);d=B(a.a);if("/"==b&&(Nb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new wc;d=new wc;P(a,"Missing next location step.");b=Sc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":C(a.a);b=Mc(a);P(a,'unclosed "("');Oc(a,")");break;case '"':case "'":b=Qc(a);break;default:if(isNaN(+b))if(!rc(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=C(a.a); -b=qc[b]||null;C(a.a);for(d=[];")"!=B(a.a);){P(a,"Missing function argument list.");d.push(Mc(a));if(","!=B(a.a))break;C(a.a)}P(a,"Unclosed function argument list.");Pc(a);b=new oc(b,d)}else{b=null;break a}else b=new tc(+C(a.a))}"["==B(a.a)&&(d=new Bc(Tc(a)),b=new mc(b,d))}if(b)if(yc(B(a.a)))d=b;else return b;else b=Sc(a,"/"),d=new xc,c.push(b)}for(;yc(B(a.a));)b=C(a.a),P(a,"Missing next location step."),b=Sc(a,b),c.push(b);return new uc(d,c)} -function Sc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new Cc(Ic,new Wb("node")),C(a.a),d;if(".."==B(a.a))return d=new Cc(Hc,new Wb("node")),C(a.a),d;var f;if("@"==B(a.a))f=vc,C(a.a),P(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+C(a.a));c=C(a.a);f=Gc[c]||null;if(!f)throw Error("No axis with name: "+c);C(a.a);P(a,"Missing node name")}else f=Dc;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!rc(c))throw Error("Invalid node type: "+c);c=C(a.a);if(!rc(c))throw Error("Invalid type name: "+c);Oc(a,"(");P(a,"Bad nodetype");e=B(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Qc(a);P(a,"Bad nodetype");Pc(a);c=new Wb(c,g)}else if(c=C(a.a),e=c.indexOf(":"),-1==e)c=new Tb(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Tb(c,k)}else throw Error("Bad token: "+C(a.a));e=new Bc(Tc(a),f.a);return d|| -new Cc(f,c,e,"//"==b)}function Tc(a){for(var b=[];"["==B(a.a);){C(a.a);P(a,"Missing predicate expression.");var c=Mc(a);b.push(c);P(a,"Unclosed predicate expression.");Oc(a,"]")}return b}function Nc(a){if("-"==B(a.a))return C(a.a),new Jc(Nc(a));var b=Rc(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==C(a.a);)P(a,"Missing next union location path."),b.push(Rc(a));a.a.a--;a=new Kc(b)}return a};function Uc(a){switch(a.nodeType){case 1:return ma(Vc,a);case 9:return Uc(a.documentElement);case 11:case 10:case 6:case 12:return Wc;default:return a.parentNode?Uc(a.parentNode):Wc}}function Wc(){return null}function Vc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Vc(a.parentNode,b):null};function Xc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Kb(a);if(Nb(c))throw Error("Invalid XPath expression.");b?fa(b)||(b=la(b.lookupNamespaceURI,b)):b=function(){return null};var d=Mc(new Lc(c,b));if(!Nb(c))throw Error("Bad token: "+C(c));this.evaluate=function(a,b){var c=d.a(new Db(a));return new Yc(c,b)}} -function Yc(a,b){if(0==b)if(a instanceof D)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof D))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof D?bc(a):""+a;break;case 1:this.numberValue=a instanceof D?+bc(a):+a;break;case 3:this.booleanValue=a instanceof D?0<a.o:!!a;break;case 4:case 5:case 6:case 7:var d= -cc(a);c=[];for(var e=F(d);e;e=F(d))c.push(e instanceof Gb?e.a:e);this.snapshotLength=a.o;this.invalidIteratorState=!1;break;case 8:case 9:d=ac(a);this.singleNodeValue=d instanceof Gb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}Yc.ANY_TYPE=0;Yc.NUMBER_TYPE=1;Yc.STRING_TYPE=2;Yc.BOOLEAN_TYPE=3;Yc.UNORDERED_NODE_ITERATOR_TYPE=4;Yc.ORDERED_NODE_ITERATOR_TYPE=5;Yc.UNORDERED_NODE_SNAPSHOT_TYPE=6;Yc.ORDERED_NODE_SNAPSHOT_TYPE=7;Yc.ANY_UNORDERED_NODE_TYPE=8;Yc.FIRST_ORDERED_NODE_TYPE=9;function Zc(a){this.lookupNamespaceURI=Uc(a)} -function $c(a,b){var c=a||aa,d=c.document;if(!d.evaluate||b)c.XPathResult=Yc,d.evaluate=function(a,b,c,d){return(new Xc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Xc(a,b)},d.createNSResolver=function(a){return new Zc(a)}}ba("wgxpath.install",$c);var Q={};Q.H=function(){var a={Y:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -Q.u=function(a,b,c){var d=A(a);if(!d.documentElement)return null;(x||Ab)&&$c(mb(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):Q.H;if(x&&!fb(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=Number(hb)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var n=g[k],v=n.namespaceURI;if(v&&!f[v]){var u=n.lookupPrefix(v);if(!u)var G=v.match(".*/(\\w+)/?$"),u=G?G[1]:"xhtml";f[v]=u}}var y={},M;for(M in f)y[f[M]]=M;e=function(a){return y[a]||null}}try{return d.evaluate(b, -a,e,c,null)}catch(R){if("TypeError"===R.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):Q.H,d.evaluate(b,a,e,c,null);throw R;}}catch(R){if(!z||"NS_ERROR_ILLEGAL_VALUE"!=R.name)throw new r(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+R);}};Q.I=function(a,b){if(!a||1!=a.nodeType)throw new r(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -Q.w=function(a,b){var c=function(){var c=Q.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||Q.I(c,a);return c}; -Q.s=function(a,b){var c=function(){var c=Q.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();q(c,function(b){Q.I(b,a)});return c};function ad(a){return(a=a.exec(La))?a[1]:""}var bd=function(){if(xb)return ad(/Firefox\/([0-9.]+)/);if(x||Xa||Wa)return db;if(Bb)return ad(/Chrome\/([0-9.]+)/);if(Cb&&!(Va()||w("iPad")||w("iPod")))return ad(/Version\/([0-9.]+)/);if(yb||zb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(La))return a[1]+"."+a[2]}else if(Ab)return(a=ad(/Android\s+([0-9.]+)/))?a:ad(/Version\/([0-9.]+)/);return""}();var cd,dd;function ed(a){return fd?cd(a):x?0<=sa(hb,a):fb(a)}function gd(a){return fd?dd(a):Ab?0<=sa(hd,a):0<=sa(bd,a)} -var fd=function(){if(!z)return!1;var a=aa.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;cd=function(a){return 0<=c.compare(d,""+a)};dd=function(a){return 0<=c.compare(e,""+a)};return!0}(),id=zb||yb,jd; -if(Ab){var kd=/Android\s+([0-9\.]+)/.exec(La);jd=kd?kd[1]:"0"}else jd="0";var hd=jd,ld=x&&!(8<=Number(hb)),md=x&&!(9<=Number(hb));Ab&&gd(2.3);Ab&&gd(4);Cb&&gd(6);function nd(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=nd.prototype;h.clone=function(){return new nd(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof nd?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function S(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=S.prototype;h.clone=function(){return new S(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof S?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function od(a,b){var c=A(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}var pd={thin:2,medium:4,thick:6}; -function qd(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in pd)d=pd[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};function rd(a){var b;a:{a=A(a);try{b=a&&a.activeElement;break a}catch(c){}b=null}return x&&b&&"undefined"===typeof b.nodeType?null:b}function T(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function sd(a,b){var c;if(c=ld&&"value"==b&&T(a,"OPTION"))c=null===td(a,"value");c?(c=[],ub(a,c,!1),c=c.join("")):c=a[b];return c}var ud=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; -function vd(a){var b=[];q(a.split(ud),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function td(a,b){b=b.toLowerCase();if("style"==b)return vd(a.style.cssText);if(ld&&"value"==b&&T(a,"INPUT"))return a.value;if(md&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}var wd="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" "); -function xd(a){var b=a.tagName.toUpperCase();return Ba(wd,b)?sd(a,"disabled")?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?xd(a.parentNode):!vb(a,function(a){var b=a.parentNode;if(b&&T(b,"FIELDSET")&&sd(b,"disabled")){if(!T(a,"LEGEND"))return!0;for(;a=l(a.previousElementSibling)?a.previousElementSibling:nb(a.previousSibling);)if(T(a,"LEGEND"))return!0}return!1},!0):!0}var yd="text search tel url email password number".split(" "); -function zd(a){function b(a){return"inherit"==a.contentEditable?(a=Ad(a))?b(a):!1:"true"==a.contentEditable}return l(a.contentEditable)?!x&&l(a.isContentEditable)?a.isContentEditable:b(a):!1}function Bd(a){return((T(a,"TEXTAREA")?!0:T(a,"INPUT")?Ba(yd,a.type.toLowerCase()):zd(a)?!0:!1)||(T(a,"INPUT")?"file"==a.type.toLowerCase():!1))&&!sd(a,"readOnly")}function Ad(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return T(a)?a:null} -function U(a,b){var c=ua(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=md?"styleFloat":"cssFloat";var d=od(a,c)||Cd(a,c);if(null===d)d=null;else if(Ba(Fa,c)){b:{var e=d.match(Ia);if(e){var c=Number(e[1]),f=Number(e[2]),g=Number(e[3]),e=Number(e[4]);if(0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g&&0<=e&&1>=e){c=[c,f,g,e];break b}}c=null}if(!c)b:{if(g=d.match(Ja))if(c=Number(g[1]),f=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g){c=[c,f,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase(); -f=Ea[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(Ga,"#$1$1$2$2$3$3")),!Ha.test(f))){c=null;break b}c=[parseInt(f.substr(1,2),16),parseInt(f.substr(3,2),16),parseInt(f.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}function Cd(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&fa(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(c=Ad(a))?Cd(c,b):null} -function Dd(a,b,c){function d(a){var b=Ed(a);return 0<b.height&&0<b.width?!0:T(a,"PATH")&&(0<b.height||0<b.width)?(a=U(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=U(a,"overflow")&&ya(a.childNodes,function(a){return 3==a.nodeType||T(a)&&d(a)})}function e(a){return Fd(a)==Gd&&za(a.childNodes,function(a){return!T(a)||e(a)||!d(a)})}if(!T(a))throw Error("Argument to isShown must be of type Element");if(T(a,"BODY"))return!0;if(T(a,"OPTION")||T(a,"OPTGROUP"))return a=vb(a,function(a){return T(a,"SELECT")}), -!!a&&Dd(a,!0,c);var f=Hd(a);if(f)return!!f.J&&0<f.rect.width&&0<f.rect.height&&Dd(f.J,b,c);if(T(a,"INPUT")&&"hidden"==a.type.toLowerCase()||T(a,"NOSCRIPT"))return!1;f=U(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Id(a))&&d(a)?!e(a):!1}function Jd(a,b){function c(a){if("none"==U(a,"display"))return!1;a=Ad(a);return!a||c(a)}return Dd(a,!!b,c)}var Gd="hidden"; -function Fd(a,b){function c(a){function b(a){return a==k?!0:0==U(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==U(a,"position")?!1:!0}var c=U(a,"position");if("fixed"==c)return u=!0,a==k?null:k;for(a=Ad(a);a&&!b(a);)a=Ad(a);return a}function d(a){var b=a;if("visible"==v)if(a==k&&n)b=n;else if(a==n)return{x:"visible",y:"visible"};b={x:U(b,"overflow-x"),y:U(b,"overflow-y")};a==k&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==k){var b=(new lb(g)).a; -a=b.scrollingElement?b.scrollingElement:Ya||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=x&&fb("10")&&b.pageYOffset!=a.scrollTop?new ib(a.scrollLeft,a.scrollTop):new ib(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new ib(a.scrollLeft,a.scrollTop);return a}for(var f=Kd(a,b),g=A(a),k=g.documentElement,n=g.body,v=U(k,"overflow"),u,G=c(a);G;G=c(G)){var y=d(G);if("visible"!=y.x||"visible"!=y.y){var M=Ed(G);if(0==M.width||0== -M.height)return Gd;var R=f.right<M.left,Jb=f.bottom<M.top;if(R&&"hidden"==y.x||Jb&&"hidden"==y.y)return Gd;if(R&&"visible"!=y.x||Jb&&"visible"!=y.y){R=e(G);Jb=f.bottom<M.top-R.y;if(f.right<M.left-R.x&&"visible"!=y.x||Jb&&"visible"!=y.x)return Gd;f=Fd(G);return f==Gd?Gd:"scroll"}R=f.left>=M.left+M.width;M=f.top>=M.top+M.height;if(R&&"hidden"==y.x||M&&"hidden"==y.y)return Gd;if(R&&"visible"!=y.x||M&&"visible"!=y.y){if(u&&(y=e(G),f.left>=k.scrollWidth-y.x||f.right>=k.scrollHeight-y.y))return Gd;f=Fd(G); -return f==Gd?Gd:"scroll"}}}return"none"} -function Ed(a){var b=Hd(a);if(b)return b.rect;if(T(a,"HTML"))return a=A(a),a=(mb(a)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new jb(a.clientWidth,a.clientHeight),new S(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new S(0,0,0,0)}b=new S(c.left,c.top,c.right-c.left,c.bottom-c.top);x&&a.ownerDocument.body&&(a=A(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b} -function Hd(a){var b=T(a,"MAP");if(!b&&!T(a,"AREA"))return null;var c=b?a:T(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=Q.w('/descendant::*[@usemap = "#'+c.name+'"]',A(c)))&&(e=Ed(d),b||"default"==a.shape.toLowerCase()||(a=Ld(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new S(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{J:d,rect:e||new S(0,0,0,0)}} -function Ld(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new S(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new S(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new S(b,c,d-b,e-c)}return new S(0,0,0,0)} -function Kd(a,b){var c;c=Ed(a);c=new nd(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof S?b:new S(b.x,b.y,1,1);c.left=Math.min(Math.max(c.left+d.left,c.left),c.right);c.top=Math.min(Math.max(c.top+d.top,c.top),c.bottom);c.right=Math.min(Math.max(c.left+d.width,c.left),c.right);c.bottom=Math.min(Math.max(c.top+d.height,c.top),c.bottom)}return c}function Md(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")} -function Nd(a){var b=[];Od(a,b);a=wa(b,Md);return Md(a.join("\n")).replace(/\xa0/g," ")} -function Pd(a,b,c){if(T(a,"BR"))b.push("");else{var d=T(a,"TD"),e=U(a,"display"),f=!d&&!Ba(Qd,e),g=l(a.previousElementSibling)?a.previousElementSibling:nb(a.previousSibling),g=g?U(g,"display"):"",k=U(a,"float")||U(a,"cssFloat")||U(a,"styleFloat");!f||"run-in"==g&&"none"==k||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var n=Jd(a),v=null,u=null;n&&(v=U(a,"white-space"),u=U(a,"text-transform"));q(a.childNodes,function(a){c(a,b,n,v,u)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||qa(a)||(b[b.length- -1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function Od(a,b){Pd(a,b,function(a,b,e,f,g){3==a.nodeType&&e?Rd(a,b,f,g):T(a)&&Od(a,b)})}var Qd="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); -function Rd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";qa(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} -function Id(a){if(md){if("relative"==U(a,"position"))return 1;a=U(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Sd(a)}function Sd(a){var b=1,c=U(a,"opacity");c&&(b=Number(c));(a=Ad(a))&&(b*=Sd(a));return b};var Td={C:function(a){return!(!a.querySelectorAll||!a.querySelector)},w:function(a,b){if(!a)throw new r(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new r(32,"Compound class names not permitted");if(Td.C(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(d){throw new r(32,"An invalid or illegal class name was specified");}var c=wb(kb(b),"*",a,b);return c.length?c[0]:null},s:function(a,b){if(!a)throw new r(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new r(32, -"Compound class names not permitted");if(Td.C(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new r(32,"An invalid or illegal class name was specified");}return wb(kb(b),"*",a,b)}};var Ud={w:function(a,b){if(!fa(b.querySelector)&&x&&ed(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new r(32,"No selector specified");a=ra(a);var c;try{c=b.querySelector(a)}catch(d){throw new r(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},s:function(a,b){if(!fa(b.querySelectorAll)&&x&&ed(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new r(32,"No selector specified");a=ra(a);try{return b.querySelectorAll(a)}catch(c){throw new r(32, -"An invalid or illegal selector was specified");}}};var Vd={C:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},w:function(a,b){var c=kb(b),d=m(a)?c.a.getElementById(a):a;if(!d)return null;if(td(d,"id")==a&&ob(b,d))return d;c=wb(c,"*");return Aa(c,function(c){return td(c,"id")==a&&ob(b,c)})},s:function(a,b){if(!a)return[];if(Vd.C(b,a))try{return b.querySelectorAll("#"+Vd.R(a))}catch(d){return[]}var c=wb(kb(b),"*",null,b);return va(c,function(b){return td(b,"id")==a})},R:function(a){return a.replace(/(['"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g, -"\\$1")}};var Wd={},Xd={};Wd.P=function(a,b,c){var d;try{d=Ud.s("a",b)}catch(e){d=wb(kb(b),"A",null,b)}return Aa(d,function(b){b=Nd(b);return c&&-1!=b.indexOf(a)||b==a})};Wd.L=function(a,b,c){var d;try{d=Ud.s("a",b)}catch(e){d=wb(kb(b),"A",null,b)}return va(d,function(b){b=Nd(b);return c&&-1!=b.indexOf(a)||b==a})};Wd.w=function(a,b){return Wd.P(a,b,!1)};Wd.s=function(a,b){return Wd.L(a,b,!1)};Xd.w=function(a,b){return Wd.P(a,b,!0)};Xd.s=function(a,b){return Wd.L(a,b,!0)};var Yd={w:function(a,b){if(""===a)throw new r(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},s:function(a,b){if(""===a)throw new r(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var Zd={className:Td,"class name":Td,css:Ud,"css selector":Ud,id:Vd,linkText:Wd,"link text":Wd,name:{w:function(a,b){var c=wb(kb(b),"*",null,b);return Aa(c,function(b){return td(b,"name")==a})},s:function(a,b){var c=wb(kb(b),"*",null,b);return va(c,function(b){return td(b,"name")==a})}},partialLinkText:Xd,"partial link text":Xd,tagName:Yd,"tag name":Yd,xpath:Q}; -function $d(a,b){var c;a:{for(c in a)if(a.hasOwnProperty(c))break a;c=null}if(c){var d=Zd[c];if(d&&fa(d.s))return d.s(a[c],b||oa.document)}throw Error("Unsupported locator strategy: "+c);};function ae(a){this.a=oa.document.documentElement;this.i=null;var b=rd(this.a);b&&be(this,b);this.v=a||new ce}function be(a,b){a.a=b;T(b,"OPTION")?a.i=vb(b,function(a){return T(a,"SELECT")}):a.i=null}function de(a){a=a.i||a.a;var b=rd(a);if(a==b)return!1;if(b&&(fa(b.blur)||x&&ga(b.blur))){if(!T(b,"BODY"))try{b.blur()}catch(c){if(!x||"Unspecified error."!=c.message)throw c;}x&&!ed(8)&&mb(A(a)).focus()}return fa(a.focus)||x&&ga(a.focus)?(a.focus(),!0):!1}Ya||fd&&gd(3.6); -function ee(a){return T(a,"FORM")}function fe(a){if(!ee(a))throw new r(12,"Element is not a form, so could not submit.");if(V(a,ge))if(T(a.submit))if(!x||ed(8))a.constructor.prototype.submit.call(a);else{var b=$d({id:"submit"},a),c=$d({name:"submit"},a);q(b,function(a){a.removeAttribute("id")});q(c,function(a){a.removeAttribute("name")});a=a.submit;q(b,function(a){a.setAttribute("id","submit")});q(c,function(a){a.setAttribute("name","submit")});a()}else a.submit()}function ce(){this.a=0};var he=!(x&&!ed(10)),ie=Ab?!gd(4):!id;function je(a,b,c){this.a=a;this.b=b;this.f=c}je.prototype.c=function(a){a=A(a);md&&a.createEventObject?a=a.createEventObject():(a=a.createEvent("HTMLEvents"),a.initEvent(this.a,this.b,this.f));return a};je.prototype.toString=function(){return this.a};function ke(a,b,c){je.call(this,a,b,c)}p(ke,je); -ke.prototype.c=function(a,b){var c=A(a);if(z){var d=mb(c),e=b.charCode?0:b.keyCode,c=c.createEvent("KeyboardEvent");c.initKeyEvent(this.a,this.b,this.f,d,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,e,b.charCode);this.a==le&&b.preventDefault&&c.preventDefault()}else if(md?c=c.createEventObject():(c=c.createEvent("Events"),c.initEvent(this.a,this.b,this.f)),c.altKey=b.altKey,c.ctrlKey=b.ctrlKey,c.metaKey=b.metaKey,c.shiftKey=b.shiftKey,c.keyCode=b.charCode||b.keyCode,Ya||Xa)c.charCode=this==le?c.keyCode: -0;return c};function me(a,b,c){je.call(this,a,b,c)}p(me,je); -me.prototype.c=function(a,b){function c(b){b=wa(b,function(b){return f.createTouch(g,a,b.identifier,b.pageX,b.pageY,b.screenX,b.screenY)});return f.createTouchList.apply(f,b)}function d(b){var c=wa(b,function(b){return{identifier:b.identifier,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY,pageX:b.pageX,pageY:b.pageY,target:a}});c.item=function(a){return c[a]};return c}function e(a){return ie?d(a):c(a)}if(!he)throw new r(9,"Browser does not support firing touch events.");var f= -A(a),g=mb(f),k=e(b.changedTouches),n=b.touches==b.changedTouches?k:e(b.touches),v=b.targetTouches==b.changedTouches?k:e(b.targetTouches),u;ie?(u=f.createEvent("MouseEvents"),u.initMouseEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,0,b.relatedTarget),u.touches=n,u.targetTouches=v,u.changedTouches=k,u.scale=b.scale,u.rotation=b.rotation):(u=f.createEvent("TouchEvent"),0==u.initTouchEvent.length?u.initTouchEvent(n,v,k,this.a,g,0,0,b.clientX,b.clientY, -b.ctrlKey,b.altKey,b.shiftKey,b.metaKey):u.initTouchEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,n,v,k,b.scale,b.rotation),u.relatedTarget=b.relatedTarget);return u}; -var ne=new je("blur",!1,!1),oe=new je("change",!0,!1),pe=new je("focus",!1,!1),qe=new je("input",!0,!1),ge=new je("submit",!0,!0),re=new je("textInput",!0,!0),se=new ke("keydown",!0,!0),le=new ke("keypress",!0,!0),te=new ke("keyup",!0,!0),ue=new me("touchend",!0,!0),ve=new me("touchstart",!0,!0);function V(a,b,c){c=b.c(a,c);"isTrusted"in c||(c.isTrusted=!1);return md&&a.fireEvent?a.fireEvent("on"+b.a,c):a.dispatchEvent(c)};function we(a,b){if(xe(a))a.selectionStart=b;else if(x){var c=ye(a),d=c[0];d.inRange(c[1])&&(b=ze(a,b),d.collapse(!0),d.move("character",b),d.select())}} -function Ae(a,b){var c=0,d=0;if(xe(a))c=a.selectionStart,d=b?-1:a.selectionEnd;else if(x){var e=ye(a),f=e[0],e=e[1];if(f.inRange(e)){f.setEndPoint("EndToStart",e);if("textarea"==a.type){for(var c=e.duplicate(),g=f.text,d=g,k=e=c.text,n=!1;!n;)0==f.compareEndPoints("StartToEnd",f)?n=!0:(f.moveEnd("character",-1),f.text==g?d+="\r\n":n=!0);if(b)f=[d.length,-1];else{for(f=!1;!f;)0==c.compareEndPoints("StartToEnd",c)?f=!0:(c.moveEnd("character",-1),c.text==e?k+="\r\n":f=!0);f=[d.length,d.length+k.length]}return f}c= -f.text.length;b?d=-1:d=f.text.length+e.text.length}}return[c,d]}function Be(a,b){if(xe(a))a.selectionEnd=b;else if(x){var c=ye(a),d=c[1];c[0].inRange(d)&&(b=ze(a,b),c=ze(a,Ae(a,!0)[0]),d.collapse(!0),d.moveEnd("character",b-c),d.select())}}function Ce(a,b){if(xe(a))a.selectionStart=b,a.selectionEnd=b;else if(x){b=ze(a,b);var c=a.createTextRange();c.collapse(!0);c.move("character",b);c.select()}} -function De(a,b){if(xe(a)){var c=a.value,d=a.selectionStart;a.value=c.substr(0,d)+b+c.substr(a.selectionEnd);a.selectionStart=d;a.selectionEnd=d+b.length}else if(x)d=ye(a),c=d[1],d[0].inRange(c)&&(d=c.duplicate(),c.text=b,c.setEndPoint("StartToStart",d),c.select());else throw Error("Cannot set the selection end");}function ye(a){var b=a.ownerDocument||a.document,c=b.selection.createRange();"textarea"==a.type?(b=b.body.createTextRange(),b.moveToElementText(a)):b=a.createTextRange();return[b,c]} -function ze(a,b){"textarea"==a.type&&(b=a.value.substring(0,b).replace(/(\r\n|\r|\n)/g,"\n").length);return b}function xe(a){try{return"number"==typeof a.selectionStart}catch(b){return!1}};function Ee(a,b){this.b={};this.a=[];this.c=this.f=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Fe(this,arguments[d],arguments[d+1])}else if(a){if(a instanceof Ee)d=Ge(a),c=a.A();else{var c=[],e=0;for(d in a)c[e++]=d;d=c;c=Qa(a)}for(e=0;e<d.length;e++)Fe(this,d[e],c[e])}}h=Ee.prototype;h.A=function(){He(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};function Ge(a){He(a);return a.a.concat()} -h.clear=function(){this.b={};this.c=this.f=this.a.length=0};function He(a){if(a.f!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Ie(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.f!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],Ie(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}h.get=function(a,b){return Ie(this.b,a)?this.b[a]:b};function Fe(a,b,c){Ie(a.b,b)||(a.f++,a.a.push(b),a.c++);a.b[b]=c} -h.forEach=function(a,b){for(var c=Ge(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new Ee(this)};function Ie(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Je(a){if(a.A&&"function"==typeof a.A)return a.A();if(m(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Qa(a)};function Ke(a){this.a=new Ee;if(a){a=Je(a);for(var b=a.length,c=0;c<b;c++){var d=a[c];Fe(this.a,Le(d),d)}}}function Le(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[ha]||(a[ha]=++ia)):b.substr(0,1)+a}Ke.prototype.clear=function(){this.a.clear()};Ke.prototype.contains=function(a){a=Le(a);return Ie(this.a.b,a)};Ke.prototype.A=function(){return this.a.A()};Ke.prototype.clone=function(){return new Ke(this)};function Me(a){ae.call(this);this.f=Bd(this.a);this.b=0;this.c=new Ke;a&&(q(a.pressed,function(a){Ne(this,a,!0)},this),this.b=a.currentPos||0)}p(Me,ae);var Oe={};function W(a,b,c){ga(a)&&(a=z?a.g:a.h);a=new Pe(a,b,c);!b||b in Oe&&!c||(Oe[b]={key:a,shift:!1},c&&(Oe[c]={key:a,shift:!0}));return a}function Pe(a,b,c){this.code=a;this.a=b||null;this.b=c||this.a}var Qe=W(8),Re=W(9),Se=W(13),X=W(16),Te=W(17),Ue=W(18),Ve=W(19);W(20); -var We=W(27),Xe=W(32," "),Ye=W(33),Ze=W(34),$e=W(35),af=W(36),bf=W(37),cf=W(38),df=W(39),ef=W(40);W(44);var ff=W(45),gf=W(46);W(48,"0",")");W(49,"1","!");W(50,"2","@");W(51,"3","#");W(52,"4","$");W(53,"5","%");W(54,"6","^");W(55,"7","&");W(56,"8","*");W(57,"9","(");W(65,"a","A");W(66,"b","B");W(67,"c","C");W(68,"d","D");W(69,"e","E");W(70,"f","F");W(71,"g","G");W(72,"h","H");W(73,"i","I");W(74,"j","J");W(75,"k","K");W(76,"l","L");W(77,"m","M");W(78,"n","N");W(79,"o","O");W(80,"p","P");W(81,"q","Q"); -W(82,"r","R");W(83,"s","S");W(84,"t","T");W(85,"u","U");W(86,"v","V");W(87,"w","W");W(88,"x","X");W(89,"y","Y");W(90,"z","Z"); -var hf=W(ab?{g:91,h:91}:$a?{g:224,h:91}:{g:0,h:91}),jf=W(ab?{g:92,h:92}:$a?{g:224,h:93}:{g:0,h:92}),kf=W(ab?{g:93,h:93}:$a?{g:0,h:0}:{g:93,h:null}),lf=W({g:96,h:96},"0"),mf=W({g:97,h:97},"1"),nf=W({g:98,h:98},"2"),of=W({g:99,h:99},"3"),pf=W({g:100,h:100},"4"),qf=W({g:101,h:101},"5"),rf=W({g:102,h:102},"6"),sf=W({g:103,h:103},"7"),tf=W({g:104,h:104},"8"),uf=W({g:105,h:105},"9"),vf=W({g:106,h:106},"*"),wf=W({g:107,h:107},"+"),xf=W({g:109,h:109},"-"),yf=W({g:110,h:110},"."),zf=W({g:111,h:111},"/");W(144); -var Af=W(112),Bf=W(113),Cf=W(114),Df=W(115),Ef=W(116),Ff=W(117),Gf=W(118),Hf=W(119),If=W(120),Jf=W(121),Kf=W(122),Lf=W(123),Mf=W({g:107,h:187},"=","+"),Nf=W(108,",");W({g:109,h:189},"-","_");W(188,",","<");W(190,".",">");W(191,"/","?");W(192,"`","~");W(219,"[","{");W(220,"\\","|");W(221,"]","}");var Of=W({g:59,h:186},";",":");W(222,"'",'"');var Pf=[Ue,Te,hf,X],Qf=new Ee;Fe(Qf,1,X);Fe(Qf,2,Te);Fe(Qf,4,Ue);Fe(Qf,8,hf);var Rf=function(a){var b=new Ee;q(Ge(a),function(c){Fe(b,a.get(c).code,c)});return b}(Qf); -function Ne(a,b,c){if(Ba(Pf,b)){var d=Rf.get(b.code),e=a.v;e.a=c?e.a|d:e.a&~d}c?Fe(a.c.a,Le(b),b):(a=a.c.a,b=Le(b),Ie(a.b,b)&&(delete a.b[b],a.f--,a.c++,a.a.length>2*a.f&&He(a)))}var Sf=x?"\r\n":"\n";function Y(a,b){return a.c.contains(b)} -function Tf(a,b){if(Ba(Pf,b)&&Y(a,b))throw new r(13,"Cannot press a modifier key that is already pressed.");var c=null!==b.code&&Uf(a,se,b);if((c||z)&&(!Vf(b)||Uf(a,le,b,!c))&&c&&(Wf(a,b),a.f))if(b.a){if(!Xf){var c=Yf(a,b),d=Ae(a.a,!0)[0]+1;Zf(a.a)?(De(a.a,c),we(a.a,d)):a.a.value+=c;Ya&&V(a.a,re);md||V(a.a,qe);a.b=d}}else switch(b){case Se:Xf||(Ya&&V(a.a,re),T(a.a,"TEXTAREA")&&(c=Ae(a.a,!0)[0]+Sf.length,Zf(a.a)?(De(a.a,Sf),we(a.a,c)):a.a.value+=Sf,x||V(a.a,qe),a.b=c));break;case Qe:case gf:Xf||($f(a.a), -c=Ae(a.a,!1),c[0]==c[1]&&(b==Qe?(we(a.a,c[1]-1),Be(a.a,c[1])):Be(a.a,c[1]+1)),c=Ae(a.a,!1),c=!(c[0]==a.a.value.length||0==c[1]),De(a.a,""),(!x&&c||z&&b==Qe)&&V(a.a,qe),c=Ae(a.a,!1),a.b=c[1]);break;case bf:case df:$f(a.a);var c=a.a,e=Ae(c,!0)[0],f=Ae(c,!1)[1],g=d=0;b==bf?Y(a,X)?a.b==e?(d=Math.max(e-1,0),g=f,e=d):(d=e,e=g=f-1):e=e==f?Math.max(e-1,0):e:Y(a,X)?a.b==f?(d=e,e=g=Math.min(f+1,c.value.length)):(d=e+1,g=f,e=d):e=e==f?Math.min(f+1,c.value.length):f;Y(a,X)?(we(c,d),Be(c,g)):Ce(c,e);a.b=e;break; -case af:case $e:$f(a.a),c=a.a,d=Ae(c,!0)[0],g=Ae(c,!1)[1],b==af?(Y(a,X)?(we(c,0),Be(c,a.b==d?g:d)):Ce(c,0),a.b=0):(Y(a,X)?(a.b==d&&we(c,g),Be(c,c.value.length)):Ce(c,c.value.length),a.b=c.value.length)}Ne(a,b,!0)}function Vf(a){if(a.a||a==Se)return!0;if(Ya||Xa)return!1;if(x)return a==We;switch(a){case X:case Te:case Ue:return!1;case hf:case jf:case kf:return z;default:return!0}} -function Wf(a,b){if(b==Se&&!z&&T(a.a,"INPUT")){var c=vb(a.a,ee,!0);if(c){var d=c.getElementsByTagName("input");(ya(d,function(a){a:{if(T(a,"INPUT")){var b=a.type.toLowerCase();if("submit"==b||"image"==b){a=!0;break a}}if(T(a,"BUTTON")&&(b=a.type.toLowerCase(),"submit"==b)){a=!0;break a}a=!1}return a})||1==d.length||Ya&&!ed(534))&&fe(c)}}}function ag(a,b){if(!Y(a,b))throw new r(13,"Cannot release a key that is not pressed. ("+b.code+")");null===b.code||Uf(a,te,b);Ne(a,b,!1)} -function Yf(a,b){if(!b.a)throw new r(13,"not a character key");return Y(a,X)?b.b:b.a}var Xf=z&&!ed(12);function $f(a){try{a.selectionStart}catch(b){if(-1!=b.message.indexOf("does not support selection."))throw Error(b.message+" (For more information, see https://code.google.com/p/chromium/issues/detail?id=330456)");throw b;}}function Zf(a){try{$f(a)}catch(b){return!1}return!0} -function Uf(a,b,c,d){if(null===c.code)throw new r(13,"Key must have a keycode to be fired.");c={altKey:Y(a,Ue),ctrlKey:Y(a,Te),metaKey:Y(a,hf),shiftKey:Y(a,X),keyCode:c.code,charCode:c.a&&b==le?Yf(a,c).charCodeAt(0):0,preventDefault:!!d};return V(a.a,b,c)}function bg(a,b){be(a,b);a.f=Bd(b);var c=de(a);a.f&&c&&(Ce(b,b.value.length),a.b=b.value.length)};function cg(a){var b;(b=!Jd(a,!0)||!xd(a))||(b=x||z&&!ed("1.9.2")?!1:"none"==U(a,"pointer-events"));if(b)throw new r(12,"Element is not currently interactable and may not be manipulated");}function dg(a){cg(a);if(!Bd(a))throw new r(12,"Element must be user-editable in order to clear it.");var b=eg.S();be(b,a);de(b);a.value?(a.value="",V(a,oe)):T(a,"INPUT")&&a.getAttribute("type")&&"number"==a.getAttribute("type").toLowerCase()&&(a.value="");zd(a)&&(a.innerHTML=" ")} -function fg(a,b,c,d){function e(a){m(a)?q(a.split(""),function(a){if(1!=a.length)throw new r(13,"Argument not a single character: "+a);var b=Oe[a];b||(b=a.toUpperCase(),b=W(b.charCodeAt(0),a.toLowerCase(),b),b={key:b,shift:a!=b.a});a=b;b=Y(f,X);a.shift&&!b&&Tf(f,X);Tf(f,a.key);ag(f,a.key);a.shift&&!b&&ag(f,X)}):Ba(Pf,a)?Y(f,a)?ag(f,a):Tf(f,a):(Tf(f,a),ag(f,a))}a!=rd(a)&&(cg(a),gg(a));var f=c||new Me;bg(f,a);if((!Cb||Za)&&Ya&&"date"==a.type){c="array"==ca(b)?b=b.join(""):b;var g=/\d{4}-\d{2}-\d{2}/; -if(c.match(g)){Za&&Cb&&(V(a,ve),V(a,ue));V(a,pe);a.value=c.match(g)[0];V(a,oe);V(a,ne);return}}"array"==ca(b)?q(b,e):e(b);d||q(Pf,function(a){Y(f,a)&&ag(f,a)})}function eg(){ae.call(this)}p(eg,ae);(function(){var a=eg;a.S=function(){return a.K?a.K:a.K=new a}})(); -function gg(a){if("scroll"==Fd(a,void 0)){if(a.scrollIntoView&&(a.scrollIntoView(),"none"==Fd(a,void 0)))return;for(var b=Kd(a,void 0),c=Ad(a);c;c=Ad(c)){var d=c,e=Ed(d),f;var g=d;if(!x||9<=Number(hb))k=od(g,"borderLeftWidth"),f=od(g,"borderRightWidth"),n=od(g,"borderTopWidth"),g=od(g,"borderBottomWidth"),f=new nd(parseFloat(n),parseFloat(f),parseFloat(g),parseFloat(k));else{var k=qd(g,"borderLeft");f=qd(g,"borderRight");var n=qd(g,"borderTop"),g=qd(g,"borderBottom");f=new nd(n,f,g,k)}k=b.left-e.left- -f.left;e=b.top-e.top-f.top;f=d.clientHeight+b.top-b.bottom;d.scrollLeft+=Math.min(k,Math.max(k-(d.clientWidth+b.left-b.right),0));d.scrollTop+=Math.min(e,Math.max(e-f,0))}Fd(a,void 0)}};function Z(a,b,c,d){function e(){return{M:f,keys:[]}}var f=!!d,g=[],k=e();g.push(k);q(b,function(a){q(a.split(""),function(a){if("\ue000"<=a&&"\ue03d">=a){var b=Z.a[a];if(null===b)g.push(k=e()),f&&(k.M=!1,g.push(k=e()));else if(l(b))k.keys.push(b);else throw Error("Unsupported WebDriver key: \\u"+a.charCodeAt(0).toString(16));}else switch(a){case "\n":k.keys.push(Se);break;case "\t":k.keys.push(Re);break;case "\b":k.keys.push(Qe);break;default:k.keys.push(a)}})});q(g,function(b){fg(a,b.keys,c,b.M)})} -Z.a={};Z.a["\ue000"]=null;Z.a["\ue003"]=Qe;Z.a["\ue004"]=Re;Z.a["\ue006"]=Se;Z.a["\ue007"]=Se;Z.a["\ue008"]=X;Z.a["\ue009"]=Te;Z.a["\ue00a"]=Ue;Z.a["\ue00b"]=Ve;Z.a["\ue00c"]=We;Z.a["\ue00d"]=Xe;Z.a["\ue00e"]=Ye;Z.a["\ue00f"]=Ze;Z.a["\ue010"]=$e;Z.a["\ue011"]=af;Z.a["\ue012"]=bf;Z.a["\ue013"]=cf;Z.a["\ue014"]=df;Z.a["\ue015"]=ef;Z.a["\ue016"]=ff;Z.a["\ue017"]=gf;Z.a["\ue018"]=Of;Z.a["\ue019"]=Mf;Z.a["\ue01a"]=lf;Z.a["\ue01b"]=mf;Z.a["\ue01c"]=nf;Z.a["\ue01d"]=of;Z.a["\ue01e"]=pf;Z.a["\ue01f"]=qf; -Z.a["\ue020"]=rf;Z.a["\ue021"]=sf;Z.a["\ue022"]=tf;Z.a["\ue023"]=uf;Z.a["\ue024"]=vf;Z.a["\ue025"]=wf;Z.a["\ue027"]=xf;Z.a["\ue028"]=yf;Z.a["\ue029"]=zf;Z.a["\ue026"]=Nf;Z.a["\ue031"]=Af;Z.a["\ue032"]=Bf;Z.a["\ue033"]=Cf;Z.a["\ue034"]=Df;Z.a["\ue035"]=Ef;Z.a["\ue036"]=Ff;Z.a["\ue037"]=Gf;Z.a["\ue038"]=Hf;Z.a["\ue039"]=If;Z.a["\ue03a"]=Jf;Z.a["\ue03b"]=Kf;Z.a["\ue03c"]=Lf;Z.a["\ue03d"]=hf;function hg(){} -function ig(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ca(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),ig(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),jg(d,c),c.push(":"),ig(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":jg(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var kg={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},lg=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function jg(a,b){b.push('"',a.replace(lg,function(a){var b=kg[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),kg[a]=b);return b}),'"')};Ya||z&&ed(3.5)||x&&ed(8);function mg(a){switch(ca(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return wa(a,mg);case "object":if(Ra(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=ng(a);return b}if(Ra(a,"document"))return b={},b.WINDOW=ng(a),b;if(da(a))return wa(a,mg);a=Oa(a,function(a,b){return ea(b)||m(b)});return Pa(a,mg);default:return null}} -function og(a,b){return"array"==ca(a)?wa(a,function(a){return og(a,b)}):ga(a)?"function"==typeof a?a:Ra(a,"ELEMENT")?pg(a.ELEMENT,b):Ra(a,"WINDOW")?pg(a.WINDOW,b):Pa(a,function(a){return og(a,b)}):a}function qg(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.F=na());b.F||(b.F=na());return b}function ng(a){var b=qg(a.ownerDocument),c=Sa(b,function(b){return b==a});c||(c=":wdc:"+b.F++,b[c]=a);return c} -function pg(a,b){a=decodeURIComponent(a);var c=b||document,d=qg(c);if(!Ra(d,a))throw new r(10,"Element does not exist in cache");var e=d[a];if(Ra(e,"setInterval")){if(e.closed)throw delete d[a],new r(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new r(10,"Element is no longer attached to the DOM");};ba("_",function(a,b){var c=[a],d;try{var e;b?e=pg(b.WINDOW):e=window;var f=og(c,e.document),g=dg.apply(null,f);d={status:0,value:mg(g)}}catch(k){d={status:Ra(k,"code")?k.code:13,value:{message:k.message}}}c=[];ig(new hg,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/click.js b/src/ghostdriver/third_party/webdriver-atoms/click.js deleted file mode 100644 index 867a4e44ff..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/click.js +++ /dev/null @@ -1,174 +0,0 @@ -function(){return function(){var k,aa=this;function l(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){return"function"==ca(a)}function ga(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ha="closure_uid_"+(1E9*Math.random()>>>0),ia=0;function ja(a,b,c){return a.call.apply(a.bind,arguments)} -function ka(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function la(a,b,c){la=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ja:ka;return la.apply(null,arguments)} -function ma(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var na=Date.now||function(){return+new Date};function p(a,b){function c(){}c.prototype=b.prototype;a.W=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.V=function(a,c,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[c].apply(a,g)}};var oa=window;var pa;function qa(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var ra=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function sa(a,b){for(var c=0,d=ra(String(a)).split("."),e=ra(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var h=d[g]||"",n=e[g]||"",q=RegExp("(\\d*)(\\D*)","g"),u=RegExp("(\\d*)(\\D*)","g");do{var A=q.exec(h)||["","",""],y=u.exec(n)||["","",""];if(0==A[0].length&&0==y[0].length)break;c=ta(0==A[1].length?0:parseInt(A[1],10),0==y[1].length?0:parseInt(y[1],10))||ta(0==A[2].length,0==y[2].length)||ta(A[2],y[2])}while(0==c)}return c}function ta(a,b){return a<b?-1:a>b?1:0} -function ua(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function r(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)}function va(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d}function wa(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function xa(a,b,c){var d=c;r(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function ya(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function za(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0}function Aa(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]} -function Ba(a,b){var c;a:if(m(a))c=m(b)&&1==b.length?a.indexOf(b,0):-1;else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function Ca(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function Da(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Ea={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Fa="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ga=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ha=/^#(?:[0-9a-f]{3}){1,2}$/i,Ia=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ja=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function t(a,b){this.code=a;this.a=v[a]||Ka;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}p(t,Error);var Ka="unknown error",v={15:"element not selectable",11:"element not visible"};v[31]=Ka;v[30]=Ka;v[24]="invalid cookie domain";v[29]="invalid element coordinates";v[12]="invalid element state"; -v[32]="invalid selector";v[51]="invalid selector";v[52]="invalid selector";v[17]="javascript error";v[405]="unsupported operation";v[34]="move target out of bounds";v[27]="no such alert";v[7]="no such element";v[8]="no such frame";v[23]="no such window";v[28]="script timeout";v[33]="session not created";v[10]="stale element reference";v[21]="timeout";v[25]="unable to set cookie";v[26]="unexpected alert open";v[13]=Ka;v[9]="unknown command";t.prototype.toString=function(){return this.name+": "+this.message};var La;a:{var Ma=aa.navigator;if(Ma){var Na=Ma.userAgent;if(Na){La=Na;break a}}La=""}function w(a){return-1!=La.indexOf(a)};function Oa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Pa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Qa(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ra(a,b){return null!==a&&b in a}function Sa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ta(){return w("Opera")||w("OPR")}function Ua(){return(w("Chrome")||w("CriOS"))&&!Ta()&&!w("Edge")};function Va(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Wa=Ta(),x=w("Trident")||w("MSIE"),Xa=w("Edge"),z=w("Gecko")&&!(-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),B=-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"),Ya=B&&w("Mobile"),Za=w("Macintosh"),$a=w("Windows");function ab(){var a=La;if(z)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Xa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(B)return/WebKit\/(\S+)/.exec(a)} -function bb(){var a=aa.document;return a?a.documentMode:void 0}var cb=function(){if(Wa&&aa.opera){var a;var b=aa.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=ab())&&(a=b?b[1]:"");return x&&(b=bb(),null!=b&&b>parseFloat(a))?String(b):a}(),db={};function eb(a){return db[a]||(db[a]=0<=sa(cb,a))}function fb(a){return Number(gb)>=a}var hb=aa.document,gb=hb&&x?bb()||("CSS1Compat"==hb.compatMode?parseInt(cb,10):5):void 0;!z&&!x||x&&fb(9)||z&&eb("1.9.1");x&&eb("9");function ib(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}k=ib.prototype;k.clone=function(){return new ib(this.x,this.y)};k.toString=function(){return"("+this.x+", "+this.y+")"};k.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};k.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};k.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};k.scale=function(a,b){var c=ea(b)?b:a;this.x*=a;this.y*=c;return this};function jb(a,b){this.width=a;this.height=b}k=jb.prototype;k.clone=function(){return new jb(this.width,this.height)};k.toString=function(){return"("+this.width+" x "+this.height+")"};k.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};k.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};k.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -k.scale=function(a,b){var c=ea(b)?b:a;this.width*=a;this.height*=c;return this};function kb(a){return a?new lb(C(a)):pa||(pa=new lb)}function mb(a){return a.scrollingElement?a.scrollingElement:B||"CSS1Compat"!=a.compatMode?a.body||a.documentElement:a.documentElement}function nb(a){return a?a.parentWindow||a.defaultView:window}function ob(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a} -function pb(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function qb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!fb(9)){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?rb(a,b):!c&&pb(e,b)?-1*sb(a,b):!d&&pb(f,a)?sb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=C(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function sb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return rb(d,a)}function rb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function C(a){return 9==a.nodeType?a:a.ownerDocument||a.document}var tb={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},ub={IMG:" ",BR:"\n"}; -function vb(a,b,c){if(!(a.nodeName in tb))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in ub)b.push(ub[a.nodeName]);else for(a=a.firstChild;a;)vb(a,b,c),a=a.nextSibling}function wb(a,b,c){c||(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function lb(a){this.a=a||aa.document||document} -function xb(a,b,c,d){a=d||a.a;b=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(b||c))c=a.querySelectorAll(b+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(a=a.getElementsByClassName(c),b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g.nodeName&&(d[e++]=g);d.length=e;c=d}else c=a;else if(a=a.getElementsByTagName(b||"*"),c){d={};for(f=e=0;g=a[f];f++)b=g.className,"function"==typeof b.split&&Ba(b.split(/\s+/),c)&&(d[e++]=g);d.length=e;c=d}else c=a;return c} -function yb(a){return mb(a.a)}lb.prototype.contains=pb;var zb=w("Firefox"),Ab=Va()||w("iPod"),Bb=w("iPad"),Cb=w("Android")&&!(Ua()||w("Firefox")||Ta()||w("Silk")),Db=Ua(),Eb=w("Safari")&&!(Ua()||w("Coast")||Ta()||w("Edge")||w("Silk")||w("Android"))&&!(Va()||w("iPad")||w("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Fb(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var Gb=x&&!fb(9),Hb=x&&!fb(8);function Ib(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Jb(a,b){var c=Hb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Ib(b,a,b.nodeName,c)};function Kb(a){this.b=a;this.a=0}function Lb(a){a=a.match(Mb);for(var b=0;b<a.length;b++)Nb.test(a[b])&&a.splice(b,1);return new Kb(a)}var Mb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Nb=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function Ob(a){return a.b.length<=a.a};function Pb(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(Gb&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),Gb&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function Qb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Hb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Rb(a,b,c,d,e){return(Gb?Sb:Tb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new F)} -function Sb(a,b,c,d,e){if(a instanceof Ub||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Vb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)Qb(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||G(e,b);return e}Wb(a,b,c,d,e);return e} -function Tb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),r(b,function(b){a.a(b)&&G(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),r(b,function(b){b.className==d&&a.a(b)&&G(e,b)})):a instanceof Xb?Wb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),r(b,function(a){Qb(a,c,d)&&G(e,a)}));return e} -function Yb(a,b,c,d,e){var f;if((a instanceof Ub||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Vb(a);if("*"!=g&&(f=va(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=va(f,function(a){return Qb(a,c,d)}));r(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||G(e,a)});return e}return Zb(a,b,c,d,e)}function Zb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Qb(b,c,d)&&a.a(b)&&G(e,b);return e} -function Wb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Qb(b,c,d)&&a.a(b)&&G(e,b),Wb(a,b,c,d,e)}function Vb(a){if(a instanceof Xb){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function F(){this.b=this.a=null;this.s=0}function $b(a){this.node=a;this.a=this.b=null}function ac(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,h=d.node;f==h||f instanceof Ib&&h instanceof Ib&&f.a==h.a?(f=c,c=c.a,d=d.a):0<qb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.s=g;return a} -F.prototype.unshift=function(a){a=new $b(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function G(a,b){var c=new $b(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function bc(a){return(a=a.a)?a.node:null}function cc(a){return(a=bc(a))?Pb(a):""}function ec(a,b){return new fc(a,!!b)}function fc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function H(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function J(a){this.l=a;this.b=this.j=!1;this.f=null}function K(a){return"\n "+a.toString().split("\n").join("\n ")}function gc(a,b){a.j=b}function hc(a,b){a.b=b}function L(a,b){var c=a.a(b);return c instanceof F?+cc(c):+c}function M(a,b){var c=a.a(b);return c instanceof F?cc(c):""+c}function ic(a,b){var c=a.a(b);return c instanceof F?!!c.s:!!c};function jc(a,b,c){J.call(this,a.l);this.c=a;this.g=b;this.o=c;this.j=b.j||c.j;this.b=b.b||c.b;this.c==kc&&(c.b||c.j||4==c.l||0==c.l||!b.f?b.b||b.j||4==b.l||0==b.l||!c.f||(this.f={name:c.f.name,C:b}):this.f={name:b.f.name,C:c})}p(jc,J); -function lc(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof F&&c instanceof F){b=ec(b);for(d=H(b);d;d=H(b))for(e=ec(c),f=H(e);f;f=H(e))if(a(Pb(d),Pb(f)))return!0;return!1}if(b instanceof F||c instanceof F){b instanceof F?(e=b,d=c):(e=c,d=b);f=ec(e);for(var g=typeof d,h=H(f);h;h=H(f)){switch(g){case "number":h=+Pb(h);break;case "boolean":h=!!Pb(h);break;case "string":h=Pb(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}jc.prototype.a=function(a){return this.c.v(this.g,this.o,a)};jc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+K(this.g);return a+=K(this.o)};function mc(a,b,c,d){this.a=a;this.N=b;this.l=c;this.v=d}mc.prototype.toString=function(){return this.a};var nc={}; -function N(a,b,c,d){if(nc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new mc(a,b,c,d);return nc[a.toString()]=a}N("div",6,1,function(a,b,c){return L(a,c)/L(b,c)});N("mod",6,1,function(a,b,c){return L(a,c)%L(b,c)});N("*",6,1,function(a,b,c){return L(a,c)*L(b,c)});N("+",5,1,function(a,b,c){return L(a,c)+L(b,c)});N("-",5,1,function(a,b,c){return L(a,c)-L(b,c)});N("<",4,2,function(a,b,c){return lc(function(a,b){return a<b},a,b,c)}); -N(">",4,2,function(a,b,c){return lc(function(a,b){return a>b},a,b,c)});N("<=",4,2,function(a,b,c){return lc(function(a,b){return a<=b},a,b,c)});N(">=",4,2,function(a,b,c){return lc(function(a,b){return a>=b},a,b,c)});var kc=N("=",3,2,function(a,b,c){return lc(function(a,b){return a==b},a,b,c,!0)});N("!=",3,2,function(a,b,c){return lc(function(a,b){return a!=b},a,b,c,!0)});N("and",2,2,function(a,b,c){return ic(a,c)&&ic(b,c)});N("or",1,2,function(a,b,c){return ic(a,c)||ic(b,c)});function oc(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");J.call(this,a.l);this.c=a;this.g=b;this.j=a.j;this.b=a.b}p(oc,J);oc.prototype.a=function(a){a=this.c.a(a);return pc(this.g,a)};oc.prototype.toString=function(){var a;a="Filter:"+K(this.c);return a+=K(this.g)};function qc(a,b){if(b.length<a.P)throw Error("Function "+a.m+" expects at least"+a.P+" arguments, "+b.length+" given");if(null!==a.H&&b.length>a.H)throw Error("Function "+a.m+" expects at most "+a.H+" arguments, "+b.length+" given");a.R&&r(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.m+" is not of type Nodeset: "+b);});J.call(this,a.l);this.g=a;this.c=b;gc(this,a.j||ya(b,function(a){return a.j}));hc(this,a.U&&!b.length||a.T&&!!b.length||ya(b,function(a){return a.b}))} -p(qc,J);qc.prototype.a=function(a){return this.g.v.apply(null,Ca(a,this.c))};qc.prototype.toString=function(){var a="Function: "+this.g;if(this.c.length)var b=xa(this.c,function(a,b){return a+K(b)},"Arguments:"),a=a+K(b);return a};function rc(a,b,c,d,e,f,g,h,n){this.m=a;this.l=b;this.j=c;this.U=d;this.T=e;this.v=f;this.P=g;this.H=l(h)?h:g;this.R=!!n}rc.prototype.toString=function(){return this.m};var sc={}; -function O(a,b,c,d,e,f,g,h){if(sc.hasOwnProperty(a))throw Error("Function already created: "+a+".");sc[a]=new rc(a,b,c,d,!1,e,f,g,h)}O("boolean",2,!1,!1,function(a,b){return ic(b,a)},1);O("ceiling",1,!1,!1,function(a,b){return Math.ceil(L(b,a))},1);O("concat",3,!1,!1,function(a,b){return xa(Da(arguments,1),function(b,d){return b+M(d,a)},"")},2,null);O("contains",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return-1!=b.indexOf(a)},2);O("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -O("false",2,!1,!1,function(){return!1},0);O("floor",1,!1,!1,function(a,b){return Math.floor(L(b,a))},1);O("id",4,!1,!1,function(a,b){function c(a){if(Gb){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return Aa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=M(b,a).split(/\s+/),f=[];r(d,function(a){(a=c(a))&&!Ba(f,a)&&f.push(a)});f.sort(qb);var g=new F;r(f,function(a){G(g,a)});return g},1); -O("lang",2,!1,!1,function(){return!1},1);O("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);O("local-name",3,!1,!0,function(a,b){var c=b?bc(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);O("name",3,!1,!0,function(a,b){var c=b?bc(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);O("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -O("normalize-space",3,!1,!0,function(a,b){return(b?M(b,a):Pb(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);O("not",2,!1,!1,function(a,b){return!ic(b,a)},1);O("number",1,!1,!0,function(a,b){return b?L(b,a):+Pb(a.a)},0,1);O("position",1,!0,!1,function(a){return a.b},0);O("round",1,!1,!1,function(a,b){return Math.round(L(b,a))},1);O("starts-with",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return 0==b.lastIndexOf(a,0)},2);O("string",3,!1,!0,function(a,b){return b?M(b,a):Pb(a.a)},0,1); -O("string-length",1,!1,!0,function(a,b){return(b?M(b,a):Pb(a.a)).length},0,1);O("substring",3,!1,!1,function(a,b,c,d){c=L(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?L(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=M(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);O("substring-after",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -O("substring-before",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);O("sum",1,!1,!1,function(a,b){for(var c=ec(b.a(a)),d=0,e=H(c);e;e=H(c))d+=+Pb(e);return d},1,1,!0);O("translate",3,!1,!1,function(a,b,c,d){b=M(b,a);c=M(c,a);var e=M(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);O("true",2,!1,!1,function(){return!0},0);function Xb(a,b){this.g=a;this.c=l(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function tc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}Xb.prototype.a=function(a){return null===this.b||this.b==a.nodeType};Xb.prototype.f=function(){return this.g}; -Xb.prototype.toString=function(){var a="Kind Test: "+this.g;null===this.c||(a+=K(this.c));return a};function uc(a){J.call(this,3);this.c=a.substring(1,a.length-1)}p(uc,J);uc.prototype.a=function(){return this.c};uc.prototype.toString=function(){return"Literal: "+this.c};function Ub(a,b){this.m=a.toLowerCase();var c;c="*"==this.m?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Ub.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.m&&this.m!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Ub.prototype.f=function(){return this.m};Ub.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.m};function vc(a){J.call(this,1);this.c=a}p(vc,J);vc.prototype.a=function(){return this.c};vc.prototype.toString=function(){return"Number: "+this.c};function wc(a,b){J.call(this,a.l);this.g=a;this.c=b;this.j=a.j;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.w||c.c!=xc||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),C:null}))}}p(wc,J);function yc(){J.call(this,4)}p(yc,J);yc.prototype.a=function(a){var b=new F;a=a.a;9==a.nodeType?G(b,a):G(b,a.ownerDocument);return b};yc.prototype.toString=function(){return"Root Helper Expression"};function zc(){J.call(this,4)}p(zc,J);zc.prototype.a=function(a){var b=new F;G(b,a.a);return b};zc.prototype.toString=function(){return"Context Helper Expression"}; -function Ac(a){return"/"==a||"//"==a}wc.prototype.a=function(a){var b=this.g.a(a);if(!(b instanceof F))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=ec(b,e.c.a),g;if(e.j||e.c!=Bc)if(e.j||e.c!=Cc)for(g=H(f),b=e.a(new Fb(g));null!=(g=H(f));)g=e.a(new Fb(g)),b=ac(b,g);else g=H(f),b=e.a(new Fb(g));else{for(g=H(f);(b=H(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Fb(g))}}return b}; -wc.prototype.toString=function(){var a;a="Path Expression:"+K(this.g);if(this.c.length){var b=xa(this.c,function(a,b){return a+K(b)},"Steps:");a+=K(b)}return a};function Dc(a,b){this.a=a;this.b=!!b} -function pc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=ec(b),f=b.s,g,h=0;g=H(e);h++){var n=a.b?f-h:h+1;g=d.a(new Fb(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof F)n=0<g.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var q=n.a;if(!q)throw Error("Next must be called at least once before remove.");var u=q.b,q=q.a;u?u.a=q:g.a=q;q?q.b=u:g.b=u;g.s--;n.a=null}}return b} -Dc.prototype.toString=function(){return xa(this.a,function(a,b){return a+K(b)},"Predicates:")};function Ec(a,b,c,d){J.call(this,4);this.c=a;this.o=b;this.g=c||new Dc([]);this.w=!!d;b=this.g;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=Gb?a.toLowerCase():a,this.f={name:a,C:b.C});a:{a=this.g;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.j||1==c.l||0==c.l){a=!0;break a}a=!1}this.j=a}p(Ec,J); -Ec.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.C?M(c.C,a):null,f=1);if(this.w)if(this.j||this.c!=Fc)if(a=ec((new Ec(Gc,new Xb("node"))).a(a)),b=H(a))for(c=this.v(b,d,e,f);null!=(b=H(a));)c=ac(c,this.v(b,d,e,f));else c=new F;else c=Rb(this.o,b,d,e),c=pc(this.g,c,f);else c=this.v(a.a,d,e,f);return c};Ec.prototype.v=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=pc(this.g,a,d)}; -Ec.prototype.toString=function(){var a;a="Step:"+K("Operator: "+(this.w?"//":"/"));this.c.m&&(a+=K("Axis: "+this.c));a+=K(this.o);if(this.g.a.length){var b=xa(this.g.a,function(a,b){return a+K(b)},"Predicates:");a+=K(b)}return a};function Hc(a,b,c,d){this.m=a;this.f=b;this.a=c;this.b=d}Hc.prototype.toString=function(){return this.m};var Ic={};function Jc(a,b,c,d){if(Ic.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Hc(a,b,c,!!d);return Ic[a]=b} -Jc("ancestor",function(a,b){for(var c=new F,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);Jc("ancestor-or-self",function(a,b){var c=new F,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var xc=Jc("attribute",function(a,b){var c=new F,d=a.f();if("style"==d&&b.style&&Gb)return G(c,new Ib(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof Xb&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)Gb?f.nodeValue&&G(c,Jb(b,f)):G(c,f);else(f=e.getNamedItem(d))&&(Gb?f.nodeValue&&G(c,Jb(b,f)):G(c,f));return c},!1),Fc=Jc("child",function(a,b,c,d,e){return(Gb?Yb:Zb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new F)},!1,!0);Jc("descendant",Rb,!1,!0); -var Gc=Jc("descendant-or-self",function(a,b,c,d){var e=new F;Qb(b,c,d)&&a.a(b)&&G(e,b);return Rb(a,b,c,d,e)},!1,!0),Bc=Jc("following",function(a,b,c,d){var e=new F;do for(var f=b;f=f.nextSibling;)Qb(f,c,d)&&a.a(f)&&G(e,f),e=Rb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);Jc("following-sibling",function(a,b){for(var c=new F,d=b;d=d.nextSibling;)a.a(d)&&G(c,d);return c},!1);Jc("namespace",function(){return new F},!1); -var Kc=Jc("parent",function(a,b){var c=new F;if(9==b.nodeType)return c;if(2==b.nodeType)return G(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&G(c,d);return c},!1),Cc=Jc("preceding",function(a,b,c,d){var e=new F,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var q=0,u=n.length;q<u;q++)b=n[q],Qb(b,c,d)&&a.a(b)&&G(e,b),e=Rb(a,b,c,d,e)}return e},!0,!0); -Jc("preceding-sibling",function(a,b){for(var c=new F,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Lc=Jc("self",function(a,b){var c=new F;a.a(b)&&G(c,b);return c},!1);function Mc(a){J.call(this,1);this.c=a;this.j=a.j;this.b=a.b}p(Mc,J);Mc.prototype.a=function(a){return-L(this.c,a)};Mc.prototype.toString=function(){return"Unary Expression: -"+K(this.c)};function Nc(a){J.call(this,4);this.c=a;gc(this,ya(this.c,function(a){return a.j}));hc(this,ya(this.c,function(a){return a.b}))}p(Nc,J);Nc.prototype.a=function(a){var b=new F;r(this.c,function(c){c=c.a(a);if(!(c instanceof F))throw Error("Path expression must evaluate to NodeSet.");b=ac(b,c)});return b};Nc.prototype.toString=function(){return xa(this.c,function(a,b){return a+K(b)},"Union Expression:")};function Oc(a,b){this.a=a;this.b=b}function Pc(a){for(var b,c=[];;){Qc(a,"Missing right hand side of binary expression.");b=Rc(a);var d=E(a.a);if(!d)break;var e=(d=nc[d]||null)&&d.N;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].N;)b=new jc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new jc(c.pop(),c.pop(),b);return b}function Qc(a,b){if(Ob(a.a))throw Error(b);}function Sc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function Tc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Uc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new uc(a)} -function Vc(a){var b,c=[],d;if(Ac(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(Ob(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new yc;d=new yc;Qc(a,"Missing next location step.");b=Wc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=Pc(a);Qc(a,'unclosed "("');Sc(a,")");break;case '"':case "'":b=Uc(a);break;default:if(isNaN(+b))if(!tc(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a); -b=sc[b]||null;E(a.a);for(d=[];")"!=D(a.a);){Qc(a,"Missing function argument list.");d.push(Pc(a));if(","!=D(a.a))break;E(a.a)}Qc(a,"Unclosed function argument list.");Tc(a);b=new qc(b,d)}else{b=null;break a}else b=new vc(+E(a.a))}"["==D(a.a)&&(d=new Dc(Xc(a)),b=new oc(b,d))}if(b)if(Ac(D(a.a)))d=b;else return b;else b=Wc(a,"/"),d=new zc,c.push(b)}for(;Ac(D(a.a));)b=E(a.a),Qc(a,"Missing next location step."),b=Wc(a,b),c.push(b);return new wc(d,c)} -function Wc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new Ec(Lc,new Xb("node")),E(a.a),d;if(".."==D(a.a))return d=new Ec(Kc,new Xb("node")),E(a.a),d;var f;if("@"==D(a.a))f=xc,E(a.a),Qc(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=Ic[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);Qc(a,"Missing node name")}else f=Fc;c=D(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -D(a.a,1)){if(!tc(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!tc(c))throw Error("Invalid type name: "+c);Sc(a,"(");Qc(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Uc(a);Qc(a,"Bad nodetype");Tc(a);c=new Xb(c,g)}else if(c=E(a.a),e=c.indexOf(":"),-1==e)c=new Ub(c);else{var g=c.substring(0,e),h;if("*"==g)h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Ub(c,h)}else throw Error("Bad token: "+E(a.a));e=new Dc(Xc(a),f.a);return d|| -new Ec(f,c,e,"//"==b)}function Xc(a){for(var b=[];"["==D(a.a);){E(a.a);Qc(a,"Missing predicate expression.");var c=Pc(a);b.push(c);Qc(a,"Unclosed predicate expression.");Sc(a,"]")}return b}function Rc(a){if("-"==D(a.a))return E(a.a),new Mc(Rc(a));var b=Vc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)Qc(a,"Missing next union location path."),b.push(Vc(a));a.a.a--;a=new Nc(b)}return a};function Yc(a){switch(a.nodeType){case 1:return ma(Zc,a);case 9:return Yc(a.documentElement);case 11:case 10:case 6:case 12:return $c;default:return a.parentNode?Yc(a.parentNode):$c}}function $c(){return null}function Zc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Zc(a.parentNode,b):null};function ad(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Lb(a);if(Ob(c))throw Error("Invalid XPath expression.");b?fa(b)||(b=la(b.lookupNamespaceURI,b)):b=function(){return null};var d=Pc(new Oc(c,b));if(!Ob(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new Fb(a));return new bd(c,b)}} -function bd(a,b){if(0==b)if(a instanceof F)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof F))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof F?cc(a):""+a;break;case 1:this.numberValue=a instanceof F?+cc(a):+a;break;case 3:this.booleanValue=a instanceof F?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -ec(a);c=[];for(var e=H(d);e;e=H(d))c.push(e instanceof Ib?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=bc(a);this.singleNodeValue=d instanceof Ib?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}bd.ANY_TYPE=0;bd.NUMBER_TYPE=1;bd.STRING_TYPE=2;bd.BOOLEAN_TYPE=3;bd.UNORDERED_NODE_ITERATOR_TYPE=4;bd.ORDERED_NODE_ITERATOR_TYPE=5;bd.UNORDERED_NODE_SNAPSHOT_TYPE=6;bd.ORDERED_NODE_SNAPSHOT_TYPE=7;bd.ANY_UNORDERED_NODE_TYPE=8;bd.FIRST_ORDERED_NODE_TYPE=9;function cd(a){this.lookupNamespaceURI=Yc(a)} -function dd(a,b){var c=a||aa,d=c.document;if(!d.evaluate||b)c.XPathResult=bd,d.evaluate=function(a,b,c,d){return(new ad(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new ad(a,b)},d.createNSResolver=function(a){return new cd(a)}}ba("wgxpath.install",dd);var ed={};ed.I=function(){var a={X:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -ed.v=function(a,b,c){var d=C(a);if(!d.documentElement)return null;(x||Cb)&&dd(nb(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):ed.I;if(x&&!eb(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||fb(9)){for(var f={},g=d.getElementsByTagName("*"),h=0;h<g.length;++h){var n=g[h],q=n.namespaceURI;if(q&&!f[q]){var u=n.lookupPrefix(q);if(!u)var A=q.match(".*/(\\w+)/?$"),u=A?A[1]:"xhtml";f[q]=u}}var y={},I;for(I in f)y[f[I]]=I;e=function(a){return y[a]||null}}try{return d.evaluate(b, -a,e,c,null)}catch(S){if("TypeError"===S.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):ed.I,d.evaluate(b,a,e,c,null);throw S;}}catch(S){if(!z||"NS_ERROR_ILLEGAL_VALUE"!=S.name)throw new t(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+S);}};ed.J=function(a,b){if(!a||1!=a.nodeType)throw new t(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -ed.A=function(a,b){var c=function(){var c=ed.v(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||ed.J(c,a);return c}; -ed.u=function(a,b){var c=function(){var c=ed.v(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=C(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();r(c,function(b){ed.J(b,a)});return c};function fd(a){return(a=a.exec(La))?a[1]:""}var gd=function(){if(zb)return fd(/Firefox\/([0-9.]+)/);if(x||Xa||Wa)return cb;if(Db)return fd(/Chrome\/([0-9.]+)/);if(Eb&&!(Va()||w("iPad")||w("iPod")))return fd(/Version\/([0-9.]+)/);if(Ab||Bb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(La))return a[1]+"."+a[2]}else if(Cb)return(a=fd(/Android\s+([0-9.]+)/))?a:fd(/Version\/([0-9.]+)/);return""}();var hd,id;function jd(a){return kd?hd(a):x?0<=sa(gb,a):eb(a)}function ld(a){return kd?id(a):Cb?0<=sa(md,a):0<=sa(gd,a)} -var kd=function(){if(!z)return!1;var a=aa.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;hd=function(a){return 0<=c.compare(d,""+a)};id=function(a){return 0<=c.compare(e,""+a)};return!0}(),nd=Bb||Ab,od; -if(Cb){var pd=/Android\s+([0-9\.]+)/.exec(La);od=pd?pd[1]:"0"}else od="0";var md=od,qd=x&&!fb(8),rd=fb(9),sd=x&&!fb(9),td=fb(10);Cb&&ld(2.3);Cb&&ld(4);Eb&&ld(6);var ud=x&&-1!=La.indexOf("IEMobile");function vd(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}k=vd.prototype;k.clone=function(){return new vd(this.top,this.right,this.bottom,this.left)};k.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};k.contains=function(a){return this&&a?a instanceof vd?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -k.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};k.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};k.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -k.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function P(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}k=P.prototype;k.clone=function(){return new P(this.left,this.top,this.width,this.height)};k.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};k.contains=function(a){return a instanceof P?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -k.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};k.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};k.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -k.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function wd(a,b){var c=C(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function xd(a){a=a?C(a):document;var b;(b=!x||fb(9))||(b="CSS1Compat"==kb(a).a.compatMode);return b?a.documentElement:a.body} -function yd(a){var b=a.offsetWidth,c=a.offsetHeight,d=B&&!b&&!c;if((!l(b)||d)&&a.getBoundingClientRect){var e;a:{try{e=a.getBoundingClientRect()}catch(f){e={left:0,top:0,right:0,bottom:0};break a}x&&a.ownerDocument.body&&(a=a.ownerDocument,e.left-=a.documentElement.clientLeft+a.body.clientLeft,e.top-=a.documentElement.clientTop+a.body.clientTop)}return new jb(e.right-e.left,e.bottom-e.top)}return new jb(b,c)}var zd={thin:2,medium:4,thick:6}; -function Ad(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in zd)d=zd[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};function Bd(a){var b;a:{a=C(a);try{b=a&&a.activeElement;break a}catch(c){}b=null}return x&&b&&"undefined"===typeof b.nodeType?null:b}function Q(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Cd(a){var b;if(b=Dd(a,!0)&&Ed(a))b=!(x||z&&!jd("1.9.2")?0:"none"==R(a,"pointer-events"));return b}function Fd(a){return Q(a,"OPTION")?!0:Q(a,"INPUT")?(a=a.type.toLowerCase(),"checkbox"==a||"radio"==a):!1} -function Gd(a){if(!Fd(a))throw new t(15,"Element is not selectable");var b="selected",c=a.type&&a.type.toLowerCase();if("checkbox"==c||"radio"==c)b="checked";return!!Hd(a,b)}function Hd(a,b){var c;if(c=qd&&"value"==b&&Q(a,"OPTION"))c=null===Id(a,"value");c?(c=[],vb(a,c,!1),c=c.join("")):c=a[b];return c}var Jd=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; -function Kd(a){var b=[];r(a.split(Jd),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function Id(a,b){b=b.toLowerCase();if("style"==b)return Kd(a.style.cssText);if(qd&&"value"==b&&Q(a,"INPUT"))return a.value;if(sd&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}var Ld="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" "); -function Ed(a){var b=a.tagName.toUpperCase();return Ba(Ld,b)?Hd(a,"disabled")?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?Ed(a.parentNode):!wb(a,function(a){var b=a.parentNode;if(b&&Q(b,"FIELDSET")&&Hd(b,"disabled")){if(!Q(a,"LEGEND"))return!0;for(;a=l(a.previousElementSibling)?a.previousElementSibling:ob(a.previousSibling);)if(Q(a,"LEGEND"))return!0}return!1},!0):!0}var Md="text search tel url email password number".split(" "); -function Nd(a){function b(a){return"inherit"==a.contentEditable?(a=Od(a))?b(a):!1:"true"==a.contentEditable}return l(a.contentEditable)?!x&&l(a.isContentEditable)?a.isContentEditable:b(a):!1}function Pd(a){return((Q(a,"TEXTAREA")?!0:Q(a,"INPUT")?Ba(Md,a.type.toLowerCase()):Nd(a)?!0:!1)||(Q(a,"INPUT")?"file"==a.type.toLowerCase():!1))&&!Hd(a,"readOnly")}function Od(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return Q(a)?a:null} -function R(a,b){var c=ua(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=sd?"styleFloat":"cssFloat";var d=wd(a,c)||Qd(a,c);if(null===d)d=null;else if(Ba(Fa,c)){b:{var e=d.match(Ia);if(e){var c=Number(e[1]),f=Number(e[2]),g=Number(e[3]),e=Number(e[4]);if(0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g&&0<=e&&1>=e){c=[c,f,g,e];break b}}c=null}if(!c)b:{if(g=d.match(Ja))if(c=Number(g[1]),f=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g){c=[c,f,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase(); -f=Ea[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(Ga,"#$1$1$2$2$3$3")),!Ha.test(f))){c=null;break b}c=[parseInt(f.substr(1,2),16),parseInt(f.substr(3,2),16),parseInt(f.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}function Qd(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&fa(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(c=Od(a))?Qd(c,b):null} -function Rd(a,b,c){function d(a){var b=Sd(a);return 0<b.height&&0<b.width?!0:Q(a,"PATH")&&(0<b.height||0<b.width)?(a=R(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=R(a,"overflow")&&ya(a.childNodes,function(a){return 3==a.nodeType||Q(a)&&d(a)})}function e(a){return Td(a)==Ud&&za(a.childNodes,function(a){return!Q(a)||e(a)||!d(a)})}if(!Q(a))throw Error("Argument to isShown must be of type Element");if(Q(a,"BODY"))return!0;if(Q(a,"OPTION")||Q(a,"OPTGROUP"))return a=wb(a,function(a){return Q(a,"SELECT")}), -!!a&&Rd(a,!0,c);var f=Vd(a);if(f)return!!f.K&&0<f.rect.width&&0<f.rect.height&&Rd(f.K,b,c);if(Q(a,"INPUT")&&"hidden"==a.type.toLowerCase()||Q(a,"NOSCRIPT"))return!1;f=R(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Wd(a))&&d(a)?!e(a):!1}function Dd(a,b){function c(a){if("none"==R(a,"display"))return!1;a=Od(a);return!a||c(a)}return Rd(a,!!b,c)}var Ud="hidden"; -function Td(a,b){function c(a){function b(a){return a==h?!0:0==R(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==R(a,"position")?!1:!0}var c=R(a,"position");if("fixed"==c)return u=!0,a==h?null:h;for(a=Od(a);a&&!b(a);)a=Od(a);return a}function d(a){var b=a;if("visible"==q)if(a==h&&n)b=n;else if(a==n)return{x:"visible",y:"visible"};b={x:R(b,"overflow-x"),y:R(b,"overflow-y")};a==h&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==h){var b=(new lb(g)).a; -a=mb(b);b=b.parentWindow||b.defaultView;a=x&&eb("10")&&b.pageYOffset!=a.scrollTop?new ib(a.scrollLeft,a.scrollTop):new ib(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new ib(a.scrollLeft,a.scrollTop);return a}for(var f=Xd(a,b),g=C(a),h=g.documentElement,n=g.body,q=R(h,"overflow"),u,A=c(a);A;A=c(A)){var y=d(A);if("visible"!=y.x||"visible"!=y.y){var I=Sd(A);if(0==I.width||0==I.height)return Ud;var S=f.right<I.left,dc=f.bottom<I.top;if(S&&"hidden"==y.x||dc&&"hidden"==y.y)return Ud; -if(S&&"visible"!=y.x||dc&&"visible"!=y.y){S=e(A);dc=f.bottom<I.top-S.y;if(f.right<I.left-S.x&&"visible"!=y.x||dc&&"visible"!=y.x)return Ud;f=Td(A);return f==Ud?Ud:"scroll"}S=f.left>=I.left+I.width;I=f.top>=I.top+I.height;if(S&&"hidden"==y.x||I&&"hidden"==y.y)return Ud;if(S&&"visible"!=y.x||I&&"visible"!=y.y){if(u&&(y=e(A),f.left>=h.scrollWidth-y.x||f.right>=h.scrollHeight-y.y))return Ud;f=Td(A);return f==Ud?Ud:"scroll"}}}return"none"} -function Sd(a){var b=Vd(a);if(b)return b.rect;if(Q(a,"HTML"))return a=C(a),a=(nb(a)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new jb(a.clientWidth,a.clientHeight),new P(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new P(0,0,0,0)}b=new P(c.left,c.top,c.right-c.left,c.bottom-c.top);x&&a.ownerDocument.body&&(a=C(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b} -function Vd(a){var b=Q(a,"MAP");if(!b&&!Q(a,"AREA"))return null;var c=b?a:Q(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=ed.A('/descendant::*[@usemap = "#'+c.name+'"]',C(c)))&&(e=Sd(d),b||"default"==a.shape.toLowerCase()||(a=Yd(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new P(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{K:d,rect:e||new P(0,0,0,0)}} -function Yd(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new P(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new P(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new P(b,c,d-b,e-c)}return new P(0,0,0,0)} -function Xd(a,b){var c;c=Sd(a);c=new vd(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof P?b:new P(b.x,b.y,1,1);c.left=Math.min(Math.max(c.left+d.left,c.left),c.right);c.top=Math.min(Math.max(c.top+d.top,c.top),c.bottom);c.right=Math.min(Math.max(c.left+d.width,c.left),c.right);c.bottom=Math.min(Math.max(c.top+d.height,c.top),c.bottom)}return c}function Zd(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")} -function $d(a){var b=[];ae(a,b);a=wa(b,Zd);return Zd(a.join("\n")).replace(/\xa0/g," ")} -function be(a,b,c){var d=Dd;if(Q(a,"BR"))b.push("");else{var e=Q(a,"TD"),f=R(a,"display"),g=!e&&!Ba(ce,f),h=l(a.previousElementSibling)?a.previousElementSibling:ob(a.previousSibling),h=h?R(h,"display"):"",n=R(a,"float")||R(a,"cssFloat")||R(a,"styleFloat");!g||"run-in"==h&&"none"==n||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var q=d(a),u=null,A=null;q&&(u=R(a,"white-space"),A=R(a,"text-transform"));r(a.childNodes,function(a){c(a,b,q,u,A)});a=b[b.length-1]||"";!e&&"table-cell"!=f||!a||qa(a)|| -(b[b.length-1]+=" ");g&&"run-in"!=f&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function ae(a,b){be(a,b,function(a,b,e,f,g){3==a.nodeType&&e?de(a,b,f,g):Q(a)&&ae(a,b)})}var ce="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); -function de(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";qa(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} -function Wd(a){if(sd){if("relative"==R(a,"position"))return 1;a=R(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return ee(a)}function ee(a){var b=1,c=R(a,"opacity");c&&(b=Number(c));(a=Od(a))&&(b*=ee(a));return b};var fe={D:function(a){return!(!a.querySelectorAll||!a.querySelector)},A:function(a,b){if(!a)throw new t(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new t(32,"Compound class names not permitted");if(fe.D(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(d){throw new t(32,"An invalid or illegal class name was specified");}var c=xb(kb(b),"*",a,b);return c.length?c[0]:null},u:function(a,b){if(!a)throw new t(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new t(32, -"Compound class names not permitted");if(fe.D(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new t(32,"An invalid or illegal class name was specified");}return xb(kb(b),"*",a,b)}};var ge={A:function(a,b){if(!fa(b.querySelector)&&x&&jd(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=ra(a);var c;try{c=b.querySelector(a)}catch(d){throw new t(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},u:function(a,b){if(!fa(b.querySelectorAll)&&x&&jd(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=ra(a);try{return b.querySelectorAll(a)}catch(c){throw new t(32, -"An invalid or illegal selector was specified");}}};var he={D:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},A:function(a,b){var c=kb(b),d=m(a)?c.a.getElementById(a):a;if(!d)return null;if(Id(d,"id")==a&&pb(b,d))return d;c=xb(c,"*");return Aa(c,function(c){return Id(c,"id")==a&&pb(b,c)})},u:function(a,b){if(!a)return[];if(he.D(b,a))try{return b.querySelectorAll("#"+he.S(a))}catch(d){return[]}var c=xb(kb(b),"*",null,b);return va(c,function(b){return Id(b,"id")==a})},S:function(a){return a.replace(/(['"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g, -"\\$1")}};var ie={},je={};ie.O=function(a,b,c){var d;try{d=ge.u("a",b)}catch(e){d=xb(kb(b),"A",null,b)}return Aa(d,function(b){b=$d(b);return c&&-1!=b.indexOf(a)||b==a})};ie.L=function(a,b,c){var d;try{d=ge.u("a",b)}catch(e){d=xb(kb(b),"A",null,b)}return va(d,function(b){b=$d(b);return c&&-1!=b.indexOf(a)||b==a})};ie.A=function(a,b){return ie.O(a,b,!1)};ie.u=function(a,b){return ie.L(a,b,!1)};je.A=function(a,b){return ie.O(a,b,!0)};je.u=function(a,b){return ie.L(a,b,!0)};var ke={A:function(a,b){if(""===a)throw new t(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},u:function(a,b){if(""===a)throw new t(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var le={className:fe,"class name":fe,css:ge,"css selector":ge,id:he,linkText:ie,"link text":ie,name:{A:function(a,b){var c=xb(kb(b),"*",null,b);return Aa(c,function(b){return Id(b,"name")==a})},u:function(a,b){var c=xb(kb(b),"*",null,b);return va(c,function(b){return Id(b,"name")==a})}},partialLinkText:je,"partial link text":je,tagName:ke,"tag name":ke,xpath:ed}; -function me(a,b){var c;a:{for(c in a)if(a.hasOwnProperty(c))break a;c=null}if(c){var d=le[c];if(d&&fa(d.u))return d.u(a[c],b||oa.document)}throw Error("Unsupported locator strategy: "+c);};function ne(a){this.a=oa.document.documentElement;this.b=null;var b=Bd(this.a);b&&oe(this,b);this.o=a||new pe}function oe(a,b){a.a=b;Q(b,"OPTION")?a.b=wb(b,function(a){return Q(a,"SELECT")}):a.b=null} -function qe(a,b,c,d,e,f,g,h,n){if(!g&&!Cd(a.a))return!1;if(e&&re!=b&&se!=b)throw new t(12,"Event type does not allow related target: "+b);c={clientX:c.x,clientY:c.y,button:d,altKey:0!=(a.o.a&4),ctrlKey:0!=(a.o.a&2),shiftKey:0!=(a.o.a&1),metaKey:0!=(a.o.a&8),wheelDelta:f||0,relatedTarget:e||null,count:n||1};h=h||1;d=a.a;b!=te&&b!=ue&&h in ve?d=ve[h]:a.b&&(d=we(a,b));return d?T(d,b,c):!0} -function xe(a,b,c,d,e,f,g){var h=MSPointerEvent.MSPOINTER_TYPE_MOUSE;if(!g&&!Cd(a.a))return!1;if(f&&ye!=b&&ze!=b)throw new t(12,"Event type does not allow related target: "+b);c={clientX:c.x,clientY:c.y,button:d,altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,relatedTarget:f||null,width:0,height:0,pressure:0,rotation:0,pointerId:1,tiltX:0,tiltY:0,pointerType:h,isPrimary:e};d=a.b?we(a,b):a.a;ve[1]&&(d=ve[1]);a=nb(C(a.a));var n;a&&b==Ae&&(n=a.Element.prototype.msSetPointerCapture,a.Element.prototype.msSetPointerCapture= -function(a){ve[a]=this});b=d?T(d,b,c):!0;n&&(a.Element.prototype.msSetPointerCapture=n);return b}function we(a,b){if(x)switch(b){case re:case ye:return null;case Be:case Ce:case De:return a.b.multiple?a.b:null;default:return a.b}if(B)switch(b){case te:case Ee:return a.b.multiple?a.a:a.b;default:return a.b.multiple?a.a:null}return a.a} -function Fe(a){a=a.b||a.a;var b=Bd(a);if(a==b)return!1;if(b&&(fa(b.blur)||x&&ga(b.blur))){if(!Q(b,"BODY"))try{b.blur()}catch(c){if(!x||"Unspecified error."!=c.message)throw c;}x&&!jd(8)&&nb(C(a)).focus()}return fa(a.focus)||x&&ga(a.focus)?(a.focus(),!0):!1}var Ge=B||kd&&ld(3.6);function He(a){if(Q(a,"INPUT")){var b=a.type.toLowerCase();if("submit"==b||"image"==b)return!0}return Q(a,"BUTTON")&&(b=a.type.toLowerCase(),"submit"==b)?!0:!1} -function Ie(a){if(Ge||!a.href)return!1;if(!kd)return!0;if(a.target||0==a.href.toLowerCase().indexOf("javascript"))return!1;var b=nb(C(a)),c=b.location.href;a=Je(b.location,a.href);return c.split("#")[0]!==a.split("#")[0]}function Ke(a){return Q(a,"FORM")} -function Le(a){if(!Ke(a))throw new t(12,"Element is not a form, so could not submit.");if(T(a,Me))if(Q(a.submit))if(!x||jd(8))a.constructor.prototype.submit.call(a);else{var b=me({id:"submit"},a),c=me({name:"submit"},a);r(b,function(a){a.removeAttribute("id")});r(c,function(a){a.removeAttribute("name")});a=a.submit;r(b,function(a){a.setAttribute("id","submit")});r(c,function(a){a.setAttribute("name","submit")});a()}else a.submit()}var Ne=/^([^:/?#.]+:)?(?:\/\/([^/]*))?([^?#]+)?(\?[^#]*)?(#.*)?$/; -function Je(a,b){var c=b.match(Ne);if(!c)return"";var d=c[1]||"",e=c[2]||"",f=c[3]||"",g=c[4]||"",c=c[5]||"";if(!d&&(d=a.protocol,!e))if(e=a.host,!f)f=a.pathname,g=g||a.search;else if("/"!=f.charAt(0)){var h=a.pathname.lastIndexOf("/");-1!=h&&(f=a.pathname.substr(0,h+1)+f)}return d+"//"+e+f+g+c}function pe(){this.a=0}var ve={};var Oe=!(x&&!jd(10)),Pe=Cb?!ld(4):!nd,Qe=x&&oa.navigator.msPointerEnabled;function U(a,b,c){this.a=a;this.b=b;this.f=c}U.prototype.c=function(a){a=C(a);sd&&a.createEventObject?a=a.createEventObject():(a=a.createEvent("HTMLEvents"),a.initEvent(this.a,this.b,this.f));return a};U.prototype.toString=function(){return this.a};function Re(a,b,c){U.call(this,a,b,c)}p(Re,U); -Re.prototype.c=function(a,b){if(!z&&this==Se)throw new t(9,"Browser does not support a mouse pixel scroll event.");var c=C(a),d;if(sd){d=c.createEventObject();d.altKey=b.altKey;d.ctrlKey=b.ctrlKey;d.metaKey=b.metaKey;d.shiftKey=b.shiftKey;d.button=b.button;d.clientX=b.clientX;d.clientY=b.clientY;c=function(a,b){Object.defineProperty(d,a,{get:function(){return b}})};if(this==se||this==re)if(Object.defineProperty){var e=this==se;c("fromElement",e?a:b.relatedTarget);c("toElement",e?b.relatedTarget:a)}else d.relatedTarget= -b.relatedTarget;this==Te&&(Object.defineProperty?c("wheelDelta",b.wheelDelta):d.detail=b.wheelDelta)}else{e=nb(c);d=c.createEvent("MouseEvents");var f=1;this==Te&&(z||(d.wheelDelta=b.wheelDelta),z&&(f=b.wheelDelta/-40));z&&this==Se&&(f=b.wheelDelta);d.initMouseEvent(this.a,this.b,this.f,e,f,b.clientX,b.clientY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);if(x&&0===d.pageX&&0===d.pageY&&Object.defineProperty){var e=yb(kb(a)),c=xd(c),g=b.clientX+e.scrollLeft- -c.clientLeft,h=b.clientY+e.scrollTop-c.clientTop;Object.defineProperty(d,"pageX",{get:function(){return g}});Object.defineProperty(d,"pageY",{get:function(){return h}})}}return d};function Ue(a,b,c){U.call(this,a,b,c)}p(Ue,U); -Ue.prototype.c=function(a,b){var c=C(a);if(z){var d=nb(c),e=b.charCode?0:b.keyCode,c=c.createEvent("KeyboardEvent");c.initKeyEvent(this.a,this.b,this.f,d,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,e,b.charCode);this.a==Ve&&b.preventDefault&&c.preventDefault()}else if(sd?c=c.createEventObject():(c=c.createEvent("Events"),c.initEvent(this.a,this.b,this.f)),c.altKey=b.altKey,c.ctrlKey=b.ctrlKey,c.metaKey=b.metaKey,c.shiftKey=b.shiftKey,c.keyCode=b.charCode||b.keyCode,B||Xa)c.charCode=this==Ve?c.keyCode: -0;return c};function We(a,b,c){U.call(this,a,b,c)}p(We,U); -We.prototype.c=function(a,b){function c(b){b=wa(b,function(b){return f.createTouch(g,a,b.identifier,b.pageX,b.pageY,b.screenX,b.screenY)});return f.createTouchList.apply(f,b)}function d(b){var c=wa(b,function(b){return{identifier:b.identifier,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY,pageX:b.pageX,pageY:b.pageY,target:a}});c.item=function(a){return c[a]};return c}function e(a){return Pe?d(a):c(a)}if(!Oe)throw new t(9,"Browser does not support firing touch events.");var f= -C(a),g=nb(f),h=e(b.changedTouches),n=b.touches==b.changedTouches?h:e(b.touches),q=b.targetTouches==b.changedTouches?h:e(b.targetTouches),u;Pe?(u=f.createEvent("MouseEvents"),u.initMouseEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,0,b.relatedTarget),u.touches=n,u.targetTouches=q,u.changedTouches=h,u.scale=b.scale,u.rotation=b.rotation):(u=f.createEvent("TouchEvent"),0==u.initTouchEvent.length?u.initTouchEvent(n,q,h,this.a,g,0,0,b.clientX,b.clientY, -b.ctrlKey,b.altKey,b.shiftKey,b.metaKey):u.initTouchEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,n,q,h,b.scale,b.rotation),u.relatedTarget=b.relatedTarget);return u};function Xe(a,b,c){U.call(this,a,b,c)}p(Xe,U); -Xe.prototype.c=function(a,b){if(!Qe)throw new t(9,"Browser does not support MSPointer events.");var c=C(a),d=nb(c),c=c.createEvent("MSPointerEvent");c.initPointerEvent(this.a,this.b,this.f,d,0,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget,0,0,b.width,b.height,b.pressure,b.rotation,b.tiltX,b.tiltY,b.pointerId,b.pointerType,0,b.isPrimary);return c}; -var Ye=new U("blur",!1,!1),Ze=new U("change",!0,!1),$e=new U("focus",!1,!1),af=new U("input",!0,!1),Me=new U("submit",!0,!0),bf=new U("textInput",!0,!0),te=new Re("click",!0,!0),Be=new Re("contextmenu",!0,!0),cf=new Re("dblclick",!0,!0),ue=new Re("mousedown",!0,!0),Ce=new Re("mousemove",!0,!1),se=new Re("mouseout",!0,!0),re=new Re("mouseover",!0,!0),Ee=new Re("mouseup",!0,!0),Te=new Re(z?"DOMMouseScroll":"mousewheel",!0,!0),Se=new Re("MozMousePixelScroll",!0,!0),df=new Ue("keydown",!0,!0),Ve=new Ue("keypress", -!0,!0),ef=new Ue("keyup",!0,!0),ff=new We("touchend",!0,!0),gf=new We("touchstart",!0,!0),hf=new Xe("MSGotPointerCapture",!0,!1),jf=new Xe("MSLostPointerCapture",!0,!1),Ae=new Xe("MSPointerDown",!0,!0),De=new Xe("MSPointerMove",!0,!0),ye=new Xe("MSPointerOver",!0,!0),ze=new Xe("MSPointerOut",!0,!0),kf=new Xe("MSPointerUp",!0,!0);function T(a,b,c){c=b.c(a,c);"isTrusted"in c||(c.isTrusted=!1);return sd&&a.fireEvent?a.fireEvent("on"+b.a,c):a.dispatchEvent(c)};function lf(a,b){if(mf(a))a.selectionStart=b;else if(x){var c=nf(a),d=c[0];d.inRange(c[1])&&(b=of(a,b),d.collapse(!0),d.move("character",b),d.select())}} -function pf(a,b){var c=0,d=0;if(mf(a))c=a.selectionStart,d=b?-1:a.selectionEnd;else if(x){var e=nf(a),f=e[0],e=e[1];if(f.inRange(e)){f.setEndPoint("EndToStart",e);if("textarea"==a.type){for(var c=e.duplicate(),g=f.text,d=g,h=e=c.text,n=!1;!n;)0==f.compareEndPoints("StartToEnd",f)?n=!0:(f.moveEnd("character",-1),f.text==g?d+="\r\n":n=!0);if(b)f=[d.length,-1];else{for(f=!1;!f;)0==c.compareEndPoints("StartToEnd",c)?f=!0:(c.moveEnd("character",-1),c.text==e?h+="\r\n":f=!0);f=[d.length,d.length+h.length]}return f}c= -f.text.length;b?d=-1:d=f.text.length+e.text.length}}return[c,d]}function qf(a,b){if(mf(a))a.selectionEnd=b;else if(x){var c=nf(a),d=c[1];c[0].inRange(d)&&(b=of(a,b),c=of(a,pf(a,!0)[0]),d.collapse(!0),d.moveEnd("character",b-c),d.select())}}function rf(a,b){if(mf(a))a.selectionStart=b,a.selectionEnd=b;else if(x){b=of(a,b);var c=a.createTextRange();c.collapse(!0);c.move("character",b);c.select()}} -function sf(a,b){if(mf(a)){var c=a.value,d=a.selectionStart;a.value=c.substr(0,d)+b+c.substr(a.selectionEnd);a.selectionStart=d;a.selectionEnd=d+b.length}else if(x)d=nf(a),c=d[1],d[0].inRange(c)&&(d=c.duplicate(),c.text=b,c.setEndPoint("StartToStart",d),c.select());else throw Error("Cannot set the selection end");}function nf(a){var b=a.ownerDocument||a.document,c=b.selection.createRange();"textarea"==a.type?(b=b.body.createTextRange(),b.moveToElementText(a)):b=a.createTextRange();return[b,c]} -function of(a,b){"textarea"==a.type&&(b=a.value.substring(0,b).replace(/(\r\n|\r|\n)/g,"\n").length);return b}function mf(a){try{return"number"==typeof a.selectionStart}catch(b){return!1}};function tf(a,b){this.b={};this.a=[];this.c=this.f=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)uf(this,arguments[d],arguments[d+1])}else if(a){if(a instanceof tf)d=vf(a),c=a.B();else{var c=[],e=0;for(d in a)c[e++]=d;d=c;c=Qa(a)}for(e=0;e<d.length;e++)uf(this,d[e],c[e])}}k=tf.prototype;k.B=function(){wf(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};function vf(a){wf(a);return a.a.concat()} -k.clear=function(){this.b={};this.c=this.f=this.a.length=0};function wf(a){if(a.f!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];xf(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.f!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],xf(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}k.get=function(a,b){return xf(this.b,a)?this.b[a]:b};function uf(a,b,c){xf(a.b,b)||(a.f++,a.a.push(b),a.c++);a.b[b]=c} -k.forEach=function(a,b){for(var c=vf(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};k.clone=function(){return new tf(this)};function xf(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function yf(a){if(a.B&&"function"==typeof a.B)return a.B();if(m(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Qa(a)};function zf(a){this.a=new tf;if(a){a=yf(a);for(var b=a.length,c=0;c<b;c++){var d=a[c];uf(this.a,Af(d),d)}}}function Af(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[ha]||(a[ha]=++ia)):b.substr(0,1)+a}zf.prototype.clear=function(){this.a.clear()};zf.prototype.contains=function(a){a=Af(a);return xf(this.a.b,a)};zf.prototype.B=function(){return this.a.B()};zf.prototype.clone=function(){return new zf(this)};function Bf(a){ne.call(this);this.c=Pd(this.a);this.f=0;this.g=new zf;a&&(r(a.pressed,function(a){Cf(this,a,!0)},this),this.f=a.currentPos||0)}p(Bf,ne);var Df={};function V(a,b,c){ga(a)&&(a=z?a.h:a.i);a=new Ef(a,b,c);!b||b in Df&&!c||(Df[b]={key:a,shift:!1},c&&(Df[c]={key:a,shift:!0}));return a}function Ef(a,b,c){this.code=a;this.a=b||null;this.b=c||this.a}var Ff=V(8),Gf=V(9),Hf=V(13),W=V(16),If=V(17),Jf=V(18),Kf=V(19);V(20); -var Lf=V(27),Mf=V(32," "),Nf=V(33),Of=V(34),Pf=V(35),Qf=V(36),Rf=V(37),Sf=V(38),Tf=V(39),Uf=V(40);V(44);var Vf=V(45),Wf=V(46);V(48,"0",")");V(49,"1","!");V(50,"2","@");V(51,"3","#");V(52,"4","$");V(53,"5","%");V(54,"6","^");V(55,"7","&");V(56,"8","*");V(57,"9","(");V(65,"a","A");V(66,"b","B");V(67,"c","C");V(68,"d","D");V(69,"e","E");V(70,"f","F");V(71,"g","G");V(72,"h","H");V(73,"i","I");V(74,"j","J");V(75,"k","K");V(76,"l","L");V(77,"m","M");V(78,"n","N");V(79,"o","O");V(80,"p","P");V(81,"q","Q"); -V(82,"r","R");V(83,"s","S");V(84,"t","T");V(85,"u","U");V(86,"v","V");V(87,"w","W");V(88,"x","X");V(89,"y","Y");V(90,"z","Z"); -var Xf=V($a?{h:91,i:91}:Za?{h:224,i:91}:{h:0,i:91}),Yf=V($a?{h:92,i:92}:Za?{h:224,i:93}:{h:0,i:92}),Zf=V($a?{h:93,i:93}:Za?{h:0,i:0}:{h:93,i:null}),$f=V({h:96,i:96},"0"),ag=V({h:97,i:97},"1"),bg=V({h:98,i:98},"2"),cg=V({h:99,i:99},"3"),dg=V({h:100,i:100},"4"),eg=V({h:101,i:101},"5"),fg=V({h:102,i:102},"6"),gg=V({h:103,i:103},"7"),hg=V({h:104,i:104},"8"),ig=V({h:105,i:105},"9"),jg=V({h:106,i:106},"*"),kg=V({h:107,i:107},"+"),lg=V({h:109,i:109},"-"),mg=V({h:110,i:110},"."),ng=V({h:111,i:111},"/");V(144); -var og=V(112),pg=V(113),qg=V(114),rg=V(115),sg=V(116),tg=V(117),ug=V(118),vg=V(119),wg=V(120),xg=V(121),yg=V(122),zg=V(123),Ag=V({h:107,i:187},"=","+"),Bg=V(108,",");V({h:109,i:189},"-","_");V(188,",","<");V(190,".",">");V(191,"/","?");V(192,"`","~");V(219,"[","{");V(220,"\\","|");V(221,"]","}");var Cg=V({h:59,i:186},";",":");V(222,"'",'"');var Dg=[Jf,If,Xf,W],Eg=new tf;uf(Eg,1,W);uf(Eg,2,If);uf(Eg,4,Jf);uf(Eg,8,Xf);var Fg=function(a){var b=new tf;r(vf(a),function(c){uf(b,a.get(c).code,c)});return b}(Eg); -function Cf(a,b,c){if(Ba(Dg,b)){var d=Fg.get(b.code),e=a.o;e.a=c?e.a|d:e.a&~d}c?uf(a.g.a,Af(b),b):(a=a.g.a,b=Af(b),xf(a.b,b)&&(delete a.b[b],a.f--,a.c++,a.a.length>2*a.f&&wf(a)))}var Gg=x?"\r\n":"\n";function X(a,b){return a.g.contains(b)} -function Hg(a,b){if(Ba(Dg,b)&&X(a,b))throw new t(13,"Cannot press a modifier key that is already pressed.");var c=null!==b.code&&Ig(a,df,b);if((c||z)&&(!Jg(b)||Ig(a,Ve,b,!c))&&c&&(Kg(a,b),a.c))if(b.a){if(!Lg){var c=Mg(a,b),d=pf(a.a,!0)[0]+1;Ng(a.a)?(sf(a.a,c),lf(a.a,d)):a.a.value+=c;B&&T(a.a,bf);sd||T(a.a,af);a.f=d}}else switch(b){case Hf:Lg||(B&&T(a.a,bf),Q(a.a,"TEXTAREA")&&(c=pf(a.a,!0)[0]+Gg.length,Ng(a.a)?(sf(a.a,Gg),lf(a.a,c)):a.a.value+=Gg,x||T(a.a,af),a.f=c));break;case Ff:case Wf:Lg||(Og(a.a), -c=pf(a.a,!1),c[0]==c[1]&&(b==Ff?(lf(a.a,c[1]-1),qf(a.a,c[1])):qf(a.a,c[1]+1)),c=pf(a.a,!1),c=!(c[0]==a.a.value.length||0==c[1]),sf(a.a,""),(!x&&c||z&&b==Ff)&&T(a.a,af),c=pf(a.a,!1),a.f=c[1]);break;case Rf:case Tf:Og(a.a);var c=a.a,e=pf(c,!0)[0],f=pf(c,!1)[1],g=d=0;b==Rf?X(a,W)?a.f==e?(d=Math.max(e-1,0),g=f,e=d):(d=e,e=g=f-1):e=e==f?Math.max(e-1,0):e:X(a,W)?a.f==f?(d=e,e=g=Math.min(f+1,c.value.length)):(d=e+1,g=f,e=d):e=e==f?Math.min(f+1,c.value.length):f;X(a,W)?(lf(c,d),qf(c,g)):rf(c,e);a.f=e;break; -case Qf:case Pf:Og(a.a),c=a.a,d=pf(c,!0)[0],g=pf(c,!1)[1],b==Qf?(X(a,W)?(lf(c,0),qf(c,a.f==d?g:d)):rf(c,0),a.f=0):(X(a,W)?(a.f==d&&lf(c,g),qf(c,c.value.length)):rf(c,c.value.length),a.f=c.value.length)}Cf(a,b,!0)}function Jg(a){if(a.a||a==Hf)return!0;if(B||Xa)return!1;if(x)return a==Lf;switch(a){case W:case If:case Jf:return!1;case Xf:case Yf:case Zf:return z;default:return!0}} -function Kg(a,b){if(b==Hf&&!z&&Q(a.a,"INPUT")){var c=wb(a.a,Ke,!0);if(c){var d=c.getElementsByTagName("input");(ya(d,function(a){return He(a)})||1==d.length||B&&!jd(534))&&Le(c)}}}function Pg(a,b){if(!X(a,b))throw new t(13,"Cannot release a key that is not pressed. ("+b.code+")");null===b.code||Ig(a,ef,b);Cf(a,b,!1)}function Mg(a,b){if(!b.a)throw new t(13,"not a character key");return X(a,W)?b.b:b.a}var Lg=z&&!jd(12); -function Og(a){try{a.selectionStart}catch(b){if(-1!=b.message.indexOf("does not support selection."))throw Error(b.message+" (For more information, see https://code.google.com/p/chromium/issues/detail?id=330456)");throw b;}}function Ng(a){try{Og(a)}catch(b){return!1}return!0} -function Ig(a,b,c,d){if(null===c.code)throw new t(13,"Key must have a keycode to be fired.");c={altKey:X(a,Jf),ctrlKey:X(a,If),metaKey:X(a,Xf),shiftKey:X(a,W),keyCode:c.code,charCode:c.a&&b==Ve?Mg(a,c).charCodeAt(0):0,preventDefault:!!d};return T(a.a,b,c)}function Qg(a,b){oe(a,b);a.c=Pd(b);var c=Fe(a);a.c&&c&&(rf(b,b.value.length),a.f=b.value.length)};function Rg(a,b){ne.call(this,b);this.g=this.f=null;this.c=new ib(0,0);this.G=this.w=!1;if(a){ea(a.buttonPressed)&&(this.f=a.buttonPressed);try{Q(a.elementPressed)&&(this.g=a.elementPressed)}catch(c){this.f=null}this.c=new ib(a.clientXY.x,a.clientXY.y);this.w=!!a.nextClickIsDoubleClick;this.G=!!a.hasEverInteracted;try{a.element&&Q(a.element)&&oe(this,a.element)}catch(c){this.f=null}}}p(Rg,ne);var Y={}; -sd?(Y[te]=[0,0,0,null],Y[Be]=[null,null,0,null],Y[Ee]=[1,4,2,null],Y[se]=[0,0,0,0],Y[Ce]=[1,4,2,0]):B||rd?(Y[te]=[0,1,2,null],Y[Be]=[null,null,2,null],Y[Ee]=[0,1,2,null],Y[se]=[0,1,2,0],Y[Ce]=[0,1,2,0]):(Y[te]=[0,1,2,null],Y[Be]=[null,null,2,null],Y[Ee]=[0,1,2,null],Y[se]=[0,0,0,0],Y[Ce]=[0,0,0,0]);td&&(Y[Ae]=Y[Ee],Y[kf]=Y[Ee],Y[De]=[-1,-1,-1,-1],Y[ze]=Y[De],Y[ye]=Y[De]);Y[cf]=Y[te];Y[ue]=Y[Ee];Y[re]=Y[se];var Sg={};Sg[ue]=Ae;Sg[Ce]=De;Sg[se]=ze;Sg[re]=ye;Sg[Ee]=kf; -function Tg(a,b,c,d,e,f){a.G=!0;if(td){var g=Sg[b];if(g&&!xe(a,g,a.c,Ug(a,g),!0,c,e))return!1}return qe(a,b,a.c,Ug(a,b),c,d,e,null,f)}function Ug(a,b){if(!(b in Y))return 0;var c=Y[b][null===a.f?3:a.f];if(null===c)throw new t(13,"Event does not permit the specified mouse button.");return c};function Vg(a,b){this.x=a;this.y=b}p(Vg,ib);Vg.prototype.clone=function(){return new Vg(this.x,this.y)};Vg.prototype.scale=ib.prototype.scale;Vg.prototype.rotate=function(a){var b=Math.cos(a);a=Math.sin(a);var c=this.y*b+this.x*a;this.x=this.x*b-this.y*a;this.y=c;return this};function Wg(a,b,c,d){function e(a){m(a)?r(a.split(""),function(a){if(1!=a.length)throw new t(13,"Argument not a single character: "+a);var b=Df[a];b||(b=a.toUpperCase(),b=V(b.charCodeAt(0),a.toLowerCase(),b),b={key:b,shift:a!=b.a});a=b;b=X(f,W);a.shift&&!b&&Hg(f,W);Hg(f,a.key);Pg(f,a.key);a.shift&&!b&&Pg(f,W)}):Ba(Dg,a)?X(f,a)?Pg(f,a):Hg(f,a):(Hg(f,a),Pg(f,a))}if(a!=Bd(a)){if(!Cd(a))throw new t(12,"Element is not currently interactable and may not be manipulated");Xg(a)}var f=c||new Bf;Qg(f,a);if((!Eb|| -Ya)&&B&&"date"==a.type){c="array"==ca(b)?b=b.join(""):b;var g=/\d{4}-\d{2}-\d{2}/;if(c.match(g)){Ya&&Eb&&(T(a,gf),T(a,ff));T(a,$e);a.value=c.match(g)[0];T(a,Ze);T(a,Ye);return}}"array"==ca(b)?r(b,e):e(b);d||r(Dg,function(a){X(f,a)&&Pg(f,a)})} -function Yg(a,b,c,d){if(!Dd(a,!0))throw new t(11,"Element is not currently visible and may not be manipulated");Xg(a,b||void 0);b?b=new Vg(b.x,b.y):(b=Zg(a),b=new Vg(b.width/2,b.height/2));c=c||new Rg;var e=b;b=Cd(a);var f=Sd(a);c.c.x=e.x+f.left;c.c.y=e.y+f.top;e=c.a;if(a!=e){try{nb(C(e)).closed&&(e=null)}catch(S){e=null}e&&(f=e===oa.document.documentElement||e===oa.document.body,e=!c.G&&f?null:e,Tg(c,se,a));oe(c,a);x||Tg(c,re,e,null,b)}Tg(c,Ce,null,null,b);x&&a!=e&&Tg(c,re,e,null,b);c.w=!1;if(null!== -c.f)throw new t(13,"Cannot press more then one button or an already pressed button.");c.f=0;c.g=c.a;var g;a=z&&!ld(4);(B||a)&&(Q(c.a,"OPTION")||Q(c.a,"SELECT"))?g=!0:((a=z||x)&&(g=Bd(c.a)),g=(b=Tg(c,ue,null,null,!1,void 0))&&a&&g!=Bd(c.a)?!1:b);g&&(td&&0==c.f&&Q(c.g,"OPTION")&&xe(c,hf,c.c,0,!0),Fe(c));if(null===c.f)throw new t(13,"Cannot release a button when no button is pressed.");c.b&&Cd(c.a)&&(g=c.b,a=Gd(c.a),!a||g.multiple)&&(c.a.selected=!a,(!B||!g.multiple||Db&&ld(28)||Cb&&ld(4))&&T(g,Ze)); -g=Cd(c.a);Tg(c,Ee,null,null,d,void 0);try{if(0==c.f&&c.a==c.g){if(!ud||!Q(c.g,"OPTION")){var h=c.c,n=Ug(c,te);if(g||Cd(c.a)){a=d=null;if(!Ge)for(var q=c.a;q;q=q.parentNode)if(Q(q,"A")){d=q;break}else if(He(q)){a=q;break}var u=!c.b&&Fd(c.a),A=u&&Gd(c.a);if(x&&a)a.click();else if(qe(c,te,h,n,null,0,g,void 0))if(d&&Ie(d)){var h=d,y=h.href,I=nb(C(h));x&&!jd(8)&&(y=Je(I.location,y));h.target?I.open(y,h.target):I.location.href=y}else!u||z||B||A&&"radio"==c.a.type.toLowerCase()||(c.a.checked=!A)}}c.w&&Tg(c, -cf);c.w=!c.w;td&&0==c.f&&Q(c.g,"OPTION")&&xe(c,jf,new ib(0,0),0,!1)}else 2==c.f&&Tg(c,Be)}catch(S){}ve={};c.f=null;c.g=null}function Zg(a){var b;if("none"!=(wd(a,"display")||(a.currentStyle?a.currentStyle.display:null)||a.style&&a.style.display))b=yd(a);else{b=a.style;var c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";var f=yd(a);b.display=c;b.position=e;b.visibility=d;b=f}return 0<b.width&&0<b.height||!a.offsetParent?b:Zg(a.offsetParent)} -function Xg(a,b){if("scroll"==Td(a,b)){if(a.scrollIntoView&&(a.scrollIntoView(),"none"==Td(a,b)))return;for(var c=Xd(a,b),d=Od(a);d;d=Od(d)){var e=d,f=Sd(e),g;var h=e;if(x&&!fb(9)){var n=Ad(h,"borderLeft");g=Ad(h,"borderRight");var q=Ad(h,"borderTop"),h=Ad(h,"borderBottom");g=new vd(q,g,h,n)}else n=wd(h,"borderLeftWidth"),g=wd(h,"borderRightWidth"),q=wd(h,"borderTopWidth"),h=wd(h,"borderBottomWidth"),g=new vd(parseFloat(q),parseFloat(g),parseFloat(h),parseFloat(n));n=c.left-f.left-g.left;f=c.top- -f.top-g.top;g=e.clientHeight+c.top-c.bottom;e.scrollLeft+=Math.min(n,Math.max(n-(e.clientWidth+c.left-c.right),0));e.scrollTop+=Math.min(f,Math.max(f-g,0))}Td(a,b)}};function Z(a,b,c,d){function e(){return{M:f,keys:[]}}var f=!!d,g=[],h=e();g.push(h);r(b,function(a){r(a.split(""),function(a){if("\ue000"<=a&&"\ue03d">=a){var b=Z.a[a];if(null===b)g.push(h=e()),f&&(h.M=!1,g.push(h=e()));else if(l(b))h.keys.push(b);else throw Error("Unsupported WebDriver key: \\u"+a.charCodeAt(0).toString(16));}else switch(a){case "\n":h.keys.push(Hf);break;case "\t":h.keys.push(Gf);break;case "\b":h.keys.push(Ff);break;default:h.keys.push(a)}})});r(g,function(b){Wg(a,b.keys,c,b.M)})} -Z.a={};Z.a["\ue000"]=null;Z.a["\ue003"]=Ff;Z.a["\ue004"]=Gf;Z.a["\ue006"]=Hf;Z.a["\ue007"]=Hf;Z.a["\ue008"]=W;Z.a["\ue009"]=If;Z.a["\ue00a"]=Jf;Z.a["\ue00b"]=Kf;Z.a["\ue00c"]=Lf;Z.a["\ue00d"]=Mf;Z.a["\ue00e"]=Nf;Z.a["\ue00f"]=Of;Z.a["\ue010"]=Pf;Z.a["\ue011"]=Qf;Z.a["\ue012"]=Rf;Z.a["\ue013"]=Sf;Z.a["\ue014"]=Tf;Z.a["\ue015"]=Uf;Z.a["\ue016"]=Vf;Z.a["\ue017"]=Wf;Z.a["\ue018"]=Cg;Z.a["\ue019"]=Ag;Z.a["\ue01a"]=$f;Z.a["\ue01b"]=ag;Z.a["\ue01c"]=bg;Z.a["\ue01d"]=cg;Z.a["\ue01e"]=dg;Z.a["\ue01f"]=eg; -Z.a["\ue020"]=fg;Z.a["\ue021"]=gg;Z.a["\ue022"]=hg;Z.a["\ue023"]=ig;Z.a["\ue024"]=jg;Z.a["\ue025"]=kg;Z.a["\ue027"]=lg;Z.a["\ue028"]=mg;Z.a["\ue029"]=ng;Z.a["\ue026"]=Bg;Z.a["\ue031"]=og;Z.a["\ue032"]=pg;Z.a["\ue033"]=qg;Z.a["\ue034"]=rg;Z.a["\ue035"]=sg;Z.a["\ue036"]=tg;Z.a["\ue037"]=ug;Z.a["\ue038"]=vg;Z.a["\ue039"]=wg;Z.a["\ue03a"]=xg;Z.a["\ue03b"]=yg;Z.a["\ue03c"]=zg;Z.a["\ue03d"]=Xf;function $g(){} -function ah(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ca(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),ah(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),bh(d,c),c.push(":"),ah(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":bh(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var ch={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},dh=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function bh(a,b){b.push('"',a.replace(dh,function(a){var b=ch[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),ch[a]=b);return b}),'"')};B||z&&jd(3.5)||x&&jd(8);function eh(a){switch(ca(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return wa(a,eh);case "object":if(Ra(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=fh(a);return b}if(Ra(a,"document"))return b={},b.WINDOW=fh(a),b;if(da(a))return wa(a,eh);a=Oa(a,function(a,b){return ea(b)||m(b)});return Pa(a,eh);default:return null}} -function gh(a,b){return"array"==ca(a)?wa(a,function(a){return gh(a,b)}):ga(a)?"function"==typeof a?a:Ra(a,"ELEMENT")?hh(a.ELEMENT,b):Ra(a,"WINDOW")?hh(a.WINDOW,b):Pa(a,function(a){return gh(a,b)}):a}function ih(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.F=na());b.F||(b.F=na());return b}function fh(a){var b=ih(a.ownerDocument),c=Sa(b,function(b){return b==a});c||(c=":wdc:"+b.F++,b[c]=a);return c} -function hh(a,b){a=decodeURIComponent(a);var c=b||document,d=ih(c);if(!Ra(d,a))throw new t(10,"Element does not exist in cache");var e=d[a];if(Ra(e,"setInterval")){if(e.closed)throw delete d[a],new t(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new t(10,"Element is no longer attached to the DOM");};ba("_",function(a,b){var c=[a],d;try{var e;b?e=hh(b.WINDOW):e=window;var f=gh(c,e.document),g=Yg.apply(null,f);d={status:0,value:eh(g)}}catch(h){d={status:Ra(h,"code")?h.code:13,value:{message:h.message}}}c=[];ah(new $g,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/execute_async_script.js b/src/ghostdriver/third_party/webdriver-atoms/execute_async_script.js deleted file mode 100644 index 94d049f6fd..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/execute_async_script.js +++ /dev/null @@ -1,16 +0,0 @@ -function(){return function(){var e=this; -function g(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"== -b&&"undefined"==typeof a.call)return"object";return b}function aa(a){var b=g(a);return"array"==b||"object"==b&&"number"==typeof a.length}function ba(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function m(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var n=Date.now||function(){return+new Date};function p(a,b){this.code=a;this.b=r[a]||t;this.message=b||"";var c=this.b.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""} -(function(){var a=Error;function b(){}b.prototype=a.prototype;p.c=a.prototype;p.prototype=new b;p.prototype.constructor=p;p.b=function(b,d,h){for(var f=Array(arguments.length-2),k=2;k<arguments.length;k++)f[k-2]=arguments[k];return a.prototype[d].apply(b,f)}})();var t="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=t;r[30]=t;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state";r[32]="invalid selector";r[51]="invalid selector"; -r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=t;r[9]="unknown command";p.prototype.toString=function(){return this.name+": "+this.message};var v=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function w(a,b){for(var c=0,d=v(String(a)).split("."),h=v(String(b)).split("."),f=Math.max(d.length,h.length),k=0;0==c&&k<f;k++){var x=d[k]||"",l=h[k]||"",F=RegExp("(\\d*)(\\D*)","g"),G=RegExp("(\\d*)(\\D*)","g");do{var u=F.exec(x)||["","",""],q=G.exec(l)||["","",""];if(0==u[0].length&&0==q[0].length)break;c=y(0==u[1].length?0:parseInt(u[1],10),0==q[1].length?0:parseInt(q[1],10))||y(0==u[2].length,0==q[2].length)||y(u[2],q[2])}while(0==c)}return c}function y(a,b){return a<b?-1:a>b?1:0};function z(a,b){for(var c=a.length,d=Array(c),h="string"==typeof a?a.split(""):a,f=0;f<c;f++)f in h&&(d[f]=b.call(void 0,h[f],f,a));return d};var A;a:{var B=e.navigator;if(B){var ca=B.userAgent;if(ca){A=ca;break a}}A=""}function C(a){return-1!=A.indexOf(a)};function da(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function ea(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function D(a,b){return null!==a&&b in a}function fa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function E(){return C("Opera")||C("OPR")}function H(){return(C("Chrome")||C("CriOS"))&&!E()&&!C("Edge")};function I(){return C("iPhone")&&!C("iPod")&&!C("iPad")};var ga=E(),J=C("Trident")||C("MSIE"),ha=C("Edge"),K=C("Gecko")&&!(-1!=A.toLowerCase().indexOf("webkit")&&!C("Edge"))&&!(C("Trident")||C("MSIE"))&&!C("Edge"),ia=-1!=A.toLowerCase().indexOf("webkit")&&!C("Edge");function ja(){var a=A;if(K)return/rv\:([^\);]+)(\)|;)/.exec(a);if(ha)return/Edge\/([\d\.]+)/.exec(a);if(J)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(ia)return/WebKit\/(\S+)/.exec(a)}function ka(){var a=e.document;return a?a.documentMode:void 0} -var L=function(){if(ga&&e.opera){var a;var b=e.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=ja())&&(a=b?b[1]:"");return J&&(b=ka(),null!=b&&b>parseFloat(a))?String(b):a}(),M={},la=e.document,ma=la&&J?ka()||("CSS1Compat"==la.compatMode?parseInt(L,10):5):void 0;var na=C("Firefox"),oa=I()||C("iPod"),pa=C("iPad"),N=C("Android")&&!(H()||C("Firefox")||E()||C("Silk")),qa=H(),ra=C("Safari")&&!(H()||C("Coast")||E()||C("Edge")||C("Silk")||C("Android"))&&!(I()||C("iPad")||C("iPod"));function O(a){return(a=a.exec(A))?a[1]:""}var sa=function(){if(na)return O(/Firefox\/([0-9.]+)/);if(J||ha||ga)return L;if(qa)return O(/Chrome\/([0-9.]+)/);if(ra&&!(I()||C("iPad")||C("iPod")))return O(/Version\/([0-9.]+)/);if(oa||pa){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(A))return a[1]+"."+a[2]}else if(N)return(a=O(/Android\s+([0-9.]+)/))?a:O(/Version\/([0-9.]+)/);return""}();var P,ta;function Q(a){R?ta(a):N?w(ua,a):w(sa,a)}var R=function(){if(!K)return!1;var a=e.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,h=b.version;P=function(a){return 0<=c.compare(d,""+a)};ta=function(a){c.compare(h,""+a)};return!0}(),S; -if(N){var va=/Android\s+([0-9\.]+)/.exec(A);S=va?va[1]:"0"}else S="0";var ua=S;N&&Q(2.3);N&&Q(4);ra&&Q(6);function wa(){} -function T(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==g(b)){var d=b;b=d.length;c.push("[");for(var h="",f=0;f<b;f++)c.push(h),T(a,d[f],c),h=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");h="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(h),xa(d,c),c.push(":"),T(a,f,c),h=","));c.push("}");return}}switch(typeof b){case "string":xa(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var ya={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},za=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function xa(a,b){b.push('"',a.replace(za,function(a){var b=ya[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),ya[a]=b);return b}),'"')};ia||K&&(R?P(3.5):J?0<=w(ma,3.5):M[3.5]||(M[3.5]=0<=w(L,3.5)))||J&&(R?P(8):J?w(ma,8):M[8]||(M[8]=0<=w(L,8)));function U(a){switch(g(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return z(a,U);case "object":if(D(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Aa(a);return b}if(D(a,"document"))return b={},b.WINDOW=Aa(a),b;if(aa(a))return z(a,U);a=da(a,function(a,b){return"number"==typeof b||"string"==typeof b});return ea(a,U);default:return null}} -function V(a,b){return"array"==g(a)?z(a,function(a){return V(a,b)}):ba(a)?"function"==typeof a?a:D(a,"ELEMENT")?Ba(a.ELEMENT,b):D(a,"WINDOW")?Ba(a.WINDOW,b):ea(a,function(a){return V(a,b)}):a}function Ca(a,b){if("string"==typeof a)try{return new b.Function(a)}catch(c){if(J&&b.execScript)return b.execScript(";"),new b.Function(a);throw c;}return b==window?a:new b.Function("return ("+a+").apply(null,arguments);")} -function Da(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.a=n());b.a||(b.a=n());return b}function Aa(a){var b=Da(a.ownerDocument),c=fa(b,function(b){return b==a});c||(c=":wdc:"+b.a++,b[c]=a);return c} -function Ba(a,b){a=decodeURIComponent(a);var c=b||document,d=Da(c);if(!D(d,a))throw new p(10,"Element does not exist in cache");var h=d[a];if(D(h,"setInterval")){if(h.closed)throw delete d[a],new p(23,"Window has been closed.");return h}for(var f=h;f;){if(f==c.documentElement)return h;f=f.parentNode}delete d[a];throw new p(10,"Element is no longer attached to the DOM");};function Ea(a,b,c,d,h,f){function k(a,b){if(!G){l.removeEventListener?l.removeEventListener("unload",x,!0):l.detachEvent("onunload",x);l.clearTimeout(F);if(0!=a){var c=new p(a,b.message||b+"");c.stack=b.stack;b={status:D(c,"code")?c.code:13,value:{message:c.message}}}else b={status:0,value:U(b)};h?(c=[],T(new wa,b,c),c=c.join("")):c=b;d(c);G=!0}}function x(){k(13,Error("Detected a page unload event; asynchronous script execution does not work across page loads."))}var l=f||window,F,G=!1;f=m(k,13); -if(l.closed)f("Unable to execute script; the target window is closed.");else{a=Ca(a,l);b=V(b,l.document);b.push(m(k,0));l.addEventListener?l.addEventListener("unload",x,!0):l.attachEvent("onunload",x);var u=n();try{a.apply(l,b),F=l.setTimeout(function(){k(28,Error("Timed out waiting for asyncrhonous script result after "+(n()-u)+" ms"))},Math.max(0,c))}catch(q){k(q.code||13,q)}}}var W=["_"],X=e;W[0]in X||!X.execScript||X.execScript("var "+W[0]); -for(var Y;W.length&&(Y=W.shift());){var Z;if(Z=!W.length)Z=void 0!==Ea;Z?X[Y]=Ea:X[Y]?X=X[Y]:X=X[Y]={}};; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/execute_script.js b/src/ghostdriver/third_party/webdriver-atoms/execute_script.js deleted file mode 100644 index e964f8ef1f..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/execute_script.js +++ /dev/null @@ -1,14 +0,0 @@ -function(){return function(){var e=this; -function h(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"== -b&&"undefined"==typeof a.call)return"object";return b}function aa(a){var b=h(a);return"array"==b||"object"==b&&"number"==typeof a.length}function ba(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var l=Date.now||function(){return+new Date};var ca=window;function m(a,b){this.code=a;this.b=n[a]||p;this.message=b||"";var c=this.b.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""} -(function(){var a=Error;function b(){}b.prototype=a.prototype;m.c=a.prototype;m.prototype=new b;m.prototype.constructor=m;m.b=function(b,d,g){for(var f=Array(arguments.length-2),k=2;k<arguments.length;k++)f[k-2]=arguments[k];return a.prototype[d].apply(b,f)}})();var p="unknown error",n={15:"element not selectable",11:"element not visible"};n[31]=p;n[30]=p;n[24]="invalid cookie domain";n[29]="invalid element coordinates";n[12]="invalid element state";n[32]="invalid selector";n[51]="invalid selector"; -n[52]="invalid selector";n[17]="javascript error";n[405]="unsupported operation";n[34]="move target out of bounds";n[27]="no such alert";n[7]="no such element";n[8]="no such frame";n[23]="no such window";n[28]="script timeout";n[33]="session not created";n[10]="stale element reference";n[21]="timeout";n[25]="unable to set cookie";n[26]="unexpected alert open";n[13]=p;n[9]="unknown command";m.prototype.toString=function(){return this.name+": "+this.message};var q=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function t(a,b){for(var c=0,d=q(String(a)).split("."),g=q(String(b)).split("."),f=Math.max(d.length,g.length),k=0;0==c&&k<f;k++){var H=d[k]||"",r=g[k]||"",ra=RegExp("(\\d*)(\\D*)","g"),sa=RegExp("(\\d*)(\\D*)","g");do{var v=ra.exec(H)||["","",""],w=sa.exec(r)||["","",""];if(0==v[0].length&&0==w[0].length)break;c=u(0==v[1].length?0:parseInt(v[1],10),0==w[1].length?0:parseInt(w[1],10))||u(0==v[2].length,0==w[2].length)||u(v[2],w[2])}while(0==c)}return c}function u(a,b){return a<b?-1:a>b?1:0};function x(a,b){for(var c=a.length,d=Array(c),g="string"==typeof a?a.split(""):a,f=0;f<c;f++)f in g&&(d[f]=b.call(void 0,g[f],f,a));return d};var y;a:{var z=e.navigator;if(z){var A=z.userAgent;if(A){y=A;break a}}y=""}function B(a){return-1!=y.indexOf(a)};function da(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function C(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function D(a,b){return null!==a&&b in a}function ea(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function E(){return B("Opera")||B("OPR")}function F(){return(B("Chrome")||B("CriOS"))&&!E()&&!B("Edge")};function G(){return B("iPhone")&&!B("iPod")&&!B("iPad")};var I=E(),J=B("Trident")||B("MSIE"),fa=B("Edge"),K=B("Gecko")&&!(-1!=y.toLowerCase().indexOf("webkit")&&!B("Edge"))&&!(B("Trident")||B("MSIE"))&&!B("Edge"),ga=-1!=y.toLowerCase().indexOf("webkit")&&!B("Edge");function ha(){var a=y;if(K)return/rv\:([^\);]+)(\)|;)/.exec(a);if(fa)return/Edge\/([\d\.]+)/.exec(a);if(J)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(ga)return/WebKit\/(\S+)/.exec(a)}function ia(){var a=e.document;return a?a.documentMode:void 0} -var L=function(){if(I&&e.opera){var a;var b=e.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=ha())&&(a=b?b[1]:"");return J&&(b=ia(),null!=b&&b>parseFloat(a))?String(b):a}(),M={},ja=e.document,ka=ja&&J?ia()||("CSS1Compat"==ja.compatMode?parseInt(L,10):5):void 0;var la=B("Firefox"),ma=G()||B("iPod"),na=B("iPad"),N=B("Android")&&!(F()||B("Firefox")||E()||B("Silk")),oa=F(),pa=B("Safari")&&!(F()||B("Coast")||E()||B("Edge")||B("Silk")||B("Android"))&&!(G()||B("iPad")||B("iPod"));function O(a){return(a=a.exec(y))?a[1]:""}var qa=function(){if(la)return O(/Firefox\/([0-9.]+)/);if(J||fa||I)return L;if(oa)return O(/Chrome\/([0-9.]+)/);if(pa&&!(G()||B("iPad")||B("iPod")))return O(/Version\/([0-9.]+)/);if(ma||na){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(y))return a[1]+"."+a[2]}else if(N)return(a=O(/Android\s+([0-9.]+)/))?a:O(/Version\/([0-9.]+)/);return""}();var P,ta;function Q(a){R?ta(a):N?t(ua,a):t(qa,a)}var R=function(){if(!K)return!1;var a=e.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,g=b.version;P=function(a){return 0<=c.compare(d,""+a)};ta=function(a){c.compare(g,""+a)};return!0}(),S; -if(N){var va=/Android\s+([0-9\.]+)/.exec(y);S=va?va[1]:"0"}else S="0";var ua=S;N&&Q(2.3);N&&Q(4);pa&&Q(6);function wa(){} -function T(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==h(b)){var d=b;b=d.length;c.push("[");for(var g="",f=0;f<b;f++)c.push(g),T(a,d[f],c),g=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");g="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(g),xa(d,c),c.push(":"),T(a,f,c),g=","));c.push("}");return}}switch(typeof b){case "string":xa(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var ya={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},za=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function xa(a,b){b.push('"',a.replace(za,function(a){var b=ya[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),ya[a]=b);return b}),'"')};ga||K&&(R?P(3.5):J?0<=t(ka,3.5):M[3.5]||(M[3.5]=0<=t(L,3.5)))||J&&(R?P(8):J?t(ka,8):M[8]||(M[8]=0<=t(L,8)));function U(a){switch(h(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return x(a,U);case "object":if(D(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Aa(a);return b}if(D(a,"document"))return b={},b.WINDOW=Aa(a),b;if(aa(a))return x(a,U);a=da(a,function(a,b){return"number"==typeof b||"string"==typeof b});return C(a,U);default:return null}} -function V(a,b){return"array"==h(a)?x(a,function(a){return V(a,b)}):ba(a)?"function"==typeof a?a:D(a,"ELEMENT")?Ba(a.ELEMENT,b):D(a,"WINDOW")?Ba(a.WINDOW,b):C(a,function(a){return V(a,b)}):a}function Ca(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.a=l());b.a||(b.a=l());return b}function Aa(a){var b=Ca(a.ownerDocument),c=ea(b,function(b){return b==a});c||(c=":wdc:"+b.a++,b[c]=a);return c} -function Ba(a,b){a=decodeURIComponent(a);var c=b||document,d=Ca(c);if(!D(d,a))throw new m(10,"Element does not exist in cache");var g=d[a];if(D(g,"setInterval")){if(g.closed)throw delete d[a],new m(23,"Window has been closed.");return g}for(var f=g;f;){if(f==c.documentElement)return g;f=f.parentNode}delete d[a];throw new m(10,"Element is no longer attached to the DOM");};function Da(a,b,c,d){d=d||ca;var g;try{a:{var f=a;if("string"==typeof f)try{a=new d.Function(f);break a}catch(r){if(J&&d.execScript){d.execScript(";");a=new d.Function(f);break a}throw r;}a=d==window?f:new d.Function("return ("+f+").apply(null,arguments);")}var k=V(b,d.document),H=a.apply(null,k);g={status:0,value:U(H)}}catch(r){g={status:D(r,"code")?r.code:13,value:{message:r.message}}}c&&(a=[],T(new wa,g,a),g=a.join(""));return g}var W=["_"],X=e;W[0]in X||!X.execScript||X.execScript("var "+W[0]); -for(var Y;W.length&&(Y=W.shift());){var Z;if(Z=!W.length)Z=void 0!==Da;Z?X[Y]=Da:X[Y]?X=X[Y]:X=X[Y]={}};; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/find_element.js b/src/ghostdriver/third_party/webdriver-atoms/find_element.js deleted file mode 100644 index b96c905e75..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/find_element.js +++ /dev/null @@ -1,118 +0,0 @@ -function(){return function(){var l=this;function aa(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&aa(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){return"function"==ca(a)}function fa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ga(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function q(a,b){function c(){}c.prototype=b.prototype;a.R=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.P=function(a,c,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[c].apply(a,g)}};var la=window;function t(a,b){this.code=a;this.a=u[a]||ma;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}q(t,Error);var ma="unknown error",u={15:"element not selectable",11:"element not visible"};u[31]=ma;u[30]=ma;u[24]="invalid cookie domain";u[29]="invalid element coordinates";u[12]="invalid element state"; -u[32]="invalid selector";u[51]="invalid selector";u[52]="invalid selector";u[17]="javascript error";u[405]="unsupported operation";u[34]="move target out of bounds";u[27]="no such alert";u[7]="no such element";u[8]="no such frame";u[23]="no such window";u[28]="script timeout";u[33]="session not created";u[10]="stale element reference";u[21]="timeout";u[25]="unable to set cookie";u[26]="unexpected alert open";u[13]=ma;u[9]="unknown command";t.prototype.toString=function(){return this.name+": "+this.message};var na;function oa(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var pa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function qa(a,b){for(var c=0,d=pa(String(a)).split("."),e=pa(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var h=d[g]||"",n=e[g]||"",p=RegExp("(\\d*)(\\D*)","g"),k=RegExp("(\\d*)(\\D*)","g");do{var r=p.exec(h)||["","",""],y=k.exec(n)||["","",""];if(0==r[0].length&&0==y[0].length)break;c=ra(0==r[1].length?0:parseInt(r[1],10),0==y[1].length?0:parseInt(y[1],10))||ra(0==r[2].length,0==y[2].length)||ra(r[2],y[2])}while(0==c)}return c}function ra(a,b){return a<b?-1:a>b?1:0} -function sa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function ta(a,b){if(m(a))return m(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function v(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ua(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d} -function va(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function wa(a,b,c){var d=c;v(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function xa(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ya(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0} -function za(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function Ba(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function Ca(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var w;a:{var Da=l.navigator;if(Da){var Ea=Da.userAgent;if(Ea){w=Ea;break a}}w=""}function x(a){return-1!=w.indexOf(a)};function Fa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ga(a){var b=Ha,c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ia(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ja(){return x("Opera")||x("OPR")}function Ka(){return(x("Chrome")||x("CriOS"))&&!Ja()&&!x("Edge")};function La(){return x("iPhone")&&!x("iPod")&&!x("iPad")};var Ma=Ja(),z=x("Trident")||x("MSIE"),Na=x("Edge"),Oa=x("Gecko")&&!(-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),Pa=-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge");function Qa(){var a=w;if(Oa)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Na)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Pa)return/WebKit\/(\S+)/.exec(a)}function Ra(){var a=l.document;return a?a.documentMode:void 0} -var Sa=function(){if(Ma&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Qa())&&(a=b?b[1]:"");return z&&(b=Ra(),null!=b&&b>parseFloat(a))?String(b):a}(),Ta={};function Ua(a){return Ta[a]||(Ta[a]=0<=qa(Sa,a))}var Va=l.document,Wa=Va&&z?Ra()||("CSS1Compat"==Va.compatMode?parseInt(Sa,10):5):void 0;!Oa&&!z||z&&9<=Number(Wa)||Oa&&Ua("1.9.1");z&&Ua("9");function A(a,b){this.x=aa(a)?a:0;this.y=aa(b)?b:0}A.prototype.clone=function(){return new A(this.x,this.y)};A.prototype.toString=function(){return"("+this.x+", "+this.y+")"};A.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};A.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};A.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Xa(a,b){this.width=a;this.height=b}Xa.prototype.clone=function(){return new Xa(this.width,this.height)};Xa.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};Xa.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Xa.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this}; -Xa.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Ya(a){return a?new Za(B(a)):na||(na=new Za)}function $a(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function ab(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function bb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(z&&!(9<=Number(Wa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?cb(a,b):!c&&ab(e,b)?-1*db(a,b):!d&&ab(f,a)?db(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=B(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function db(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return cb(d,a)}function cb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function B(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function eb(a,b){a=a.parentNode;for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null} -function Za(a){this.a=a||l.document||document} -function fb(a,b,c,d){a=d||a.a;var e=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(e||c))c=a.querySelectorAll(e+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(b=a.getElementsByClassName(c),e){a={};for(var f=d=0,g;g=b[f];f++)e==g.nodeName&&(a[d++]=g);a.length=d;c=a}else c=b;else if(b=a.getElementsByTagName(e||"*"),c){a={};for(f=d=0;g=b[f];f++){var e=g.className,h;if(h="function"==typeof e.split)h=0<=ta(e.split(/\s+/),c);h&&(a[d++]=g)}a.length=d;c=a}else c=b;return c};var gb={w:function(a){return!(!a.querySelectorAll||!a.querySelector)},o:function(a,b){if(!a)throw new t(32,"No class name specified");a=pa(a);if(-1!==a.indexOf(" "))throw new t(32,"Compound class names not permitted");if(gb.w(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(d){throw new t(32,"An invalid or illegal class name was specified");}var c=fb(Ya(b),"*",a,b);return c.length?c[0]:null},s:function(a,b){if(!a)throw new t(32,"No class name specified");a=pa(a);if(-1!==a.indexOf(" "))throw new t(32, -"Compound class names not permitted");if(gb.w(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new t(32,"An invalid or illegal class name was specified");}return fb(Ya(b),"*",a,b)}};var hb=x("Firefox"),ib=La()||x("iPod"),jb=x("iPad"),kb=x("Android")&&!(Ka()||x("Firefox")||Ja()||x("Silk")),lb=Ka(),mb=x("Safari")&&!(Ka()||x("Coast")||Ja()||x("Edge")||x("Silk")||x("Android"))&&!(La()||x("iPad")||x("iPod"));function nb(a){return(a=a.exec(w))?a[1]:""}var ob=function(){if(hb)return nb(/Firefox\/([0-9.]+)/);if(z||Na||Ma)return Sa;if(lb)return nb(/Chrome\/([0-9.]+)/);if(mb&&!(La()||x("iPad")||x("iPod")))return nb(/Version\/([0-9.]+)/);if(ib||jb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w))return a[1]+"."+a[2]}else if(kb)return(a=nb(/Android\s+([0-9.]+)/))?a:nb(/Version\/([0-9.]+)/);return""}();var pb,qb;function rb(a){return sb?pb(a):z?0<=qa(Wa,a):Ua(a)}function tb(a){sb?qb(a):kb?qa(ub,a):qa(ob,a)} -var sb=function(){if(!Oa)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;pb=function(a){return 0<=c.compare(d,""+a)};qb=function(a){c.compare(e,""+a)};return!0}(),vb;if(kb){var wb=/Android\s+([0-9\.]+)/.exec(w);vb=wb?wb[1]:"0"}else vb="0"; -var ub=vb,xb=z&&!(8<=Number(Wa)),yb=z&&!(9<=Number(Wa));kb&&tb(2.3);kb&&tb(4);mb&&tb(6);var zb={o:function(a,b){if(!ea(b.querySelector)&&z&&rb(8)&&!fa(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=pa(a);var c;try{c=b.querySelector(a)}catch(d){throw new t(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},s:function(a,b){if(!ea(b.querySelectorAll)&&z&&rb(8)&&!fa(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=pa(a);try{return b.querySelectorAll(a)}catch(c){throw new t(32, -"An invalid or illegal selector was specified");}}};var Ab={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Bb="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Cb=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Db=/^#(?:[0-9a-f]{3}){1,2}$/i,Eb=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Fb=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Gb(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var C=z&&!(9<=Number(Wa)),Hb=z&&!(8<=Number(Wa));function Ib(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Jb(a,b){var c=Hb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Ib(b,a,b.nodeName,c)};function Kb(a){this.b=a;this.a=0}function Lb(a){a=a.match(Mb);for(var b=0;b<a.length;b++)Nb.test(a[b])&&a.splice(b,1);return new Kb(a)}var Mb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Nb=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function Ob(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(C&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),C&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function Pb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Hb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Qb(a,b,c,d,e){return(C?Rb:Sb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new G)} -function Rb(a,b,c,d,e){if(a instanceof Tb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Ub(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)Pb(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||H(e,b);return e}Vb(a,b,c,d,e);return e} -function Sb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!z?(b=b.getElementsByName(d),v(b,function(b){a.a(b)&&H(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),v(b,function(b){b.className==d&&a.a(b)&&H(e,b)})):a instanceof I?Vb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),v(b,function(a){Pb(a,c,d)&&H(e,a)}));return e} -function Wb(a,b,c,d,e){var f;if((a instanceof Tb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ub(a);if("*"!=g&&(f=ua(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ua(f,function(a){return Pb(a,c,d)}));v(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||H(e,a)});return e}return Xb(a,b,c,d,e)}function Xb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&H(e,b);return e} -function Vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&H(e,b),Vb(a,b,c,d,e)}function Ub(a){if(a instanceof I){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function G(){this.b=this.a=null;this.l=0}function Yb(a){this.node=a;this.a=this.b=null}function Zb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,h=d.node;f==h||f instanceof Ib&&h instanceof Ib&&f.a==h.a?(f=c,c=c.a,d=d.a):0<bb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a} -G.prototype.unshift=function(a){a=new Yb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++};function H(a,b){var c=new Yb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function $b(a){return(a=a.a)?a.node:null}function ac(a){return(a=$b(a))?F(a):""}function bc(a,b){return new cc(a,!!b)}function cc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function J(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function K(a){this.i=a;this.b=this.g=!1;this.f=null}function L(a){return"\n "+a.toString().split("\n").join("\n ")}function dc(a,b){a.g=b}function ec(a,b){a.b=b}function M(a,b){var c=a.a(b);return c instanceof G?+ac(c):+c}function O(a,b){var c=a.a(b);return c instanceof G?ac(c):""+c}function fc(a,b){var c=a.a(b);return c instanceof G?!!c.l:!!c};function gc(a,b,c){K.call(this,a.i);this.c=a;this.h=b;this.u=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==hc&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,v:b}):this.f={name:b.f.name,v:c})}q(gc,K); -function ic(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=bc(b);for(d=J(b);d;d=J(b))for(e=bc(c),f=J(e);f;f=J(e))if(a(F(d),F(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=bc(e);for(var g=typeof d,h=J(f);h;h=J(f)){switch(g){case "number":h=+F(h);break;case "boolean":h=!!F(h);break;case "string":h=F(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}gc.prototype.a=function(a){return this.c.m(this.h,this.u,a)};gc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+L(this.h);return a+=L(this.u)};function jc(a,b,c,d){this.a=a;this.I=b;this.i=c;this.m=d}jc.prototype.toString=function(){return this.a};var kc={}; -function P(a,b,c,d){if(kc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new jc(a,b,c,d);return kc[a.toString()]=a}P("div",6,1,function(a,b,c){return M(a,c)/M(b,c)});P("mod",6,1,function(a,b,c){return M(a,c)%M(b,c)});P("*",6,1,function(a,b,c){return M(a,c)*M(b,c)});P("+",5,1,function(a,b,c){return M(a,c)+M(b,c)});P("-",5,1,function(a,b,c){return M(a,c)-M(b,c)});P("<",4,2,function(a,b,c){return ic(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return ic(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return ic(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return ic(function(a,b){return a>=b},a,b,c)});var hc=P("=",3,2,function(a,b,c){return ic(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return ic(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return fc(a,c)&&fc(b,c)});P("or",1,2,function(a,b,c){return fc(a,c)||fc(b,c)});function lc(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}q(lc,K);lc.prototype.a=function(a){a=this.c.a(a);return mc(this.h,a)};lc.prototype.toString=function(){var a;a="Filter:"+L(this.c);return a+=L(this.h)};function nc(a,b){if(b.length<a.J)throw Error("Function "+a.j+" expects at least"+a.J+" arguments, "+b.length+" given");if(null!==a.C&&b.length>a.C)throw Error("Function "+a.j+" expects at most "+a.C+" arguments, "+b.length+" given");a.O&&v(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});K.call(this,a.i);this.h=a;this.c=b;dc(this,a.g||xa(b,function(a){return a.g}));ec(this,a.N&&!b.length||a.M&&!!b.length||xa(b,function(a){return a.b}))} -q(nc,K);nc.prototype.a=function(a){return this.h.m.apply(null,Ba(a,this.c))};nc.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=wa(this.c,function(a,b){return a+L(b)},"Arguments:"),a=a+L(b);return a};function oc(a,b,c,d,e,f,g,h,n){this.j=a;this.i=b;this.g=c;this.N=d;this.M=e;this.m=f;this.J=g;this.C=aa(h)?h:g;this.O=!!n}oc.prototype.toString=function(){return this.j};var pc={}; -function Q(a,b,c,d,e,f,g,h){if(pc.hasOwnProperty(a))throw Error("Function already created: "+a+".");pc[a]=new oc(a,b,c,d,!1,e,f,g,h)}Q("boolean",2,!1,!1,function(a,b){return fc(b,a)},1);Q("ceiling",1,!1,!1,function(a,b){return Math.ceil(M(b,a))},1);Q("concat",3,!1,!1,function(a,b){return wa(Ca(arguments,1),function(b,d){return b+O(d,a)},"")},2,null);Q("contains",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return-1!=b.indexOf(a)},2);Q("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); -Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){return Math.floor(M(b,a))},1);Q("id",4,!1,!1,function(a,b){function c(a){if(C){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return za(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=O(b,a).split(/\s+/),f=[];v(d,function(a){a=c(a);!a||0<=ta(f,a)||f.push(a)});f.sort(bb);var g=new G;v(f,function(a){H(g,a)});return g},1); -Q("lang",2,!1,!1,function(){return!1},1);Q("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);Q("local-name",3,!1,!0,function(a,b){var c=b?$b(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);Q("name",3,!1,!0,function(a,b){var c=b?$b(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);Q("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -Q("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);Q("not",2,!1,!1,function(a,b){return!fc(b,a)},1);Q("number",1,!1,!0,function(a,b){return b?M(b,a):+F(a.a)},0,1);Q("position",1,!0,!1,function(a){return a.b},0);Q("round",1,!1,!1,function(a,b){return Math.round(M(b,a))},1);Q("starts-with",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return 0==b.lastIndexOf(a,0)},2);Q("string",3,!1,!0,function(a,b){return b?O(b,a):F(a.a)},0,1); -Q("string-length",1,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).length},0,1);Q("substring",3,!1,!1,function(a,b,c,d){c=M(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?M(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=O(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);Q("substring-after",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -Q("substring-before",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);Q("sum",1,!1,!1,function(a,b){for(var c=bc(b.a(a)),d=0,e=J(c);e;e=J(c))d+=+F(e);return d},1,1,!0);Q("translate",3,!1,!1,function(a,b,c,d){b=O(b,a);c=O(c,a);var e=O(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);Q("true",2,!1,!1,function(){return!0},0);function I(a,b){this.h=a;this.c=aa(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function qc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}I.prototype.a=function(a){return null===this.b||this.b==a.nodeType};I.prototype.f=function(){return this.h}; -I.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=L(this.c));return a};function rc(a){K.call(this,3);this.c=a.substring(1,a.length-1)}q(rc,K);rc.prototype.a=function(){return this.c};rc.prototype.toString=function(){return"Literal: "+this.c};function Tb(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Tb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Tb.prototype.f=function(){return this.j};Tb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function sc(a){K.call(this,1);this.c=a}q(sc,K);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Number: "+this.c};function tc(a,b){K.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.A||c.c!=uc||(c=c.u,"*"!=c.f()&&(this.f={name:c.f(),v:null}))}}q(tc,K);function vc(){K.call(this,4)}q(vc,K);vc.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?H(b,a):H(b,a.ownerDocument);return b};vc.prototype.toString=function(){return"Root Helper Expression"};function wc(){K.call(this,4)}q(wc,K);wc.prototype.a=function(a){var b=new G;H(b,a.a);return b};wc.prototype.toString=function(){return"Context Helper Expression"}; -function xc(a){return"/"==a||"//"==a}tc.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=bc(b,e.c.a),g;if(e.g||e.c!=yc)if(e.g||e.c!=zc)for(g=J(f),b=e.a(new Gb(g));null!=(g=J(f));)g=e.a(new Gb(g)),b=Zb(b,g);else g=J(f),b=e.a(new Gb(g));else{for(g=J(f);(b=J(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Gb(g))}}return b}; -tc.prototype.toString=function(){var a;a="Path Expression:"+L(this.h);if(this.c.length){var b=wa(this.c,function(a,b){return a+L(b)},"Steps:");a+=L(b)}return a};function Ac(a,b){this.a=a;this.b=!!b} -function mc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=bc(b),f=b.l,g,h=0;g=J(e);h++){var n=a.b?f-h:h+1;g=d.a(new Gb(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof G)n=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var p=n.a;if(!p)throw Error("Next must be called at least once before remove.");var k=p.b,p=p.a;k?k.a=p:g.a=p;p?p.b=k:g.b=k;g.l--;n.a=null}}return b} -Ac.prototype.toString=function(){return wa(this.a,function(a,b){return a+L(b)},"Predicates:")};function Bc(a,b,c,d){K.call(this,4);this.c=a;this.u=b;this.h=c||new Ac([]);this.A=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=C?a.toLowerCase():a,this.f={name:a,v:b.v});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}q(Bc,K); -Bc.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.v?O(c.v,a):null,f=1);if(this.A)if(this.g||this.c!=Cc)if(a=bc((new Bc(Dc,new I("node"))).a(a)),b=J(a))for(c=this.m(b,d,e,f);null!=(b=J(a));)c=Zb(c,this.m(b,d,e,f));else c=new G;else c=Qb(this.u,b,d,e),c=mc(this.h,c,f);else c=this.m(a.a,d,e,f);return c};Bc.prototype.m=function(a,b,c,d){a=this.c.f(this.u,a,b,c);return a=mc(this.h,a,d)}; -Bc.prototype.toString=function(){var a;a="Step:"+L("Operator: "+(this.A?"//":"/"));this.c.j&&(a+=L("Axis: "+this.c));a+=L(this.u);if(this.h.a.length){var b=wa(this.h.a,function(a,b){return a+L(b)},"Predicates:");a+=L(b)}return a};function Ec(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Ec.prototype.toString=function(){return this.j};var Fc={};function R(a,b,c,d){if(Fc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Ec(a,b,c,!!d);return Fc[a]=b} -R("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);R("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var uc=R("attribute",function(a,b){var c=new G,d=a.f();if("style"==d&&b.style&&C)return H(c,new Ib(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof I&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C?f.nodeValue&&H(c,Jb(b,f)):H(c,f);else(f=e.getNamedItem(d))&&(C?f.nodeValue&&H(c,Jb(b,f)):H(c,f));return c},!1),Cc=R("child",function(a,b,c,d,e){return(C?Wb:Xb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new G)},!1,!0);R("descendant",Qb,!1,!0); -var Dc=R("descendant-or-self",function(a,b,c,d){var e=new G;Pb(b,c,d)&&a.a(b)&&H(e,b);return Qb(a,b,c,d,e)},!1,!0),yc=R("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)Pb(f,c,d)&&a.a(f)&&H(e,f),e=Qb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&H(c,d);return c},!1);R("namespace",function(){return new G},!1); -var Gc=R("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return H(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&H(c,d);return c},!1),zc=R("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var p=0,k=n.length;p<k;p++)b=n[p],Pb(b,c,d)&&a.a(b)&&H(e,b),e=Qb(a,b,c,d,e)}return e},!0,!0); -R("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Hc=R("self",function(a,b){var c=new G;a.a(b)&&H(c,b);return c},!1);function Ic(a){K.call(this,1);this.c=a;this.g=a.g;this.b=a.b}q(Ic,K);Ic.prototype.a=function(a){return-M(this.c,a)};Ic.prototype.toString=function(){return"Unary Expression: -"+L(this.c)};function Jc(a){K.call(this,4);this.c=a;dc(this,xa(this.c,function(a){return a.g}));ec(this,xa(this.c,function(a){return a.b}))}q(Jc,K);Jc.prototype.a=function(a){var b=new G;v(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=Zb(b,c)});return b};Jc.prototype.toString=function(){return wa(this.c,function(a,b){return a+L(b)},"Union Expression:")};function Kc(a,b){this.a=a;this.b=b}function Lc(a){for(var b,c=[];;){S(a,"Missing right hand side of binary expression.");b=Mc(a);var d=E(a.a);if(!d)break;var e=(d=kc[d]||null)&&d.I;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].I;)b=new gc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new gc(c.pop(),c.pop(),b);return b}function S(a,b){if(Ob(a.a))throw Error(b);}function Nc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function Oc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Pc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new rc(a)} -function Qc(a){var b,c=[],d;if(xc(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(Ob(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new vc;d=new vc;S(a,"Missing next location step.");b=Rc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=Lc(a);S(a,'unclosed "("');Nc(a,")");break;case '"':case "'":b=Pc(a);break;default:if(isNaN(+b))if(!qc(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a); -b=pc[b]||null;E(a.a);for(d=[];")"!=D(a.a);){S(a,"Missing function argument list.");d.push(Lc(a));if(","!=D(a.a))break;E(a.a)}S(a,"Unclosed function argument list.");Oc(a);b=new nc(b,d)}else{b=null;break a}else b=new sc(+E(a.a))}"["==D(a.a)&&(d=new Ac(Sc(a)),b=new lc(b,d))}if(b)if(xc(D(a.a)))d=b;else return b;else b=Rc(a,"/"),d=new wc,c.push(b)}for(;xc(D(a.a));)b=E(a.a),S(a,"Missing next location step."),b=Rc(a,b),c.push(b);return new tc(d,c)} -function Rc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new Bc(Hc,new I("node")),E(a.a),d;if(".."==D(a.a))return d=new Bc(Gc,new I("node")),E(a.a),d;var f;if("@"==D(a.a))f=uc,E(a.a),S(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=Fc[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);S(a,"Missing node name")}else f=Cc;c=D(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -D(a.a,1)){if(!qc(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!qc(c))throw Error("Invalid type name: "+c);Nc(a,"(");S(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Pc(a);S(a,"Bad nodetype");Oc(a);c=new I(c,g)}else if(c=E(a.a),e=c.indexOf(":"),-1==e)c=new Tb(c);else{var g=c.substring(0,e),h;if("*"==g)h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Tb(c,h)}else throw Error("Bad token: "+E(a.a));e=new Ac(Sc(a),f.a);return d|| -new Bc(f,c,e,"//"==b)}function Sc(a){for(var b=[];"["==D(a.a);){E(a.a);S(a,"Missing predicate expression.");var c=Lc(a);b.push(c);S(a,"Unclosed predicate expression.");Nc(a,"]")}return b}function Mc(a){if("-"==D(a.a))return E(a.a),new Ic(Mc(a));var b=Qc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)S(a,"Missing next union location path."),b.push(Qc(a));a.a.a--;a=new Jc(b)}return a};function Tc(a){switch(a.nodeType){case 1:return ja(Uc,a);case 9:return Tc(a.documentElement);case 11:case 10:case 6:case 12:return Vc;default:return a.parentNode?Tc(a.parentNode):Vc}}function Vc(){return null}function Uc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Uc(a.parentNode,b):null};function Wc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Lb(a);if(Ob(c))throw Error("Invalid XPath expression.");b?ea(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=Lc(new Kc(c,b));if(!Ob(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new Gb(a));return new T(c,b)}} -function T(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?ac(a):""+a;break;case 1:this.numberValue=a instanceof G?+ac(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d= -bc(a);c=[];for(var e=J(d);e;e=J(d))c.push(e instanceof Ib?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:d=$b(a);this.singleNodeValue=d instanceof Ib?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}T.ANY_TYPE=0;T.NUMBER_TYPE=1;T.STRING_TYPE=2;T.BOOLEAN_TYPE=3;T.UNORDERED_NODE_ITERATOR_TYPE=4;T.ORDERED_NODE_ITERATOR_TYPE=5;T.UNORDERED_NODE_SNAPSHOT_TYPE=6;T.ORDERED_NODE_SNAPSHOT_TYPE=7;T.ANY_UNORDERED_NODE_TYPE=8;T.FIRST_ORDERED_NODE_TYPE=9;function Xc(a){this.lookupNamespaceURI=Tc(a)} -function Yc(a,b){var c=a||l,d=c.document;if(!d.evaluate||b)c.XPathResult=T,d.evaluate=function(a,b,c,d){return(new Wc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Wc(a,b)},d.createNSResolver=function(a){return new Xc(a)}}ba("wgxpath.install",Yc);var U={};U.D=function(){var a={S:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -U.m=function(a,b,c){var d=B(a);if(!d.documentElement)return null;(z||kb)&&Yc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):U.D;if(z&&!Ua(7))return d.evaluate.call(d,b,a,e,c,null);if(!z||9<=Number(Wa)){for(var f={},g=d.getElementsByTagName("*"),h=0;h<g.length;++h){var n=g[h],p=n.namespaceURI;if(p&&!f[p]){var k=n.lookupPrefix(p);if(!k)var r=p.match(".*/(\\w+)/?$"),k=r?r[1]:"xhtml";f[p]=k}}var y={},N;for(N in f)y[f[N]]=N;e=function(a){return y[a]|| -null}}try{return d.evaluate(b,a,e,c,null)}catch(Aa){if("TypeError"===Aa.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):U.D,d.evaluate(b,a,e,c,null);throw Aa;}}catch(Aa){if(!Oa||"NS_ERROR_ILLEGAL_VALUE"!=Aa.name)throw new t(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+Aa);}};U.F=function(a,b){if(!a||1!=a.nodeType)throw new t(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -U.o=function(a,b){var c=function(){var c=U.m(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||U.F(c,a);return c}; -U.s=function(a,b){var c=function(){var c=U.m(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();v(c,function(b){U.F(b,a)});return c};function Zc(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}Zc.prototype.clone=function(){return new Zc(this.top,this.right,this.bottom,this.left)};Zc.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};Zc.prototype.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this}; -Zc.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};Zc.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};function V(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}V.prototype.clone=function(){return new V(this.left,this.top,this.width,this.height)};V.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};V.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this}; -V.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};V.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function W(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}var $c=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;function ad(a){var b=[];v(a.split($c),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"} -function bd(a,b){b=b.toLowerCase();if("style"==b)return ad(a.style.cssText);if(xb&&"value"==b&&W(a,"INPUT"))return a.value;if(yb&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}function cd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return W(a)?a:null} -function X(a,b){var c=sa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=yb?"styleFloat":"cssFloat";var d;a:{d=c;var e=B(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){d=e[d]||e.getPropertyValue(d)||"";break a}d=""}d=d||dd(a,c);if(null===d)d=null;else if(0<=ta(Bb,c)){b:{var f=d.match(Eb);if(f){var c=Number(f[1]),e=Number(f[2]),g=Number(f[3]),f=Number(f[4]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g&&0<=f&&1>=f){c=[c,e,g,f];break b}}c=null}if(!c)b:{if(g= -d.match(Fb))if(c=Number(g[1]),e=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g){c=[c,e,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();e=Ab[c.toLowerCase()];if(!e&&(e="#"==c.charAt(0)?c:"#"+c,4==e.length&&(e=e.replace(Cb,"#$1$1$2$2$3$3")),!Db.test(e))){c=null;break b}c=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d} -function dd(a,b){var c=a.currentStyle||a.style,d=c[b];!aa(d)&&ea(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?aa(d)?d:null:(c=cd(a))?dd(c,b):null} -function ed(a,b,c){function d(a){var b=fd(a);return 0<b.height&&0<b.width?!0:W(a,"PATH")&&(0<b.height||0<b.width)?(a=X(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=X(a,"overflow")&&xa(a.childNodes,function(a){return 3==a.nodeType||W(a)&&d(a)})}function e(a){return gd(a)==Y&&ya(a.childNodes,function(a){return!W(a)||e(a)||!d(a)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=eb(a,function(a){return W(a,"SELECT")}), -!!a&&ed(a,!0,c);var f=hd(a);if(f)return!!f.G&&0<f.rect.width&&0<f.rect.height&&ed(f.G,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=X(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=id(a))&&d(a)?!e(a):!1}function jd(a){function b(a){if("none"==X(a,"display"))return!1;a=cd(a);return!a||b(a)}return ed(a,!1,b)}var Y="hidden"; -function gd(a){function b(a){function b(a){return a==g?!0:0==X(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==X(a,"position")?!1:!0}var c=X(a,"position");if("fixed"==c)return p=!0,a==g?null:g;for(a=cd(a);a&&!b(a);)a=cd(a);return a}function c(a){var b=a;if("visible"==n)if(a==g&&h)b=h;else if(a==h)return{x:"visible",y:"visible"};b={x:X(b,"overflow-x"),y:X(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==g){var b=(new Za(f)).a; -a=b.scrollingElement?b.scrollingElement:Pa||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=z&&Ua("10")&&b.pageYOffset!=a.scrollTop?new A(a.scrollLeft,a.scrollTop):new A(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new A(a.scrollLeft,a.scrollTop);return a}var e=kd(a),f=B(a),g=f.documentElement,h=f.body,n=X(g,"overflow"),p;for(a=b(a);a;a=b(a)){var k=c(a);if("visible"!=k.x||"visible"!=k.y){var r=fd(a);if(0==r.width||0==r.height)return Y; -var y=e.right<r.left,N=e.bottom<r.top;if(y&&"hidden"==k.x||N&&"hidden"==k.y)return Y;if(y&&"visible"!=k.x||N&&"visible"!=k.y){y=d(a);N=e.bottom<r.top-y.y;if(e.right<r.left-y.x&&"visible"!=k.x||N&&"visible"!=k.x)return Y;e=gd(a);return e==Y?Y:"scroll"}y=e.left>=r.left+r.width;r=e.top>=r.top+r.height;if(y&&"hidden"==k.x||r&&"hidden"==k.y)return Y;if(y&&"visible"!=k.x||r&&"visible"!=k.y){if(p&&(k=d(a),e.left>=g.scrollWidth-k.x||e.right>=g.scrollHeight-k.y))return Y;e=gd(a);return e==Y?Y:"scroll"}}}return"none"} -function fd(a){var b=hd(a);if(b)return b.rect;if(W(a,"HTML"))return a=B(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Xa(a.clientWidth,a.clientHeight),new V(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new V(0,0,0,0)}b=new V(c.left,c.top,c.right-c.left,c.bottom-c.top);z&&a.ownerDocument.body&&(a=B(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+ -a.body.clientTop);return b}function hd(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=U.o('/descendant::*[@usemap = "#'+c.name+'"]',B(c)))&&(e=fd(d),b||"default"==a.shape.toLowerCase()||(a=ld(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new V(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{G:d,rect:e||new V(0,0,0,0)}} -function ld(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new V(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new V(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new V(b,c,d-b,e-c)}return new V(0,0,0,0)}function kd(a){a=fd(a);return new Zc(a.top,a.left+a.width,a.top+a.height,a.left)} -function md(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function nd(a){var b=[];od(a,b);a=va(b,md);return md(a.join("\n")).replace(/\xa0/g," ")} -function pd(a,b,c){if(W(a,"BR"))b.push("");else{var d=W(a,"TD"),e=X(a,"display"),f=!d&&!(0<=ta(qd,e)),g=aa(a.previousElementSibling)?a.previousElementSibling:$a(a.previousSibling),g=g?X(g,"display"):"",h=X(a,"float")||X(a,"cssFloat")||X(a,"styleFloat");!f||"run-in"==g&&"none"==h||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var n=jd(a),p=null,k=null;n&&(p=X(a,"white-space"),k=X(a,"text-transform"));v(a.childNodes,function(a){c(a,b,n,p,k)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||oa(a)|| -(b[b.length-1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function od(a,b){pd(a,b,function(a,b,e,f,g){3==a.nodeType&&e?rd(a,b,f,g):W(a)&&od(a,b)})}var qd="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); -function rd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";oa(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} -function id(a){if(yb){if("relative"==X(a,"position"))return 1;a=X(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return sd(a)}function sd(a){var b=1,c=X(a,"opacity");c&&(b=Number(c));(a=cd(a))&&(b*=sd(a));return b};var td={w:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},o:function(a,b){var c=Ya(b),d=m(a)?c.a.getElementById(a):a;if(!d)return null;if(bd(d,"id")==a&&ab(b,d))return d;c=fb(c,"*");return za(c,function(c){return bd(c,"id")==a&&ab(b,c)})},s:function(a,b){if(!a)return[];if(td.w(b,a))try{return b.querySelectorAll("#"+td.L(a))}catch(d){return[]}var c=fb(Ya(b),"*",null,b);return ua(c,function(b){return bd(b,"id")==a})},L:function(a){return a.replace(/(['"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g, -"\\$1")}};var Z={},ud={};Z.K=function(a,b,c){var d;try{d=zb.s("a",b)}catch(e){d=fb(Ya(b),"A",null,b)}return za(d,function(b){b=nd(b);return c&&-1!=b.indexOf(a)||b==a})};Z.H=function(a,b,c){var d;try{d=zb.s("a",b)}catch(e){d=fb(Ya(b),"A",null,b)}return ua(d,function(b){b=nd(b);return c&&-1!=b.indexOf(a)||b==a})};Z.o=function(a,b){return Z.K(a,b,!1)};Z.s=function(a,b){return Z.H(a,b,!1)};ud.o=function(a,b){return Z.K(a,b,!0)};ud.s=function(a,b){return Z.H(a,b,!0)};var vd={o:function(a,b){if(""===a)throw new t(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},s:function(a,b){if(""===a)throw new t(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var wd={className:gb,"class name":gb,css:zb,"css selector":zb,id:td,linkText:Z,"link text":Z,name:{o:function(a,b){var c=fb(Ya(b),"*",null,b);return za(c,function(b){return bd(b,"name")==a})},s:function(a,b){var c=fb(Ya(b),"*",null,b);return ua(c,function(b){return bd(b,"name")==a})}},partialLinkText:ud,"partial link text":ud,tagName:vd,"tag name":vd,xpath:U};function xd(){} -function yd(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ca(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),yd(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),zd(d,c),c.push(":"),yd(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":zd(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Ad={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Bd=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function zd(a,b){b.push('"',a.replace(Bd,function(a){var b=Ad[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ad[a]=b);return b}),'"')};Pa||Oa&&rb(3.5)||z&&rb(8);function Ha(a){switch(ca(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return va(a,Ha);case "object":if(null!==a&&"nodeType"in a&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Cd(a);return b}if(null!==a&&"document"in a)return b={},b.WINDOW=Cd(a),b;if(da(a))return va(a,Ha);a=Fa(a,function(a,b){return"number"==typeof b||m(b)});return Ga(a);default:return null}} -function Dd(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b}function Cd(a){var b=Dd(a.ownerDocument),c=Ia(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function Ed(a,b){a=decodeURIComponent(a);var c=b||document,d=Dd(c);if(!(null!==d&&a in d))throw new t(10,"Element does not exist in cache");var e=d[a];if(null!==e&&"setInterval"in e){if(e.closed)throw delete d[a],new t(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new t(10,"Element is no longer attached to the DOM");};ba("_",function(a,b,c,d){var e={};e[a]=b;var f;try{var g,h;d?h=Ed(d.WINDOW):h=window;g=h;var n;c?n=Ed(c.ELEMENT,g.document):n=g.document;var p;a:{a=n;var k;b:{for(var r in e)if(e.hasOwnProperty(r)){k=r;break b}k=null}if(k){var y=wd[k];if(y&&ea(y.o)){p=y.o(e[k],a||la.document);break a}}throw Error("Unsupported locator strategy: "+k);}f={status:0,value:Ha(p)}}catch(N){f={status:null!==N&&"code"in N?N.code:13,value:{message:N.message}}}e=[];yd(new xd,f,e);return e.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/find_elements.js b/src/ghostdriver/third_party/webdriver-atoms/find_elements.js deleted file mode 100644 index 523deb8730..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/find_elements.js +++ /dev/null @@ -1,118 +0,0 @@ -function(){return function(){var l=this;function aa(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&aa(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){return"function"==ca(a)}function fa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ga(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function q(a,b){function c(){}c.prototype=b.prototype;a.R=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.P=function(a,c,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[c].apply(a,g)}};var la=window;function t(a,b){this.code=a;this.a=u[a]||ma;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}q(t,Error);var ma="unknown error",u={15:"element not selectable",11:"element not visible"};u[31]=ma;u[30]=ma;u[24]="invalid cookie domain";u[29]="invalid element coordinates";u[12]="invalid element state"; -u[32]="invalid selector";u[51]="invalid selector";u[52]="invalid selector";u[17]="javascript error";u[405]="unsupported operation";u[34]="move target out of bounds";u[27]="no such alert";u[7]="no such element";u[8]="no such frame";u[23]="no such window";u[28]="script timeout";u[33]="session not created";u[10]="stale element reference";u[21]="timeout";u[25]="unable to set cookie";u[26]="unexpected alert open";u[13]=ma;u[9]="unknown command";t.prototype.toString=function(){return this.name+": "+this.message};var na;function oa(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var pa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function qa(a,b){for(var c=0,d=pa(String(a)).split("."),e=pa(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var h=d[g]||"",n=e[g]||"",p=RegExp("(\\d*)(\\D*)","g"),k=RegExp("(\\d*)(\\D*)","g");do{var r=p.exec(h)||["","",""],y=k.exec(n)||["","",""];if(0==r[0].length&&0==y[0].length)break;c=ra(0==r[1].length?0:parseInt(r[1],10),0==y[1].length?0:parseInt(y[1],10))||ra(0==r[2].length,0==y[2].length)||ra(r[2],y[2])}while(0==c)}return c}function ra(a,b){return a<b?-1:a>b?1:0} -function sa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function ta(a,b){if(m(a))return m(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function v(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ua(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d} -function va(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function wa(a,b,c){var d=c;v(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function xa(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ya(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0} -function za(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function Ba(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function Ca(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var w;a:{var Da=l.navigator;if(Da){var Ea=Da.userAgent;if(Ea){w=Ea;break a}}w=""}function x(a){return-1!=w.indexOf(a)};function Fa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ga(a){var b=Ha,c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ia(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ja(){return x("Opera")||x("OPR")}function Ka(){return(x("Chrome")||x("CriOS"))&&!Ja()&&!x("Edge")};function La(){return x("iPhone")&&!x("iPod")&&!x("iPad")};var Ma=Ja(),z=x("Trident")||x("MSIE"),Na=x("Edge"),Oa=x("Gecko")&&!(-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),Pa=-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge");function Qa(){var a=w;if(Oa)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Na)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Pa)return/WebKit\/(\S+)/.exec(a)}function Ra(){var a=l.document;return a?a.documentMode:void 0} -var Sa=function(){if(Ma&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Qa())&&(a=b?b[1]:"");return z&&(b=Ra(),null!=b&&b>parseFloat(a))?String(b):a}(),Ta={};function Ua(a){return Ta[a]||(Ta[a]=0<=qa(Sa,a))}var Va=l.document,Wa=Va&&z?Ra()||("CSS1Compat"==Va.compatMode?parseInt(Sa,10):5):void 0;!Oa&&!z||z&&9<=Number(Wa)||Oa&&Ua("1.9.1");z&&Ua("9");function A(a,b){this.x=aa(a)?a:0;this.y=aa(b)?b:0}A.prototype.clone=function(){return new A(this.x,this.y)};A.prototype.toString=function(){return"("+this.x+", "+this.y+")"};A.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};A.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};A.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Xa(a,b){this.width=a;this.height=b}Xa.prototype.clone=function(){return new Xa(this.width,this.height)};Xa.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};Xa.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Xa.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this}; -Xa.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Ya(a){return a?new Za(B(a)):na||(na=new Za)}function $a(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function ab(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function bb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(z&&!(9<=Number(Wa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?cb(a,b):!c&&ab(e,b)?-1*db(a,b):!d&&ab(f,a)?db(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=B(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function db(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return cb(d,a)}function cb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function B(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function eb(a,b){a=a.parentNode;for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null} -function Za(a){this.a=a||l.document||document} -function fb(a,b,c,d){a=d||a.a;var e=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(e||c))c=a.querySelectorAll(e+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(b=a.getElementsByClassName(c),e){a={};for(var f=d=0,g;g=b[f];f++)e==g.nodeName&&(a[d++]=g);a.length=d;c=a}else c=b;else if(b=a.getElementsByTagName(e||"*"),c){a={};for(f=d=0;g=b[f];f++){var e=g.className,h;if(h="function"==typeof e.split)h=0<=ta(e.split(/\s+/),c);h&&(a[d++]=g)}a.length=d;c=a}else c=b;return c};var gb={w:function(a){return!(!a.querySelectorAll||!a.querySelector)},s:function(a,b){if(!a)throw new t(32,"No class name specified");a=pa(a);if(-1!==a.indexOf(" "))throw new t(32,"Compound class names not permitted");if(gb.w(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(d){throw new t(32,"An invalid or illegal class name was specified");}var c=fb(Ya(b),"*",a,b);return c.length?c[0]:null},m:function(a,b){if(!a)throw new t(32,"No class name specified");a=pa(a);if(-1!==a.indexOf(" "))throw new t(32, -"Compound class names not permitted");if(gb.w(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new t(32,"An invalid or illegal class name was specified");}return fb(Ya(b),"*",a,b)}};var hb=x("Firefox"),ib=La()||x("iPod"),jb=x("iPad"),kb=x("Android")&&!(Ka()||x("Firefox")||Ja()||x("Silk")),lb=Ka(),mb=x("Safari")&&!(Ka()||x("Coast")||Ja()||x("Edge")||x("Silk")||x("Android"))&&!(La()||x("iPad")||x("iPod"));function nb(a){return(a=a.exec(w))?a[1]:""}var ob=function(){if(hb)return nb(/Firefox\/([0-9.]+)/);if(z||Na||Ma)return Sa;if(lb)return nb(/Chrome\/([0-9.]+)/);if(mb&&!(La()||x("iPad")||x("iPod")))return nb(/Version\/([0-9.]+)/);if(ib||jb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w))return a[1]+"."+a[2]}else if(kb)return(a=nb(/Android\s+([0-9.]+)/))?a:nb(/Version\/([0-9.]+)/);return""}();var pb,qb;function rb(a){return sb?pb(a):z?0<=qa(Wa,a):Ua(a)}function tb(a){sb?qb(a):kb?qa(ub,a):qa(ob,a)} -var sb=function(){if(!Oa)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;pb=function(a){return 0<=c.compare(d,""+a)};qb=function(a){c.compare(e,""+a)};return!0}(),vb;if(kb){var wb=/Android\s+([0-9\.]+)/.exec(w);vb=wb?wb[1]:"0"}else vb="0"; -var ub=vb,xb=z&&!(8<=Number(Wa)),yb=z&&!(9<=Number(Wa));kb&&tb(2.3);kb&&tb(4);mb&&tb(6);var zb={s:function(a,b){if(!ea(b.querySelector)&&z&&rb(8)&&!fa(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=pa(a);var c;try{c=b.querySelector(a)}catch(d){throw new t(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},m:function(a,b){if(!ea(b.querySelectorAll)&&z&&rb(8)&&!fa(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new t(32,"No selector specified");a=pa(a);try{return b.querySelectorAll(a)}catch(c){throw new t(32, -"An invalid or illegal selector was specified");}}};var Ab={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Bb="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Cb=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Db=/^#(?:[0-9a-f]{3}){1,2}$/i,Eb=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Fb=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Gb(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var C=z&&!(9<=Number(Wa)),Hb=z&&!(8<=Number(Wa));function Ib(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Jb(a,b){var c=Hb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Ib(b,a,b.nodeName,c)};function Kb(a){this.b=a;this.a=0}function Lb(a){a=a.match(Mb);for(var b=0;b<a.length;b++)Nb.test(a[b])&&a.splice(b,1);return new Kb(a)}var Mb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Nb=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function Ob(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(C&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),C&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function Pb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Hb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Qb(a,b,c,d,e){return(C?Rb:Sb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new G)} -function Rb(a,b,c,d,e){if(a instanceof Tb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Ub(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)Pb(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||H(e,b);return e}Vb(a,b,c,d,e);return e} -function Sb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!z?(b=b.getElementsByName(d),v(b,function(b){a.a(b)&&H(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),v(b,function(b){b.className==d&&a.a(b)&&H(e,b)})):a instanceof I?Vb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),v(b,function(a){Pb(a,c,d)&&H(e,a)}));return e} -function Wb(a,b,c,d,e){var f;if((a instanceof Tb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ub(a);if("*"!=g&&(f=ua(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ua(f,function(a){return Pb(a,c,d)}));v(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||H(e,a)});return e}return Xb(a,b,c,d,e)}function Xb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&H(e,b);return e} -function Vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&H(e,b),Vb(a,b,c,d,e)}function Ub(a){if(a instanceof I){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function G(){this.b=this.a=null;this.l=0}function Yb(a){this.node=a;this.a=this.b=null}function Zb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,h=d.node;f==h||f instanceof Ib&&h instanceof Ib&&f.a==h.a?(f=c,c=c.a,d=d.a):0<bb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a} -G.prototype.unshift=function(a){a=new Yb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++};function H(a,b){var c=new Yb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function $b(a){return(a=a.a)?a.node:null}function ac(a){return(a=$b(a))?F(a):""}function bc(a,b){return new cc(a,!!b)}function cc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function J(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function K(a){this.i=a;this.b=this.g=!1;this.f=null}function L(a){return"\n "+a.toString().split("\n").join("\n ")}function dc(a,b){a.g=b}function ec(a,b){a.b=b}function M(a,b){var c=a.a(b);return c instanceof G?+ac(c):+c}function O(a,b){var c=a.a(b);return c instanceof G?ac(c):""+c}function fc(a,b){var c=a.a(b);return c instanceof G?!!c.l:!!c};function gc(a,b,c){K.call(this,a.i);this.c=a;this.h=b;this.u=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==hc&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,v:b}):this.f={name:b.f.name,v:c})}q(gc,K); -function ic(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=bc(b);for(d=J(b);d;d=J(b))for(e=bc(c),f=J(e);f;f=J(e))if(a(F(d),F(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=bc(e);for(var g=typeof d,h=J(f);h;h=J(f)){switch(g){case "number":h=+F(h);break;case "boolean":h=!!F(h);break;case "string":h=F(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}gc.prototype.a=function(a){return this.c.o(this.h,this.u,a)};gc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+L(this.h);return a+=L(this.u)};function jc(a,b,c,d){this.a=a;this.I=b;this.i=c;this.o=d}jc.prototype.toString=function(){return this.a};var kc={}; -function P(a,b,c,d){if(kc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new jc(a,b,c,d);return kc[a.toString()]=a}P("div",6,1,function(a,b,c){return M(a,c)/M(b,c)});P("mod",6,1,function(a,b,c){return M(a,c)%M(b,c)});P("*",6,1,function(a,b,c){return M(a,c)*M(b,c)});P("+",5,1,function(a,b,c){return M(a,c)+M(b,c)});P("-",5,1,function(a,b,c){return M(a,c)-M(b,c)});P("<",4,2,function(a,b,c){return ic(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return ic(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return ic(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return ic(function(a,b){return a>=b},a,b,c)});var hc=P("=",3,2,function(a,b,c){return ic(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return ic(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return fc(a,c)&&fc(b,c)});P("or",1,2,function(a,b,c){return fc(a,c)||fc(b,c)});function lc(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}q(lc,K);lc.prototype.a=function(a){a=this.c.a(a);return mc(this.h,a)};lc.prototype.toString=function(){var a;a="Filter:"+L(this.c);return a+=L(this.h)};function nc(a,b){if(b.length<a.J)throw Error("Function "+a.j+" expects at least"+a.J+" arguments, "+b.length+" given");if(null!==a.C&&b.length>a.C)throw Error("Function "+a.j+" expects at most "+a.C+" arguments, "+b.length+" given");a.O&&v(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});K.call(this,a.i);this.h=a;this.c=b;dc(this,a.g||xa(b,function(a){return a.g}));ec(this,a.N&&!b.length||a.M&&!!b.length||xa(b,function(a){return a.b}))} -q(nc,K);nc.prototype.a=function(a){return this.h.o.apply(null,Ba(a,this.c))};nc.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=wa(this.c,function(a,b){return a+L(b)},"Arguments:"),a=a+L(b);return a};function oc(a,b,c,d,e,f,g,h,n){this.j=a;this.i=b;this.g=c;this.N=d;this.M=e;this.o=f;this.J=g;this.C=aa(h)?h:g;this.O=!!n}oc.prototype.toString=function(){return this.j};var pc={}; -function Q(a,b,c,d,e,f,g,h){if(pc.hasOwnProperty(a))throw Error("Function already created: "+a+".");pc[a]=new oc(a,b,c,d,!1,e,f,g,h)}Q("boolean",2,!1,!1,function(a,b){return fc(b,a)},1);Q("ceiling",1,!1,!1,function(a,b){return Math.ceil(M(b,a))},1);Q("concat",3,!1,!1,function(a,b){return wa(Ca(arguments,1),function(b,d){return b+O(d,a)},"")},2,null);Q("contains",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return-1!=b.indexOf(a)},2);Q("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); -Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){return Math.floor(M(b,a))},1);Q("id",4,!1,!1,function(a,b){function c(a){if(C){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return za(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=O(b,a).split(/\s+/),f=[];v(d,function(a){a=c(a);!a||0<=ta(f,a)||f.push(a)});f.sort(bb);var g=new G;v(f,function(a){H(g,a)});return g},1); -Q("lang",2,!1,!1,function(){return!1},1);Q("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);Q("local-name",3,!1,!0,function(a,b){var c=b?$b(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);Q("name",3,!1,!0,function(a,b){var c=b?$b(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);Q("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -Q("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);Q("not",2,!1,!1,function(a,b){return!fc(b,a)},1);Q("number",1,!1,!0,function(a,b){return b?M(b,a):+F(a.a)},0,1);Q("position",1,!0,!1,function(a){return a.b},0);Q("round",1,!1,!1,function(a,b){return Math.round(M(b,a))},1);Q("starts-with",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return 0==b.lastIndexOf(a,0)},2);Q("string",3,!1,!0,function(a,b){return b?O(b,a):F(a.a)},0,1); -Q("string-length",1,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).length},0,1);Q("substring",3,!1,!1,function(a,b,c,d){c=M(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?M(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=O(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);Q("substring-after",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -Q("substring-before",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);Q("sum",1,!1,!1,function(a,b){for(var c=bc(b.a(a)),d=0,e=J(c);e;e=J(c))d+=+F(e);return d},1,1,!0);Q("translate",3,!1,!1,function(a,b,c,d){b=O(b,a);c=O(c,a);var e=O(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);Q("true",2,!1,!1,function(){return!0},0);function I(a,b){this.h=a;this.c=aa(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function qc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}I.prototype.a=function(a){return null===this.b||this.b==a.nodeType};I.prototype.f=function(){return this.h}; -I.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=L(this.c));return a};function rc(a){K.call(this,3);this.c=a.substring(1,a.length-1)}q(rc,K);rc.prototype.a=function(){return this.c};rc.prototype.toString=function(){return"Literal: "+this.c};function Tb(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Tb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Tb.prototype.f=function(){return this.j};Tb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function sc(a){K.call(this,1);this.c=a}q(sc,K);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Number: "+this.c};function tc(a,b){K.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.A||c.c!=uc||(c=c.u,"*"!=c.f()&&(this.f={name:c.f(),v:null}))}}q(tc,K);function vc(){K.call(this,4)}q(vc,K);vc.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?H(b,a):H(b,a.ownerDocument);return b};vc.prototype.toString=function(){return"Root Helper Expression"};function wc(){K.call(this,4)}q(wc,K);wc.prototype.a=function(a){var b=new G;H(b,a.a);return b};wc.prototype.toString=function(){return"Context Helper Expression"}; -function xc(a){return"/"==a||"//"==a}tc.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=bc(b,e.c.a),g;if(e.g||e.c!=yc)if(e.g||e.c!=zc)for(g=J(f),b=e.a(new Gb(g));null!=(g=J(f));)g=e.a(new Gb(g)),b=Zb(b,g);else g=J(f),b=e.a(new Gb(g));else{for(g=J(f);(b=J(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Gb(g))}}return b}; -tc.prototype.toString=function(){var a;a="Path Expression:"+L(this.h);if(this.c.length){var b=wa(this.c,function(a,b){return a+L(b)},"Steps:");a+=L(b)}return a};function Ac(a,b){this.a=a;this.b=!!b} -function mc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=bc(b),f=b.l,g,h=0;g=J(e);h++){var n=a.b?f-h:h+1;g=d.a(new Gb(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof G)n=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var p=n.a;if(!p)throw Error("Next must be called at least once before remove.");var k=p.b,p=p.a;k?k.a=p:g.a=p;p?p.b=k:g.b=k;g.l--;n.a=null}}return b} -Ac.prototype.toString=function(){return wa(this.a,function(a,b){return a+L(b)},"Predicates:")};function Bc(a,b,c,d){K.call(this,4);this.c=a;this.u=b;this.h=c||new Ac([]);this.A=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=C?a.toLowerCase():a,this.f={name:a,v:b.v});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}q(Bc,K); -Bc.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.v?O(c.v,a):null,f=1);if(this.A)if(this.g||this.c!=Cc)if(a=bc((new Bc(Dc,new I("node"))).a(a)),b=J(a))for(c=this.o(b,d,e,f);null!=(b=J(a));)c=Zb(c,this.o(b,d,e,f));else c=new G;else c=Qb(this.u,b,d,e),c=mc(this.h,c,f);else c=this.o(a.a,d,e,f);return c};Bc.prototype.o=function(a,b,c,d){a=this.c.f(this.u,a,b,c);return a=mc(this.h,a,d)}; -Bc.prototype.toString=function(){var a;a="Step:"+L("Operator: "+(this.A?"//":"/"));this.c.j&&(a+=L("Axis: "+this.c));a+=L(this.u);if(this.h.a.length){var b=wa(this.h.a,function(a,b){return a+L(b)},"Predicates:");a+=L(b)}return a};function Ec(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Ec.prototype.toString=function(){return this.j};var Fc={};function R(a,b,c,d){if(Fc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Ec(a,b,c,!!d);return Fc[a]=b} -R("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);R("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var uc=R("attribute",function(a,b){var c=new G,d=a.f();if("style"==d&&b.style&&C)return H(c,new Ib(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof I&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C?f.nodeValue&&H(c,Jb(b,f)):H(c,f);else(f=e.getNamedItem(d))&&(C?f.nodeValue&&H(c,Jb(b,f)):H(c,f));return c},!1),Cc=R("child",function(a,b,c,d,e){return(C?Wb:Xb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new G)},!1,!0);R("descendant",Qb,!1,!0); -var Dc=R("descendant-or-self",function(a,b,c,d){var e=new G;Pb(b,c,d)&&a.a(b)&&H(e,b);return Qb(a,b,c,d,e)},!1,!0),yc=R("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)Pb(f,c,d)&&a.a(f)&&H(e,f),e=Qb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&H(c,d);return c},!1);R("namespace",function(){return new G},!1); -var Gc=R("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return H(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&H(c,d);return c},!1),zc=R("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var p=0,k=n.length;p<k;p++)b=n[p],Pb(b,c,d)&&a.a(b)&&H(e,b),e=Qb(a,b,c,d,e)}return e},!0,!0); -R("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Hc=R("self",function(a,b){var c=new G;a.a(b)&&H(c,b);return c},!1);function Ic(a){K.call(this,1);this.c=a;this.g=a.g;this.b=a.b}q(Ic,K);Ic.prototype.a=function(a){return-M(this.c,a)};Ic.prototype.toString=function(){return"Unary Expression: -"+L(this.c)};function Jc(a){K.call(this,4);this.c=a;dc(this,xa(this.c,function(a){return a.g}));ec(this,xa(this.c,function(a){return a.b}))}q(Jc,K);Jc.prototype.a=function(a){var b=new G;v(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=Zb(b,c)});return b};Jc.prototype.toString=function(){return wa(this.c,function(a,b){return a+L(b)},"Union Expression:")};function Kc(a,b){this.a=a;this.b=b}function Lc(a){for(var b,c=[];;){S(a,"Missing right hand side of binary expression.");b=Mc(a);var d=E(a.a);if(!d)break;var e=(d=kc[d]||null)&&d.I;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].I;)b=new gc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new gc(c.pop(),c.pop(),b);return b}function S(a,b){if(Ob(a.a))throw Error(b);}function Nc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function Oc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Pc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new rc(a)} -function Qc(a){var b,c=[],d;if(xc(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(Ob(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new vc;d=new vc;S(a,"Missing next location step.");b=Rc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=Lc(a);S(a,'unclosed "("');Nc(a,")");break;case '"':case "'":b=Pc(a);break;default:if(isNaN(+b))if(!qc(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a); -b=pc[b]||null;E(a.a);for(d=[];")"!=D(a.a);){S(a,"Missing function argument list.");d.push(Lc(a));if(","!=D(a.a))break;E(a.a)}S(a,"Unclosed function argument list.");Oc(a);b=new nc(b,d)}else{b=null;break a}else b=new sc(+E(a.a))}"["==D(a.a)&&(d=new Ac(Sc(a)),b=new lc(b,d))}if(b)if(xc(D(a.a)))d=b;else return b;else b=Rc(a,"/"),d=new wc,c.push(b)}for(;xc(D(a.a));)b=E(a.a),S(a,"Missing next location step."),b=Rc(a,b),c.push(b);return new tc(d,c)} -function Rc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new Bc(Hc,new I("node")),E(a.a),d;if(".."==D(a.a))return d=new Bc(Gc,new I("node")),E(a.a),d;var f;if("@"==D(a.a))f=uc,E(a.a),S(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=Fc[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);S(a,"Missing node name")}else f=Cc;c=D(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -D(a.a,1)){if(!qc(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!qc(c))throw Error("Invalid type name: "+c);Nc(a,"(");S(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Pc(a);S(a,"Bad nodetype");Oc(a);c=new I(c,g)}else if(c=E(a.a),e=c.indexOf(":"),-1==e)c=new Tb(c);else{var g=c.substring(0,e),h;if("*"==g)h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Tb(c,h)}else throw Error("Bad token: "+E(a.a));e=new Ac(Sc(a),f.a);return d|| -new Bc(f,c,e,"//"==b)}function Sc(a){for(var b=[];"["==D(a.a);){E(a.a);S(a,"Missing predicate expression.");var c=Lc(a);b.push(c);S(a,"Unclosed predicate expression.");Nc(a,"]")}return b}function Mc(a){if("-"==D(a.a))return E(a.a),new Ic(Mc(a));var b=Qc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)S(a,"Missing next union location path."),b.push(Qc(a));a.a.a--;a=new Jc(b)}return a};function Tc(a){switch(a.nodeType){case 1:return ja(Uc,a);case 9:return Tc(a.documentElement);case 11:case 10:case 6:case 12:return Vc;default:return a.parentNode?Tc(a.parentNode):Vc}}function Vc(){return null}function Uc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Uc(a.parentNode,b):null};function Wc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Lb(a);if(Ob(c))throw Error("Invalid XPath expression.");b?ea(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=Lc(new Kc(c,b));if(!Ob(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new Gb(a));return new T(c,b)}} -function T(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?ac(a):""+a;break;case 1:this.numberValue=a instanceof G?+ac(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d= -bc(a);c=[];for(var e=J(d);e;e=J(d))c.push(e instanceof Ib?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:d=$b(a);this.singleNodeValue=d instanceof Ib?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}T.ANY_TYPE=0;T.NUMBER_TYPE=1;T.STRING_TYPE=2;T.BOOLEAN_TYPE=3;T.UNORDERED_NODE_ITERATOR_TYPE=4;T.ORDERED_NODE_ITERATOR_TYPE=5;T.UNORDERED_NODE_SNAPSHOT_TYPE=6;T.ORDERED_NODE_SNAPSHOT_TYPE=7;T.ANY_UNORDERED_NODE_TYPE=8;T.FIRST_ORDERED_NODE_TYPE=9;function Xc(a){this.lookupNamespaceURI=Tc(a)} -function Yc(a,b){var c=a||l,d=c.document;if(!d.evaluate||b)c.XPathResult=T,d.evaluate=function(a,b,c,d){return(new Wc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Wc(a,b)},d.createNSResolver=function(a){return new Xc(a)}}ba("wgxpath.install",Yc);var U={};U.D=function(){var a={S:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -U.o=function(a,b,c){var d=B(a);if(!d.documentElement)return null;(z||kb)&&Yc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):U.D;if(z&&!Ua(7))return d.evaluate.call(d,b,a,e,c,null);if(!z||9<=Number(Wa)){for(var f={},g=d.getElementsByTagName("*"),h=0;h<g.length;++h){var n=g[h],p=n.namespaceURI;if(p&&!f[p]){var k=n.lookupPrefix(p);if(!k)var r=p.match(".*/(\\w+)/?$"),k=r?r[1]:"xhtml";f[p]=k}}var y={},N;for(N in f)y[f[N]]=N;e=function(a){return y[a]|| -null}}try{return d.evaluate(b,a,e,c,null)}catch(Aa){if("TypeError"===Aa.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):U.D,d.evaluate(b,a,e,c,null);throw Aa;}}catch(Aa){if(!Oa||"NS_ERROR_ILLEGAL_VALUE"!=Aa.name)throw new t(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+Aa);}};U.F=function(a,b){if(!a||1!=a.nodeType)throw new t(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -U.s=function(a,b){var c=function(){var c=U.o(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||U.F(c,a);return c}; -U.m=function(a,b){var c=function(){var c=U.o(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();v(c,function(b){U.F(b,a)});return c};function Zc(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}Zc.prototype.clone=function(){return new Zc(this.top,this.right,this.bottom,this.left)};Zc.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};Zc.prototype.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this}; -Zc.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};Zc.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};function V(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}V.prototype.clone=function(){return new V(this.left,this.top,this.width,this.height)};V.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};V.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this}; -V.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};V.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function W(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}var $c=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;function ad(a){var b=[];v(a.split($c),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"} -function bd(a,b){b=b.toLowerCase();if("style"==b)return ad(a.style.cssText);if(xb&&"value"==b&&W(a,"INPUT"))return a.value;if(yb&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}function cd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return W(a)?a:null} -function X(a,b){var c=sa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=yb?"styleFloat":"cssFloat";var d;a:{d=c;var e=B(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){d=e[d]||e.getPropertyValue(d)||"";break a}d=""}d=d||dd(a,c);if(null===d)d=null;else if(0<=ta(Bb,c)){b:{var f=d.match(Eb);if(f){var c=Number(f[1]),e=Number(f[2]),g=Number(f[3]),f=Number(f[4]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g&&0<=f&&1>=f){c=[c,e,g,f];break b}}c=null}if(!c)b:{if(g= -d.match(Fb))if(c=Number(g[1]),e=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g){c=[c,e,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();e=Ab[c.toLowerCase()];if(!e&&(e="#"==c.charAt(0)?c:"#"+c,4==e.length&&(e=e.replace(Cb,"#$1$1$2$2$3$3")),!Db.test(e))){c=null;break b}c=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d} -function dd(a,b){var c=a.currentStyle||a.style,d=c[b];!aa(d)&&ea(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?aa(d)?d:null:(c=cd(a))?dd(c,b):null} -function ed(a,b,c){function d(a){var b=fd(a);return 0<b.height&&0<b.width?!0:W(a,"PATH")&&(0<b.height||0<b.width)?(a=X(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=X(a,"overflow")&&xa(a.childNodes,function(a){return 3==a.nodeType||W(a)&&d(a)})}function e(a){return gd(a)==Y&&ya(a.childNodes,function(a){return!W(a)||e(a)||!d(a)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=eb(a,function(a){return W(a,"SELECT")}), -!!a&&ed(a,!0,c);var f=hd(a);if(f)return!!f.G&&0<f.rect.width&&0<f.rect.height&&ed(f.G,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=X(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=id(a))&&d(a)?!e(a):!1}function jd(a){function b(a){if("none"==X(a,"display"))return!1;a=cd(a);return!a||b(a)}return ed(a,!1,b)}var Y="hidden"; -function gd(a){function b(a){function b(a){return a==g?!0:0==X(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==X(a,"position")?!1:!0}var c=X(a,"position");if("fixed"==c)return p=!0,a==g?null:g;for(a=cd(a);a&&!b(a);)a=cd(a);return a}function c(a){var b=a;if("visible"==n)if(a==g&&h)b=h;else if(a==h)return{x:"visible",y:"visible"};b={x:X(b,"overflow-x"),y:X(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==g){var b=(new Za(f)).a; -a=b.scrollingElement?b.scrollingElement:Pa||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=z&&Ua("10")&&b.pageYOffset!=a.scrollTop?new A(a.scrollLeft,a.scrollTop):new A(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new A(a.scrollLeft,a.scrollTop);return a}var e=kd(a),f=B(a),g=f.documentElement,h=f.body,n=X(g,"overflow"),p;for(a=b(a);a;a=b(a)){var k=c(a);if("visible"!=k.x||"visible"!=k.y){var r=fd(a);if(0==r.width||0==r.height)return Y; -var y=e.right<r.left,N=e.bottom<r.top;if(y&&"hidden"==k.x||N&&"hidden"==k.y)return Y;if(y&&"visible"!=k.x||N&&"visible"!=k.y){y=d(a);N=e.bottom<r.top-y.y;if(e.right<r.left-y.x&&"visible"!=k.x||N&&"visible"!=k.x)return Y;e=gd(a);return e==Y?Y:"scroll"}y=e.left>=r.left+r.width;r=e.top>=r.top+r.height;if(y&&"hidden"==k.x||r&&"hidden"==k.y)return Y;if(y&&"visible"!=k.x||r&&"visible"!=k.y){if(p&&(k=d(a),e.left>=g.scrollWidth-k.x||e.right>=g.scrollHeight-k.y))return Y;e=gd(a);return e==Y?Y:"scroll"}}}return"none"} -function fd(a){var b=hd(a);if(b)return b.rect;if(W(a,"HTML"))return a=B(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Xa(a.clientWidth,a.clientHeight),new V(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new V(0,0,0,0)}b=new V(c.left,c.top,c.right-c.left,c.bottom-c.top);z&&a.ownerDocument.body&&(a=B(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+ -a.body.clientTop);return b}function hd(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=U.s('/descendant::*[@usemap = "#'+c.name+'"]',B(c)))&&(e=fd(d),b||"default"==a.shape.toLowerCase()||(a=ld(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new V(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{G:d,rect:e||new V(0,0,0,0)}} -function ld(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new V(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new V(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new V(b,c,d-b,e-c)}return new V(0,0,0,0)}function kd(a){a=fd(a);return new Zc(a.top,a.left+a.width,a.top+a.height,a.left)} -function md(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function nd(a){var b=[];od(a,b);a=va(b,md);return md(a.join("\n")).replace(/\xa0/g," ")} -function pd(a,b,c){if(W(a,"BR"))b.push("");else{var d=W(a,"TD"),e=X(a,"display"),f=!d&&!(0<=ta(qd,e)),g=aa(a.previousElementSibling)?a.previousElementSibling:$a(a.previousSibling),g=g?X(g,"display"):"",h=X(a,"float")||X(a,"cssFloat")||X(a,"styleFloat");!f||"run-in"==g&&"none"==h||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var n=jd(a),p=null,k=null;n&&(p=X(a,"white-space"),k=X(a,"text-transform"));v(a.childNodes,function(a){c(a,b,n,p,k)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||oa(a)|| -(b[b.length-1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function od(a,b){pd(a,b,function(a,b,e,f,g){3==a.nodeType&&e?rd(a,b,f,g):W(a)&&od(a,b)})}var qd="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); -function rd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";oa(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} -function id(a){if(yb){if("relative"==X(a,"position"))return 1;a=X(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return sd(a)}function sd(a){var b=1,c=X(a,"opacity");c&&(b=Number(c));(a=cd(a))&&(b*=sd(a));return b};var td={w:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},s:function(a,b){var c=Ya(b),d=m(a)?c.a.getElementById(a):a;if(!d)return null;if(bd(d,"id")==a&&ab(b,d))return d;c=fb(c,"*");return za(c,function(c){return bd(c,"id")==a&&ab(b,c)})},m:function(a,b){if(!a)return[];if(td.w(b,a))try{return b.querySelectorAll("#"+td.L(a))}catch(d){return[]}var c=fb(Ya(b),"*",null,b);return ua(c,function(b){return bd(b,"id")==a})},L:function(a){return a.replace(/(['"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g, -"\\$1")}};var Z={},ud={};Z.K=function(a,b,c){var d;try{d=zb.m("a",b)}catch(e){d=fb(Ya(b),"A",null,b)}return za(d,function(b){b=nd(b);return c&&-1!=b.indexOf(a)||b==a})};Z.H=function(a,b,c){var d;try{d=zb.m("a",b)}catch(e){d=fb(Ya(b),"A",null,b)}return ua(d,function(b){b=nd(b);return c&&-1!=b.indexOf(a)||b==a})};Z.s=function(a,b){return Z.K(a,b,!1)};Z.m=function(a,b){return Z.H(a,b,!1)};ud.s=function(a,b){return Z.K(a,b,!0)};ud.m=function(a,b){return Z.H(a,b,!0)};var vd={s:function(a,b){if(""===a)throw new t(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},m:function(a,b){if(""===a)throw new t(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var wd={className:gb,"class name":gb,css:zb,"css selector":zb,id:td,linkText:Z,"link text":Z,name:{s:function(a,b){var c=fb(Ya(b),"*",null,b);return za(c,function(b){return bd(b,"name")==a})},m:function(a,b){var c=fb(Ya(b),"*",null,b);return ua(c,function(b){return bd(b,"name")==a})}},partialLinkText:ud,"partial link text":ud,tagName:vd,"tag name":vd,xpath:U};function xd(){} -function yd(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ca(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),yd(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),zd(d,c),c.push(":"),yd(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":zd(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Ad={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Bd=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function zd(a,b){b.push('"',a.replace(Bd,function(a){var b=Ad[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ad[a]=b);return b}),'"')};Pa||Oa&&rb(3.5)||z&&rb(8);function Ha(a){switch(ca(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return va(a,Ha);case "object":if(null!==a&&"nodeType"in a&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Cd(a);return b}if(null!==a&&"document"in a)return b={},b.WINDOW=Cd(a),b;if(da(a))return va(a,Ha);a=Fa(a,function(a,b){return"number"==typeof b||m(b)});return Ga(a);default:return null}} -function Dd(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b}function Cd(a){var b=Dd(a.ownerDocument),c=Ia(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function Ed(a,b){a=decodeURIComponent(a);var c=b||document,d=Dd(c);if(!(null!==d&&a in d))throw new t(10,"Element does not exist in cache");var e=d[a];if(null!==e&&"setInterval"in e){if(e.closed)throw delete d[a],new t(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new t(10,"Element is no longer attached to the DOM");};ba("_",function(a,b,c,d){var e={};e[a]=b;var f;try{var g,h;d?h=Ed(d.WINDOW):h=window;g=h;var n;c?n=Ed(c.ELEMENT,g.document):n=g.document;var p;a:{a=n;var k;b:{for(var r in e)if(e.hasOwnProperty(r)){k=r;break b}k=null}if(k){var y=wd[k];if(y&&ea(y.m)){p=y.m(e[k],a||la.document);break a}}throw Error("Unsupported locator strategy: "+k);}f={status:0,value:Ha(p)}}catch(N){f={status:null!==N&&"code"in N?N.code:13,value:{message:N.message}}}e=[];yd(new xd,f,e);return e.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/frame_name.js b/src/ghostdriver/third_party/webdriver-atoms/frame_name.js deleted file mode 100644 index e3597d5e6e..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/frame_name.js +++ /dev/null @@ -1,90 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var n=window;var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",C=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var fa=C.exec(k)||["","",""],ga=O.exec(v)||["","",""];if(0==fa[0].length&&0==ga[0].length)break;c=na(0==fa[1].length?0:parseInt(fa[1],10),0==ga[1].length?0:parseInt(ga[1],10))||na(0==fa[2].length,0==ga[2].length)||na(fa[2],ga[2])}while(0==c)}return c} -function na(a,b){return a<b?-1:a>b?1:0};function p(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function oa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function pa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function q(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function qa(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ra(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]}function sa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ta(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function ua(a,b){this.code=a;this.a=r[a]||va;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(ua,Error);var va="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=va;r[30]=va;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=va;r[9]="unknown command";ua.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var wa=g.navigator;if(wa){var xa=wa.userAgent;if(xa){t=xa;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function ya(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function za(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return u("Opera")||u("OPR")}function Ca(){return(u("Chrome")||u("CriOS"))&&!Ba()&&!u("Edge")};function Da(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Ea=Ba(),x=u("Trident")||u("MSIE"),Fa=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ga=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ha=u("Macintosh"),Ia=u("Windows");function Ja(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ga)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=g.document;return a?a.documentMode:void 0} -var La=function(){if(Ea&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),null!=b&&b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=ma(La,a))}var Oa=g.document,Pa=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!y&&!x||x&&9<=Number(Pa)||y&&Na("1.9.1");x&&Na("9");function Qa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Ra(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(Pa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Sa(a,b):!c&&Qa(e,b)?-1*Ta(a,b):!d&&Qa(f,a)?Ta(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Ta(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Sa(d,a)}function Sa(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};var Ua=u("Firefox"),Va=Da()||u("iPod"),Wa=u("iPad"),z=u("Android")&&!(Ca()||u("Firefox")||Ba()||u("Silk")),Xa=Ca(),Ya=u("Safari")&&!(Ca()||u("Coast")||Ba()||u("Edge")||u("Silk")||u("Android"))&&!(Da()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Za(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(Pa)),$a=x&&!(8<=Number(Pa));function ab(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function bb(a,b){var c=$a&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new ab(b,a,b.nodeName,c)};function cb(a){this.b=a;this.a=0}function db(a){a=a.match(eb);for(var b=0;b<a.length;b++)fb.test(a[b])&&a.splice(b,1);return new cb(a)}var eb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),fb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function gb(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}$a&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function hb(a,b,c,d,e){return(A?ib:jb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function ib(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=kb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}lb(a,b,c,d,e);return e} -function jb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?lb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function mb(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=kb(a);if("*"!=h&&(f=oa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=oa(f,function(a){return F(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return nb(a,b,c,d,e)}function nb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function lb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),lb(a,b,c,d,e)}function kb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function ob(a){this.node=a;this.a=this.b=null}function pb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof ab&&k instanceof ab&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Ra(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new ob(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new ob(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function qb(a){return(a=a.a)?a.node:null}function rb(a){return(a=qb(a))?E(a):""}function K(a,b){return new sb(a,!!b)}function sb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function tb(a,b){a.i=b}function ub(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+rb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?rb(c):""+c}function vb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function wb(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==xb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(wb,M); -function yb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}wb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};wb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function zb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}zb.prototype.toString=function(){return this.a};var Ab={}; -function R(a,b,c,d){if(Ab.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new zb(a,b,c,d);return Ab[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return yb(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return yb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return yb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return yb(function(a,b){return a>=b},a,b,c)});var xb=R("=",3,2,function(a,b,c){return yb(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return yb(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return vb(a,c)&&vb(b,c)});R("or",1,2,function(a,b,c){return vb(a,c)||vb(b,c)});function Bb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Bb,M);Bb.prototype.a=function(a){a=this.c.a(a);return Cb(this.j,a)};Bb.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Db(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;tb(this,a.i||qa(b,function(a){return a.i}));ub(this,a.J&&!b.length||a.I&&!!b.length||qa(b,function(a){return a.b}))} -m(Db,M);Db.prototype.a=function(a){return this.j.v.apply(null,sa(a,this.c))};Db.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=q(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Eb(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Eb.prototype.toString=function(){return this.o};var Fb={}; -function S(a,b,c,d,e,f,h,k){if(Fb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Fb[a]=new Eb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return vb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return q(ta(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1); -S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ra(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(l(f))b=l(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Ra);var h=new G;p(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!vb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Gb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Hb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Hb,M);Hb.prototype.a=function(){return this.c};Hb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Ib(a){M.call(this,1);this.c=a}m(Ib,M);Ib.prototype.a=function(){return this.c};Ib.prototype.toString=function(){return"Number: "+this.c};function Jb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Kb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Jb,M);function Lb(){M.call(this,4)}m(Lb,M);Lb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Lb.prototype.toString=function(){return"Root Helper Expression"};function Mb(){M.call(this,4)}m(Mb,M);Mb.prototype.a=function(a){var b=new G;I(b,a.a);return b};Mb.prototype.toString=function(){return"Context Helper Expression"}; -function Nb(a){return"/"==a||"//"==a}Jb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Ob)if(e.i||e.c!=Pb)for(h=L(f),b=e.a(new Za(h));null!=(h=L(f));)h=e.a(new Za(h)),b=pb(b,h);else h=L(f),b=e.a(new Za(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new Za(h))}}return b}; -Jb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=q(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Qb(a,b){this.a=a;this.b=!!b} -function Cb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new Za(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var C=v.a;if(!C)throw Error("Next must be called at least once before remove.");var O=C.b,C=C.a;O?O.a=C:h.a=C;C?C.b=O:h.b=O;h.s--;v.a=null}}return b} -Qb.prototype.toString=function(){return q(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Qb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Rb)if(a=K((new T(Sb,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=pb(c,this.v(b,d,e,f));else c=new G;else c=hb(this.w,b,d,e),c=Cb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Cb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=q(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Tb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Tb.prototype.toString=function(){return this.o};var Ub={};function U(a,b,c,d){if(Ub.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Tb(a,b,c,!!d);return Ub[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Kb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new ab(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,bb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,bb(b,f)):I(c,f));return c},!1),Rb=U("child",function(a,b,c,d,e){return(A?mb:nb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",hb,!1,!0); -var Sb=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return hb(a,b,c,d,e)},!1,!0),Ob=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=hb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Vb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Pb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var C=0,O=v.length;C<O;C++)b=v[C],F(b,c,d)&&a.a(b)&&I(e,b),e=hb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Wb=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function Xb(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m(Xb,M);Xb.prototype.a=function(a){return-P(this.c,a)};Xb.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function Yb(a){M.call(this,4);this.c=a;tb(this,qa(this.c,function(a){return a.i}));ub(this,qa(this.c,function(a){return a.b}))}m(Yb,M);Yb.prototype.a=function(a){var b=new G;p(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=pb(b,c)});return b};Yb.prototype.toString=function(){return q(this.c,function(a,b){return a+N(b)},"Union Expression:")};function Zb(a,b){this.a=a;this.b=b}function $b(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=ac(a);var d=D(a.a);if(!d)break;var e=(d=Ab[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new wb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new wb(c.pop(),c.pop(),b);return b}function V(a,b){if(gb(a.a))throw Error(b);}function bc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function cc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function dc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Hb(a)} -function ec(a){var b,c=[],d;if(Nb(B(a.a))){b=D(a.a);d=B(a.a);if("/"==b&&(gb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Lb;d=new Lb;V(a,"Missing next location step.");b=fc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=$b(a);V(a,'unclosed "("');bc(a,")");break;case '"':case "'":b=dc(a);break;default:if(isNaN(+b))if(!Gb(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=D(a.a); -b=Fb[b]||null;D(a.a);for(d=[];")"!=B(a.a);){V(a,"Missing function argument list.");d.push($b(a));if(","!=B(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");cc(a);b=new Db(b,d)}else{b=null;break a}else b=new Ib(+D(a.a))}"["==B(a.a)&&(d=new Qb(gc(a)),b=new Bb(b,d))}if(b)if(Nb(B(a.a)))d=b;else return b;else b=fc(a,"/"),d=new Mb,c.push(b)}for(;Nb(B(a.a));)b=D(a.a),V(a,"Missing next location step."),b=fc(a,b),c.push(b);return new Jb(d,c)} -function fc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new T(Wb,new J("node")),D(a.a),d;if(".."==B(a.a))return d=new T(Vb,new J("node")),D(a.a),d;var f;if("@"==B(a.a))f=Kb,D(a.a),V(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Ub[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Rb;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!Gb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Gb(c))throw Error("Invalid type name: "+c);bc(a,"(");V(a,"Bad nodetype");e=B(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=dc(a);V(a,"Bad nodetype");cc(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Qb(gc(a),f.a);return d|| -new T(f,c,e,"//"==b)}function gc(a){for(var b=[];"["==B(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=$b(a);b.push(c);V(a,"Unclosed predicate expression.");bc(a,"]")}return b}function ac(a){if("-"==B(a.a))return D(a.a),new Xb(ac(a));var b=ec(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(ec(a));a.a.a--;a=new Yb(b)}return a};function hc(a){switch(a.nodeType){case 1:return ja(ic,a);case 9:return hc(a.documentElement);case 11:case 10:case 6:case 12:return jc;default:return a.parentNode?hc(a.parentNode):jc}}function jc(){return null}function ic(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?ic(a.parentNode,b):null};function kc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=db(a);if(gb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=$b(new Zb(c,b));if(!gb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new Za(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?rb(a):""+a;break;case 1:this.numberValue=a instanceof G?+rb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof ab?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=qb(a);this.singleNodeValue=d instanceof ab?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function lc(a){this.lookupNamespaceURI=hc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new kc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new kc(a,b)},d.createNSResolver=function(a){return new lc(a)}});function mc(a){return(a=a.exec(t))?a[1]:""}var nc=function(){if(Ua)return mc(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return La;if(Xa)return mc(/Chrome\/([0-9.]+)/);if(Ya&&!(Da()||u("iPad")||u("iPod")))return mc(/Version\/([0-9.]+)/);if(Va||Wa){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(z)return(a=mc(/Android\s+([0-9.]+)/))?a:mc(/Version\/([0-9.]+)/);return""}();var oc,pc;function qc(a){return rc?oc(a):x?0<=ma(Pa,a):Na(a)}function sc(a){rc?pc(a):z?ma(tc,a):ma(nc,a)} -var rc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;oc=function(a){return 0<=c.compare(d,""+a)};pc=function(a){c.compare(e,""+a)};return!0}(),uc;if(z){var vc=/Android\s+([0-9\.]+)/.exec(t);uc=vc?vc[1]:"0"}else uc="0";var tc=uc;z&&sc(2.3); -z&&sc(4);Ya&&sc(6);Ga||rc&&sc(3.6);x&&qc(10);z&&sc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=wc(a),xc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function wc(a){xc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function xc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=wc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var yc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new zc(a);!b||b in yc&&!c||(yc[b]={key:a,shift:!1},c&&(yc[c]={key:a,shift:!0}));return a}function zc(a){this.code=a}Z(8);Z(9);Z(13);var Ac=Z(16),Bc=Z(17),Cc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Dc=Z(Ia?{f:91,g:91}:Ha?{f:224,g:91}:{f:0,g:91});Z(Ia?{f:92,g:92}:Ha?{f:224,g:93}:{f:0,g:92});Z(Ia?{f:93,g:93}:Ha?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Ec=new X;Y(Ec,1,Ac);Y(Ec,2,Bc);Y(Ec,4,Cc);Y(Ec,8,Dc);(function(a){var b=new X;p(wc(a),function(c){Y(b,a.get(c).code,c)});return b})(Ec);y&&qc(12);function Fc(){} -function Gc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Gc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Hc(d,c),c.push(":"),Gc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Hc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Ic={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Jc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Hc(a,b){b.push('"',a.replace(Jc,function(a){var b=Ic[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ic[a]=b);return b}),'"')};Ga||y&&qc(3.5)||x&&qc(8);function Kc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return pa(a,Kc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Lc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Lc(a),b;if(ca(a))return pa(a,Kc);a=ya(a,function(a,b){return"number"==typeof b||l(b)});return za(a,Kc);default:return null}} -function Mc(a,b){return"array"==ba(a)?pa(a,function(a){return Mc(a,b)}):da(a)?"function"==typeof a?a:w(a,"ELEMENT")?Nc(a.ELEMENT,b):w(a,"WINDOW")?Nc(a.WINDOW,b):za(a,function(a){return Mc(a,b)}):a} -function Oc(a,b){var c;try{a:{var d=a;if(l(d))try{a=new n.Function(d);break a}catch(h){if(x&&n.execScript){n.execScript(";");a=new n.Function(d);break a}throw h;}a=n==window?d:new n.Function("return ("+d+").apply(null,arguments);")}var e=Mc(b,n.document),f=a.apply(null,e);c={status:0,value:Kc(f)}}catch(h){c={status:w(h,"code")?h.code:13,value:{message:h.message}}}d=[];Gc(new Fc,c,d);return d.join("")}function Pc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b} -function Lc(a){var b=Pc(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c}function Nc(a,b){a=decodeURIComponent(a);var c=b||document,d=Pc(c);if(!w(d,a))throw new ua(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new ua(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new ua(10,"Element is no longer attached to the DOM");};aa("_",function(a){return Oc(function(a){a.name||a.id||(a.name="random_name_id_"+(new Date).getTime(),a.id=a.name);return a.name||a.id},[a])});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_attribute_value.js b/src/ghostdriver/third_party/webdriver-atoms/get_attribute_value.js deleted file mode 100644 index 235844e23a..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_attribute_value.js +++ /dev/null @@ -1,93 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function fa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ga(a,b,c){ga=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa;return ga.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",C=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var ha=C.exec(k)||["","",""],ia=O.exec(v)||["","",""];if(0==ha[0].length&&0==ia[0].length)break;c=na(0==ha[1].length?0:parseInt(ha[1],10),0==ia[1].length?0:parseInt(ia[1],10))||na(0==ha[2].length,0==ia[2].length)||na(ha[2],ia[2])}while(0==c)}return c} -function na(a,b){return a<b?-1:a>b?1:0};function oa(a,b){if(l(a))return l(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function n(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function pa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d} -function qa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function p(a,b,c){var d=c;n(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ra(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function sa(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]} -function ta(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ua(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function q(a,b){this.code=a;this.a=r[a]||va;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(q,Error);var va="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=va;r[30]=va;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=va;r[9]="unknown command";q.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var wa=g.navigator;if(wa){var xa=wa.userAgent;if(xa){t=xa;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function ya(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function za(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return u("Opera")||u("OPR")}function Ca(){return(u("Chrome")||u("CriOS"))&&!Ba()&&!u("Edge")};function Da(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Ea=Ba(),x=u("Trident")||u("MSIE"),Fa=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ga=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ha=u("Macintosh"),Ia=u("Windows");function Ja(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ga)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=g.document;return a?a.documentMode:void 0} -var La=function(){if(Ea&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),null!=b&&b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=ma(La,a))}var Oa=g.document,z=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!y&&!x||x&&9<=Number(z)||y&&Na("1.9.1");x&&Na("9");function Pa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Qa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(z))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ra(a,b):!c&&Pa(e,b)?-1*Sa(a,b):!d&&Pa(f,a)?Sa(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Sa(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ra(d,a)}function Ra(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}var Ta={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Ua={IMG:" ",BR:"\n"}; -function Va(a,b,c){if(!(a.nodeName in Ta))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in Ua)b.push(Ua[a.nodeName]);else for(a=a.firstChild;a;)Va(a,b,c),a=a.nextSibling};var Wa=u("Firefox"),Xa=Da()||u("iPod"),Ya=u("iPad"),Za=u("Android")&&!(Ca()||u("Firefox")||Ba()||u("Silk")),$a=Ca(),ab=u("Safari")&&!(Ca()||u("Coast")||Ba()||u("Edge")||u("Silk")||u("Android"))&&!(Da()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function bb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(z)),cb=x&&!(8<=Number(z));function db(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function eb(a,b){var c=cb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new db(b,a,b.nodeName,c)};function fb(a){this.b=a;this.a=0}function gb(a){a=a.match(hb);for(var b=0;b<a.length;b++)ib.test(a[b])&&a.splice(b,1);return new fb(a)}var hb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),ib=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function jb(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}cb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function kb(a,b,c,d,e){return(A?lb:mb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function lb(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=nb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}ob(a,b,c,d,e);return e} -function mb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),n(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?ob(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),n(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function pb(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=nb(a);if("*"!=h&&(f=pa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=pa(f,function(a){return F(a,c,d)}));n(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return qb(a,b,c,d,e)}function qb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function ob(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),ob(a,b,c,d,e)}function nb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function rb(a){this.node=a;this.a=this.b=null}function sb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof db&&k instanceof db&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Qa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new rb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new rb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function tb(a){return(a=a.a)?a.node:null}function ub(a){return(a=tb(a))?E(a):""}function K(a,b){return new vb(a,!!b)}function vb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function wb(a,b){a.i=b}function xb(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+ub(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?ub(c):""+c}function yb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function zb(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Ab&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(zb,M); -function Bb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}zb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};zb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function Cb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}Cb.prototype.toString=function(){return this.a};var Db={}; -function R(a,b,c,d){if(Db.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Cb(a,b,c,d);return Db[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return Bb(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return Bb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return Bb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return Bb(function(a,b){return a>=b},a,b,c)});var Ab=R("=",3,2,function(a,b,c){return Bb(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return Bb(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return yb(a,c)&&yb(b,c)});R("or",1,2,function(a,b,c){return yb(a,c)||yb(b,c)});function Eb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Eb,M);Eb.prototype.a=function(a){a=this.c.a(a);return Fb(this.j,a)};Eb.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Gb(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&n(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;wb(this,a.i||ra(b,function(a){return a.i}));xb(this,a.J&&!b.length||a.I&&!!b.length||ra(b,function(a){return a.b}))} -m(Gb,M);Gb.prototype.a=function(a){return this.j.v.apply(null,ta(a,this.c))};Gb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=p(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Hb(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Hb.prototype.toString=function(){return this.o};var Ib={}; -function S(a,b,c,d,e,f,h,k){if(Ib.hasOwnProperty(a))throw Error("Function already created: "+a+".");Ib[a]=new Hb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return yb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return p(ua(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1);S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return sa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];n(d,function(a){a=c(a);!a||0<=oa(f,a)||f.push(a)});f.sort(Qa);var h=new G;n(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?tb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?tb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!yb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Jb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Kb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Kb,M);Kb.prototype.a=function(){return this.c};Kb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Lb(a){M.call(this,1);this.c=a}m(Lb,M);Lb.prototype.a=function(){return this.c};Lb.prototype.toString=function(){return"Number: "+this.c};function Mb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Nb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Mb,M);function Ob(){M.call(this,4)}m(Ob,M);Ob.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Ob.prototype.toString=function(){return"Root Helper Expression"};function Pb(){M.call(this,4)}m(Pb,M);Pb.prototype.a=function(a){var b=new G;I(b,a.a);return b};Pb.prototype.toString=function(){return"Context Helper Expression"}; -function Qb(a){return"/"==a||"//"==a}Mb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Rb)if(e.i||e.c!=Sb)for(h=L(f),b=e.a(new bb(h));null!=(h=L(f));)h=e.a(new bb(h)),b=sb(b,h);else h=L(f),b=e.a(new bb(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new bb(h))}}return b}; -Mb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=p(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Tb(a,b){this.a=a;this.b=!!b} -function Fb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new bb(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var C=v.a;if(!C)throw Error("Next must be called at least once before remove.");var O=C.b,C=C.a;O?O.a=C:h.a=C;C?C.b=O:h.b=O;h.s--;v.a=null}}return b} -Tb.prototype.toString=function(){return p(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Tb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Ub)if(a=K((new T(Vb,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=sb(c,this.v(b,d,e,f));else c=new G;else c=kb(this.w,b,d,e),c=Fb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Fb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=p(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Wb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Wb.prototype.toString=function(){return this.o};var Xb={};function U(a,b,c,d){if(Xb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Wb(a,b,c,!!d);return Xb[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Nb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new db(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,eb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,eb(b,f)):I(c,f));return c},!1),Ub=U("child",function(a,b,c,d,e){return(A?pb:qb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",kb,!1,!0); -var Vb=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return kb(a,b,c,d,e)},!1,!0),Rb=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=kb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Yb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Sb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var C=0,O=v.length;C<O;C++)b=v[C],F(b,c,d)&&a.a(b)&&I(e,b),e=kb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Zb=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function $b(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m($b,M);$b.prototype.a=function(a){return-P(this.c,a)};$b.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function ac(a){M.call(this,4);this.c=a;wb(this,ra(this.c,function(a){return a.i}));xb(this,ra(this.c,function(a){return a.b}))}m(ac,M);ac.prototype.a=function(a){var b=new G;n(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=sb(b,c)});return b};ac.prototype.toString=function(){return p(this.c,function(a,b){return a+N(b)},"Union Expression:")};function bc(a,b){this.a=a;this.b=b}function cc(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=dc(a);var d=D(a.a);if(!d)break;var e=(d=Db[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new zb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new zb(c.pop(),c.pop(),b);return b}function V(a,b){if(jb(a.a))throw Error(b);}function ec(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function fc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function gc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Kb(a)} -function hc(a){var b,c=[],d;if(Qb(B(a.a))){b=D(a.a);d=B(a.a);if("/"==b&&(jb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Ob;d=new Ob;V(a,"Missing next location step.");b=ic(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=cc(a);V(a,'unclosed "("');ec(a,")");break;case '"':case "'":b=gc(a);break;default:if(isNaN(+b))if(!Jb(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=D(a.a); -b=Ib[b]||null;D(a.a);for(d=[];")"!=B(a.a);){V(a,"Missing function argument list.");d.push(cc(a));if(","!=B(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");fc(a);b=new Gb(b,d)}else{b=null;break a}else b=new Lb(+D(a.a))}"["==B(a.a)&&(d=new Tb(jc(a)),b=new Eb(b,d))}if(b)if(Qb(B(a.a)))d=b;else return b;else b=ic(a,"/"),d=new Pb,c.push(b)}for(;Qb(B(a.a));)b=D(a.a),V(a,"Missing next location step."),b=ic(a,b),c.push(b);return new Mb(d,c)} -function ic(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new T(Zb,new J("node")),D(a.a),d;if(".."==B(a.a))return d=new T(Yb,new J("node")),D(a.a),d;var f;if("@"==B(a.a))f=Nb,D(a.a),V(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Xb[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Ub;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!Jb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Jb(c))throw Error("Invalid type name: "+c);ec(a,"(");V(a,"Bad nodetype");e=B(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=gc(a);V(a,"Bad nodetype");fc(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Tb(jc(a),f.a);return d|| -new T(f,c,e,"//"==b)}function jc(a){for(var b=[];"["==B(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=cc(a);b.push(c);V(a,"Unclosed predicate expression.");ec(a,"]")}return b}function dc(a){if("-"==B(a.a))return D(a.a),new $b(dc(a));var b=hc(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(hc(a));a.a.a--;a=new ac(b)}return a};function kc(a){switch(a.nodeType){case 1:return ja(lc,a);case 9:return kc(a.documentElement);case 11:case 10:case 6:case 12:return mc;default:return a.parentNode?kc(a.parentNode):mc}}function mc(){return null}function lc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?lc(a.parentNode,b):null};function nc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=gb(a);if(jb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ga(b.lookupNamespaceURI,b)):b=function(){return null};var d=cc(new bc(c,b));if(!jb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new bb(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?ub(a):""+a;break;case 1:this.numberValue=a instanceof G?+ub(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof db?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=tb(a);this.singleNodeValue=d instanceof db?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function oc(a){this.lookupNamespaceURI=kc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new nc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new nc(a,b)},d.createNSResolver=function(a){return new oc(a)}});function pc(a){return(a=a.exec(t))?a[1]:""}var qc=function(){if(Wa)return pc(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return La;if($a)return pc(/Chrome\/([0-9.]+)/);if(ab&&!(Da()||u("iPad")||u("iPod")))return pc(/Version\/([0-9.]+)/);if(Xa||Ya){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(Za)return(a=pc(/Android\s+([0-9.]+)/))?a:pc(/Version\/([0-9.]+)/);return""}();var rc,sc;function tc(a){return uc?rc(a):x?0<=ma(z,a):Na(a)}function vc(a){uc?sc(a):Za?ma(wc,a):ma(qc,a)} -var uc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;rc=function(a){return 0<=c.compare(d,""+a)};sc=function(a){c.compare(e,""+a)};return!0}(),xc;if(Za){var yc=/Android\s+([0-9\.]+)/.exec(t);xc=yc?yc[1]:"0"}else xc="0"; -var wc=xc,zc=x&&!(8<=Number(z)),Ac=x&&!(9<=Number(z));Za&&vc(2.3);Za&&vc(4);ab&&vc(6);function Bc(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Cc(a){return Bc(a,"OPTION")?!0:Bc(a,"INPUT")?(a=a.type.toLowerCase(),"checkbox"==a||"radio"==a):!1}function Dc(a,b){var c;if(c=zc&&"value"==b&&Bc(a,"OPTION"))c=null===Ec(a,"value");c?(c=[],Va(a,c,!1),c=c.join("")):c=a[b];return c}var Fc=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; -function Gc(a){var b=[];n(a.split(Fc),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function Ec(a,b){b=b.toLowerCase();if("style"==b)return Gc(a.style.cssText);if(zc&&"value"==b&&Bc(a,"INPUT"))return a.value;if(Ac&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null};Ga||uc&&vc(3.6);x&&tc(10);Za&&vc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=Hc(a),Ic(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function Hc(a){Ic(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function Ic(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=Hc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var Jc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new Kc(a);!b||b in Jc&&!c||(Jc[b]={key:a,shift:!1},c&&(Jc[c]={key:a,shift:!0}));return a}function Kc(a){this.code=a}Z(8);Z(9);Z(13);var Lc=Z(16),Mc=Z(17),Nc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Oc=Z(Ia?{f:91,g:91}:Ha?{f:224,g:91}:{f:0,g:91});Z(Ia?{f:92,g:92}:Ha?{f:224,g:93}:{f:0,g:92});Z(Ia?{f:93,g:93}:Ha?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Pc=new X;Y(Pc,1,Lc);Y(Pc,2,Mc);Y(Pc,4,Nc);Y(Pc,8,Oc);(function(a){var b=new X;n(Hc(a),function(c){Y(b,a.get(c).code,c)});return b})(Pc);y&&tc(12);var Qc={"class":"className",readonly:"readOnly"},Rc="async autofocus autoplay checked compact complete controls declare defaultchecked defaultselected defer disabled draggable ended formnovalidate hidden indeterminate iscontenteditable ismap itemscope loop multiple muted nohref noresize noshade novalidate nowrap open paused pubdate readonly required reversed scoped seamless seeking selected spellcheck truespeed willvalidate".split(" "); -function Sc(a,b){var c=null,d=b.toLowerCase();if("style"==d)return(c=a.style)&&!l(c)&&(c=c.cssText),c;if(("selected"==d||"checked"==d)&&Cc(a)){if(!Cc(a))throw new q(15,"Element is not selectable");c="selected";d=a.type&&a.type.toLowerCase();if("checkbox"==d||"radio"==d)c="checked";return Dc(a,c)?"true":null}var e=Bc(a,"A");if(Bc(a,"IMG")&&"src"==d||e&&"href"==d)return(c=Ec(a,d))&&(c=Dc(a,d)),c;if("spellcheck"==d){c=Ec(a,d);if(null!==c){if("false"==c.toLowerCase())return"false";if("true"==c.toLowerCase())return"true"}return Dc(a, -d)+""}e=Qc[b]||b;if(0<=oa(Rc,d))return(c=null!==Ec(a,b)||Dc(a,e))?"true":null;var f;try{f=Dc(a,e)}catch(h){}null==f||da(f)?c=Ec(a,b):c=f;return null!=c?c.toString():null};function Tc(){} -function Uc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Uc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Vc(d,c),c.push(":"),Uc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Vc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Wc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Xc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Vc(a,b){b.push('"',a.replace(Xc,function(a){var b=Wc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Wc[a]=b);return b}),'"')};Ga||y&&tc(3.5)||x&&tc(8);function Yc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return qa(a,Yc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Zc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Zc(a),b;if(ca(a))return qa(a,Yc);a=ya(a,function(a,b){return"number"==typeof b||l(b)});return za(a,Yc);default:return null}} -function $c(a,b){return"array"==ba(a)?qa(a,function(a){return $c(a,b)}):da(a)?"function"==typeof a?a:w(a,"ELEMENT")?ad(a.ELEMENT,b):w(a,"WINDOW")?ad(a.WINDOW,b):za(a,function(a){return $c(a,b)}):a}function bd(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b}function Zc(a){var b=bd(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function ad(a,b){a=decodeURIComponent(a);var c=b||document,d=bd(c);if(!w(d,a))throw new q(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new q(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new q(10,"Element is no longer attached to the DOM");};aa("_",function(a,b,c){a=[a,b];var d;try{var e;c?e=ad(c.WINDOW):e=window;var f=$c(a,e.document),h=Sc.apply(null,f);d={status:0,value:Yc(h)}}catch(k){d={status:w(k,"code")?k.code:13,value:{message:k.message}}}c=[];Uc(new Tc,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_first_client_rect_chrome.js b/src/ghostdriver/third_party/webdriver-atoms/get_first_client_rect_chrome.js deleted file mode 100644 index d280365af5..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_first_client_rect_chrome.js +++ /dev/null @@ -1,69 +0,0 @@ -function(){return function(){var aa=this;function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function h(a){return"string"==typeof a}function da(a,b,c){return a.call.apply(a.bind,arguments)}function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}} -function fa(a,b,c){fa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?da:ea;return fa.apply(null,arguments)}function ga(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}} -function l(a){var b=m;function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.F=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};function n(a,b){for(var c=a.length,d=h(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function p(a,b,c){var d=c;n(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function q(a,b){for(var c=a.length,d=h(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ha(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ia(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function r(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}r.prototype.clone=function(){return new r(this.x,this.y)};r.prototype.toString=function(){return"("+this.x+", "+this.y+")"};r.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};r.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};r.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function ja(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function ka(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?la(a,b):!c&&ja(e,b)?-1*ma(a,b):!d&&ja(f,a)?ma(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType?a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0); -d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function ma(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return la(d,a)}function la(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function t(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function na(a){this.b=a;this.a=0}function oa(a){a=a.match(pa);for(var b=0;b<a.length;b++)qa.test(a[b])&&a.splice(b,1);return new na(a)}var pa=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),qa=/^\s/;function u(a,b){return a.b[a.a+(b||0)]}function w(a){return a.b[a.a++]}function x(a){return a.b.length<=a.a};function y(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function z(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function B(a,b,c,d,e){return ra.call(null,a,b,h(c)?c:null,h(d)?d:null,e||new C)} -function ra(a,b,c,d,e){b.getElementsByName&&d&&"name"==c?(b=b.getElementsByName(d),n(b,function(b){a.a(b)&&D(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(b){b.className==d&&a.a(b)&&D(e,b)})):a instanceof E?sa(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),n(b,function(a){z(a,c,d)&&D(e,a)}));return e}function ta(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)z(b,c,d)&&a.a(b)&&D(e,b);return e} -function sa(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)z(b,c,d)&&a.a(b)&&D(e,b),sa(a,b,c,d,e)};function C(){this.b=this.a=null;this.l=0}function ua(a){this.node=a;this.a=this.b=null}function va(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;)c.node==d.node?(f=c,c=c.a,d=d.a):0<ka(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a),(f.b=e)?e.a=f:a.a=f,e=f,g++;for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}C.prototype.unshift=function(a){a=new ua(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++}; -function D(a,b){var c=new ua(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function F(a){return(a=a.a)?a.node:null}function G(a){return(a=F(a))?y(a):""}function H(a,b){return new wa(a,!!b)}function wa(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function I(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function m(a){this.i=a;this.b=this.g=!1;this.f=null}function J(a){return"\n "+a.toString().split("\n").join("\n ")}function xa(a,b){a.g=b}function ya(a,b){a.b=b}function K(a,b){var c=a.a(b);return c instanceof C?+G(c):+c}function L(a,b){var c=a.a(b);return c instanceof C?G(c):""+c}function M(a,b){var c=a.a(b);return c instanceof C?!!c.l:!!c};function N(a,b,c){m.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==za&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,s:b}):this.f={name:b.f.name,s:c})}l(N); -function O(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof C&&c instanceof C){b=H(b);for(d=I(b);d;d=I(b))for(e=H(c),f=I(e);f;f=I(e))if(a(y(d),y(f)))return!0;return!1}if(b instanceof C||c instanceof C){b instanceof C?(e=b,d=c):(e=c,d=b);f=H(e);for(var g=typeof d,k=I(f);k;k=I(f)){switch(g){case "number":k=+y(k);break;case "boolean":k=!!y(k);break;case "string":k=y(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}N.prototype.a=function(a){return this.c.m(this.h,this.o,a)};N.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+J(this.h);return a+=J(this.o)};function Aa(a,b,c,d){this.a=a;this.w=b;this.i=c;this.m=d}Aa.prototype.toString=function(){return this.a};var Ba={}; -function P(a,b,c,d){if(Ba.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Aa(a,b,c,d);return Ba[a.toString()]=a}P("div",6,1,function(a,b,c){return K(a,c)/K(b,c)});P("mod",6,1,function(a,b,c){return K(a,c)%K(b,c)});P("*",6,1,function(a,b,c){return K(a,c)*K(b,c)});P("+",5,1,function(a,b,c){return K(a,c)+K(b,c)});P("-",5,1,function(a,b,c){return K(a,c)-K(b,c)});P("<",4,2,function(a,b,c){return O(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return O(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return O(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return O(function(a,b){return a>=b},a,b,c)});var za=P("=",3,2,function(a,b,c){return O(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return O(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return M(a,c)&&M(b,c)});P("or",1,2,function(a,b,c){return M(a,c)||M(b,c)});function R(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");m.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}l(R);R.prototype.a=function(a){a=this.c.a(a);return Ca(this.h,a)};R.prototype.toString=function(){var a;a="Filter:"+J(this.c);return a+=J(this.h)};function Da(a,b){if(b.length<a.A)throw Error("Function "+a.j+" expects at least"+a.A+" arguments, "+b.length+" given");if(null!==a.v&&b.length>a.v)throw Error("Function "+a.j+" expects at most "+a.v+" arguments, "+b.length+" given");a.B&&n(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});m.call(this,a.i);this.h=a;this.c=b;xa(this,a.g||q(b,function(a){return a.g}));ya(this,a.D&&!b.length||a.C&&!!b.length||q(b,function(a){return a.b}))}l(Da); -Da.prototype.a=function(a){return this.h.m.apply(null,ha(a,this.c))};Da.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=p(this.c,function(a,b){return a+J(b)},"Arguments:"),a=a+J(b);return a};function Ea(a,b,c,d,e,f,g,k,v){this.j=a;this.i=b;this.g=c;this.D=d;this.C=e;this.m=f;this.A=g;this.v=void 0!==k?k:g;this.B=!!v}Ea.prototype.toString=function(){return this.j};var Fa={}; -function S(a,b,c,d,e,f,g,k){if(Fa.hasOwnProperty(a))throw Error("Function already created: "+a+".");Fa[a]=new Ea(a,b,c,d,!1,e,f,g,k)}S("boolean",2,!1,!1,function(a,b){return M(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(K(b,a))},1);S("concat",3,!1,!1,function(a,b){return p(ia(arguments,1),function(b,d){return b+L(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(K(b,a))},1);S("id",4,!1,!1,function(a,b){var c=a.a,d=9==c.nodeType?c:c.ownerDocument,c=L(b,a).split(/\s+/),e=[];n(c,function(a){a=d.getElementById(a);var b;if(!(b=!a)){a:if(h(e))b=h(a)&&1==a.length?e.indexOf(a,0):-1;else{for(b=0;b<e.length;b++)if(b in e&&e[b]===a)break a;b=-1}b=0<=b}b||e.push(a)});e.sort(ka);var f=new C;n(e,function(a){D(f,a)});return f},1);S("lang",2,!1,!1,function(){return!1},1); -S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);S("local-name",3,!1,!0,function(a,b){var c=b?F(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?F(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0);S("normalize-space",3,!1,!0,function(a,b){return(b?L(b,a):y(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1); -S("not",2,!1,!1,function(a,b){return!M(b,a)},1);S("number",1,!1,!0,function(a,b){return b?K(b,a):+y(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(K(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?L(b,a):y(a.a)},0,1);S("string-length",1,!1,!0,function(a,b){return(b?L(b,a):y(a.a)).length},0,1); -S("substring",3,!1,!1,function(a,b,c,d){c=K(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?K(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=L(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=H(b.a(a)),d=0,e=I(c);e;e=I(c))d+=+y(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=L(b,a);c=L(c,a);var e=L(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function E(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ga(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}E.prototype.a=function(a){return null===this.b||this.b==a.nodeType};E.prototype.f=function(){return this.h}; -E.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=J(this.c));return a};function Ha(a){m.call(this,3);this.c=a.substring(1,a.length-1)}l(Ha);Ha.prototype.a=function(){return this.c};Ha.prototype.toString=function(){return"Literal: "+this.c};function T(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.b=b?b.toLowerCase():c}T.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.localName.toLowerCase()?!1:"*"==this.b?!0:this.b==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};T.prototype.f=function(){return this.j};T.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.b?"":this.b+":")+this.j};function Ia(a){m.call(this,1);this.c=a}l(Ia);Ia.prototype.a=function(){return this.c};Ia.prototype.toString=function(){return"Number: "+this.c};function Ja(a,b){m.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.u||c.c!=Ka||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}l(Ja);function U(){m.call(this,4)}l(U);U.prototype.a=function(a){var b=new C;a=a.a;9==a.nodeType?D(b,a):D(b,a.ownerDocument);return b};U.prototype.toString=function(){return"Root Helper Expression"};function La(){m.call(this,4)}l(La);La.prototype.a=function(a){var b=new C;D(b,a.a);return b};La.prototype.toString=function(){return"Context Helper Expression"}; -function Ma(a){return"/"==a||"//"==a}Ja.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof C))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=H(b,e.c.a),g;if(e.g||e.c!=Na)if(e.g||e.c!=Oa)for(g=I(f),b=e.a(new t(g));null!=(g=I(f));)g=e.a(new t(g)),b=va(b,g);else g=I(f),b=e.a(new t(g));else{for(g=I(f);(b=I(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new t(g))}}return b}; -Ja.prototype.toString=function(){var a;a="Path Expression:"+J(this.h);if(this.c.length){var b=p(this.c,function(a,b){return a+J(b)},"Steps:");a+=J(b)}return a};function Pa(a,b){this.a=a;this.b=!!b} -function Ca(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=H(b),f=b.l,g,k=0;g=I(e);k++){var v=a.b?f-k:k+1;g=d.a(new t(g,v,f));if("number"==typeof g)v=v==g;else if("string"==typeof g||"boolean"==typeof g)v=!!g;else if(g instanceof C)v=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;g=v.f;var A=v.a;if(!A)throw Error("Next must be called at least once before remove.");var Q=A.b,A=A.a;Q?Q.a=A:g.a=A;A?A.b=Q:g.b=Q;g.l--;v.a=null}}return b} -Pa.prototype.toString=function(){return p(this.a,function(a,b){return a+J(b)},"Predicates:")};function V(a,b,c,d){m.call(this,4);this.c=a;this.o=b;this.h=c||new Pa([]);this.u=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(this.f={name:b.name,s:b.s});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}l(V); -V.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.s?L(c.s,a):null,f=1);if(this.u)if(this.g||this.c!=Qa)if(a=H((new V(Ra,new E("node"))).a(a)),b=I(a))for(c=this.m(b,d,e,f);null!=(b=I(a));)c=va(c,this.m(b,d,e,f));else c=new C;else c=B(this.o,b,d,e),c=Ca(this.h,c,f);else c=this.m(a.a,d,e,f);return c};V.prototype.m=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=Ca(this.h,a,d)}; -V.prototype.toString=function(){var a;a="Step:"+J("Operator: "+(this.u?"//":"/"));this.c.j&&(a+=J("Axis: "+this.c));a+=J(this.o);if(this.h.a.length){var b=p(this.h.a,function(a,b){return a+J(b)},"Predicates:");a+=J(b)}return a};function Sa(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Sa.prototype.toString=function(){return this.j};var Ta={};function W(a,b,c,d){if(Ta.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Sa(a,b,c,!!d);return Ta[a]=b} -W("ancestor",function(a,b){for(var c=new C,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);W("ancestor-or-self",function(a,b){var c=new C,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);var Ka=W("attribute",function(a,b){var c=new C,d=a.f(),e=b.attributes;if(e)if(a instanceof E&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)D(c,f);else(f=e.getNamedItem(d))&&D(c,f);return c},!1),Qa=W("child",function(a,b,c,d,e){return ta.call(null,a,b,h(c)?c:null,h(d)?d:null,e||new C)},!1,!0); -W("descendant",B,!1,!0);var Ra=W("descendant-or-self",function(a,b,c,d){var e=new C;z(b,c,d)&&a.a(b)&&D(e,b);return B(a,b,c,d,e)},!1,!0),Na=W("following",function(a,b,c,d){var e=new C;do for(var f=b;f=f.nextSibling;)z(f,c,d)&&a.a(f)&&D(e,f),e=B(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);W("following-sibling",function(a,b){for(var c=new C,d=b;d=d.nextSibling;)a.a(d)&&D(c,d);return c},!1);W("namespace",function(){return new C},!1); -var Ua=W("parent",function(a,b){var c=new C;if(9==b.nodeType)return c;if(2==b.nodeType)return D(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&D(c,d);return c},!1),Oa=W("preceding",function(a,b,c,d){var e=new C,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var v=[];for(b=f[g];b=b.previousSibling;)v.unshift(b);for(var A=0,Q=v.length;A<Q;A++)b=v[A],z(b,c,d)&&a.a(b)&&D(e,b),e=B(a,b,c,d,e)}return e},!0,!0); -W("preceding-sibling",function(a,b){for(var c=new C,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Va=W("self",function(a,b){var c=new C;a.a(b)&&D(c,b);return c},!1);function Wa(a){m.call(this,1);this.c=a;this.g=a.g;this.b=a.b}l(Wa);Wa.prototype.a=function(a){return-K(this.c,a)};Wa.prototype.toString=function(){return"Unary Expression: -"+J(this.c)};function Xa(a){m.call(this,4);this.c=a;xa(this,q(this.c,function(a){return a.g}));ya(this,q(this.c,function(a){return a.b}))}l(Xa);Xa.prototype.a=function(a){var b=new C;n(this.c,function(c){c=c.a(a);if(!(c instanceof C))throw Error("Path expression must evaluate to NodeSet.");b=va(b,c)});return b};Xa.prototype.toString=function(){return p(this.c,function(a,b){return a+J(b)},"Union Expression:")};function Ya(a,b){this.a=a;this.b=b}function Za(a){for(var b,c=[];;){X(a,"Missing right hand side of binary expression.");b=$a(a);var d=w(a.a);if(!d)break;var e=(d=Ba[d]||null)&&d.w;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].w;)b=new N(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new N(c.pop(),c.pop(),b);return b}function X(a,b){if(x(a.a))throw Error(b);}function ab(a,b){var c=w(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function bb(a){a=w(a.a);if(")"!=a)throw Error("Bad token: "+a);}function cb(a){a=w(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Ha(a)} -function db(a){var b,c=[],d;if(Ma(u(a.a))){b=w(a.a);d=u(a.a);if("/"==b&&(x(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new U;d=new U;X(a,"Missing next location step.");b=eb(a,b);c.push(b)}else{a:{b=u(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":w(a.a);b=Za(a);X(a,'unclosed "("');ab(a,")");break;case '"':case "'":b=cb(a);break;default:if(isNaN(+b))if(!Ga(b)&&/(?![0-9])[\w]/.test(d)&&"("==u(a.a,1)){b=w(a.a);b= -Fa[b]||null;w(a.a);for(d=[];")"!=u(a.a);){X(a,"Missing function argument list.");d.push(Za(a));if(","!=u(a.a))break;w(a.a)}X(a,"Unclosed function argument list.");bb(a);b=new Da(b,d)}else{b=null;break a}else b=new Ia(+w(a.a))}"["==u(a.a)&&(d=new Pa(fb(a)),b=new R(b,d))}if(b)if(Ma(u(a.a)))d=b;else return b;else b=eb(a,"/"),d=new La,c.push(b)}for(;Ma(u(a.a));)b=w(a.a),X(a,"Missing next location step."),b=eb(a,b),c.push(b);return new Ja(d,c)} -function eb(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==u(a.a))return d=new V(Va,new E("node")),w(a.a),d;if(".."==u(a.a))return d=new V(Ua,new E("node")),w(a.a),d;var f;if("@"==u(a.a))f=Ka,w(a.a),X(a,"Missing attribute name");else if("::"==u(a.a,1)){if(!/(?![0-9])[\w]/.test(u(a.a).charAt(0)))throw Error("Bad token: "+w(a.a));c=w(a.a);f=Ta[c]||null;if(!f)throw Error("No axis with name: "+c);w(a.a);X(a,"Missing node name")}else f=Qa;c=u(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -u(a.a,1)){if(!Ga(c))throw Error("Invalid node type: "+c);c=w(a.a);if(!Ga(c))throw Error("Invalid type name: "+c);ab(a,"(");X(a,"Bad nodetype");e=u(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=cb(a);X(a,"Bad nodetype");bb(a);c=new E(c,g)}else if(c=w(a.a),e=c.indexOf(":"),-1==e)c=new T(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new T(c,k)}else throw Error("Bad token: "+w(a.a));e=new Pa(fb(a),f.a);return d|| -new V(f,c,e,"//"==b)}function fb(a){for(var b=[];"["==u(a.a);){w(a.a);X(a,"Missing predicate expression.");var c=Za(a);b.push(c);X(a,"Unclosed predicate expression.");ab(a,"]")}return b}function $a(a){if("-"==u(a.a))return w(a.a),new Wa($a(a));var b=db(a);if("|"!=u(a.a))a=b;else{for(b=[b];"|"==w(a.a);)X(a,"Missing next union location path."),b.push(db(a));a.a.a--;a=new Xa(b)}return a};function gb(a){switch(a.nodeType){case 1:return ga(hb,a);case 9:return gb(a.documentElement);case 11:case 10:case 6:case 12:return ib;default:return a.parentNode?gb(a.parentNode):ib}}function ib(){return null}function hb(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?hb(a.parentNode,b):null};function jb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=oa(a);if(x(c))throw Error("Invalid XPath expression.");b?"function"==ca(b)||(b=fa(b.lookupNamespaceURI,b)):b=function(){return null};var d=Za(new Ya(c,b));if(!x(c))throw Error("Bad token: "+w(c));this.evaluate=function(a,b){var c=d.a(new t(a));return new Y(c,b)}} -function Y(a,b){if(0==b)if(a instanceof C)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof C))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof C?G(a):""+a;break;case 1:this.numberValue=a instanceof C?+G(a):+a;break;case 3:this.booleanValue=a instanceof C?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d= -H(a);c=[];for(var e=I(d);e;e=I(d))c.push(e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:this.singleNodeValue=F(a);break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||0>a?null:c[a]}}Y.ANY_TYPE=0; -Y.NUMBER_TYPE=1;Y.STRING_TYPE=2;Y.BOOLEAN_TYPE=3;Y.UNORDERED_NODE_ITERATOR_TYPE=4;Y.ORDERED_NODE_ITERATOR_TYPE=5;Y.UNORDERED_NODE_SNAPSHOT_TYPE=6;Y.ORDERED_NODE_SNAPSHOT_TYPE=7;Y.ANY_UNORDERED_NODE_TYPE=8;Y.FIRST_ORDERED_NODE_TYPE=9;function kb(a){this.lookupNamespaceURI=gb(a)} -ba("wgxpath.install",function(a,b){var c=a||aa,d=c.document;if(!d.evaluate||b)c.XPathResult=Y,d.evaluate=function(a,b,c,d){return(new jb(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new jb(a,b)},d.createNSResolver=function(a){return new kb(a)}});function Z(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}Z.prototype.clone=function(){return new Z(this.left,this.top,this.width,this.height)};Z.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};Z.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this}; -Z.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Z.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};ba("_",function(a){var b=a.getClientRects();if(0==b.length)throw Error("Element does not have any client rects");b=b[0];if(1==a.nodeType){b:{var c;try{c=a.getBoundingClientRect()}catch(d){a={left:0,top:0,right:0,bottom:0};break b}a=c}a=new r(a.left,a.top)}else a=a.changedTouches?a.changedTouches[0]:a,a=new r(a.clientX,a.clientY);return new Z(b.left-a.x,b.top-a.y,b.right-b.left,b.bottom-b.top)});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_location.js b/src/ghostdriver/third_party/webdriver-atoms/get_location.js deleted file mode 100644 index 0af3b5fee9..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_location.js +++ /dev/null @@ -1,91 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function fa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ga(a,b,c){ga=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa;return ga.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var n=window;var la;var ma=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function na(a,b){for(var c=0,d=ma(String(a)).split("."),e=ma(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",C=RegExp("(\\d*)(\\D*)","g"),P=RegExp("(\\d*)(\\D*)","g");do{var ha=C.exec(k)||["","",""],ia=P.exec(v)||["","",""];if(0==ha[0].length&&0==ia[0].length)break;c=oa(0==ha[1].length?0:parseInt(ha[1],10),0==ia[1].length?0:parseInt(ia[1],10))||oa(0==ha[2].length,0==ia[2].length)||oa(ha[2],ia[2])}while(0==c)}return c} -function oa(a,b){return a<b?-1:a>b?1:0};function p(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function pa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function qa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function q(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function ra(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function sa(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]}function ta(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ua(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function va(a,b){this.code=a;this.a=r[a]||wa;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(va,Error);var wa="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=wa;r[30]=wa;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=wa;r[9]="unknown command";va.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var xa=g.navigator;if(xa){var ya=xa.userAgent;if(ya){t=ya;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function za(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Aa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Ba(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ca(){return u("Opera")||u("OPR")}function Da(){return(u("Chrome")||u("CriOS"))&&!Ca()&&!u("Edge")};function Ea(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Fa=Ca(),x=u("Trident")||u("MSIE"),Ga=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ha=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ia=u("Macintosh"),Ja=u("Windows");function Ka(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ga)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ha)return/WebKit\/(\S+)/.exec(a)}function La(){var a=g.document;return a?a.documentMode:void 0} -var Ma=function(){if(Fa&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ka())&&(a=b?b[1]:"");return x&&(b=La(),null!=b&&b>parseFloat(a))?String(b):a}(),Na={};function Oa(a){return Na[a]||(Na[a]=0<=na(Ma,a))}var Pa=g.document,Qa=Pa&&x?La()||("CSS1Compat"==Pa.compatMode?parseInt(Ma,10):5):void 0;!y&&!x||x&&9<=Number(Qa)||y&&Oa("1.9.1");x&&Oa("9");function z(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}z.prototype.clone=function(){return new z(this.x,this.y)};z.prototype.toString=function(){return"("+this.x+", "+this.y+")"};z.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};z.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};z.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}; -z.prototype.scale=function(a,b){this.x*=a;this.y*="number"==typeof b?b:a;return this};function Ra(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Sa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(Qa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ta(a,b):!c&&Ra(e,b)?-1*Ua(a,b):!d&&Ra(f,a)?Ua(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=Va(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Ua(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ta(d,a)}function Ta(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function Va(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Wa(a){this.a=a||g.document||document}Wa.prototype.contains=Ra;var Xa=u("Firefox"),Ya=Ea()||u("iPod"),Za=u("iPad"),$a=u("Android")&&!(Da()||u("Firefox")||Ca()||u("Silk")),ab=Da(),bb=u("Safari")&&!(Da()||u("Coast")||Ca()||u("Edge")||u("Silk")||u("Android"))&&!(Ea()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function cb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(Qa)),db=x&&!(8<=Number(Qa));function eb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function fb(a,b){var c=db&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new eb(b,a,b.nodeName,c)};function gb(a){this.b=a;this.a=0}function hb(a){a=a.match(ib);for(var b=0;b<a.length;b++)jb.test(a[b])&&a.splice(b,1);return new gb(a)}var ib=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),jb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function kb(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}db&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function lb(a,b,c,d,e){return(A?mb:nb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function mb(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=ob(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}pb(a,b,c,d,e);return e} -function nb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?pb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function qb(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=ob(a);if("*"!=h&&(f=pa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=pa(f,function(a){return F(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return rb(a,b,c,d,e)}function rb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function pb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),pb(a,b,c,d,e)}function ob(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function sb(a){this.node=a;this.a=this.b=null}function tb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof eb&&k instanceof eb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Sa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new sb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new sb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function ub(a){return(a=a.a)?a.node:null}function vb(a){return(a=ub(a))?E(a):""}function K(a,b){return new wb(a,!!b)}function wb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function xb(a,b){a.i=b}function yb(a,b){a.b=b}function O(a,b){var c=a.a(b);return c instanceof G?+vb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?vb(c):""+c}function zb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function Ab(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Bb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(Ab,M); -function Cb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Ab.prototype.a=function(a){return this.c.v(this.j,this.w,a)};Ab.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function Db(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}Db.prototype.toString=function(){return this.a};var Eb={}; -function R(a,b,c,d){if(Eb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Db(a,b,c,d);return Eb[a.toString()]=a}R("div",6,1,function(a,b,c){return O(a,c)/O(b,c)});R("mod",6,1,function(a,b,c){return O(a,c)%O(b,c)});R("*",6,1,function(a,b,c){return O(a,c)*O(b,c)});R("+",5,1,function(a,b,c){return O(a,c)+O(b,c)});R("-",5,1,function(a,b,c){return O(a,c)-O(b,c)});R("<",4,2,function(a,b,c){return Cb(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return Cb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return Cb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return Cb(function(a,b){return a>=b},a,b,c)});var Bb=R("=",3,2,function(a,b,c){return Cb(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return Cb(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return zb(a,c)&&zb(b,c)});R("or",1,2,function(a,b,c){return zb(a,c)||zb(b,c)});function Fb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Fb,M);Fb.prototype.a=function(a){a=this.c.a(a);return Gb(this.j,a)};Fb.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Hb(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;xb(this,a.i||ra(b,function(a){return a.i}));yb(this,a.J&&!b.length||a.I&&!!b.length||ra(b,function(a){return a.b}))} -m(Hb,M);Hb.prototype.a=function(a){return this.j.v.apply(null,ta(a,this.c))};Hb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=q(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Ib(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Ib.prototype.toString=function(){return this.o};var Jb={}; -function S(a,b,c,d,e,f,h,k){if(Jb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Jb[a]=new Ib(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return zb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(O(b,a))},1);S("concat",3,!1,!1,function(a,b){return q(ua(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(O(b,a))},1); -S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return sa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(l(f))b=l(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Sa);var h=new G;p(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?ub(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?ub(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!zb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?O(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(O(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=O(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?O(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Kb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Lb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Lb,M);Lb.prototype.a=function(){return this.c};Lb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Mb(a){M.call(this,1);this.c=a}m(Mb,M);Mb.prototype.a=function(){return this.c};Mb.prototype.toString=function(){return"Number: "+this.c};function Nb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Ob||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Nb,M);function Pb(){M.call(this,4)}m(Pb,M);Pb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Pb.prototype.toString=function(){return"Root Helper Expression"};function Qb(){M.call(this,4)}m(Qb,M);Qb.prototype.a=function(a){var b=new G;I(b,a.a);return b};Qb.prototype.toString=function(){return"Context Helper Expression"}; -function Rb(a){return"/"==a||"//"==a}Nb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Sb)if(e.i||e.c!=Tb)for(h=L(f),b=e.a(new cb(h));null!=(h=L(f));)h=e.a(new cb(h)),b=tb(b,h);else h=L(f),b=e.a(new cb(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new cb(h))}}return b}; -Nb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=q(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Ub(a,b){this.a=a;this.b=!!b} -function Gb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new cb(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var C=v.a;if(!C)throw Error("Next must be called at least once before remove.");var P=C.b,C=C.a;P?P.a=C:h.a=C;C?C.b=P:h.b=P;h.s--;v.a=null}}return b} -Ub.prototype.toString=function(){return q(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Ub([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Vb)if(a=K((new T(Wb,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=tb(c,this.v(b,d,e,f));else c=new G;else c=lb(this.w,b,d,e),c=Gb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Gb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=q(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Xb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Xb.prototype.toString=function(){return this.o};var Yb={};function U(a,b,c,d){if(Yb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Xb(a,b,c,!!d);return Yb[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Ob=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new eb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,fb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,fb(b,f)):I(c,f));return c},!1),Vb=U("child",function(a,b,c,d,e){return(A?qb:rb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",lb,!1,!0); -var Wb=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return lb(a,b,c,d,e)},!1,!0),Sb=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=lb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Zb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Tb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var C=0,P=v.length;C<P;C++)b=v[C],F(b,c,d)&&a.a(b)&&I(e,b),e=lb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var $b=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function ac(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m(ac,M);ac.prototype.a=function(a){return-O(this.c,a)};ac.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function bc(a){M.call(this,4);this.c=a;xb(this,ra(this.c,function(a){return a.i}));yb(this,ra(this.c,function(a){return a.b}))}m(bc,M);bc.prototype.a=function(a){var b=new G;p(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=tb(b,c)});return b};bc.prototype.toString=function(){return q(this.c,function(a,b){return a+N(b)},"Union Expression:")};function cc(a,b){this.a=a;this.b=b}function dc(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=ec(a);var d=D(a.a);if(!d)break;var e=(d=Eb[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new Ab(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Ab(c.pop(),c.pop(),b);return b}function V(a,b){if(kb(a.a))throw Error(b);}function fc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function gc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function hc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Lb(a)} -function ic(a){var b,c=[],d;if(Rb(B(a.a))){b=D(a.a);d=B(a.a);if("/"==b&&(kb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Pb;d=new Pb;V(a,"Missing next location step.");b=jc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=dc(a);V(a,'unclosed "("');fc(a,")");break;case '"':case "'":b=hc(a);break;default:if(isNaN(+b))if(!Kb(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=D(a.a); -b=Jb[b]||null;D(a.a);for(d=[];")"!=B(a.a);){V(a,"Missing function argument list.");d.push(dc(a));if(","!=B(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");gc(a);b=new Hb(b,d)}else{b=null;break a}else b=new Mb(+D(a.a))}"["==B(a.a)&&(d=new Ub(kc(a)),b=new Fb(b,d))}if(b)if(Rb(B(a.a)))d=b;else return b;else b=jc(a,"/"),d=new Qb,c.push(b)}for(;Rb(B(a.a));)b=D(a.a),V(a,"Missing next location step."),b=jc(a,b),c.push(b);return new Nb(d,c)} -function jc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new T($b,new J("node")),D(a.a),d;if(".."==B(a.a))return d=new T(Zb,new J("node")),D(a.a),d;var f;if("@"==B(a.a))f=Ob,D(a.a),V(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Yb[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Vb;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!Kb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Kb(c))throw Error("Invalid type name: "+c);fc(a,"(");V(a,"Bad nodetype");e=B(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=hc(a);V(a,"Bad nodetype");gc(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Ub(kc(a),f.a);return d|| -new T(f,c,e,"//"==b)}function kc(a){for(var b=[];"["==B(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=dc(a);b.push(c);V(a,"Unclosed predicate expression.");fc(a,"]")}return b}function ec(a){if("-"==B(a.a))return D(a.a),new ac(ec(a));var b=ic(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(ic(a));a.a.a--;a=new bc(b)}return a};function lc(a){switch(a.nodeType){case 1:return ja(mc,a);case 9:return lc(a.documentElement);case 11:case 10:case 6:case 12:return nc;default:return a.parentNode?lc(a.parentNode):nc}}function nc(){return null}function mc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?mc(a.parentNode,b):null};function oc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=hb(a);if(kb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ga(b.lookupNamespaceURI,b)):b=function(){return null};var d=dc(new cc(c,b));if(!kb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new cb(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?vb(a):""+a;break;case 1:this.numberValue=a instanceof G?+vb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof eb?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=ub(a);this.singleNodeValue=d instanceof eb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function pc(a){this.lookupNamespaceURI=lc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new oc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new oc(a,b)},d.createNSResolver=function(a){return new pc(a)}});function qc(a){return(a=a.exec(t))?a[1]:""}var rc=function(){if(Xa)return qc(/Firefox\/([0-9.]+)/);if(x||Ga||Fa)return Ma;if(ab)return qc(/Chrome\/([0-9.]+)/);if(bb&&!(Ea()||u("iPad")||u("iPod")))return qc(/Version\/([0-9.]+)/);if(Ya||Za){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if($a)return(a=qc(/Android\s+([0-9.]+)/))?a:qc(/Version\/([0-9.]+)/);return""}();var sc,tc;function uc(a){return vc?sc(a):x?0<=na(Qa,a):Oa(a)}function wc(a){vc?tc(a):$a?na(xc,a):na(rc,a)} -var vc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;sc=function(a){return 0<=c.compare(d,""+a)};tc=function(a){c.compare(e,""+a)};return!0}(),yc;if($a){var zc=/Android\s+([0-9\.]+)/.exec(t);yc=zc?zc[1]:"0"}else yc="0";var xc=yc;$a&&wc(2.3); -$a&&wc(4);bb&&wc(6);function Ac(a){var b=Va(a),c=new z(0,0),d;d=b?Va(b):document;var e;(e=!x||9<=Number(Qa))||(e="CSS1Compat"==(d?new Wa(Va(d)):la||(la=new Wa)).a.compatMode);if(a==(e?d.documentElement:d.body))return c;var f;a:{try{f=a.getBoundingClientRect()}catch(h){f={left:0,top:0,right:0,bottom:0};break a}x&&a.ownerDocument.body&&(a=a.ownerDocument,f.left-=a.documentElement.clientLeft+a.body.clientLeft,f.top-=a.documentElement.clientTop+a.body.clientTop)}a=(b?new Wa(Va(b)):la||(la=new Wa)).a;b=a.scrollingElement? -a.scrollingElement:Ha||"CSS1Compat"!=a.compatMode?a.body||a.documentElement:a.documentElement;a=a.parentWindow||a.defaultView;b=x&&Oa("10")&&a.pageYOffset!=b.scrollTop?new z(b.scrollLeft,b.scrollTop):new z(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop);c.x=f.left+b.x;c.y=f.top+b.y;return c};Ha||vc&&wc(3.6);x&&uc(10);$a&&wc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=Bc(a),Cc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function Bc(a){Cc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function Cc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=Bc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var Dc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new Ec(a);!b||b in Dc&&!c||(Dc[b]={key:a,shift:!1},c&&(Dc[c]={key:a,shift:!0}));return a}function Ec(a){this.code=a}Z(8);Z(9);Z(13);var Fc=Z(16),Gc=Z(17),Hc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Ic=Z(Ja?{f:91,g:91}:Ia?{f:224,g:91}:{f:0,g:91});Z(Ja?{f:92,g:92}:Ia?{f:224,g:93}:{f:0,g:92});Z(Ja?{f:93,g:93}:Ia?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Jc=new X;Y(Jc,1,Fc);Y(Jc,2,Gc);Y(Jc,4,Hc);Y(Jc,8,Ic);(function(a){var b=new X;p(Bc(a),function(c){Y(b,a.get(c).code,c)});return b})(Jc);y&&uc(12);function Kc(){} -function Lc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Lc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Mc(d,c),c.push(":"),Lc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Mc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Nc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Oc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Mc(a,b){b.push('"',a.replace(Oc,function(a){var b=Nc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Nc[a]=b);return b}),'"')};Ha||y&&uc(3.5)||x&&uc(8);function Pc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return qa(a,Pc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Qc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Qc(a),b;if(ca(a))return qa(a,Pc);a=za(a,function(a,b){return"number"==typeof b||l(b)});return Aa(a,Pc);default:return null}} -function Rc(a,b){return"array"==ba(a)?qa(a,function(a){return Rc(a,b)}):da(a)?"function"==typeof a?a:w(a,"ELEMENT")?Sc(a.ELEMENT,b):w(a,"WINDOW")?Sc(a.WINDOW,b):Aa(a,function(a){return Rc(a,b)}):a}function Tc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b}function Qc(a){var b=Tc(a.ownerDocument),c=Ba(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function Sc(a,b){a=decodeURIComponent(a);var c=b||document,d=Tc(c);if(!w(d,a))throw new va(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new va(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new va(10,"Element is no longer attached to the DOM");};aa("_",function(a){a=[a];var b=Ac,c;try{a:{var d=b;if(l(d))try{b=new n.Function(d);break a}catch(h){if(x&&n.execScript){n.execScript(";");b=new n.Function(d);break a}throw h;}b=n==window?d:new n.Function("return ("+d+").apply(null,arguments);")}var e=Rc(a,n.document),f=b.apply(null,e);c={status:0,value:Pc(f)}}catch(h){c={status:w(h,"code")?h.code:13,value:{message:h.message}}}e=[];Lc(new Kc,c,e);return e.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_location_in_view.js b/src/ghostdriver/third_party/webdriver-atoms/get_location_in_view.js deleted file mode 100644 index 53181314cb..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_location_in_view.js +++ /dev/null @@ -1,100 +0,0 @@ -function(){return function(){var h,l=this;function aa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function da(a){return"number"==typeof a}function ea(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function fa(a,b,c){return a.call.apply(a.bind,arguments)} -function ga(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ha(a,b,c){ha=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ga;return ha.apply(null,arguments)} -function ia(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ja=Date.now||function(){return+new Date};function n(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var p=window;var ma;var na=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function oa(a,b){for(var c=0,d=na(String(a)).split("."),e=na(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",x=e[g]||"",D=RegExp("(\\d*)(\\D*)","g"),Q=RegExp("(\\d*)(\\D*)","g");do{var ka=D.exec(k)||["","",""],la=Q.exec(x)||["","",""];if(0==ka[0].length&&0==la[0].length)break;c=pa(0==ka[1].length?0:parseInt(ka[1],10),0==la[1].length?0:parseInt(la[1],10))||pa(0==ka[2].length,0==la[2].length)||pa(ka[2],la[2])}while(0==c)}return c} -function pa(a,b){return a<b?-1:a>b?1:0};function q(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function qa(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}function ra(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function sa(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function ta(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ua(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function va(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function wa(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function xa(a,b){this.code=a;this.a=r[a]||ya;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}n(xa,Error);var ya="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=ya;r[30]=ya;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=ya;r[9]="unknown command";xa.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var za=l.navigator;if(za){var Aa=za.userAgent;if(Aa){t=Aa;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function Ba(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ca(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function v(a,b){return null!==a&&b in a}function Da(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ea(){return u("Opera")||u("OPR")}function Fa(){return(u("Chrome")||u("CriOS"))&&!Ea()&&!u("Edge")};function Ga(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Ha=Ea(),w=u("Trident")||u("MSIE"),Ia=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ja=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ka=u("Macintosh"),La=u("Windows");function Ma(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ia)return/Edge\/([\d\.]+)/.exec(a);if(w)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ja)return/WebKit\/(\S+)/.exec(a)}function Na(){var a=l.document;return a?a.documentMode:void 0} -var Oa=function(){if(Ha&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ma())&&(a=b?b[1]:"");return w&&(b=Na(),null!=b&&b>parseFloat(a))?String(b):a}(),Pa={};function Qa(a){return Pa[a]||(Pa[a]=0<=oa(Oa,a))}var Ra=l.document,z=Ra&&w?Na()||("CSS1Compat"==Ra.compatMode?parseInt(Oa,10):5):void 0;!y&&!w||w&&9<=Number(z)||y&&Qa("1.9.1");w&&Qa("9");function A(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}h=A.prototype;h.clone=function(){return new A(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=da(b)?b:a;this.x*=a;this.y*=c;return this};function Sa(a,b){this.width=a;this.height=b}h=Sa.prototype;h.clone=function(){return new Sa(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=da(b)?b:a;this.width*=a;this.height*=c;return this};function Ta(a){return a?new Ua(Va(a)):ma||(ma=new Ua)}function Wa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Xa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(w&&!(9<=Number(z))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ya(a,b):!c&&Wa(e,b)?-1*Za(a,b):!d&&Wa(f,a)?Za(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=Va(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function Za(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ya(d,a)}function Ya(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function Va(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Ua(a){this.a=a||l.document||document} -function $a(a){a=a.a;a=(a.parentWindow||a.defaultView||window).document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;return new Sa(a.clientWidth,a.clientHeight)}Ua.prototype.contains=Wa;var ab=u("Firefox"),bb=Ga()||u("iPod"),cb=u("iPad"),db=u("Android")&&!(Fa()||u("Firefox")||Ea()||u("Silk")),eb=Fa(),fb=u("Safari")&&!(Fa()||u("Coast")||Ea()||u("Edge")||u("Silk")||u("Android"))&&!(Ga()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function gb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var B=w&&!(9<=Number(z)),hb=w&&!(8<=Number(z));function ib(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function jb(a,b){var c=hb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new ib(b,a,b.nodeName,c)};function kb(a){this.b=a;this.a=0}function lb(a){a=a.match(mb);for(var b=0;b<a.length;b++)nb.test(a[b])&&a.splice(b,1);return new kb(a)}var mb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),nb=/^\s/;function C(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function ob(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(B&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),B&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function G(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}hb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function pb(a,b,c,d,e){return(B?qb:rb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new H)} -function qb(a,b,c,d,e){if(a instanceof I||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=sb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)G(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||J(e,b);return e}tb(a,b,c,d,e);return e} -function rb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!w?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&J(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&J(e,b)})):a instanceof K?tb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),q(b,function(a){G(a,c,d)&&J(e,a)}));return e} -function ub(a,b,c,d,e){var f;if((a instanceof I||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=sb(a);if("*"!=g&&(f=qa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=qa(f,function(a){return G(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||J(e,a)});return e}return vb(a,b,c,d,e)}function vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&J(e,b);return e} -function tb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&J(e,b),tb(a,b,c,d,e)}function sb(a){if(a instanceof K){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function H(){this.b=this.a=null;this.s=0}function wb(a){this.node=a;this.a=this.b=null}function xb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof ib&&k instanceof ib&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Xa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.s=g;return a} -H.prototype.unshift=function(a){a=new wb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function J(a,b){var c=new wb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function yb(a){return(a=a.a)?a.node:null}function zb(a){return(a=yb(a))?F(a):""}function L(a,b){return new Ab(a,!!b)}function Ab(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function M(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function N(a){this.m=a;this.b=this.i=!1;this.h=null}function O(a){return"\n "+a.toString().split("\n").join("\n ")}function Bb(a,b){a.i=b}function Cb(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof H?+zb(c):+c}function R(a,b){var c=a.a(b);return c instanceof H?zb(c):""+c}function Db(a,b){var c=a.a(b);return c instanceof H?!!c.s:!!c};function Eb(a,b,c){N.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Fb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}n(Eb,N); -function Gb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof H&&c instanceof H){b=L(b);for(d=M(b);d;d=M(b))for(e=L(c),f=M(e);f;f=M(e))if(a(F(d),F(f)))return!0;return!1}if(b instanceof H||c instanceof H){b instanceof H?(e=b,d=c):(e=c,d=b);f=L(e);for(var g=typeof d,k=M(f);k;k=M(f)){switch(g){case "number":k=+F(k);break;case "boolean":k=!!F(k);break;case "string":k=F(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Eb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};Eb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+O(this.j);return a+=O(this.w)};function Hb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}Hb.prototype.toString=function(){return this.a};var Ib={}; -function S(a,b,c,d){if(Ib.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Hb(a,b,c,d);return Ib[a.toString()]=a}S("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});S("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});S("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});S("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});S("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});S("<",4,2,function(a,b,c){return Gb(function(a,b){return a<b},a,b,c)}); -S(">",4,2,function(a,b,c){return Gb(function(a,b){return a>b},a,b,c)});S("<=",4,2,function(a,b,c){return Gb(function(a,b){return a<=b},a,b,c)});S(">=",4,2,function(a,b,c){return Gb(function(a,b){return a>=b},a,b,c)});var Fb=S("=",3,2,function(a,b,c){return Gb(function(a,b){return a==b},a,b,c,!0)});S("!=",3,2,function(a,b,c){return Gb(function(a,b){return a!=b},a,b,c,!0)});S("and",2,2,function(a,b,c){return Db(a,c)&&Db(b,c)});S("or",1,2,function(a,b,c){return Db(a,c)||Db(b,c)});function Jb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");N.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}n(Jb,N);Jb.prototype.a=function(a){a=this.c.a(a);return Kb(this.j,a)};Jb.prototype.toString=function(){var a;a="Filter:"+O(this.c);return a+=O(this.j)};function Lb(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&q(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});N.call(this,a.m);this.j=a;this.c=b;Bb(this,a.i||ta(b,function(a){return a.i}));Cb(this,a.J&&!b.length||a.I&&!!b.length||ta(b,function(a){return a.b}))} -n(Lb,N);Lb.prototype.a=function(a){return this.j.v.apply(null,va(a,this.c))};Lb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=sa(this.c,function(a,b){return a+O(b)},"Arguments:"),a=a+O(b);return a};function Mb(a,b,c,d,e,f,g,k,x){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=g;this.D=void 0!==k?k:g;this.H=!!x}Mb.prototype.toString=function(){return this.o};var Nb={}; -function T(a,b,c,d,e,f,g,k){if(Nb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Nb[a]=new Mb(a,b,c,d,!1,e,f,g,k)}T("boolean",2,!1,!1,function(a,b){return Db(b,a)},1);T("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);T("concat",3,!1,!1,function(a,b){return sa(wa(arguments,1),function(b,d){return b+R(d,a)},"")},2,null);T("contains",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return-1!=b.indexOf(a)},2);T("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -T("false",2,!1,!1,function(){return!1},0);T("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1); -T("id",4,!1,!1,function(a,b){function c(a){if(B){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ua(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=R(b,a).split(/\s+/),f=[];q(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(m(f))b=m(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Xa);var g=new H;q(f,function(a){J(g,a)});return g},1); -T("lang",2,!1,!1,function(){return!1},1);T("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);T("local-name",3,!1,!0,function(a,b){var c=b?yb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);T("name",3,!1,!0,function(a,b){var c=b?yb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);T("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -T("normalize-space",3,!1,!0,function(a,b){return(b?R(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);T("not",2,!1,!1,function(a,b){return!Db(b,a)},1);T("number",1,!1,!0,function(a,b){return b?P(b,a):+F(a.a)},0,1);T("position",1,!0,!1,function(a){return a.b},0);T("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);T("starts-with",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return 0==b.lastIndexOf(a,0)},2);T("string",3,!1,!0,function(a,b){return b?R(b,a):F(a.a)},0,1); -T("string-length",1,!1,!0,function(a,b){return(b?R(b,a):F(a.a)).length},0,1);T("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=R(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);T("substring-after",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -T("substring-before",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);T("sum",1,!1,!1,function(a,b){for(var c=L(b.a(a)),d=0,e=M(c);e;e=M(c))d+=+F(e);return d},1,1,!0);T("translate",3,!1,!1,function(a,b,c,d){b=R(b,a);c=R(c,a);var e=R(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);T("true",2,!1,!1,function(){return!0},0);function K(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ob(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}K.prototype.a=function(a){return null===this.b||this.b==a.nodeType};K.prototype.h=function(){return this.j}; -K.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=O(this.c));return a};function Pb(a){N.call(this,3);this.c=a.substring(1,a.length-1)}n(Pb,N);Pb.prototype.a=function(){return this.c};Pb.prototype.toString=function(){return"Literal: "+this.c};function I(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}I.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};I.prototype.h=function(){return this.o};I.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Qb(a){N.call(this,1);this.c=a}n(Qb,N);Qb.prototype.a=function(){return this.c};Qb.prototype.toString=function(){return"Number: "+this.c};function Rb(a,b){N.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Sb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}n(Rb,N);function Tb(){N.call(this,4)}n(Tb,N);Tb.prototype.a=function(a){var b=new H;a=a.a;9==a.nodeType?J(b,a):J(b,a.ownerDocument);return b};Tb.prototype.toString=function(){return"Root Helper Expression"};function Ub(){N.call(this,4)}n(Ub,N);Ub.prototype.a=function(a){var b=new H;J(b,a.a);return b};Ub.prototype.toString=function(){return"Context Helper Expression"}; -function Vb(a){return"/"==a||"//"==a}Rb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof H))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=L(b,e.c.a),g;if(e.i||e.c!=Wb)if(e.i||e.c!=Xb)for(g=M(f),b=e.a(new gb(g));null!=(g=M(f));)g=e.a(new gb(g)),b=xb(b,g);else g=M(f),b=e.a(new gb(g));else{for(g=M(f);(b=M(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new gb(g))}}return b}; -Rb.prototype.toString=function(){var a;a="Path Expression:"+O(this.j);if(this.c.length){var b=sa(this.c,function(a,b){return a+O(b)},"Steps:");a+=O(b)}return a};function Yb(a,b){this.a=a;this.b=!!b} -function Kb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=L(b),f=b.s,g,k=0;g=M(e);k++){var x=a.b?f-k:k+1;g=d.a(new gb(g,x,f));if("number"==typeof g)x=x==g;else if("string"==typeof g||"boolean"==typeof g)x=!!g;else if(g instanceof H)x=0<g.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!x){x=e;g=x.h;var D=x.a;if(!D)throw Error("Next must be called at least once before remove.");var Q=D.b,D=D.a;Q?Q.a=D:g.a=D;D?D.b=Q:g.b=Q;g.s--;x.a=null}}return b} -Yb.prototype.toString=function(){return sa(this.a,function(a,b){return a+O(b)},"Predicates:")};function U(a,b,c,d){N.call(this,4);this.c=a;this.w=b;this.j=c||new Yb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=B?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}n(U,N); -U.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?R(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Zb)if(a=L((new U($b,new K("node"))).a(a)),b=M(a))for(c=this.v(b,d,e,f);null!=(b=M(a));)c=xb(c,this.v(b,d,e,f));else c=new H;else c=pb(this.w,b,d,e),c=Kb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};U.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Kb(this.j,a,d)}; -U.prototype.toString=function(){var a;a="Step:"+O("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=O("Axis: "+this.c));a+=O(this.w);if(this.j.a.length){var b=sa(this.j.a,function(a,b){return a+O(b)},"Predicates:");a+=O(b)}return a};function ac(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}ac.prototype.toString=function(){return this.o};var bc={};function V(a,b,c,d){if(bc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new ac(a,b,c,!!d);return bc[a]=b} -V("ancestor",function(a,b){for(var c=new H,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);V("ancestor-or-self",function(a,b){var c=new H,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Sb=V("attribute",function(a,b){var c=new H,d=a.h();if("style"==d&&b.style&&B)return J(c,new ib(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof K&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)B?f.nodeValue&&J(c,jb(b,f)):J(c,f);else(f=e.getNamedItem(d))&&(B?f.nodeValue&&J(c,jb(b,f)):J(c,f));return c},!1),Zb=V("child",function(a,b,c,d,e){return(B?ub:vb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new H)},!1,!0);V("descendant",pb,!1,!0); -var $b=V("descendant-or-self",function(a,b,c,d){var e=new H;G(b,c,d)&&a.a(b)&&J(e,b);return pb(a,b,c,d,e)},!1,!0),Wb=V("following",function(a,b,c,d){var e=new H;do for(var f=b;f=f.nextSibling;)G(f,c,d)&&a.a(f)&&J(e,f),e=pb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);V("following-sibling",function(a,b){for(var c=new H,d=b;d=d.nextSibling;)a.a(d)&&J(c,d);return c},!1);V("namespace",function(){return new H},!1); -var cc=V("parent",function(a,b){var c=new H;if(9==b.nodeType)return c;if(2==b.nodeType)return J(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&J(c,d);return c},!1),Xb=V("preceding",function(a,b,c,d){var e=new H,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var x=[];for(b=f[g];b=b.previousSibling;)x.unshift(b);for(var D=0,Q=x.length;D<Q;D++)b=x[D],G(b,c,d)&&a.a(b)&&J(e,b),e=pb(a,b,c,d,e)}return e},!0,!0); -V("preceding-sibling",function(a,b){for(var c=new H,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var dc=V("self",function(a,b){var c=new H;a.a(b)&&J(c,b);return c},!1);function ec(a){N.call(this,1);this.c=a;this.i=a.i;this.b=a.b}n(ec,N);ec.prototype.a=function(a){return-P(this.c,a)};ec.prototype.toString=function(){return"Unary Expression: -"+O(this.c)};function fc(a){N.call(this,4);this.c=a;Bb(this,ta(this.c,function(a){return a.i}));Cb(this,ta(this.c,function(a){return a.b}))}n(fc,N);fc.prototype.a=function(a){var b=new H;q(this.c,function(c){c=c.a(a);if(!(c instanceof H))throw Error("Path expression must evaluate to NodeSet.");b=xb(b,c)});return b};fc.prototype.toString=function(){return sa(this.c,function(a,b){return a+O(b)},"Union Expression:")};function gc(a,b){this.a=a;this.b=b}function hc(a){for(var b,c=[];;){W(a,"Missing right hand side of binary expression.");b=ic(a);var d=E(a.a);if(!d)break;var e=(d=Ib[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new Eb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Eb(c.pop(),c.pop(),b);return b}function W(a,b){if(ob(a.a))throw Error(b);}function jc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function kc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function lc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Pb(a)} -function mc(a){var b,c=[],d;if(Vb(C(a.a))){b=E(a.a);d=C(a.a);if("/"==b&&(ob(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Tb;d=new Tb;W(a,"Missing next location step.");b=nc(a,b);c.push(b)}else{a:{b=C(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=hc(a);W(a,'unclosed "("');jc(a,")");break;case '"':case "'":b=lc(a);break;default:if(isNaN(+b))if(!Ob(b)&&/(?![0-9])[\w]/.test(d)&&"("==C(a.a,1)){b=E(a.a); -b=Nb[b]||null;E(a.a);for(d=[];")"!=C(a.a);){W(a,"Missing function argument list.");d.push(hc(a));if(","!=C(a.a))break;E(a.a)}W(a,"Unclosed function argument list.");kc(a);b=new Lb(b,d)}else{b=null;break a}else b=new Qb(+E(a.a))}"["==C(a.a)&&(d=new Yb(oc(a)),b=new Jb(b,d))}if(b)if(Vb(C(a.a)))d=b;else return b;else b=nc(a,"/"),d=new Ub,c.push(b)}for(;Vb(C(a.a));)b=E(a.a),W(a,"Missing next location step."),b=nc(a,b),c.push(b);return new Rb(d,c)} -function nc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==C(a.a))return d=new U(dc,new K("node")),E(a.a),d;if(".."==C(a.a))return d=new U(cc,new K("node")),E(a.a),d;var f;if("@"==C(a.a))f=Sb,E(a.a),W(a,"Missing attribute name");else if("::"==C(a.a,1)){if(!/(?![0-9])[\w]/.test(C(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=bc[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);W(a,"Missing node name")}else f=Zb;c=C(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -C(a.a,1)){if(!Ob(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!Ob(c))throw Error("Invalid type name: "+c);jc(a,"(");W(a,"Bad nodetype");e=C(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=lc(a);W(a,"Bad nodetype");kc(a);c=new K(c,g)}else if(c=E(a.a),e=c.indexOf(":"),-1==e)c=new I(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new I(c,k)}else throw Error("Bad token: "+E(a.a));e=new Yb(oc(a),f.a);return d|| -new U(f,c,e,"//"==b)}function oc(a){for(var b=[];"["==C(a.a);){E(a.a);W(a,"Missing predicate expression.");var c=hc(a);b.push(c);W(a,"Unclosed predicate expression.");jc(a,"]")}return b}function ic(a){if("-"==C(a.a))return E(a.a),new ec(ic(a));var b=mc(a);if("|"!=C(a.a))a=b;else{for(b=[b];"|"==E(a.a);)W(a,"Missing next union location path."),b.push(mc(a));a.a.a--;a=new fc(b)}return a};function pc(a){switch(a.nodeType){case 1:return ia(qc,a);case 9:return pc(a.documentElement);case 11:case 10:case 6:case 12:return rc;default:return a.parentNode?pc(a.parentNode):rc}}function rc(){return null}function qc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?qc(a.parentNode,b):null};function sc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=lb(a);if(ob(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ha(b.lookupNamespaceURI,b)):b=function(){return null};var d=hc(new gc(c,b));if(!ob(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new gb(a));return new X(c,b)}} -function X(a,b){if(0==b)if(a instanceof H)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof H))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof H?zb(a):""+a;break;case 1:this.numberValue=a instanceof H?+zb(a):+a;break;case 3:this.booleanValue=a instanceof H?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -L(a);c=[];for(var e=M(d);e;e=M(d))c.push(e instanceof ib?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=yb(a);this.singleNodeValue=d instanceof ib?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}X.ANY_TYPE=0;X.NUMBER_TYPE=1;X.STRING_TYPE=2;X.BOOLEAN_TYPE=3;X.UNORDERED_NODE_ITERATOR_TYPE=4;X.ORDERED_NODE_ITERATOR_TYPE=5;X.UNORDERED_NODE_SNAPSHOT_TYPE=6;X.ORDERED_NODE_SNAPSHOT_TYPE=7;X.ANY_UNORDERED_NODE_TYPE=8;X.FIRST_ORDERED_NODE_TYPE=9;function tc(a){this.lookupNamespaceURI=pc(a)} -aa("wgxpath.install",function(a,b){var c=a||l,d=c.document;if(!d.evaluate||b)c.XPathResult=X,d.evaluate=function(a,b,c,d){return(new sc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new sc(a,b)},d.createNSResolver=function(a){return new tc(a)}});function uc(a){return(a=a.exec(t))?a[1]:""}var vc=function(){if(ab)return uc(/Firefox\/([0-9.]+)/);if(w||Ia||Ha)return Oa;if(eb)return uc(/Chrome\/([0-9.]+)/);if(fb&&!(Ga()||u("iPad")||u("iPod")))return uc(/Version\/([0-9.]+)/);if(bb||cb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(db)return(a=uc(/Android\s+([0-9.]+)/))?a:uc(/Version\/([0-9.]+)/);return""}();var wc,xc;function yc(a){return zc?wc(a):w?0<=oa(z,a):Qa(a)}function Ac(a){zc?xc(a):db?oa(Bc,a):oa(vc,a)} -var zc=function(){if(!y)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;wc=function(a){return 0<=c.compare(d,""+a)};xc=function(a){c.compare(e,""+a)};return!0}(),Cc;if(db){var Dc=/Android\s+([0-9\.]+)/.exec(t);Cc=Dc?Dc[1]:"0"}else Cc="0";var Bc=Cc;db&&Ac(2.3); -db&&Ac(4);fb&&Ac(6);function Ec(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=Ec.prototype;h.clone=function(){return new Ec(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof Ec?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -h.scale=function(a,b){var c=da(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function Fc(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=Fc.prototype;h.clone=function(){return new Fc(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof Fc?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=da(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Gc(a,b){var c=Va(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function Hc(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}w&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b} -function Ic(a){var b=Va(a),c=new A(0,0),d;d=b?Va(b):document;var e;(e=!w||9<=Number(z))||(e="CSS1Compat"==Ta(d).a.compatMode);if(a==(e?d.documentElement:d.body))return c;a=Hc(a);d=Ta(b).a;b=d.scrollingElement?d.scrollingElement:Ja||"CSS1Compat"!=d.compatMode?d.body||d.documentElement:d.documentElement;d=d.parentWindow||d.defaultView;b=w&&Qa("10")&&d.pageYOffset!=b.scrollTop?new A(b.scrollLeft,b.scrollTop):new A(d.pageXOffset||b.scrollLeft,d.pageYOffset||b.scrollTop);c.x=a.left+b.x;c.y=a.top+b.y;return c} -function Jc(a){if(1==a.nodeType)return a=Hc(a),new A(a.left,a.top);a=a.changedTouches?a.changedTouches[0]:a;return new A(a.clientX,a.clientY)}var Kc={thin:2,medium:4,thick:6}; -function Lc(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in Kc)d=Kc[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};Ja||zc&&Ac(3.6);w&&yc(10);db&&Ac(4);function Y(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Mc(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof Y)for(d=Nc(a),Oc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Mc(this,d[c],e[c])}}function Nc(a){Oc(a);return a.l.concat()} -Y.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function Oc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}Y.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Mc(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}Y.prototype.forEach=function(a,b){for(var c=Nc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};Y.prototype.clone=function(){return new Y(this)};var Pc={};function Z(a,b,c){ea(a)&&(a=y?a.f:a.g);a=new Qc(a);!b||b in Pc&&!c||(Pc[b]={key:a,shift:!1},c&&(Pc[c]={key:a,shift:!0}));return a}function Qc(a){this.code=a}Z(8);Z(9);Z(13);var Rc=Z(16),Sc=Z(17),Tc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Uc=Z(La?{f:91,g:91}:Ka?{f:224,g:91}:{f:0,g:91});Z(La?{f:92,g:92}:Ka?{f:224,g:93}:{f:0,g:92});Z(La?{f:93,g:93}:Ka?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Vc=new Y;Mc(Vc,1,Rc);Mc(Vc,2,Sc);Mc(Vc,4,Tc);Mc(Vc,8,Uc);(function(a){var b=new Y;q(Nc(a),function(c){Mc(b,a.get(c).code,c)});return b})(Vc);y&&yc(12);function Wc(){} -function Xc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Xc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Yc(d,c),c.push(":"),Xc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Yc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Zc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},$c=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Yc(a,b){b.push('"',a.replace($c,function(a){var b=Zc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Zc[a]=b);return b}),'"')};Ja||y&&yc(3.5)||w&&yc(8);function ad(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return ra(a,ad);case "object":if(v(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=bd(a);return b}if(v(a,"document"))return b={},b.WINDOW=bd(a),b;if(ca(a))return ra(a,ad);a=Ba(a,function(a,b){return da(b)||m(b)});return Ca(a,ad);default:return null}} -function cd(a,b){return"array"==ba(a)?ra(a,function(a){return cd(a,b)}):ea(a)?"function"==typeof a?a:v(a,"ELEMENT")?dd(a.ELEMENT,b):v(a,"WINDOW")?dd(a.WINDOW,b):Ca(a,function(a){return cd(a,b)}):a}function ed(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ja());b.B||(b.B=ja());return b}function bd(a){var b=ed(a.ownerDocument),c=Da(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function dd(a,b){a=decodeURIComponent(a);var c=b||document,d=ed(c);if(!v(d,a))throw new xa(10,"Element does not exist in cache");var e=d[a];if(v(e,"setInterval")){if(e.closed)throw delete d[a],new xa(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new xa(10,"Element is no longer attached to the DOM");};var fd="function"===typeof ShadowRoot;function gd(a,b){var c;c=Ic(b);var d=Ic(a);c=new A(c.x-d.x,c.y-d.y);if(!w||9<=Number(z))d=Gc(a,"borderLeftWidth"),e=Gc(a,"borderRightWidth"),f=Gc(a,"borderTopWidth"),g=Gc(a,"borderBottomWidth"),d=new Ec(parseFloat(f),parseFloat(e),parseFloat(g),parseFloat(d));else var d=Lc(a,"borderLeft"),e=Lc(a,"borderRight"),f=Lc(a,"borderTop"),g=Lc(a,"borderBottom"),d=new Ec(f,e,g,d);c.x-=d.left;c.y-=d.top;return c} -function hd(a,b,c){function d(a,b,c,d,e){d=new Fc(c.x+d.left,c.y+d.top,d.width,d.height);c=[0,0];b=[b.width,b.height];var f=[d.left,d.top];d=[d.width,d.height];for(var g=0;2>g;g++)if(d[g]>b[g])c[g]=e?f[g]+d[g]/2-b[g]/2:f[g];else{var k=f[g]-b[g]+d[g];0<k?c[g]=k:0>f[g]&&(c[g]=f[g])}e=new A(c[0],c[1]);a.scrollLeft+=e.x;a.scrollTop+=e.y}function e(a){var b=a.parentNode;fd&&b instanceof ShadowRoot&&(b=a.host);return b}for(var f=Va(a),g=e(a),k;g&&g!=f.documentElement&&g!=f.body;)k=gd(g,a),d(g,new Sa(g.clientWidth, -g.clientHeight),k,b,c),g=e(g);k=Jc(a);a=$a(Ta(a));d(f.body,a,k,b,c)}function id(a,b,c){c||(c=new Fc(0,0,a.offsetWidth,a.offsetHeight));hd(a,c,b);a=Jc(a);return new A(a.x+c.left,a.y+c.top)};aa("_",function(a){a=[a];var b=id,c;try{a:{var d=b;if(m(d))try{b=new p.Function(d);break a}catch(g){if(w&&p.execScript){p.execScript(";");b=new p.Function(d);break a}throw g;}b=p==window?d:new p.Function("return ("+d+").apply(null,arguments);")}var e=cd(a,p.document),f=b.apply(null,e);c={status:0,value:ad(f)}}catch(g){c={status:v(g,"code")?g.code:13,value:{message:g.message}}}e=[];Xc(new Wc,c,e);return e.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_location_in_view_chrome.js b/src/ghostdriver/third_party/webdriver-atoms/get_location_in_view_chrome.js deleted file mode 100644 index 2e04c68740..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_location_in_view_chrome.js +++ /dev/null @@ -1,75 +0,0 @@ -function(){return function(){var k=this;function aa(a,b){var c=a.split("."),d=k;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function l(a){return"string"==typeof a}function ca(a,b,c){return a.call.apply(a.bind,arguments)}function da(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}} -function ea(a,b,c){ea=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ca:da;return ea.apply(null,arguments)}function fa(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}} -function m(a){var b=n;function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.F=function(a,c,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[c].apply(a,g)}};var p;function q(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function r(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ga(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ha(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ia(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function t(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}t.prototype.clone=function(){return new t(this.x,this.y)};t.prototype.toString=function(){return"("+this.x+", "+this.y+")"};t.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};t.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};t.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function u(a,b){this.width=a;this.height=b}u.prototype.clone=function(){return new u(this.width,this.height)};u.prototype.toString=function(){return"("+this.width+" x "+this.height+")"};u.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};u.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this}; -u.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function ja(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function ka(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?la(a,b):!c&&ja(e,b)?-1*ma(a,b):!d&&ja(f,a)?ma(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=w(a);c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b); -d.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,d)}function ma(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return la(d,a)}function la(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function w(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function na(a){this.a=a||k.document||document} -function oa(a){a=a.a;a=(a.parentWindow||a.defaultView||window).document;a="CSS1Compat"==a.compatMode?a.documentElement:a.body;return new u(a.clientWidth,a.clientHeight)};/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function x(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function pa(a){this.b=a;this.a=0}function qa(a){a=a.match(ra);for(var b=0;b<a.length;b++)sa.test(a[b])&&a.splice(b,1);return new pa(a)}var ra=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),sa=/^\s/;function y(a,b){return a.b[a.a+(b||0)]}function z(a){return a.b[a.a++]}function ta(a){return a.b.length<=a.a};function A(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function C(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function D(a,b,c,d,e){return ua.call(null,a,b,l(c)?c:null,l(d)?d:null,e||new E)} -function ua(a,b,c,d,e){b.getElementsByName&&d&&"name"==c?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&F(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&F(e,b)})):a instanceof G?va(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),q(b,function(a){C(a,c,d)&&F(e,a)}));return e}function wa(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)C(b,c,d)&&a.a(b)&&F(e,b);return e} -function va(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)C(b,c,d)&&a.a(b)&&F(e,b),va(a,b,c,d,e)};function E(){this.b=this.a=null;this.l=0}function xa(a){this.node=a;this.a=this.b=null}function ya(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;)c.node==d.node?(f=c,c=c.a,d=d.a):0<ka(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a),(f.b=e)?e.a=f:a.a=f,e=f,g++;for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}E.prototype.unshift=function(a){a=new xa(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++}; -function F(a,b){var c=new xa(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function za(a){return(a=a.a)?a.node:null}function Aa(a){return(a=za(a))?A(a):""}function H(a,b){return new Ba(a,!!b)}function Ba(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function I(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function n(a){this.i=a;this.b=this.g=!1;this.f=null}function J(a){return"\n "+a.toString().split("\n").join("\n ")}function Ca(a,b){a.g=b}function Da(a,b){a.b=b}function K(a,b){var c=a.a(b);return c instanceof E?+Aa(c):+c}function L(a,b){var c=a.a(b);return c instanceof E?Aa(c):""+c}function M(a,b){var c=a.a(b);return c instanceof E?!!c.l:!!c};function N(a,b,c){n.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==Ea&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,s:b}):this.f={name:b.f.name,s:c})}m(N); -function O(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof E&&c instanceof E){b=H(b);for(d=I(b);d;d=I(b))for(e=H(c),f=I(e);f;f=I(e))if(a(A(d),A(f)))return!0;return!1}if(b instanceof E||c instanceof E){b instanceof E?(e=b,d=c):(e=c,d=b);f=H(e);for(var g=typeof d,h=I(f);h;h=I(f)){switch(g){case "number":h=+A(h);break;case "boolean":h=!!A(h);break;case "string":h=A(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}N.prototype.a=function(a){return this.c.m(this.h,this.o,a)};N.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+J(this.h);return a+=J(this.o)};function Fa(a,b,c,d){this.a=a;this.w=b;this.i=c;this.m=d}Fa.prototype.toString=function(){return this.a};var Ga={}; -function P(a,b,c,d){if(Ga.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Fa(a,b,c,d);return Ga[a.toString()]=a}P("div",6,1,function(a,b,c){return K(a,c)/K(b,c)});P("mod",6,1,function(a,b,c){return K(a,c)%K(b,c)});P("*",6,1,function(a,b,c){return K(a,c)*K(b,c)});P("+",5,1,function(a,b,c){return K(a,c)+K(b,c)});P("-",5,1,function(a,b,c){return K(a,c)-K(b,c)});P("<",4,2,function(a,b,c){return O(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return O(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return O(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return O(function(a,b){return a>=b},a,b,c)});var Ea=P("=",3,2,function(a,b,c){return O(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return O(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return M(a,c)&&M(b,c)});P("or",1,2,function(a,b,c){return M(a,c)||M(b,c)});function Ha(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");n.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}m(Ha);Ha.prototype.a=function(a){a=this.c.a(a);return Ia(this.h,a)};Ha.prototype.toString=function(){var a;a="Filter:"+J(this.c);return a+=J(this.h)};function Ja(a,b){if(b.length<a.A)throw Error("Function "+a.j+" expects at least"+a.A+" arguments, "+b.length+" given");if(null!==a.v&&b.length>a.v)throw Error("Function "+a.j+" expects at most "+a.v+" arguments, "+b.length+" given");a.B&&q(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});n.call(this,a.i);this.h=a;this.c=b;Ca(this,a.g||ga(b,function(a){return a.g}));Da(this,a.D&&!b.length||a.C&&!!b.length||ga(b,function(a){return a.b}))}m(Ja); -Ja.prototype.a=function(a){return this.h.m.apply(null,ha(a,this.c))};Ja.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=r(this.c,function(a,b){return a+J(b)},"Arguments:"),a=a+J(b);return a};function Ka(a,b,c,d,e,f,g,h,v){this.j=a;this.i=b;this.g=c;this.D=d;this.C=e;this.m=f;this.A=g;this.v=void 0!==h?h:g;this.B=!!v}Ka.prototype.toString=function(){return this.j};var La={}; -function Q(a,b,c,d,e,f,g,h){if(La.hasOwnProperty(a))throw Error("Function already created: "+a+".");La[a]=new Ka(a,b,c,d,!1,e,f,g,h)}Q("boolean",2,!1,!1,function(a,b){return M(b,a)},1);Q("ceiling",1,!1,!1,function(a,b){return Math.ceil(K(b,a))},1);Q("concat",3,!1,!1,function(a,b){return r(ia(arguments,1),function(b,d){return b+L(d,a)},"")},2,null);Q("contains",2,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);return-1!=b.indexOf(a)},2);Q("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); -Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){return Math.floor(K(b,a))},1);Q("id",4,!1,!1,function(a,b){var c=a.a,d=9==c.nodeType?c:c.ownerDocument,c=L(b,a).split(/\s+/),e=[];q(c,function(a){a=d.getElementById(a);var b;if(!(b=!a)){a:if(l(e))b=l(a)&&1==a.length?e.indexOf(a,0):-1;else{for(b=0;b<e.length;b++)if(b in e&&e[b]===a)break a;b=-1}b=0<=b}b||e.push(a)});e.sort(ka);var f=new E;q(e,function(a){F(f,a)});return f},1);Q("lang",2,!1,!1,function(){return!1},1); -Q("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);Q("local-name",3,!1,!0,function(a,b){var c=b?za(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);Q("name",3,!1,!0,function(a,b){var c=b?za(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);Q("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -Q("normalize-space",3,!1,!0,function(a,b){return(b?L(b,a):A(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);Q("not",2,!1,!1,function(a,b){return!M(b,a)},1);Q("number",1,!1,!0,function(a,b){return b?K(b,a):+A(a.a)},0,1);Q("position",1,!0,!1,function(a){return a.b},0);Q("round",1,!1,!1,function(a,b){return Math.round(K(b,a))},1);Q("starts-with",2,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);return 0==b.lastIndexOf(a,0)},2);Q("string",3,!1,!0,function(a,b){return b?L(b,a):A(a.a)},0,1); -Q("string-length",1,!1,!0,function(a,b){return(b?L(b,a):A(a.a)).length},0,1);Q("substring",3,!1,!1,function(a,b,c,d){c=K(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?K(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=L(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);Q("substring-after",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -Q("substring-before",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);Q("sum",1,!1,!1,function(a,b){for(var c=H(b.a(a)),d=0,e=I(c);e;e=I(c))d+=+A(e);return d},1,1,!0);Q("translate",3,!1,!1,function(a,b,c,d){b=L(b,a);c=L(c,a);var e=L(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);Q("true",2,!1,!1,function(){return!0},0);function G(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ma(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}G.prototype.a=function(a){return null===this.b||this.b==a.nodeType};G.prototype.f=function(){return this.h}; -G.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=J(this.c));return a};function Na(a){n.call(this,3);this.c=a.substring(1,a.length-1)}m(Na);Na.prototype.a=function(){return this.c};Na.prototype.toString=function(){return"Literal: "+this.c};function R(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.b=b?b.toLowerCase():c}R.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.localName.toLowerCase()?!1:"*"==this.b?!0:this.b==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};R.prototype.f=function(){return this.j};R.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.b?"":this.b+":")+this.j};function Oa(a){n.call(this,1);this.c=a}m(Oa);Oa.prototype.a=function(){return this.c};Oa.prototype.toString=function(){return"Number: "+this.c};function Pa(a,b){n.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.u||c.c!=Qa||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}m(Pa);function S(){n.call(this,4)}m(S);S.prototype.a=function(a){var b=new E;a=a.a;9==a.nodeType?F(b,a):F(b,a.ownerDocument);return b};S.prototype.toString=function(){return"Root Helper Expression"};function Ra(){n.call(this,4)}m(Ra);Ra.prototype.a=function(a){var b=new E;F(b,a.a);return b};Ra.prototype.toString=function(){return"Context Helper Expression"}; -function Sa(a){return"/"==a||"//"==a}Pa.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof E))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=H(b,e.c.a),g;if(e.g||e.c!=Ta)if(e.g||e.c!=Ua)for(g=I(f),b=e.a(new x(g));null!=(g=I(f));)g=e.a(new x(g)),b=ya(b,g);else g=I(f),b=e.a(new x(g));else{for(g=I(f);(b=I(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new x(g))}}return b}; -Pa.prototype.toString=function(){var a;a="Path Expression:"+J(this.h);if(this.c.length){var b=r(this.c,function(a,b){return a+J(b)},"Steps:");a+=J(b)}return a};function Va(a,b){this.a=a;this.b=!!b} -function Ia(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=H(b),f=b.l,g,h=0;g=I(e);h++){var v=a.b?f-h:h+1;g=d.a(new x(g,v,f));if("number"==typeof g)v=v==g;else if("string"==typeof g||"boolean"==typeof g)v=!!g;else if(g instanceof E)v=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;g=v.f;var B=v.a;if(!B)throw Error("Next must be called at least once before remove.");var T=B.b,B=B.a;T?T.a=B:g.a=B;B?B.b=T:g.b=T;g.l--;v.a=null}}return b} -Va.prototype.toString=function(){return r(this.a,function(a,b){return a+J(b)},"Predicates:")};function U(a,b,c,d){n.call(this,4);this.c=a;this.o=b;this.h=c||new Va([]);this.u=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(this.f={name:b.name,s:b.s});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}m(U); -U.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.s?L(c.s,a):null,f=1);if(this.u)if(this.g||this.c!=Wa)if(a=H((new U(Xa,new G("node"))).a(a)),b=I(a))for(c=this.m(b,d,e,f);null!=(b=I(a));)c=ya(c,this.m(b,d,e,f));else c=new E;else c=D(this.o,b,d,e),c=Ia(this.h,c,f);else c=this.m(a.a,d,e,f);return c};U.prototype.m=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=Ia(this.h,a,d)}; -U.prototype.toString=function(){var a;a="Step:"+J("Operator: "+(this.u?"//":"/"));this.c.j&&(a+=J("Axis: "+this.c));a+=J(this.o);if(this.h.a.length){var b=r(this.h.a,function(a,b){return a+J(b)},"Predicates:");a+=J(b)}return a};function Ya(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Ya.prototype.toString=function(){return this.j};var Za={};function V(a,b,c,d){if(Za.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Ya(a,b,c,!!d);return Za[a]=b} -V("ancestor",function(a,b){for(var c=new E,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);V("ancestor-or-self",function(a,b){var c=new E,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);var Qa=V("attribute",function(a,b){var c=new E,d=a.f(),e=b.attributes;if(e)if(a instanceof G&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)F(c,f);else(f=e.getNamedItem(d))&&F(c,f);return c},!1),Wa=V("child",function(a,b,c,d,e){return wa.call(null,a,b,l(c)?c:null,l(d)?d:null,e||new E)},!1,!0); -V("descendant",D,!1,!0);var Xa=V("descendant-or-self",function(a,b,c,d){var e=new E;C(b,c,d)&&a.a(b)&&F(e,b);return D(a,b,c,d,e)},!1,!0),Ta=V("following",function(a,b,c,d){var e=new E;do for(var f=b;f=f.nextSibling;)C(f,c,d)&&a.a(f)&&F(e,f),e=D(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);V("following-sibling",function(a,b){for(var c=new E,d=b;d=d.nextSibling;)a.a(d)&&F(c,d);return c},!1);V("namespace",function(){return new E},!1); -var $a=V("parent",function(a,b){var c=new E;if(9==b.nodeType)return c;if(2==b.nodeType)return F(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&F(c,d);return c},!1),Ua=V("preceding",function(a,b,c,d){var e=new E,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var v=[];for(b=f[g];b=b.previousSibling;)v.unshift(b);for(var B=0,T=v.length;B<T;B++)b=v[B],C(b,c,d)&&a.a(b)&&F(e,b),e=D(a,b,c,d,e)}return e},!0,!0); -V("preceding-sibling",function(a,b){for(var c=new E,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var ab=V("self",function(a,b){var c=new E;a.a(b)&&F(c,b);return c},!1);function bb(a){n.call(this,1);this.c=a;this.g=a.g;this.b=a.b}m(bb);bb.prototype.a=function(a){return-K(this.c,a)};bb.prototype.toString=function(){return"Unary Expression: -"+J(this.c)};function cb(a){n.call(this,4);this.c=a;Ca(this,ga(this.c,function(a){return a.g}));Da(this,ga(this.c,function(a){return a.b}))}m(cb);cb.prototype.a=function(a){var b=new E;q(this.c,function(c){c=c.a(a);if(!(c instanceof E))throw Error("Path expression must evaluate to NodeSet.");b=ya(b,c)});return b};cb.prototype.toString=function(){return r(this.c,function(a,b){return a+J(b)},"Union Expression:")};function db(a,b){this.a=a;this.b=b}function eb(a){for(var b,c=[];;){W(a,"Missing right hand side of binary expression.");b=fb(a);var d=z(a.a);if(!d)break;var e=(d=Ga[d]||null)&&d.w;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].w;)b=new N(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new N(c.pop(),c.pop(),b);return b}function W(a,b){if(ta(a.a))throw Error(b);}function gb(a,b){var c=z(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function hb(a){a=z(a.a);if(")"!=a)throw Error("Bad token: "+a);}function ib(a){a=z(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Na(a)} -function jb(a){var b,c=[],d;if(Sa(y(a.a))){b=z(a.a);d=y(a.a);if("/"==b&&(ta(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new S;d=new S;W(a,"Missing next location step.");b=kb(a,b);c.push(b)}else{a:{b=y(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":z(a.a);b=eb(a);W(a,'unclosed "("');gb(a,")");break;case '"':case "'":b=ib(a);break;default:if(isNaN(+b))if(!Ma(b)&&/(?![0-9])[\w]/.test(d)&&"("==y(a.a,1)){b=z(a.a);b= -La[b]||null;z(a.a);for(d=[];")"!=y(a.a);){W(a,"Missing function argument list.");d.push(eb(a));if(","!=y(a.a))break;z(a.a)}W(a,"Unclosed function argument list.");hb(a);b=new Ja(b,d)}else{b=null;break a}else b=new Oa(+z(a.a))}"["==y(a.a)&&(d=new Va(lb(a)),b=new Ha(b,d))}if(b)if(Sa(y(a.a)))d=b;else return b;else b=kb(a,"/"),d=new Ra,c.push(b)}for(;Sa(y(a.a));)b=z(a.a),W(a,"Missing next location step."),b=kb(a,b),c.push(b);return new Pa(d,c)} -function kb(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==y(a.a))return d=new U(ab,new G("node")),z(a.a),d;if(".."==y(a.a))return d=new U($a,new G("node")),z(a.a),d;var f;if("@"==y(a.a))f=Qa,z(a.a),W(a,"Missing attribute name");else if("::"==y(a.a,1)){if(!/(?![0-9])[\w]/.test(y(a.a).charAt(0)))throw Error("Bad token: "+z(a.a));c=z(a.a);f=Za[c]||null;if(!f)throw Error("No axis with name: "+c);z(a.a);W(a,"Missing node name")}else f=Wa;c=y(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -y(a.a,1)){if(!Ma(c))throw Error("Invalid node type: "+c);c=z(a.a);if(!Ma(c))throw Error("Invalid type name: "+c);gb(a,"(");W(a,"Bad nodetype");e=y(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=ib(a);W(a,"Bad nodetype");hb(a);c=new G(c,g)}else if(c=z(a.a),e=c.indexOf(":"),-1==e)c=new R(c);else{var g=c.substring(0,e),h;if("*"==g)h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new R(c,h)}else throw Error("Bad token: "+z(a.a));e=new Va(lb(a),f.a);return d|| -new U(f,c,e,"//"==b)}function lb(a){for(var b=[];"["==y(a.a);){z(a.a);W(a,"Missing predicate expression.");var c=eb(a);b.push(c);W(a,"Unclosed predicate expression.");gb(a,"]")}return b}function fb(a){if("-"==y(a.a))return z(a.a),new bb(fb(a));var b=jb(a);if("|"!=y(a.a))a=b;else{for(b=[b];"|"==z(a.a);)W(a,"Missing next union location path."),b.push(jb(a));a.a.a--;a=new cb(b)}return a};function mb(a){switch(a.nodeType){case 1:return fa(nb,a);case 9:return mb(a.documentElement);case 11:case 10:case 6:case 12:return ob;default:return a.parentNode?mb(a.parentNode):ob}}function ob(){return null}function nb(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?nb(a.parentNode,b):null};function pb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=qa(a);if(ta(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ea(b.lookupNamespaceURI,b)):b=function(){return null};var d=eb(new db(c,b));if(!ta(c))throw Error("Bad token: "+z(c));this.evaluate=function(a,b){var c=d.a(new x(a));return new X(c,b)}} -function X(a,b){if(0==b)if(a instanceof E)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof E))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof E?Aa(a):""+a;break;case 1:this.numberValue=a instanceof E?+Aa(a):+a;break;case 3:this.booleanValue=a instanceof E?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d= -H(a);c=[];for(var e=I(d);e;e=I(d))c.push(e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:this.singleNodeValue=za(a);break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||0>a?null:c[a]}}X.ANY_TYPE=0; -X.NUMBER_TYPE=1;X.STRING_TYPE=2;X.BOOLEAN_TYPE=3;X.UNORDERED_NODE_ITERATOR_TYPE=4;X.ORDERED_NODE_ITERATOR_TYPE=5;X.UNORDERED_NODE_SNAPSHOT_TYPE=6;X.ORDERED_NODE_SNAPSHOT_TYPE=7;X.ANY_UNORDERED_NODE_TYPE=8;X.FIRST_ORDERED_NODE_TYPE=9;function qb(a){this.lookupNamespaceURI=mb(a)} -aa("wgxpath.install",function(a,b){var c=a||k,d=c.document;if(!d.evaluate||b)c.XPathResult=X,d.evaluate=function(a,b,c,d){return(new pb(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new pb(a,b)},d.createNSResolver=function(a){return new qb(a)}});function Y(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}Y.prototype.clone=function(){return new Y(this.top,this.right,this.bottom,this.left)};Y.prototype.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};Y.prototype.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this}; -Y.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};Y.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};function Z(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}Z.prototype.clone=function(){return new Z(this.left,this.top,this.width,this.height)};Z.prototype.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};Z.prototype.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this}; -Z.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Z.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function rb(a,b){var c=w(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function sb(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}return b} -function tb(a){var b=w(a),c=new t(0,0);if(a==(b?w(b):document).documentElement)return c;a=sb(a);var d=(b?new na(w(b)):p||(p=new na)).a,b=d.scrollingElement?d.scrollingElement:d.body||d.documentElement,d=d.parentWindow||d.defaultView,b=new t(d.pageXOffset||b.scrollLeft,d.pageYOffset||b.scrollTop);c.x=a.left+b.x;c.y=a.top+b.y;return c}function ub(a){if(1==a.nodeType)return a=sb(a),new t(a.left,a.top);a=a.changedTouches?a.changedTouches[0]:a;return new t(a.clientX,a.clientY)};var vb="function"===typeof ShadowRoot;function wb(a,b){var c;c=tb(b);var d=tb(a);c=new t(c.x-d.x,c.y-d.y);var e,f,g;g=rb(a,"borderLeftWidth");f=rb(a,"borderRightWidth");e=rb(a,"borderTopWidth");d=rb(a,"borderBottomWidth");d=new Y(parseFloat(e),parseFloat(f),parseFloat(d),parseFloat(g));c.x-=d.left;c.y-=d.top;return c} -function xb(a,b,c){function d(a,b,c,d,e){d=new Z(c.x+d.left,c.y+d.top,d.width,d.height);c=[0,0];b=[b.width,b.height];var f=[d.left,d.top];d=[d.width,d.height];for(var g=0;2>g;g++)if(d[g]>b[g])c[g]=e?f[g]+d[g]/2-b[g]/2:f[g];else{var h=f[g]-b[g]+d[g];0<h?c[g]=h:0>f[g]&&(c[g]=f[g])}e=new t(c[0],c[1]);a.scrollLeft+=e.x;a.scrollTop+=e.y}function e(a){var b=a.parentNode;vb&&b instanceof ShadowRoot&&(b=a.host);return b}for(var f=w(a),g=e(a),h;g&&g!=f.documentElement&&g!=f.body;)h=wb(g,a),d(g,new u(g.clientWidth, -g.clientHeight),h,b,c),g=e(g);h=ub(a);a=oa(a?new na(w(a)):p||(p=new na));d(f.body,a,h,b,c)};aa("_",function(a,b,c){c||(c=new Z(0,0,a.offsetWidth,a.offsetHeight));xb(a,c,b);a=ub(a);return new t(a.x+c.left,a.y+c.top)});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_name.js b/src/ghostdriver/third_party/webdriver-atoms/get_name.js deleted file mode 100644 index ed57b749e9..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_name.js +++ /dev/null @@ -1,90 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var n=window;var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",C=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var fa=C.exec(k)||["","",""],ga=O.exec(v)||["","",""];if(0==fa[0].length&&0==ga[0].length)break;c=na(0==fa[1].length?0:parseInt(fa[1],10),0==ga[1].length?0:parseInt(ga[1],10))||na(0==fa[2].length,0==ga[2].length)||na(fa[2],ga[2])}while(0==c)}return c} -function na(a,b){return a<b?-1:a>b?1:0};function p(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function oa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function pa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function q(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function qa(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ra(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]}function sa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ta(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function ua(a,b){this.code=a;this.a=r[a]||va;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(ua,Error);var va="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=va;r[30]=va;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=va;r[9]="unknown command";ua.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var wa=g.navigator;if(wa){var xa=wa.userAgent;if(xa){t=xa;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function ya(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function za(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return u("Opera")||u("OPR")}function Ca(){return(u("Chrome")||u("CriOS"))&&!Ba()&&!u("Edge")};function Da(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Ea=Ba(),x=u("Trident")||u("MSIE"),Fa=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ga=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ha=u("Macintosh"),Ia=u("Windows");function Ja(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ga)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=g.document;return a?a.documentMode:void 0} -var La=function(){if(Ea&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),null!=b&&b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=ma(La,a))}var Oa=g.document,Pa=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!y&&!x||x&&9<=Number(Pa)||y&&Na("1.9.1");x&&Na("9");function Qa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Ra(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(Pa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Sa(a,b):!c&&Qa(e,b)?-1*Ta(a,b):!d&&Qa(f,a)?Ta(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Ta(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Sa(d,a)}function Sa(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};var Ua=u("Firefox"),Va=Da()||u("iPod"),Wa=u("iPad"),z=u("Android")&&!(Ca()||u("Firefox")||Ba()||u("Silk")),Xa=Ca(),Ya=u("Safari")&&!(Ca()||u("Coast")||Ba()||u("Edge")||u("Silk")||u("Android"))&&!(Da()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Za(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(Pa)),$a=x&&!(8<=Number(Pa));function ab(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function bb(a,b){var c=$a&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new ab(b,a,b.nodeName,c)};function cb(a){this.b=a;this.a=0}function db(a){a=a.match(eb);for(var b=0;b<a.length;b++)fb.test(a[b])&&a.splice(b,1);return new cb(a)}var eb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),fb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function gb(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}$a&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function hb(a,b,c,d,e){return(A?ib:jb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function ib(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=kb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}lb(a,b,c,d,e);return e} -function jb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?lb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function mb(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=kb(a);if("*"!=h&&(f=oa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=oa(f,function(a){return F(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return nb(a,b,c,d,e)}function nb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function lb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),lb(a,b,c,d,e)}function kb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function ob(a){this.node=a;this.a=this.b=null}function pb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof ab&&k instanceof ab&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Ra(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new ob(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new ob(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function qb(a){return(a=a.a)?a.node:null}function rb(a){return(a=qb(a))?E(a):""}function K(a,b){return new sb(a,!!b)}function sb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function tb(a,b){a.i=b}function ub(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+rb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?rb(c):""+c}function vb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function wb(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==xb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(wb,M); -function yb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}wb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};wb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function zb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}zb.prototype.toString=function(){return this.a};var Ab={}; -function R(a,b,c,d){if(Ab.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new zb(a,b,c,d);return Ab[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return yb(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return yb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return yb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return yb(function(a,b){return a>=b},a,b,c)});var xb=R("=",3,2,function(a,b,c){return yb(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return yb(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return vb(a,c)&&vb(b,c)});R("or",1,2,function(a,b,c){return vb(a,c)||vb(b,c)});function Bb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Bb,M);Bb.prototype.a=function(a){a=this.c.a(a);return Cb(this.j,a)};Bb.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Db(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;tb(this,a.i||qa(b,function(a){return a.i}));ub(this,a.J&&!b.length||a.I&&!!b.length||qa(b,function(a){return a.b}))} -m(Db,M);Db.prototype.a=function(a){return this.j.v.apply(null,sa(a,this.c))};Db.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=q(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Eb(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Eb.prototype.toString=function(){return this.o};var Fb={}; -function S(a,b,c,d,e,f,h,k){if(Fb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Fb[a]=new Eb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return vb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return q(ta(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1); -S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ra(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(l(f))b=l(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Ra);var h=new G;p(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!vb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Gb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Hb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Hb,M);Hb.prototype.a=function(){return this.c};Hb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Ib(a){M.call(this,1);this.c=a}m(Ib,M);Ib.prototype.a=function(){return this.c};Ib.prototype.toString=function(){return"Number: "+this.c};function Jb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Kb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Jb,M);function Lb(){M.call(this,4)}m(Lb,M);Lb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Lb.prototype.toString=function(){return"Root Helper Expression"};function Mb(){M.call(this,4)}m(Mb,M);Mb.prototype.a=function(a){var b=new G;I(b,a.a);return b};Mb.prototype.toString=function(){return"Context Helper Expression"}; -function Nb(a){return"/"==a||"//"==a}Jb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Ob)if(e.i||e.c!=Pb)for(h=L(f),b=e.a(new Za(h));null!=(h=L(f));)h=e.a(new Za(h)),b=pb(b,h);else h=L(f),b=e.a(new Za(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new Za(h))}}return b}; -Jb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=q(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Qb(a,b){this.a=a;this.b=!!b} -function Cb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new Za(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var C=v.a;if(!C)throw Error("Next must be called at least once before remove.");var O=C.b,C=C.a;O?O.a=C:h.a=C;C?C.b=O:h.b=O;h.s--;v.a=null}}return b} -Qb.prototype.toString=function(){return q(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Qb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Rb)if(a=K((new T(Sb,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=pb(c,this.v(b,d,e,f));else c=new G;else c=hb(this.w,b,d,e),c=Cb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Cb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=q(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Tb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Tb.prototype.toString=function(){return this.o};var Ub={};function U(a,b,c,d){if(Ub.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Tb(a,b,c,!!d);return Ub[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Kb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new ab(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,bb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,bb(b,f)):I(c,f));return c},!1),Rb=U("child",function(a,b,c,d,e){return(A?mb:nb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",hb,!1,!0); -var Sb=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return hb(a,b,c,d,e)},!1,!0),Ob=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=hb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Vb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Pb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var C=0,O=v.length;C<O;C++)b=v[C],F(b,c,d)&&a.a(b)&&I(e,b),e=hb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Wb=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function Xb(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m(Xb,M);Xb.prototype.a=function(a){return-P(this.c,a)};Xb.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function Yb(a){M.call(this,4);this.c=a;tb(this,qa(this.c,function(a){return a.i}));ub(this,qa(this.c,function(a){return a.b}))}m(Yb,M);Yb.prototype.a=function(a){var b=new G;p(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=pb(b,c)});return b};Yb.prototype.toString=function(){return q(this.c,function(a,b){return a+N(b)},"Union Expression:")};function Zb(a,b){this.a=a;this.b=b}function $b(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=ac(a);var d=D(a.a);if(!d)break;var e=(d=Ab[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new wb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new wb(c.pop(),c.pop(),b);return b}function V(a,b){if(gb(a.a))throw Error(b);}function bc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function cc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function dc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Hb(a)} -function ec(a){var b,c=[],d;if(Nb(B(a.a))){b=D(a.a);d=B(a.a);if("/"==b&&(gb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Lb;d=new Lb;V(a,"Missing next location step.");b=fc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=$b(a);V(a,'unclosed "("');bc(a,")");break;case '"':case "'":b=dc(a);break;default:if(isNaN(+b))if(!Gb(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=D(a.a); -b=Fb[b]||null;D(a.a);for(d=[];")"!=B(a.a);){V(a,"Missing function argument list.");d.push($b(a));if(","!=B(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");cc(a);b=new Db(b,d)}else{b=null;break a}else b=new Ib(+D(a.a))}"["==B(a.a)&&(d=new Qb(gc(a)),b=new Bb(b,d))}if(b)if(Nb(B(a.a)))d=b;else return b;else b=fc(a,"/"),d=new Mb,c.push(b)}for(;Nb(B(a.a));)b=D(a.a),V(a,"Missing next location step."),b=fc(a,b),c.push(b);return new Jb(d,c)} -function fc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new T(Wb,new J("node")),D(a.a),d;if(".."==B(a.a))return d=new T(Vb,new J("node")),D(a.a),d;var f;if("@"==B(a.a))f=Kb,D(a.a),V(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Ub[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Rb;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!Gb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Gb(c))throw Error("Invalid type name: "+c);bc(a,"(");V(a,"Bad nodetype");e=B(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=dc(a);V(a,"Bad nodetype");cc(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Qb(gc(a),f.a);return d|| -new T(f,c,e,"//"==b)}function gc(a){for(var b=[];"["==B(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=$b(a);b.push(c);V(a,"Unclosed predicate expression.");bc(a,"]")}return b}function ac(a){if("-"==B(a.a))return D(a.a),new Xb(ac(a));var b=ec(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(ec(a));a.a.a--;a=new Yb(b)}return a};function hc(a){switch(a.nodeType){case 1:return ja(ic,a);case 9:return hc(a.documentElement);case 11:case 10:case 6:case 12:return jc;default:return a.parentNode?hc(a.parentNode):jc}}function jc(){return null}function ic(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?ic(a.parentNode,b):null};function kc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=db(a);if(gb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=$b(new Zb(c,b));if(!gb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new Za(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?rb(a):""+a;break;case 1:this.numberValue=a instanceof G?+rb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof ab?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=qb(a);this.singleNodeValue=d instanceof ab?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function lc(a){this.lookupNamespaceURI=hc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new kc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new kc(a,b)},d.createNSResolver=function(a){return new lc(a)}});function mc(a){return(a=a.exec(t))?a[1]:""}var nc=function(){if(Ua)return mc(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return La;if(Xa)return mc(/Chrome\/([0-9.]+)/);if(Ya&&!(Da()||u("iPad")||u("iPod")))return mc(/Version\/([0-9.]+)/);if(Va||Wa){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(z)return(a=mc(/Android\s+([0-9.]+)/))?a:mc(/Version\/([0-9.]+)/);return""}();var oc,pc;function qc(a){return rc?oc(a):x?0<=ma(Pa,a):Na(a)}function sc(a){rc?pc(a):z?ma(tc,a):ma(nc,a)} -var rc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;oc=function(a){return 0<=c.compare(d,""+a)};pc=function(a){c.compare(e,""+a)};return!0}(),uc;if(z){var vc=/Android\s+([0-9\.]+)/.exec(t);uc=vc?vc[1]:"0"}else uc="0";var tc=uc;z&&sc(2.3); -z&&sc(4);Ya&&sc(6);Ga||rc&&sc(3.6);x&&qc(10);z&&sc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=wc(a),xc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function wc(a){xc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function xc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=wc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var yc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new zc(a);!b||b in yc&&!c||(yc[b]={key:a,shift:!1},c&&(yc[c]={key:a,shift:!0}));return a}function zc(a){this.code=a}Z(8);Z(9);Z(13);var Ac=Z(16),Bc=Z(17),Cc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Dc=Z(Ia?{f:91,g:91}:Ha?{f:224,g:91}:{f:0,g:91});Z(Ia?{f:92,g:92}:Ha?{f:224,g:93}:{f:0,g:92});Z(Ia?{f:93,g:93}:Ha?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Ec=new X;Y(Ec,1,Ac);Y(Ec,2,Bc);Y(Ec,4,Cc);Y(Ec,8,Dc);(function(a){var b=new X;p(wc(a),function(c){Y(b,a.get(c).code,c)});return b})(Ec);y&&qc(12);function Fc(){} -function Gc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Gc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Hc(d,c),c.push(":"),Gc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Hc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Ic={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Jc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Hc(a,b){b.push('"',a.replace(Jc,function(a){var b=Ic[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ic[a]=b);return b}),'"')};Ga||y&&qc(3.5)||x&&qc(8);function Kc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return pa(a,Kc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Lc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Lc(a),b;if(ca(a))return pa(a,Kc);a=ya(a,function(a,b){return"number"==typeof b||l(b)});return za(a,Kc);default:return null}} -function Mc(a,b){return"array"==ba(a)?pa(a,function(a){return Mc(a,b)}):da(a)?"function"==typeof a?a:w(a,"ELEMENT")?Nc(a.ELEMENT,b):w(a,"WINDOW")?Nc(a.WINDOW,b):za(a,function(a){return Mc(a,b)}):a} -function Oc(a,b){var c;try{a:{var d=a;if(l(d))try{a=new n.Function(d);break a}catch(h){if(x&&n.execScript){n.execScript(";");a=new n.Function(d);break a}throw h;}a=n==window?d:new n.Function("return ("+d+").apply(null,arguments);")}var e=Mc(b,n.document),f=a.apply(null,e);c={status:0,value:Kc(f)}}catch(h){c={status:w(h,"code")?h.code:13,value:{message:h.message}}}d=[];Gc(new Fc,c,d);return d.join("")}function Pc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b} -function Lc(a){var b=Pc(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c}function Nc(a,b){a=decodeURIComponent(a);var c=b||document,d=Pc(c);if(!w(d,a))throw new ua(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new ua(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new ua(10,"Element is no longer attached to the DOM");};aa("_",function(a){return Oc(function(a){return a.tagName.toLowerCase()},[a])});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_page_zoom_chrome.js b/src/ghostdriver/third_party/webdriver-atoms/get_page_zoom_chrome.js deleted file mode 100644 index 2acf92c151..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_page_zoom_chrome.js +++ /dev/null @@ -1,68 +0,0 @@ -function(){return function(){var aa=this;function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function h(a){return"string"==typeof a}function da(a,b,c){return a.call.apply(a.bind,arguments)}function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}} -function fa(a,b,c){fa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?da:ea;return fa.apply(null,arguments)}function ga(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}} -function l(a){var b=m;function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.F=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};function n(a,b){for(var c=a.length,d=h(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function p(a,b,c){var d=c;n(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function q(a,b){for(var c=a.length,d=h(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ha(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ia(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function ja(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function ka(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?la(a,b):!c&&ja(e,b)?-1*ma(a,b):!d&&ja(f,a)?ma(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType?a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0); -d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function ma(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return la(d,a)}function la(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function r(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function na(a){this.b=a;this.a=0}function oa(a){a=a.match(pa);for(var b=0;b<a.length;b++)qa.test(a[b])&&a.splice(b,1);return new na(a)}var pa=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),qa=/^\s/;function t(a,b){return a.b[a.a+(b||0)]}function u(a){return a.b[a.a++]}function w(a){return a.b.length<=a.a};function x(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function y(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function z(a,b,c,d,e){return ra.call(null,a,b,h(c)?c:null,h(d)?d:null,e||new B)} -function ra(a,b,c,d,e){b.getElementsByName&&d&&"name"==c?(b=b.getElementsByName(d),n(b,function(b){a.a(b)&&C(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(b){b.className==d&&a.a(b)&&C(e,b)})):a instanceof D?sa(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),n(b,function(a){y(a,c,d)&&C(e,a)}));return e}function ta(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)y(b,c,d)&&a.a(b)&&C(e,b);return e} -function sa(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)y(b,c,d)&&a.a(b)&&C(e,b),sa(a,b,c,d,e)};function B(){this.b=this.a=null;this.l=0}function ua(a){this.node=a;this.a=this.b=null}function va(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;)c.node==d.node?(f=c,c=c.a,d=d.a):0<ka(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a),(f.b=e)?e.a=f:a.a=f,e=f,g++;for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}B.prototype.unshift=function(a){a=new ua(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++}; -function C(a,b){var c=new ua(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function E(a){return(a=a.a)?a.node:null}function F(a){return(a=E(a))?x(a):""}function G(a,b){return new wa(a,!!b)}function wa(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function H(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function m(a){this.i=a;this.b=this.g=!1;this.f=null}function I(a){return"\n "+a.toString().split("\n").join("\n ")}function xa(a,b){a.g=b}function ya(a,b){a.b=b}function J(a,b){var c=a.a(b);return c instanceof B?+F(c):+c}function K(a,b){var c=a.a(b);return c instanceof B?F(c):""+c}function L(a,b){var c=a.a(b);return c instanceof B?!!c.l:!!c};function M(a,b,c){m.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==za&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,s:b}):this.f={name:b.f.name,s:c})}l(M); -function N(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof B&&c instanceof B){b=G(b);for(d=H(b);d;d=H(b))for(e=G(c),f=H(e);f;f=H(e))if(a(x(d),x(f)))return!0;return!1}if(b instanceof B||c instanceof B){b instanceof B?(e=b,d=c):(e=c,d=b);f=G(e);for(var g=typeof d,k=H(f);k;k=H(f)){switch(g){case "number":k=+x(k);break;case "boolean":k=!!x(k);break;case "string":k=x(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}M.prototype.a=function(a){return this.c.m(this.h,this.o,a)};M.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+I(this.h);return a+=I(this.o)};function Aa(a,b,c,d){this.a=a;this.w=b;this.i=c;this.m=d}Aa.prototype.toString=function(){return this.a};var Ba={}; -function P(a,b,c,d){if(Ba.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Aa(a,b,c,d);return Ba[a.toString()]=a}P("div",6,1,function(a,b,c){return J(a,c)/J(b,c)});P("mod",6,1,function(a,b,c){return J(a,c)%J(b,c)});P("*",6,1,function(a,b,c){return J(a,c)*J(b,c)});P("+",5,1,function(a,b,c){return J(a,c)+J(b,c)});P("-",5,1,function(a,b,c){return J(a,c)-J(b,c)});P("<",4,2,function(a,b,c){return N(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return N(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return N(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return N(function(a,b){return a>=b},a,b,c)});var za=P("=",3,2,function(a,b,c){return N(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return N(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return L(a,c)&&L(b,c)});P("or",1,2,function(a,b,c){return L(a,c)||L(b,c)});function Q(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");m.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}l(Q);Q.prototype.a=function(a){a=this.c.a(a);return Ca(this.h,a)};Q.prototype.toString=function(){var a;a="Filter:"+I(this.c);return a+=I(this.h)};function R(a,b){if(b.length<a.A)throw Error("Function "+a.j+" expects at least"+a.A+" arguments, "+b.length+" given");if(null!==a.v&&b.length>a.v)throw Error("Function "+a.j+" expects at most "+a.v+" arguments, "+b.length+" given");a.B&&n(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});m.call(this,a.i);this.h=a;this.c=b;xa(this,a.g||q(b,function(a){return a.g}));ya(this,a.D&&!b.length||a.C&&!!b.length||q(b,function(a){return a.b}))}l(R); -R.prototype.a=function(a){return this.h.m.apply(null,ha(a,this.c))};R.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=p(this.c,function(a,b){return a+I(b)},"Arguments:"),a=a+I(b);return a};function Da(a,b,c,d,e,f,g,k,v){this.j=a;this.i=b;this.g=c;this.D=d;this.C=e;this.m=f;this.A=g;this.v=void 0!==k?k:g;this.B=!!v}Da.prototype.toString=function(){return this.j};var Ea={}; -function S(a,b,c,d,e,f,g,k){if(Ea.hasOwnProperty(a))throw Error("Function already created: "+a+".");Ea[a]=new Da(a,b,c,d,!1,e,f,g,k)}S("boolean",2,!1,!1,function(a,b){return L(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(J(b,a))},1);S("concat",3,!1,!1,function(a,b){return p(ia(arguments,1),function(b,d){return b+K(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(J(b,a))},1);S("id",4,!1,!1,function(a,b){var c=a.a,d=9==c.nodeType?c:c.ownerDocument,c=K(b,a).split(/\s+/),e=[];n(c,function(a){a=d.getElementById(a);var b;if(!(b=!a)){a:if(h(e))b=h(a)&&1==a.length?e.indexOf(a,0):-1;else{for(b=0;b<e.length;b++)if(b in e&&e[b]===a)break a;b=-1}b=0<=b}b||e.push(a)});e.sort(ka);var f=new B;n(e,function(a){C(f,a)});return f},1);S("lang",2,!1,!1,function(){return!1},1); -S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);S("local-name",3,!1,!0,function(a,b){var c=b?E(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?E(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0);S("normalize-space",3,!1,!0,function(a,b){return(b?K(b,a):x(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1); -S("not",2,!1,!1,function(a,b){return!L(b,a)},1);S("number",1,!1,!0,function(a,b){return b?J(b,a):+x(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(J(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?K(b,a):x(a.a)},0,1);S("string-length",1,!1,!0,function(a,b){return(b?K(b,a):x(a.a)).length},0,1); -S("substring",3,!1,!1,function(a,b,c,d){c=J(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?J(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=K(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=G(b.a(a)),d=0,e=H(c);e;e=H(c))d+=+x(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=K(b,a);c=K(c,a);var e=K(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function D(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Fa(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}D.prototype.a=function(a){return null===this.b||this.b==a.nodeType};D.prototype.f=function(){return this.h}; -D.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=I(this.c));return a};function T(a){m.call(this,3);this.c=a.substring(1,a.length-1)}l(T);T.prototype.a=function(){return this.c};T.prototype.toString=function(){return"Literal: "+this.c};function U(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.b=b?b.toLowerCase():c}U.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.localName.toLowerCase()?!1:"*"==this.b?!0:this.b==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};U.prototype.f=function(){return this.j};U.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.b?"":this.b+":")+this.j};function Ga(a){m.call(this,1);this.c=a}l(Ga);Ga.prototype.a=function(){return this.c};Ga.prototype.toString=function(){return"Number: "+this.c};function Ha(a,b){m.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.u||c.c!=Ia||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}l(Ha);function V(){m.call(this,4)}l(V);V.prototype.a=function(a){var b=new B;a=a.a;9==a.nodeType?C(b,a):C(b,a.ownerDocument);return b};V.prototype.toString=function(){return"Root Helper Expression"};function Ja(){m.call(this,4)}l(Ja);Ja.prototype.a=function(a){var b=new B;C(b,a.a);return b};Ja.prototype.toString=function(){return"Context Helper Expression"}; -function Ka(a){return"/"==a||"//"==a}Ha.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof B))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=G(b,e.c.a),g;if(e.g||e.c!=La)if(e.g||e.c!=Ma)for(g=H(f),b=e.a(new r(g));null!=(g=H(f));)g=e.a(new r(g)),b=va(b,g);else g=H(f),b=e.a(new r(g));else{for(g=H(f);(b=H(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new r(g))}}return b}; -Ha.prototype.toString=function(){var a;a="Path Expression:"+I(this.h);if(this.c.length){var b=p(this.c,function(a,b){return a+I(b)},"Steps:");a+=I(b)}return a};function Na(a,b){this.a=a;this.b=!!b} -function Ca(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=G(b),f=b.l,g,k=0;g=H(e);k++){var v=a.b?f-k:k+1;g=d.a(new r(g,v,f));if("number"==typeof g)v=v==g;else if("string"==typeof g||"boolean"==typeof g)v=!!g;else if(g instanceof B)v=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;g=v.f;var A=v.a;if(!A)throw Error("Next must be called at least once before remove.");var O=A.b,A=A.a;O?O.a=A:g.a=A;A?A.b=O:g.b=O;g.l--;v.a=null}}return b} -Na.prototype.toString=function(){return p(this.a,function(a,b){return a+I(b)},"Predicates:")};function W(a,b,c,d){m.call(this,4);this.c=a;this.o=b;this.h=c||new Na([]);this.u=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(this.f={name:b.name,s:b.s});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}l(W); -W.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.s?K(c.s,a):null,f=1);if(this.u)if(this.g||this.c!=Oa)if(a=G((new W(Pa,new D("node"))).a(a)),b=H(a))for(c=this.m(b,d,e,f);null!=(b=H(a));)c=va(c,this.m(b,d,e,f));else c=new B;else c=z(this.o,b,d,e),c=Ca(this.h,c,f);else c=this.m(a.a,d,e,f);return c};W.prototype.m=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=Ca(this.h,a,d)}; -W.prototype.toString=function(){var a;a="Step:"+I("Operator: "+(this.u?"//":"/"));this.c.j&&(a+=I("Axis: "+this.c));a+=I(this.o);if(this.h.a.length){var b=p(this.h.a,function(a,b){return a+I(b)},"Predicates:");a+=I(b)}return a};function Qa(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Qa.prototype.toString=function(){return this.j};var Ra={};function X(a,b,c,d){if(Ra.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Qa(a,b,c,!!d);return Ra[a]=b} -X("ancestor",function(a,b){for(var c=new B,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);X("ancestor-or-self",function(a,b){var c=new B,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);var Ia=X("attribute",function(a,b){var c=new B,d=a.f(),e=b.attributes;if(e)if(a instanceof D&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C(c,f);else(f=e.getNamedItem(d))&&C(c,f);return c},!1),Oa=X("child",function(a,b,c,d,e){return ta.call(null,a,b,h(c)?c:null,h(d)?d:null,e||new B)},!1,!0); -X("descendant",z,!1,!0);var Pa=X("descendant-or-self",function(a,b,c,d){var e=new B;y(b,c,d)&&a.a(b)&&C(e,b);return z(a,b,c,d,e)},!1,!0),La=X("following",function(a,b,c,d){var e=new B;do for(var f=b;f=f.nextSibling;)y(f,c,d)&&a.a(f)&&C(e,f),e=z(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);X("following-sibling",function(a,b){for(var c=new B,d=b;d=d.nextSibling;)a.a(d)&&C(c,d);return c},!1);X("namespace",function(){return new B},!1); -var Sa=X("parent",function(a,b){var c=new B;if(9==b.nodeType)return c;if(2==b.nodeType)return C(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&C(c,d);return c},!1),Ma=X("preceding",function(a,b,c,d){var e=new B,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var v=[];for(b=f[g];b=b.previousSibling;)v.unshift(b);for(var A=0,O=v.length;A<O;A++)b=v[A],y(b,c,d)&&a.a(b)&&C(e,b),e=z(a,b,c,d,e)}return e},!0,!0); -X("preceding-sibling",function(a,b){for(var c=new B,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Ta=X("self",function(a,b){var c=new B;a.a(b)&&C(c,b);return c},!1);function Ua(a){m.call(this,1);this.c=a;this.g=a.g;this.b=a.b}l(Ua);Ua.prototype.a=function(a){return-J(this.c,a)};Ua.prototype.toString=function(){return"Unary Expression: -"+I(this.c)};function Va(a){m.call(this,4);this.c=a;xa(this,q(this.c,function(a){return a.g}));ya(this,q(this.c,function(a){return a.b}))}l(Va);Va.prototype.a=function(a){var b=new B;n(this.c,function(c){c=c.a(a);if(!(c instanceof B))throw Error("Path expression must evaluate to NodeSet.");b=va(b,c)});return b};Va.prototype.toString=function(){return p(this.c,function(a,b){return a+I(b)},"Union Expression:")};function Wa(a,b){this.a=a;this.b=b}function Xa(a){for(var b,c=[];;){Y(a,"Missing right hand side of binary expression.");b=Ya(a);var d=u(a.a);if(!d)break;var e=(d=Ba[d]||null)&&d.w;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].w;)b=new M(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new M(c.pop(),c.pop(),b);return b}function Y(a,b){if(w(a.a))throw Error(b);}function Za(a,b){var c=u(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function $a(a){a=u(a.a);if(")"!=a)throw Error("Bad token: "+a);}function ab(a){a=u(a.a);if(2>a.length)throw Error("Unclosed literal string");return new T(a)} -function bb(a){var b,c=[],d;if(Ka(t(a.a))){b=u(a.a);d=t(a.a);if("/"==b&&(w(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new V;d=new V;Y(a,"Missing next location step.");b=cb(a,b);c.push(b)}else{a:{b=t(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":u(a.a);b=Xa(a);Y(a,'unclosed "("');Za(a,")");break;case '"':case "'":b=ab(a);break;default:if(isNaN(+b))if(!Fa(b)&&/(?![0-9])[\w]/.test(d)&&"("==t(a.a,1)){b=u(a.a);b= -Ea[b]||null;u(a.a);for(d=[];")"!=t(a.a);){Y(a,"Missing function argument list.");d.push(Xa(a));if(","!=t(a.a))break;u(a.a)}Y(a,"Unclosed function argument list.");$a(a);b=new R(b,d)}else{b=null;break a}else b=new Ga(+u(a.a))}"["==t(a.a)&&(d=new Na(db(a)),b=new Q(b,d))}if(b)if(Ka(t(a.a)))d=b;else return b;else b=cb(a,"/"),d=new Ja,c.push(b)}for(;Ka(t(a.a));)b=u(a.a),Y(a,"Missing next location step."),b=cb(a,b),c.push(b);return new Ha(d,c)} -function cb(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==t(a.a))return d=new W(Ta,new D("node")),u(a.a),d;if(".."==t(a.a))return d=new W(Sa,new D("node")),u(a.a),d;var f;if("@"==t(a.a))f=Ia,u(a.a),Y(a,"Missing attribute name");else if("::"==t(a.a,1)){if(!/(?![0-9])[\w]/.test(t(a.a).charAt(0)))throw Error("Bad token: "+u(a.a));c=u(a.a);f=Ra[c]||null;if(!f)throw Error("No axis with name: "+c);u(a.a);Y(a,"Missing node name")}else f=Oa;c=t(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -t(a.a,1)){if(!Fa(c))throw Error("Invalid node type: "+c);c=u(a.a);if(!Fa(c))throw Error("Invalid type name: "+c);Za(a,"(");Y(a,"Bad nodetype");e=t(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=ab(a);Y(a,"Bad nodetype");$a(a);c=new D(c,g)}else if(c=u(a.a),e=c.indexOf(":"),-1==e)c=new U(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new U(c,k)}else throw Error("Bad token: "+u(a.a));e=new Na(db(a),f.a);return d|| -new W(f,c,e,"//"==b)}function db(a){for(var b=[];"["==t(a.a);){u(a.a);Y(a,"Missing predicate expression.");var c=Xa(a);b.push(c);Y(a,"Unclosed predicate expression.");Za(a,"]")}return b}function Ya(a){if("-"==t(a.a))return u(a.a),new Ua(Ya(a));var b=bb(a);if("|"!=t(a.a))a=b;else{for(b=[b];"|"==u(a.a);)Y(a,"Missing next union location path."),b.push(bb(a));a.a.a--;a=new Va(b)}return a};function eb(a){switch(a.nodeType){case 1:return ga(fb,a);case 9:return eb(a.documentElement);case 11:case 10:case 6:case 12:return gb;default:return a.parentNode?eb(a.parentNode):gb}}function gb(){return null}function fb(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?fb(a.parentNode,b):null};function hb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=oa(a);if(w(c))throw Error("Invalid XPath expression.");b?"function"==ca(b)||(b=fa(b.lookupNamespaceURI,b)):b=function(){return null};var d=Xa(new Wa(c,b));if(!w(c))throw Error("Bad token: "+u(c));this.evaluate=function(a,b){var c=d.a(new r(a));return new Z(c,b)}} -function Z(a,b){if(0==b)if(a instanceof B)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof B))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof B?F(a):""+a;break;case 1:this.numberValue=a instanceof B?+F(a):+a;break;case 3:this.booleanValue=a instanceof B?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d= -G(a);c=[];for(var e=H(d);e;e=H(d))c.push(e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:this.singleNodeValue=E(a);break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||0>a?null:c[a]}}Z.ANY_TYPE=0; -Z.NUMBER_TYPE=1;Z.STRING_TYPE=2;Z.BOOLEAN_TYPE=3;Z.UNORDERED_NODE_ITERATOR_TYPE=4;Z.ORDERED_NODE_ITERATOR_TYPE=5;Z.UNORDERED_NODE_SNAPSHOT_TYPE=6;Z.ORDERED_NODE_SNAPSHOT_TYPE=7;Z.ANY_UNORDERED_NODE_TYPE=8;Z.FIRST_ORDERED_NODE_TYPE=9;function ib(a){this.lookupNamespaceURI=eb(a)} -ba("wgxpath.install",function(a,b){var c=a||aa,d=c.document;if(!d.evaluate||b)c.XPathResult=Z,d.evaluate=function(a,b,c,d){return(new hb(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new hb(a,b)},d.createNSResolver=function(a){return new ib(a)}});ba("_",function(a){a=9==a.nodeType?a:a.ownerDocument||a.document;var b=a.documentElement;return a.width/Math.max(b.clientWidth,b.offsetWidth,b.scrollWidth)});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_size.js b/src/ghostdriver/third_party/webdriver-atoms/get_size.js deleted file mode 100644 index 695c61b3bb..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_size.js +++ /dev/null @@ -1,98 +0,0 @@ -function(){return function(){var g,l=this;function aa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function fa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ga(a,b,c){ga=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa;return ga.apply(null,arguments)} -function ha(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ia=Date.now||function(){return+new Date};function n(a,b){function c(){}c.prototype=b.prototype;a.P=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.N=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var ja=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ka(a,b){for(var c=0,d=ja(String(a)).split("."),e=ja(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",u=e[h]||"",v=RegExp("(\\d*)(\\D*)","g"),I=RegExp("(\\d*)(\\D*)","g");do{var S=v.exec(k)||["","",""],T=I.exec(u)||["","",""];if(0==S[0].length&&0==T[0].length)break;c=la(0==S[1].length?0:parseInt(S[1],10),0==T[1].length?0:parseInt(T[1],10))||la(0==S[2].length,0==T[2].length)||la(S[2],T[2])}while(0==c)}return c}function la(a,b){return a<b?-1:a>b?1:0};function p(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ma(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function na(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function oa(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function qa(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ra(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function sa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ta(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function q(a,b){this.code=a;this.a=r[a]||ua;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}n(q,Error);var ua="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=ua;r[30]=ua;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=ua;r[9]="unknown command";q.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var va=l.navigator;if(va){var wa=va.userAgent;if(wa){t=wa;break a}}t=""}function w(a){return-1!=t.indexOf(a)};function xa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function ya(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function za(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return w("Opera")||w("OPR")}function Ca(){return(w("Chrome")||w("CriOS"))&&!Ba()&&!w("Edge")};function Da(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Ea=Ba(),x=w("Trident")||w("MSIE"),Fa=w("Edge"),y=w("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Ga=-1!=t.toLowerCase().indexOf("webkit")&&!w("Edge"),Ha=w("Macintosh"),Ia=w("Windows");function Ja(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ga)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=l.document;return a?a.documentMode:void 0} -var La=function(){if(Ea&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),null!=b&&b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=ka(La,a))}var Oa=l.document,Pa=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!y&&!x||x&&9<=Number(Pa)||y&&Na("1.9.1");x&&Na("9");function Qa(a,b){this.width=a;this.height=b}g=Qa.prototype;g.clone=function(){return new Qa(this.width,this.height)};g.toString=function(){return"("+this.width+" x "+this.height+")"};g.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};g.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};g.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -g.scale=function(a,b){this.width*=a;this.height*="number"==typeof b?b:a;return this};function Ra(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Sa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(Pa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ta(a,b):!c&&Ra(e,b)?-1*Ua(a,b):!d&&Ra(f,a)?Ua(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=Va(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function Ua(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ta(d,a)}function Ta(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function Va(a){return 9==a.nodeType?a:a.ownerDocument||a.document};var Wa=w("Firefox"),Xa=Da()||w("iPod"),Ya=w("iPad"),Za=w("Android")&&!(Ca()||w("Firefox")||Ba()||w("Silk")),$a=Ca(),ab=w("Safari")&&!(Ca()||w("Coast")||Ba()||w("Edge")||w("Silk")||w("Android"))&&!(Da()||w("iPad")||w("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function bb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var z=x&&!(9<=Number(Pa)),cb=x&&!(8<=Number(Pa));function db(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function eb(a,b){var c=cb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new db(b,a,b.nodeName,c)};function fb(a){this.b=a;this.a=0}function gb(a){a=a.match(hb);for(var b=0;b<a.length;b++)jb.test(a[b])&&a.splice(b,1);return new fb(a)}var hb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),jb=/^\s/;function A(a,b){return a.b[a.a+(b||0)]}function B(a){return a.b[a.a++]}function kb(a){return a.b.length<=a.a};function C(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(z&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),z&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function D(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}cb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function lb(a,b,c,d,e){return(z?mb:nb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new E)} -function mb(a,b,c,d,e){if(a instanceof ob||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=pb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)D(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||F(e,b);return e}qb(a,b,c,d,e);return e} -function nb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&F(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&F(e,b)})):a instanceof G?qb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){D(a,c,d)&&F(e,a)}));return e} -function rb(a,b,c,d,e){var f;if((a instanceof ob||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=pb(a);if("*"!=h&&(f=ma(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=ma(f,function(a){return D(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||F(e,a)});return e}return sb(a,b,c,d,e)}function sb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)D(b,c,d)&&a.a(b)&&F(e,b);return e} -function qb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)D(b,c,d)&&a.a(b)&&F(e,b),qb(a,b,c,d,e)}function pb(a){if(a instanceof G){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function E(){this.b=this.a=null;this.s=0}function tb(a){this.node=a;this.a=this.b=null}function ub(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof db&&k instanceof db&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Sa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -E.prototype.unshift=function(a){a=new tb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function F(a,b){var c=new tb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function vb(a){return(a=a.a)?a.node:null}function wb(a){return(a=vb(a))?C(a):""}function H(a,b){return new xb(a,!!b)}function xb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function J(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function K(a){this.m=a;this.b=this.i=!1;this.h=null}function L(a){return"\n "+a.toString().split("\n").join("\n ")}function yb(a,b){a.i=b}function zb(a,b){a.b=b}function M(a,b){var c=a.a(b);return c instanceof E?+wb(c):+c}function N(a,b){var c=a.a(b);return c instanceof E?wb(c):""+c}function Ab(a,b){var c=a.a(b);return c instanceof E?!!c.s:!!c};function Bb(a,b,c){K.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Cb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}n(Bb,K); -function Db(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof E&&c instanceof E){b=H(b);for(d=J(b);d;d=J(b))for(e=H(c),f=J(e);f;f=J(e))if(a(C(d),C(f)))return!0;return!1}if(b instanceof E||c instanceof E){b instanceof E?(e=b,d=c):(e=c,d=b);f=H(e);for(var h=typeof d,k=J(f);k;k=J(f)){switch(h){case "number":k=+C(k);break;case "boolean":k=!!C(k);break;case "string":k=C(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Bb.prototype.a=function(a){return this.c.u(this.j,this.w,a)};Bb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+L(this.j);return a+=L(this.w)};function Eb(a,b,c,d){this.a=a;this.H=b;this.m=c;this.u=d}Eb.prototype.toString=function(){return this.a};var Fb={}; -function O(a,b,c,d){if(Fb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Eb(a,b,c,d);return Fb[a.toString()]=a}O("div",6,1,function(a,b,c){return M(a,c)/M(b,c)});O("mod",6,1,function(a,b,c){return M(a,c)%M(b,c)});O("*",6,1,function(a,b,c){return M(a,c)*M(b,c)});O("+",5,1,function(a,b,c){return M(a,c)+M(b,c)});O("-",5,1,function(a,b,c){return M(a,c)-M(b,c)});O("<",4,2,function(a,b,c){return Db(function(a,b){return a<b},a,b,c)}); -O(">",4,2,function(a,b,c){return Db(function(a,b){return a>b},a,b,c)});O("<=",4,2,function(a,b,c){return Db(function(a,b){return a<=b},a,b,c)});O(">=",4,2,function(a,b,c){return Db(function(a,b){return a>=b},a,b,c)});var Cb=O("=",3,2,function(a,b,c){return Db(function(a,b){return a==b},a,b,c,!0)});O("!=",3,2,function(a,b,c){return Db(function(a,b){return a!=b},a,b,c,!0)});O("and",2,2,function(a,b,c){return Ab(a,c)&&Ab(b,c)});O("or",1,2,function(a,b,c){return Ab(a,c)||Ab(b,c)});function Gb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}n(Gb,K);Gb.prototype.a=function(a){a=this.c.a(a);return Hb(this.j,a)};Gb.prototype.toString=function(){var a;a="Filter:"+L(this.c);return a+=L(this.j)};function Ib(a,b){if(b.length<a.I)throw Error("Function "+a.o+" expects at least"+a.I+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.M&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});K.call(this,a.m);this.j=a;this.c=b;yb(this,a.i||qa(b,function(a){return a.i}));zb(this,a.L&&!b.length||a.K&&!!b.length||qa(b,function(a){return a.b}))} -n(Ib,K);Ib.prototype.a=function(a){return this.j.u.apply(null,sa(a,this.c))};Ib.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=oa(this.c,function(a,b){return a+L(b)},"Arguments:"),a=a+L(b);return a};function Jb(a,b,c,d,e,f,h,k,u){this.o=a;this.m=b;this.i=c;this.L=d;this.K=e;this.u=f;this.I=h;this.D=void 0!==k?k:h;this.M=!!u}Jb.prototype.toString=function(){return this.o};var Kb={}; -function P(a,b,c,d,e,f,h,k){if(Kb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Kb[a]=new Jb(a,b,c,d,!1,e,f,h,k)}P("boolean",2,!1,!1,function(a,b){return Ab(b,a)},1);P("ceiling",1,!1,!1,function(a,b){return Math.ceil(M(b,a))},1);P("concat",3,!1,!1,function(a,b){return oa(ta(arguments,1),function(b,d){return b+N(d,a)},"")},2,null);P("contains",2,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);return-1!=b.indexOf(a)},2);P("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -P("false",2,!1,!1,function(){return!1},0);P("floor",1,!1,!1,function(a,b){return Math.floor(M(b,a))},1); -P("id",4,!1,!1,function(a,b){function c(a){if(z){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ra(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=N(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(m(f))b=m(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Sa);var h=new E;p(f,function(a){F(h,a)});return h},1); -P("lang",2,!1,!1,function(){return!1},1);P("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);P("local-name",3,!1,!0,function(a,b){var c=b?vb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);P("name",3,!1,!0,function(a,b){var c=b?vb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);P("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -P("normalize-space",3,!1,!0,function(a,b){return(b?N(b,a):C(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);P("not",2,!1,!1,function(a,b){return!Ab(b,a)},1);P("number",1,!1,!0,function(a,b){return b?M(b,a):+C(a.a)},0,1);P("position",1,!0,!1,function(a){return a.b},0);P("round",1,!1,!1,function(a,b){return Math.round(M(b,a))},1);P("starts-with",2,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);return 0==b.lastIndexOf(a,0)},2);P("string",3,!1,!0,function(a,b){return b?N(b,a):C(a.a)},0,1); -P("string-length",1,!1,!0,function(a,b){return(b?N(b,a):C(a.a)).length},0,1);P("substring",3,!1,!1,function(a,b,c,d){c=M(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?M(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=N(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);P("substring-after",3,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -P("substring-before",3,!1,!1,function(a,b,c){b=N(b,a);a=N(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);P("sum",1,!1,!1,function(a,b){for(var c=H(b.a(a)),d=0,e=J(c);e;e=J(c))d+=+C(e);return d},1,1,!0);P("translate",3,!1,!1,function(a,b,c,d){b=N(b,a);c=N(c,a);var e=N(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);P("true",2,!1,!1,function(){return!0},0);function G(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Lb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}G.prototype.a=function(a){return null===this.b||this.b==a.nodeType};G.prototype.h=function(){return this.j}; -G.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=L(this.c));return a};function Mb(a){K.call(this,3);this.c=a.substring(1,a.length-1)}n(Mb,K);Mb.prototype.a=function(){return this.c};Mb.prototype.toString=function(){return"Literal: "+this.c};function ob(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}ob.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};ob.prototype.h=function(){return this.o};ob.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Nb(a){K.call(this,1);this.c=a}n(Nb,K);Nb.prototype.a=function(){return this.c};Nb.prototype.toString=function(){return"Number: "+this.c};function Ob(a,b){K.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.B||c.c!=Pb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}n(Ob,K);function Qb(){K.call(this,4)}n(Qb,K);Qb.prototype.a=function(a){var b=new E;a=a.a;9==a.nodeType?F(b,a):F(b,a.ownerDocument);return b};Qb.prototype.toString=function(){return"Root Helper Expression"};function Rb(){K.call(this,4)}n(Rb,K);Rb.prototype.a=function(a){var b=new E;F(b,a.a);return b};Rb.prototype.toString=function(){return"Context Helper Expression"}; -function Sb(a){return"/"==a||"//"==a}Ob.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof E))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=H(b,e.c.a),h;if(e.i||e.c!=Tb)if(e.i||e.c!=Ub)for(h=J(f),b=e.a(new bb(h));null!=(h=J(f));)h=e.a(new bb(h)),b=ub(b,h);else h=J(f),b=e.a(new bb(h));else{for(h=J(f);(b=J(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new bb(h))}}return b}; -Ob.prototype.toString=function(){var a;a="Path Expression:"+L(this.j);if(this.c.length){var b=oa(this.c,function(a,b){return a+L(b)},"Steps:");a+=L(b)}return a};function Vb(a,b){this.a=a;this.b=!!b} -function Hb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=H(b),f=b.s,h,k=0;h=J(e);k++){var u=a.b?f-k:k+1;h=d.a(new bb(h,u,f));if("number"==typeof h)u=u==h;else if("string"==typeof h||"boolean"==typeof h)u=!!h;else if(h instanceof E)u=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!u){u=e;h=u.h;var v=u.a;if(!v)throw Error("Next must be called at least once before remove.");var I=v.b,v=v.a;I?I.a=v:h.a=v;v?v.b=I:h.b=I;h.s--;u.a=null}}return b} -Vb.prototype.toString=function(){return oa(this.a,function(a,b){return a+L(b)},"Predicates:")};function Q(a,b,c,d){K.call(this,4);this.c=a;this.w=b;this.j=c||new Vb([]);this.B=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=z?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}n(Q,K); -Q.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?N(c.A,a):null,f=1);if(this.B)if(this.i||this.c!=Wb)if(a=H((new Q(Xb,new G("node"))).a(a)),b=J(a))for(c=this.u(b,d,e,f);null!=(b=J(a));)c=ub(c,this.u(b,d,e,f));else c=new E;else c=lb(this.w,b,d,e),c=Hb(this.j,c,f);else c=this.u(a.a,d,e,f);return c};Q.prototype.u=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Hb(this.j,a,d)}; -Q.prototype.toString=function(){var a;a="Step:"+L("Operator: "+(this.B?"//":"/"));this.c.o&&(a+=L("Axis: "+this.c));a+=L(this.w);if(this.j.a.length){var b=oa(this.j.a,function(a,b){return a+L(b)},"Predicates:");a+=L(b)}return a};function Yb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Yb.prototype.toString=function(){return this.o};var Zb={};function R(a,b,c,d){if(Zb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Yb(a,b,c,!!d);return Zb[a]=b} -R("ancestor",function(a,b){for(var c=new E,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);R("ancestor-or-self",function(a,b){var c=new E,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Pb=R("attribute",function(a,b){var c=new E,d=a.h();if("style"==d&&b.style&&z)return F(c,new db(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof G&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)z?f.nodeValue&&F(c,eb(b,f)):F(c,f);else(f=e.getNamedItem(d))&&(z?f.nodeValue&&F(c,eb(b,f)):F(c,f));return c},!1),Wb=R("child",function(a,b,c,d,e){return(z?rb:sb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new E)},!1,!0);R("descendant",lb,!1,!0); -var Xb=R("descendant-or-self",function(a,b,c,d){var e=new E;D(b,c,d)&&a.a(b)&&F(e,b);return lb(a,b,c,d,e)},!1,!0),Tb=R("following",function(a,b,c,d){var e=new E;do for(var f=b;f=f.nextSibling;)D(f,c,d)&&a.a(f)&&F(e,f),e=lb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new E,d=b;d=d.nextSibling;)a.a(d)&&F(c,d);return c},!1);R("namespace",function(){return new E},!1); -var $b=R("parent",function(a,b){var c=new E;if(9==b.nodeType)return c;if(2==b.nodeType)return F(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&F(c,d);return c},!1),Ub=R("preceding",function(a,b,c,d){var e=new E,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var u=[];for(b=f[h];b=b.previousSibling;)u.unshift(b);for(var v=0,I=u.length;v<I;v++)b=u[v],D(b,c,d)&&a.a(b)&&F(e,b),e=lb(a,b,c,d,e)}return e},!0,!0); -R("preceding-sibling",function(a,b){for(var c=new E,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var ac=R("self",function(a,b){var c=new E;a.a(b)&&F(c,b);return c},!1);function bc(a){K.call(this,1);this.c=a;this.i=a.i;this.b=a.b}n(bc,K);bc.prototype.a=function(a){return-M(this.c,a)};bc.prototype.toString=function(){return"Unary Expression: -"+L(this.c)};function cc(a){K.call(this,4);this.c=a;yb(this,qa(this.c,function(a){return a.i}));zb(this,qa(this.c,function(a){return a.b}))}n(cc,K);cc.prototype.a=function(a){var b=new E;p(this.c,function(c){c=c.a(a);if(!(c instanceof E))throw Error("Path expression must evaluate to NodeSet.");b=ub(b,c)});return b};cc.prototype.toString=function(){return oa(this.c,function(a,b){return a+L(b)},"Union Expression:")};function dc(a,b){this.a=a;this.b=b}function ec(a){for(var b,c=[];;){U(a,"Missing right hand side of binary expression.");b=fc(a);var d=B(a.a);if(!d)break;var e=(d=Fb[d]||null)&&d.H;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].H;)b=new Bb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Bb(c.pop(),c.pop(),b);return b}function U(a,b){if(kb(a.a))throw Error(b);}function gc(a,b){var c=B(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function hc(a){a=B(a.a);if(")"!=a)throw Error("Bad token: "+a);}function ic(a){a=B(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Mb(a)} -function jc(a){var b,c=[],d;if(Sb(A(a.a))){b=B(a.a);d=A(a.a);if("/"==b&&(kb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Qb;d=new Qb;U(a,"Missing next location step.");b=kc(a,b);c.push(b)}else{a:{b=A(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":B(a.a);b=ec(a);U(a,'unclosed "("');gc(a,")");break;case '"':case "'":b=ic(a);break;default:if(isNaN(+b))if(!Lb(b)&&/(?![0-9])[\w]/.test(d)&&"("==A(a.a,1)){b=B(a.a); -b=Kb[b]||null;B(a.a);for(d=[];")"!=A(a.a);){U(a,"Missing function argument list.");d.push(ec(a));if(","!=A(a.a))break;B(a.a)}U(a,"Unclosed function argument list.");hc(a);b=new Ib(b,d)}else{b=null;break a}else b=new Nb(+B(a.a))}"["==A(a.a)&&(d=new Vb(lc(a)),b=new Gb(b,d))}if(b)if(Sb(A(a.a)))d=b;else return b;else b=kc(a,"/"),d=new Rb,c.push(b)}for(;Sb(A(a.a));)b=B(a.a),U(a,"Missing next location step."),b=kc(a,b),c.push(b);return new Ob(d,c)} -function kc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==A(a.a))return d=new Q(ac,new G("node")),B(a.a),d;if(".."==A(a.a))return d=new Q($b,new G("node")),B(a.a),d;var f;if("@"==A(a.a))f=Pb,B(a.a),U(a,"Missing attribute name");else if("::"==A(a.a,1)){if(!/(?![0-9])[\w]/.test(A(a.a).charAt(0)))throw Error("Bad token: "+B(a.a));c=B(a.a);f=Zb[c]||null;if(!f)throw Error("No axis with name: "+c);B(a.a);U(a,"Missing node name")}else f=Wb;c=A(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -A(a.a,1)){if(!Lb(c))throw Error("Invalid node type: "+c);c=B(a.a);if(!Lb(c))throw Error("Invalid type name: "+c);gc(a,"(");U(a,"Bad nodetype");e=A(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=ic(a);U(a,"Bad nodetype");hc(a);c=new G(c,h)}else if(c=B(a.a),e=c.indexOf(":"),-1==e)c=new ob(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new ob(c,k)}else throw Error("Bad token: "+B(a.a));e=new Vb(lc(a),f.a);return d|| -new Q(f,c,e,"//"==b)}function lc(a){for(var b=[];"["==A(a.a);){B(a.a);U(a,"Missing predicate expression.");var c=ec(a);b.push(c);U(a,"Unclosed predicate expression.");gc(a,"]")}return b}function fc(a){if("-"==A(a.a))return B(a.a),new bc(fc(a));var b=jc(a);if("|"!=A(a.a))a=b;else{for(b=[b];"|"==B(a.a);)U(a,"Missing next union location path."),b.push(jc(a));a.a.a--;a=new cc(b)}return a};function mc(a){switch(a.nodeType){case 1:return ha(nc,a);case 9:return mc(a.documentElement);case 11:case 10:case 6:case 12:return oc;default:return a.parentNode?mc(a.parentNode):oc}}function oc(){return null}function nc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?nc(a.parentNode,b):null};function pc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=gb(a);if(kb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ga(b.lookupNamespaceURI,b)):b=function(){return null};var d=ec(new dc(c,b));if(!kb(c))throw Error("Bad token: "+B(c));this.evaluate=function(a,b){var c=d.a(new bb(a));return new V(c,b)}} -function V(a,b){if(0==b)if(a instanceof E)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof E))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof E?wb(a):""+a;break;case 1:this.numberValue=a instanceof E?+wb(a):+a;break;case 3:this.booleanValue=a instanceof E?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -H(a);c=[];for(var e=J(d);e;e=J(d))c.push(e instanceof db?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=vb(a);this.singleNodeValue=d instanceof db?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}V.ANY_TYPE=0;V.NUMBER_TYPE=1;V.STRING_TYPE=2;V.BOOLEAN_TYPE=3;V.UNORDERED_NODE_ITERATOR_TYPE=4;V.ORDERED_NODE_ITERATOR_TYPE=5;V.UNORDERED_NODE_SNAPSHOT_TYPE=6;V.ORDERED_NODE_SNAPSHOT_TYPE=7;V.ANY_UNORDERED_NODE_TYPE=8;V.FIRST_ORDERED_NODE_TYPE=9;function qc(a){this.lookupNamespaceURI=mc(a)} -function rc(a,b){var c=a||l,d=c.document;if(!d.evaluate||b)c.XPathResult=V,d.evaluate=function(a,b,c,d){return(new pc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new pc(a,b)},d.createNSResolver=function(a){return new qc(a)}}aa("wgxpath.install",rc);var W={};W.F=function(){var a={R:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -W.u=function(a,b,c){var d=Va(a);if(!d.documentElement)return null;(x||Za)&&rc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):W.F;if(x&&!Na(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=Number(Pa)){for(var f={},h=d.getElementsByTagName("*"),k=0;k<h.length;++k){var u=h[k],v=u.namespaceURI;if(v&&!f[v]){var I=u.lookupPrefix(v);if(!I)var S=v.match(".*/(\\w+)/?$"),I=S?S[1]:"xhtml";f[v]=I}}var T={},ib;for(ib in f)T[f[ib]]=ib;e=function(a){return T[a]|| -null}}try{return d.evaluate(b,a,e,c,null)}catch(pa){if("TypeError"===pa.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):W.F,d.evaluate(b,a,e,c,null);throw pa;}}catch(pa){if(!y||"NS_ERROR_ILLEGAL_VALUE"!=pa.name)throw new q(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+pa);}};W.G=function(a,b){if(!a||1!=a.nodeType)throw new q(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -W.J=function(a,b){var c=function(){var c=W.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=Va(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||W.G(c,a);return c}; -W.O=function(a,b){var c=function(){var c=W.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],h=0;h<e;++h)f.push(c.snapshotItem(h));return f}return b.selectNodes?(c=Va(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();p(c,function(b){W.G(b,a)});return c};function sc(a){return(a=a.exec(t))?a[1]:""}var tc=function(){if(Wa)return sc(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return La;if($a)return sc(/Chrome\/([0-9.]+)/);if(ab&&!(Da()||w("iPad")||w("iPod")))return sc(/Version\/([0-9.]+)/);if(Xa||Ya){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(Za)return(a=sc(/Android\s+([0-9.]+)/))?a:sc(/Version\/([0-9.]+)/);return""}();var uc,vc;function wc(a){return xc?uc(a):x?0<=ka(Pa,a):Na(a)}function yc(a){xc?vc(a):Za?ka(zc,a):ka(tc,a)} -var xc=function(){if(!y)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;uc=function(a){return 0<=c.compare(d,""+a)};vc=function(a){c.compare(e,""+a)};return!0}(),Ac;if(Za){var Bc=/Android\s+([0-9\.]+)/.exec(t);Ac=Bc?Bc[1]:"0"}else Ac="0"; -var zc=Ac,Cc=x&&!(10<=Number(Pa));Za&&yc(2.3);Za&&yc(4);ab&&yc(6);function X(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}g=X.prototype;g.clone=function(){return new X(this.left,this.top,this.width,this.height)};g.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};g.contains=function(a){return a instanceof X?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -g.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};g.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};g.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -g.scale=function(a,b){var c="number"==typeof b?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Dc(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)} -function Ec(a){var b;var c=Dc(a,"MAP");if(c||Dc(a,"AREA")){var d=c?a:Dc(a.parentNode,"MAP")?a.parentNode:null,e=b=null;if(d&&d.name&&(b=W.J('/descendant::*[@usemap = "#'+d.name+'"]',Va(d)))&&(e=Ec(b),!c&&"default"!=a.shape.toLowerCase()))var c=Fc(a),d=Math.min(Math.max(c.left,0),e.width),f=Math.min(Math.max(c.top,0),e.height),e=new X(d+e.left,f+e.top,Math.min(c.width,e.width-d),Math.min(c.height,e.height-f));b={a:b,rect:e||new X(0,0,0,0)}}else b=null;if(b)return b.rect;if(Dc(a,"HTML"))return a=Va(a), -a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Qa(a.clientWidth,a.clientHeight),new X(0,0,a.width,a.height);var h;try{h=a.getBoundingClientRect()}catch(k){return new X(0,0,0,0)}h=new X(h.left,h.top,h.right-h.left,h.bottom-h.top);x&&a.ownerDocument.body&&(a=Va(a),h.left-=a.documentElement.clientLeft+a.body.clientLeft,h.top-=a.documentElement.clientTop+a.body.clientTop);return h} -function Fc(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new X(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new X(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new X(b,c,d-b,e-c)}return new X(0,0,0,0)};Ga||xc&&yc(3.6);x&&wc(10);Za&&yc(4);function Y(a,b){this.v={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Gc(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof Y)for(d=Hc(a),Ic(a),e=[],c=0;c<a.l.length;c++)e.push(a.v[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Gc(this,d[c],e[c])}}function Hc(a){Ic(a);return a.l.concat()} -Y.prototype.clear=function(){this.v={};this.b=this.a=this.l.length=0};function Ic(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.v,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}Y.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.v,a)?this.v[a]:b}; -function Gc(a,b,c){Object.prototype.hasOwnProperty.call(a.v,b)||(a.a++,a.l.push(b),a.b++);a.v[b]=c}Y.prototype.forEach=function(a,b){for(var c=Hc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};Y.prototype.clone=function(){return new Y(this)};var Jc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new Kc(a);!b||b in Jc&&!c||(Jc[b]={key:a,shift:!1},c&&(Jc[c]={key:a,shift:!0}));return a}function Kc(a){this.code=a}Z(8);Z(9);Z(13);var Lc=Z(16),Mc=Z(17),Nc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Oc=Z(Ia?{f:91,g:91}:Ha?{f:224,g:91}:{f:0,g:91});Z(Ia?{f:92,g:92}:Ha?{f:224,g:93}:{f:0,g:92});Z(Ia?{f:93,g:93}:Ha?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Pc=new Y;Gc(Pc,1,Lc);Gc(Pc,2,Mc);Gc(Pc,4,Nc);Gc(Pc,8,Oc);(function(a){var b=new Y;p(Hc(a),function(c){Gc(b,a.get(c).code,c)});return b})(Pc);y&&wc(12);function Qc(){} -function Rc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Rc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Sc(d,c),c.push(":"),Rc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Sc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Tc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Uc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Sc(a,b){b.push('"',a.replace(Uc,function(a){var b=Tc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Tc[a]=b);return b}),'"')};Ga||y&&wc(3.5)||x&&wc(8);function Vc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return na(a,Vc);case "object":if(za(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Wc(a);return b}if(za(a,"document"))return b={},b.WINDOW=Wc(a),b;if(ca(a))return na(a,Vc);a=xa(a,function(a,b){return"number"==typeof b||m(b)});return ya(a,Vc);default:return null}} -function Xc(a,b){return"array"==ba(a)?na(a,function(a){return Xc(a,b)}):da(a)?"function"==typeof a?a:za(a,"ELEMENT")?Yc(a.ELEMENT,b):za(a,"WINDOW")?Yc(a.WINDOW,b):ya(a,function(a){return Xc(a,b)}):a}function Zc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.C=ia());b.C||(b.C=ia());return b}function Wc(a){var b=Zc(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.C++,b[c]=a);return c} -function Yc(a,b){a=decodeURIComponent(a);var c=b||document,d=Zc(c);if(!za(d,a))throw new q(10,"Element does not exist in cache");var e=d[a];if(za(e,"setInterval")){if(e.closed)throw delete d[a],new q(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new q(10,"Element is no longer attached to the DOM");};function $c(a,b,c){var d;try{var e;c?e=Yc(c.WINDOW):e=window;var f=Xc(b,e.document),h=a.apply(null,f);d={status:0,value:Vc(h)}}catch(k){d={status:za(k,"code")?k.code:13,value:{message:k.message}}}a=[];Rc(new Qc,d,a);return a.join("")};aa("_",function(a,b){return $c(function(a){var b=Ec(a);a=b.height;b=b.width;Cc||(b=Math.floor(b),a=Math.floor(a));return{width:b,height:a}},[a],b)});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_text.js b/src/ghostdriver/third_party/webdriver-atoms/get_text.js deleted file mode 100644 index d01da22da4..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_text.js +++ /dev/null @@ -1,120 +0,0 @@ -function(){return function(){var h,l=this;function m(a){return void 0!==a}function aa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&m(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function p(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ga(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function q(a,b){function c(){}c.prototype=b.prototype;a.R=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.O=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};function la(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var ma=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function na(a,b){for(var c=0,d=ma(String(a)).split("."),e=ma(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",r=e[g]||"",t=RegExp("(\\d*)(\\D*)","g"),n=RegExp("(\\d*)(\\D*)","g");do{var x=t.exec(k)||["","",""],G=n.exec(r)||["","",""];if(0==x[0].length&&0==G[0].length)break;c=oa(0==x[1].length?0:parseInt(x[1],10),0==G[1].length?0:parseInt(G[1],10))||oa(0==x[2].length,0==G[2].length)||oa(x[2],G[2])}while(0==c)}return c}function oa(a,b){return a<b?-1:a>b?1:0} -function pa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function qa(a,b){if(p(a))return p(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function u(a,b){for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ra(a,b){for(var c=a.length,d=[],e=0,f=p(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d} -function sa(a,b){for(var c=a.length,d=Array(c),e=p(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function ta(a,b,c){var d=c;u(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ua(a,b){for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function va(a,b){for(var c=a.length,d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0} -function wa(a,b){var c;a:{c=a.length;for(var d=p(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:p(a)?a.charAt(c):a[c]}function xa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function za(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Aa={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Ba="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ca=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Da=/^#(?:[0-9a-f]{3}){1,2}$/i,Ea=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Fa=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Ga(a,b){this.code=a;this.a=v[a]||Ha;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}q(Ga,Error);var Ha="unknown error",v={15:"element not selectable",11:"element not visible"};v[31]=Ha;v[30]=Ha;v[24]="invalid cookie domain";v[29]="invalid element coordinates";v[12]="invalid element state"; -v[32]="invalid selector";v[51]="invalid selector";v[52]="invalid selector";v[17]="javascript error";v[405]="unsupported operation";v[34]="move target out of bounds";v[27]="no such alert";v[7]="no such element";v[8]="no such frame";v[23]="no such window";v[28]="script timeout";v[33]="session not created";v[10]="stale element reference";v[21]="timeout";v[25]="unable to set cookie";v[26]="unexpected alert open";v[13]=Ha;v[9]="unknown command";Ga.prototype.toString=function(){return this.name+": "+this.message};var w;a:{var Ia=l.navigator;if(Ia){var Ja=Ia.userAgent;if(Ja){w=Ja;break a}}w=""}function y(a){return-1!=w.indexOf(a)};function Ka(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function La(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ma(a,b){return null!==a&&b in a}function Na(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Oa(){return y("Opera")||y("OPR")}function Pa(){return(y("Chrome")||y("CriOS"))&&!Oa()&&!y("Edge")};function Qa(){return y("iPhone")&&!y("iPod")&&!y("iPad")};var Ra=Oa(),z=y("Trident")||y("MSIE"),Sa=y("Edge"),A=y("Gecko")&&!(-1!=w.toLowerCase().indexOf("webkit")&&!y("Edge"))&&!(y("Trident")||y("MSIE"))&&!y("Edge"),Ta=-1!=w.toLowerCase().indexOf("webkit")&&!y("Edge"),Ua=y("Macintosh"),Va=y("Windows");function Wa(){var a=w;if(A)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Sa)return/Edge\/([\d\.]+)/.exec(a);if(z)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ta)return/WebKit\/(\S+)/.exec(a)}function Xa(){var a=l.document;return a?a.documentMode:void 0} -var Ya=function(){if(Ra&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Wa())&&(a=b?b[1]:"");return z&&(b=Xa(),null!=b&&b>parseFloat(a))?String(b):a}(),Za={};function $a(a){return Za[a]||(Za[a]=0<=na(Ya,a))}var ab=l.document,bb=ab&&z?Xa()||("CSS1Compat"==ab.compatMode?parseInt(Ya,10):5):void 0;!A&&!z||z&&9<=Number(bb)||A&&$a("1.9.1");z&&$a("9");function cb(a,b){this.x=m(a)?a:0;this.y=m(b)?b:0}h=cb.prototype;h.clone=function(){return new cb(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=ea(b)?b:a;this.x*=a;this.y*=c;return this};function db(a,b){this.width=a;this.height=b}h=db.prototype;h.clone=function(){return new db(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.width*=a;this.height*=c;return this};function eb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function fb(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function gb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(z&&!(9<=Number(bb))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?hb(a,b):!c&&fb(e,b)?-1*ib(a,b):!d&&fb(f,a)?ib(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=B(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function ib(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return hb(d,a)}function hb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function B(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function jb(a,b){a=a.parentNode;for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null} -function kb(a){this.a=a||l.document||document}kb.prototype.contains=fb;var lb=y("Firefox"),mb=Qa()||y("iPod"),nb=y("iPad"),ob=y("Android")&&!(Pa()||y("Firefox")||Oa()||y("Silk")),pb=Pa(),qb=y("Safari")&&!(Pa()||y("Coast")||Oa()||y("Edge")||y("Silk")||y("Android"))&&!(Qa()||y("iPad")||y("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function rb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var C=z&&!(9<=Number(bb)),sb=z&&!(8<=Number(bb));function tb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function ub(a,b){var c=sb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new tb(b,a,b.nodeName,c)};function vb(a){this.b=a;this.a=0}function wb(a){a=a.match(xb);for(var b=0;b<a.length;b++)yb.test(a[b])&&a.splice(b,1);return new vb(a)}var xb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),yb=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function zb(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(C&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),C&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function Ab(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}sb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Bb(a,b,c,d,e){return(C?Cb:Db).call(null,a,b,p(c)?c:null,p(d)?d:null,e||new H)} -function Cb(a,b,c,d,e){if(a instanceof Eb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Fb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)Ab(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}Gb(a,b,c,d,e);return e} -function Db(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!z?(b=b.getElementsByName(d),u(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),u(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?Gb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),u(b,function(a){Ab(a,c,d)&&I(e,a)}));return e} -function Hb(a,b,c,d,e){var f;if((a instanceof Eb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Fb(a);if("*"!=g&&(f=ra(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ra(f,function(a){return Ab(a,c,d)}));u(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||I(e,a)});return e}return Ib(a,b,c,d,e)}function Ib(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Ab(b,c,d)&&a.a(b)&&I(e,b);return e} -function Gb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Ab(b,c,d)&&a.a(b)&&I(e,b),Gb(a,b,c,d,e)}function Fb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function H(){this.b=this.a=null;this.s=0}function Jb(a){this.node=a;this.a=this.b=null}function Kb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof tb&&k instanceof tb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<gb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.s=g;return a} -H.prototype.unshift=function(a){a=new Jb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new Jb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function Lb(a){return(a=a.a)?a.node:null}function Mb(a){return(a=Lb(a))?F(a):""}function Nb(a,b){return new Ob(a,!!b)}function Ob(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function K(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function L(a){this.m=a;this.b=this.i=!1;this.h=null}function M(a){return"\n "+a.toString().split("\n").join("\n ")}function Pb(a,b){a.i=b}function Qb(a,b){a.b=b}function N(a,b){var c=a.a(b);return c instanceof H?+Mb(c):+c}function O(a,b){var c=a.a(b);return c instanceof H?Mb(c):""+c}function Rb(a,b){var c=a.a(b);return c instanceof H?!!c.s:!!c};function Sb(a,b,c){L.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Tb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}q(Sb,L); -function Ub(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof H&&c instanceof H){b=Nb(b);for(d=K(b);d;d=K(b))for(e=Nb(c),f=K(e);f;f=K(e))if(a(F(d),F(f)))return!0;return!1}if(b instanceof H||c instanceof H){b instanceof H?(e=b,d=c):(e=c,d=b);f=Nb(e);for(var g=typeof d,k=K(f);k;k=K(f)){switch(g){case "number":k=+F(k);break;case "boolean":k=!!F(k);break;case "string":k=F(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Sb.prototype.a=function(a){return this.c.u(this.j,this.w,a)};Sb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+M(this.j);return a+=M(this.w)};function Vb(a,b,c,d){this.a=a;this.I=b;this.m=c;this.u=d}Vb.prototype.toString=function(){return this.a};var Wb={}; -function P(a,b,c,d){if(Wb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Vb(a,b,c,d);return Wb[a.toString()]=a}P("div",6,1,function(a,b,c){return N(a,c)/N(b,c)});P("mod",6,1,function(a,b,c){return N(a,c)%N(b,c)});P("*",6,1,function(a,b,c){return N(a,c)*N(b,c)});P("+",5,1,function(a,b,c){return N(a,c)+N(b,c)});P("-",5,1,function(a,b,c){return N(a,c)-N(b,c)});P("<",4,2,function(a,b,c){return Ub(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return Ub(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return Ub(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return Ub(function(a,b){return a>=b},a,b,c)});var Tb=P("=",3,2,function(a,b,c){return Ub(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return Ub(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return Rb(a,c)&&Rb(b,c)});P("or",1,2,function(a,b,c){return Rb(a,c)||Rb(b,c)});function Xb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");L.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}q(Xb,L);Xb.prototype.a=function(a){a=this.c.a(a);return Yb(this.j,a)};Xb.prototype.toString=function(){var a;a="Filter:"+M(this.c);return a+=M(this.j)};function Zb(a,b){if(b.length<a.J)throw Error("Function "+a.o+" expects at least"+a.J+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.N&&u(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});L.call(this,a.m);this.j=a;this.c=b;Pb(this,a.i||ua(b,function(a){return a.i}));Qb(this,a.M&&!b.length||a.L&&!!b.length||ua(b,function(a){return a.b}))} -q(Zb,L);Zb.prototype.a=function(a){return this.j.u.apply(null,xa(a,this.c))};Zb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=ta(this.c,function(a,b){return a+M(b)},"Arguments:"),a=a+M(b);return a};function $b(a,b,c,d,e,f,g,k,r){this.o=a;this.m=b;this.i=c;this.M=d;this.L=e;this.u=f;this.J=g;this.D=m(k)?k:g;this.N=!!r}$b.prototype.toString=function(){return this.o};var ac={}; -function Q(a,b,c,d,e,f,g,k){if(ac.hasOwnProperty(a))throw Error("Function already created: "+a+".");ac[a]=new $b(a,b,c,d,!1,e,f,g,k)}Q("boolean",2,!1,!1,function(a,b){return Rb(b,a)},1);Q("ceiling",1,!1,!1,function(a,b){return Math.ceil(N(b,a))},1);Q("concat",3,!1,!1,function(a,b){return ta(za(arguments,1),function(b,d){return b+O(d,a)},"")},2,null);Q("contains",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return-1!=b.indexOf(a)},2);Q("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){return Math.floor(N(b,a))},1);Q("id",4,!1,!1,function(a,b){function c(a){if(C){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return wa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=O(b,a).split(/\s+/),f=[];u(d,function(a){a=c(a);!a||0<=qa(f,a)||f.push(a)});f.sort(gb);var g=new H;u(f,function(a){I(g,a)});return g},1); -Q("lang",2,!1,!1,function(){return!1},1);Q("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);Q("local-name",3,!1,!0,function(a,b){var c=b?Lb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);Q("name",3,!1,!0,function(a,b){var c=b?Lb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);Q("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -Q("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);Q("not",2,!1,!1,function(a,b){return!Rb(b,a)},1);Q("number",1,!1,!0,function(a,b){return b?N(b,a):+F(a.a)},0,1);Q("position",1,!0,!1,function(a){return a.b},0);Q("round",1,!1,!1,function(a,b){return Math.round(N(b,a))},1);Q("starts-with",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return 0==b.lastIndexOf(a,0)},2);Q("string",3,!1,!0,function(a,b){return b?O(b,a):F(a.a)},0,1); -Q("string-length",1,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).length},0,1);Q("substring",3,!1,!1,function(a,b,c,d){c=N(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?N(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=O(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);Q("substring-after",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -Q("substring-before",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);Q("sum",1,!1,!1,function(a,b){for(var c=Nb(b.a(a)),d=0,e=K(c);e;e=K(c))d+=+F(e);return d},1,1,!0);Q("translate",3,!1,!1,function(a,b,c,d){b=O(b,a);c=O(c,a);var e=O(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);Q("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=m(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function bc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=M(this.c));return a};function cc(a){L.call(this,3);this.c=a.substring(1,a.length-1)}q(cc,L);cc.prototype.a=function(){return this.c};cc.prototype.toString=function(){return"Literal: "+this.c};function Eb(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Eb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Eb.prototype.h=function(){return this.o};Eb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function dc(a){L.call(this,1);this.c=a}q(dc,L);dc.prototype.a=function(){return this.c};dc.prototype.toString=function(){return"Number: "+this.c};function ec(a,b){L.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.B||c.c!=fc||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}q(ec,L);function gc(){L.call(this,4)}q(gc,L);gc.prototype.a=function(a){var b=new H;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};gc.prototype.toString=function(){return"Root Helper Expression"};function hc(){L.call(this,4)}q(hc,L);hc.prototype.a=function(a){var b=new H;I(b,a.a);return b};hc.prototype.toString=function(){return"Context Helper Expression"}; -function ic(a){return"/"==a||"//"==a}ec.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof H))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=Nb(b,e.c.a),g;if(e.i||e.c!=jc)if(e.i||e.c!=kc)for(g=K(f),b=e.a(new rb(g));null!=(g=K(f));)g=e.a(new rb(g)),b=Kb(b,g);else g=K(f),b=e.a(new rb(g));else{for(g=K(f);(b=K(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new rb(g))}}return b}; -ec.prototype.toString=function(){var a;a="Path Expression:"+M(this.j);if(this.c.length){var b=ta(this.c,function(a,b){return a+M(b)},"Steps:");a+=M(b)}return a};function lc(a,b){this.a=a;this.b=!!b} -function Yb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=Nb(b),f=b.s,g,k=0;g=K(e);k++){var r=a.b?f-k:k+1;g=d.a(new rb(g,r,f));if("number"==typeof g)r=r==g;else if("string"==typeof g||"boolean"==typeof g)r=!!g;else if(g instanceof H)r=0<g.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!r){r=e;g=r.h;var t=r.a;if(!t)throw Error("Next must be called at least once before remove.");var n=t.b,t=t.a;n?n.a=t:g.a=t;t?t.b=n:g.b=n;g.s--;r.a=null}}return b} -lc.prototype.toString=function(){return ta(this.a,function(a,b){return a+M(b)},"Predicates:")};function mc(a,b,c,d){L.call(this,4);this.c=a;this.w=b;this.j=c||new lc([]);this.B=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=C?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}q(mc,L); -mc.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?O(c.A,a):null,f=1);if(this.B)if(this.i||this.c!=nc)if(a=Nb((new mc(oc,new J("node"))).a(a)),b=K(a))for(c=this.u(b,d,e,f);null!=(b=K(a));)c=Kb(c,this.u(b,d,e,f));else c=new H;else c=Bb(this.w,b,d,e),c=Yb(this.j,c,f);else c=this.u(a.a,d,e,f);return c};mc.prototype.u=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Yb(this.j,a,d)}; -mc.prototype.toString=function(){var a;a="Step:"+M("Operator: "+(this.B?"//":"/"));this.c.o&&(a+=M("Axis: "+this.c));a+=M(this.w);if(this.j.a.length){var b=ta(this.j.a,function(a,b){return a+M(b)},"Predicates:");a+=M(b)}return a};function pc(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}pc.prototype.toString=function(){return this.o};var qc={};function R(a,b,c,d){if(qc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new pc(a,b,c,!!d);return qc[a]=b} -R("ancestor",function(a,b){for(var c=new H,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);R("ancestor-or-self",function(a,b){var c=new H,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var fc=R("attribute",function(a,b){var c=new H,d=a.h();if("style"==d&&b.style&&C)return I(c,new tb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C?f.nodeValue&&I(c,ub(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(C?f.nodeValue&&I(c,ub(b,f)):I(c,f));return c},!1),nc=R("child",function(a,b,c,d,e){return(C?Hb:Ib).call(null,a,b,p(c)?c:null,p(d)?d:null,e||new H)},!1,!0);R("descendant",Bb,!1,!0); -var oc=R("descendant-or-self",function(a,b,c,d){var e=new H;Ab(b,c,d)&&a.a(b)&&I(e,b);return Bb(a,b,c,d,e)},!1,!0),jc=R("following",function(a,b,c,d){var e=new H;do for(var f=b;f=f.nextSibling;)Ab(f,c,d)&&a.a(f)&&I(e,f),e=Bb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new H,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);R("namespace",function(){return new H},!1); -var rc=R("parent",function(a,b){var c=new H;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),kc=R("preceding",function(a,b,c,d){var e=new H,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var r=[];for(b=f[g];b=b.previousSibling;)r.unshift(b);for(var t=0,n=r.length;t<n;t++)b=r[t],Ab(b,c,d)&&a.a(b)&&I(e,b),e=Bb(a,b,c,d,e)}return e},!0,!0); -R("preceding-sibling",function(a,b){for(var c=new H,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var sc=R("self",function(a,b){var c=new H;a.a(b)&&I(c,b);return c},!1);function tc(a){L.call(this,1);this.c=a;this.i=a.i;this.b=a.b}q(tc,L);tc.prototype.a=function(a){return-N(this.c,a)};tc.prototype.toString=function(){return"Unary Expression: -"+M(this.c)};function uc(a){L.call(this,4);this.c=a;Pb(this,ua(this.c,function(a){return a.i}));Qb(this,ua(this.c,function(a){return a.b}))}q(uc,L);uc.prototype.a=function(a){var b=new H;u(this.c,function(c){c=c.a(a);if(!(c instanceof H))throw Error("Path expression must evaluate to NodeSet.");b=Kb(b,c)});return b};uc.prototype.toString=function(){return ta(this.c,function(a,b){return a+M(b)},"Union Expression:")};function vc(a,b){this.a=a;this.b=b}function wc(a){for(var b,c=[];;){S(a,"Missing right hand side of binary expression.");b=xc(a);var d=E(a.a);if(!d)break;var e=(d=Wb[d]||null)&&d.I;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].I;)b=new Sb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Sb(c.pop(),c.pop(),b);return b}function S(a,b){if(zb(a.a))throw Error(b);}function yc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function zc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Ac(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new cc(a)} -function Bc(a){var b,c=[],d;if(ic(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(zb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new gc;d=new gc;S(a,"Missing next location step.");b=Cc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=wc(a);S(a,'unclosed "("');yc(a,")");break;case '"':case "'":b=Ac(a);break;default:if(isNaN(+b))if(!bc(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a); -b=ac[b]||null;E(a.a);for(d=[];")"!=D(a.a);){S(a,"Missing function argument list.");d.push(wc(a));if(","!=D(a.a))break;E(a.a)}S(a,"Unclosed function argument list.");zc(a);b=new Zb(b,d)}else{b=null;break a}else b=new dc(+E(a.a))}"["==D(a.a)&&(d=new lc(Dc(a)),b=new Xb(b,d))}if(b)if(ic(D(a.a)))d=b;else return b;else b=Cc(a,"/"),d=new hc,c.push(b)}for(;ic(D(a.a));)b=E(a.a),S(a,"Missing next location step."),b=Cc(a,b),c.push(b);return new ec(d,c)} -function Cc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new mc(sc,new J("node")),E(a.a),d;if(".."==D(a.a))return d=new mc(rc,new J("node")),E(a.a),d;var f;if("@"==D(a.a))f=fc,E(a.a),S(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=qc[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);S(a,"Missing node name")}else f=nc;c=D(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -D(a.a,1)){if(!bc(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!bc(c))throw Error("Invalid type name: "+c);yc(a,"(");S(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Ac(a);S(a,"Bad nodetype");zc(a);c=new J(c,g)}else if(c=E(a.a),e=c.indexOf(":"),-1==e)c=new Eb(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Eb(c,k)}else throw Error("Bad token: "+E(a.a));e=new lc(Dc(a),f.a);return d|| -new mc(f,c,e,"//"==b)}function Dc(a){for(var b=[];"["==D(a.a);){E(a.a);S(a,"Missing predicate expression.");var c=wc(a);b.push(c);S(a,"Unclosed predicate expression.");yc(a,"]")}return b}function xc(a){if("-"==D(a.a))return E(a.a),new tc(xc(a));var b=Bc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)S(a,"Missing next union location path."),b.push(Bc(a));a.a.a--;a=new uc(b)}return a};function Ec(a){switch(a.nodeType){case 1:return ja(Fc,a);case 9:return Ec(a.documentElement);case 11:case 10:case 6:case 12:return Gc;default:return a.parentNode?Ec(a.parentNode):Gc}}function Gc(){return null}function Fc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Fc(a.parentNode,b):null};function Hc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=wb(a);if(zb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=wc(new vc(c,b));if(!zb(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new rb(a));return new T(c,b)}} -function T(a,b){if(0==b)if(a instanceof H)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof H))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof H?Mb(a):""+a;break;case 1:this.numberValue=a instanceof H?+Mb(a):+a;break;case 3:this.booleanValue=a instanceof H?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -Nb(a);c=[];for(var e=K(d);e;e=K(d))c.push(e instanceof tb?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=Lb(a);this.singleNodeValue=d instanceof tb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}T.ANY_TYPE=0;T.NUMBER_TYPE=1;T.STRING_TYPE=2;T.BOOLEAN_TYPE=3;T.UNORDERED_NODE_ITERATOR_TYPE=4;T.ORDERED_NODE_ITERATOR_TYPE=5;T.UNORDERED_NODE_SNAPSHOT_TYPE=6;T.ORDERED_NODE_SNAPSHOT_TYPE=7;T.ANY_UNORDERED_NODE_TYPE=8;T.FIRST_ORDERED_NODE_TYPE=9;function Ic(a){this.lookupNamespaceURI=Ec(a)} -function Jc(a,b){var c=a||l,d=c.document;if(!d.evaluate||b)c.XPathResult=T,d.evaluate=function(a,b,c,d){return(new Hc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Hc(a,b)},d.createNSResolver=function(a){return new Ic(a)}}aa("wgxpath.install",Jc);var U={};U.F=function(){var a={S:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -U.u=function(a,b,c){var d=B(a);if(!d.documentElement)return null;(z||ob)&&Jc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):U.F;if(z&&!$a(7))return d.evaluate.call(d,b,a,e,c,null);if(!z||9<=Number(bb)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var r=g[k],t=r.namespaceURI;if(t&&!f[t]){var n=r.lookupPrefix(t);if(!n)var x=t.match(".*/(\\w+)/?$"),n=x?x[1]:"xhtml";f[t]=n}}var G={},da;for(da in f)G[f[da]]=da;e=function(a){return G[a]|| -null}}try{return d.evaluate(b,a,e,c,null)}catch(ya){if("TypeError"===ya.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):U.F,d.evaluate(b,a,e,c,null);throw ya;}}catch(ya){if(!A||"NS_ERROR_ILLEGAL_VALUE"!=ya.name)throw new Ga(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+ya);}};U.G=function(a,b){if(!a||1!=a.nodeType)throw new Ga(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -U.K=function(a,b){var c=function(){var c=U.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||U.G(c,a);return c}; -U.P=function(a,b){var c=function(){var c=U.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();u(c,function(b){U.G(b,a)});return c};function Kc(a){return(a=a.exec(w))?a[1]:""}var Lc=function(){if(lb)return Kc(/Firefox\/([0-9.]+)/);if(z||Sa||Ra)return Ya;if(pb)return Kc(/Chrome\/([0-9.]+)/);if(qb&&!(Qa()||y("iPad")||y("iPod")))return Kc(/Version\/([0-9.]+)/);if(mb||nb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w))return a[1]+"."+a[2]}else if(ob)return(a=Kc(/Android\s+([0-9.]+)/))?a:Kc(/Version\/([0-9.]+)/);return""}();var Mc,Nc;function Oc(a){return Pc?Mc(a):z?0<=na(bb,a):$a(a)}function Qc(a){Pc?Nc(a):ob?na(Rc,a):na(Lc,a)} -var Pc=function(){if(!A)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;Mc=function(a){return 0<=c.compare(d,""+a)};Nc=function(a){c.compare(e,""+a)};return!0}(),Sc;if(ob){var Tc=/Android\s+([0-9\.]+)/.exec(w);Sc=Tc?Tc[1]:"0"}else Sc="0"; -var Rc=Sc,Uc=z&&!(9<=Number(bb));ob&&Qc(2.3);ob&&Qc(4);qb&&Qc(6);function Vc(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=Vc.prototype;h.clone=function(){return new Vc(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof Vc?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function V(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=V.prototype;h.clone=function(){return new V(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof V?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function W(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Wc(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return W(a)?a:null} -function X(a,b){var c=pa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=Uc?"styleFloat":"cssFloat";var d;a:{d=c;var e=B(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){d=e[d]||e.getPropertyValue(d)||"";break a}d=""}d=d||Xc(a,c);if(null===d)d=null;else if(0<=qa(Ba,c)){b:{var f=d.match(Ea);if(f){var c=Number(f[1]),e=Number(f[2]),g=Number(f[3]),f=Number(f[4]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g&&0<=f&&1>=f){c=[c,e,g,f];break b}}c=null}if(!c)b:{if(g= -d.match(Fa))if(c=Number(g[1]),e=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g){c=[c,e,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();e=Aa[c.toLowerCase()];if(!e&&(e="#"==c.charAt(0)?c:"#"+c,4==e.length&&(e=e.replace(Ca,"#$1$1$2$2$3$3")),!Da.test(e))){c=null;break b}c=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d} -function Xc(a,b){var c=a.currentStyle||a.style,d=c[b];!m(d)&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?m(d)?d:null:(c=Wc(a))?Xc(c,b):null} -function Yc(a,b,c){function d(a){var b=Zc(a);return 0<b.height&&0<b.width?!0:W(a,"PATH")&&(0<b.height||0<b.width)?(a=X(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=X(a,"overflow")&&ua(a.childNodes,function(a){return 3==a.nodeType||W(a)&&d(a)})}function e(a){return $c(a)==Y&&va(a.childNodes,function(a){return!W(a)||e(a)||!d(a)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=jb(a,function(a){return W(a,"SELECT")}), -!!a&&Yc(a,!0,c);var f=ad(a);if(f)return!!f.H&&0<f.rect.width&&0<f.rect.height&&Yc(f.H,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=X(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=bd(a))&&d(a)?!e(a):!1}function cd(a){function b(a){if("none"==X(a,"display"))return!1;a=Wc(a);return!a||b(a)}return Yc(a,!1,b)}var Y="hidden"; -function $c(a){function b(a){function b(a){return a==g?!0:0==X(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==X(a,"position")?!1:!0}var c=X(a,"position");if("fixed"==c)return t=!0,a==g?null:g;for(a=Wc(a);a&&!b(a);)a=Wc(a);return a}function c(a){var b=a;if("visible"==r)if(a==g&&k)b=k;else if(a==k)return{x:"visible",y:"visible"};b={x:X(b,"overflow-x"),y:X(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==g){var b=(new kb(f)).a; -a=b.scrollingElement?b.scrollingElement:Ta||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=z&&$a("10")&&b.pageYOffset!=a.scrollTop?new cb(a.scrollLeft,a.scrollTop):new cb(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new cb(a.scrollLeft,a.scrollTop);return a}var e=dd(a),f=B(a),g=f.documentElement,k=f.body,r=X(g,"overflow"),t;for(a=b(a);a;a=b(a)){var n=c(a);if("visible"!=n.x||"visible"!=n.y){var x=Zc(a);if(0==x.width||0==x.height)return Y; -var G=e.right<x.left,da=e.bottom<x.top;if(G&&"hidden"==n.x||da&&"hidden"==n.y)return Y;if(G&&"visible"!=n.x||da&&"visible"!=n.y){G=d(a);da=e.bottom<x.top-G.y;if(e.right<x.left-G.x&&"visible"!=n.x||da&&"visible"!=n.x)return Y;e=$c(a);return e==Y?Y:"scroll"}G=e.left>=x.left+x.width;x=e.top>=x.top+x.height;if(G&&"hidden"==n.x||x&&"hidden"==n.y)return Y;if(G&&"visible"!=n.x||x&&"visible"!=n.y){if(t&&(n=d(a),e.left>=g.scrollWidth-n.x||e.right>=g.scrollHeight-n.y))return Y;e=$c(a);return e==Y?Y:"scroll"}}}return"none"} -function Zc(a){var b=ad(a);if(b)return b.rect;if(W(a,"HTML"))return a=B(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new db(a.clientWidth,a.clientHeight),new V(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new V(0,0,0,0)}b=new V(c.left,c.top,c.right-c.left,c.bottom-c.top);z&&a.ownerDocument.body&&(a=B(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+ -a.body.clientTop);return b}function ad(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=U.K('/descendant::*[@usemap = "#'+c.name+'"]',B(c)))&&(e=Zc(d),b||"default"==a.shape.toLowerCase()||(a=ed(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new V(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{H:d,rect:e||new V(0,0,0,0)}} -function ed(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new V(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new V(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new V(b,c,d-b,e-c)}return new V(0,0,0,0)}function dd(a){a=Zc(a);return new Vc(a.top,a.left+a.width,a.top+a.height,a.left)} -function fd(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function gd(a){var b=[];hd(a,b);a=sa(b,fd);return fd(a.join("\n")).replace(/\xa0/g," ")} -function id(a,b,c){if(W(a,"BR"))b.push("");else{var d=W(a,"TD"),e=X(a,"display"),f=!d&&!(0<=qa(jd,e)),g=m(a.previousElementSibling)?a.previousElementSibling:eb(a.previousSibling),g=g?X(g,"display"):"",k=X(a,"float")||X(a,"cssFloat")||X(a,"styleFloat");!f||"run-in"==g&&"none"==k||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var r=cd(a),t=null,n=null;r&&(t=X(a,"white-space"),n=X(a,"text-transform"));u(a.childNodes,function(a){c(a,b,r,t,n)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||la(a)||(b[b.length- -1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function hd(a,b){id(a,b,function(a,b,e,f,g){3==a.nodeType&&e?kd(a,b,f,g):W(a)&&hd(a,b)})}var jd="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); -function kd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";la(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} -function bd(a){if(Uc){if("relative"==X(a,"position"))return 1;a=X(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return ld(a)}function ld(a){var b=1,c=X(a,"opacity");c&&(b=Number(c));(a=Wc(a))&&(b*=ld(a));return b};Ta||Pc&&Qc(3.6);z&&Oc(10);ob&&Qc(4);function md(a,b){this.v={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)nd(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof md)for(d=od(a),pd(a),e=[],c=0;c<a.l.length;c++)e.push(a.v[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)nd(this,d[c],e[c])}}function od(a){pd(a);return a.l.concat()} -md.prototype.clear=function(){this.v={};this.b=this.a=this.l.length=0};function pd(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.v,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}md.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.v,a)?this.v[a]:b}; -function nd(a,b,c){Object.prototype.hasOwnProperty.call(a.v,b)||(a.a++,a.l.push(b),a.b++);a.v[b]=c}md.prototype.forEach=function(a,b){for(var c=od(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};md.prototype.clone=function(){return new md(this)};var qd={};function Z(a,b,c){fa(a)&&(a=A?a.f:a.g);a=new rd(a);!b||b in qd&&!c||(qd[b]={key:a,shift:!1},c&&(qd[c]={key:a,shift:!0}));return a}function rd(a){this.code=a}Z(8);Z(9);Z(13);var sd=Z(16),td=Z(17),ud=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var vd=Z(Va?{f:91,g:91}:Ua?{f:224,g:91}:{f:0,g:91});Z(Va?{f:92,g:92}:Ua?{f:224,g:93}:{f:0,g:92});Z(Va?{f:93,g:93}:Ua?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var wd=new md;nd(wd,1,sd);nd(wd,2,td);nd(wd,4,ud);nd(wd,8,vd);(function(a){var b=new md;u(od(a),function(c){nd(b,a.get(c).code,c)});return b})(wd);A&&Oc(12);function xd(){} -function yd(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),yd(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),zd(d,c),c.push(":"),yd(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":zd(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Ad={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Bd=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function zd(a,b){b.push('"',a.replace(Bd,function(a){var b=Ad[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ad[a]=b);return b}),'"')};Ta||A&&Oc(3.5)||z&&Oc(8);function Cd(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return sa(a,Cd);case "object":if(Ma(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Dd(a);return b}if(Ma(a,"document"))return b={},b.WINDOW=Dd(a),b;if(ca(a))return sa(a,Cd);a=Ka(a,function(a,b){return ea(b)||p(b)});return La(a,Cd);default:return null}} -function Ed(a,b){return"array"==ba(a)?sa(a,function(a){return Ed(a,b)}):fa(a)?"function"==typeof a?a:Ma(a,"ELEMENT")?Fd(a.ELEMENT,b):Ma(a,"WINDOW")?Fd(a.WINDOW,b):La(a,function(a){return Ed(a,b)}):a}function Gd(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.C=ka());b.C||(b.C=ka());return b}function Dd(a){var b=Gd(a.ownerDocument),c=Na(b,function(b){return b==a});c||(c=":wdc:"+b.C++,b[c]=a);return c} -function Fd(a,b){a=decodeURIComponent(a);var c=b||document,d=Gd(c);if(!Ma(d,a))throw new Ga(10,"Element does not exist in cache");var e=d[a];if(Ma(e,"setInterval")){if(e.closed)throw delete d[a],new Ga(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new Ga(10,"Element is no longer attached to the DOM");};aa("_",function(a,b){var c=[a],d;try{var e;b?e=Fd(b.WINDOW):e=window;var f=Ed(c,e.document),g=gd.apply(null,f);d={status:0,value:Cd(g)}}catch(k){d={status:Ma(k,"code")?k.code:13,value:{message:k.message}}}c=[];yd(new xd,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/get_value_of_css_property.js b/src/ghostdriver/third_party/webdriver-atoms/get_value_of_css_property.js deleted file mode 100644 index 75e7e99be1..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/get_value_of_css_property.js +++ /dev/null @@ -1,96 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function l(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ba(a){var b=l(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ca(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function da(a,b,c){return a.call.apply(a.bind,arguments)} -function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ha(a,b,c){ha=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?da:ea;return ha.apply(null,arguments)} -function ia(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ja=Date.now||function(){return+new Date};function n(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var ka=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function la(a,b){for(var c=0,d=ka(String(a)).split("."),e=ka(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",B=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var fa=B.exec(k)||["","",""],ga=O.exec(v)||["","",""];if(0==fa[0].length&&0==ga[0].length)break;c=ma(0==fa[1].length?0:parseInt(fa[1],10),0==ga[1].length?0:parseInt(ga[1],10))||ma(0==fa[2].length,0==ga[2].length)||ma(fa[2],ga[2])}while(0==c)}return c} -function ma(a,b){return a<b?-1:a>b?1:0}function na(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function oa(a,b){if(m(a))return m(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function p(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function pa(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d} -function qa(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function q(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ra(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function sa(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]} -function ta(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ua(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var va={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var wa="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),xa=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,ya=/^#(?:[0-9a-f]{3}){1,2}$/i,za=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Aa=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Ba(a,b){this.code=a;this.a=r[a]||Ca;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}n(Ba,Error);var Ca="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=Ca;r[30]=Ca;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=Ca;r[9]="unknown command";Ba.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var Da=g.navigator;if(Da){var Ea=Da.userAgent;if(Ea){t=Ea;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function Fa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ga(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Ha(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ia(){return u("Opera")||u("OPR")}function Ja(){return(u("Chrome")||u("CriOS"))&&!Ia()&&!u("Edge")};function Ka(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var La=Ia(),x=u("Trident")||u("MSIE"),Ma=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Na=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Oa=u("Macintosh"),Pa=u("Windows");function Qa(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ma)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Na)return/WebKit\/(\S+)/.exec(a)}function Ra(){var a=g.document;return a?a.documentMode:void 0} -var Sa=function(){if(La&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Qa())&&(a=b?b[1]:"");return x&&(b=Ra(),null!=b&&b>parseFloat(a))?String(b):a}(),Ta={};function Ua(a){return Ta[a]||(Ta[a]=0<=la(Sa,a))}var Va=g.document,z=Va&&x?Ra()||("CSS1Compat"==Va.compatMode?parseInt(Sa,10):5):void 0;!y&&!x||x&&9<=Number(z)||y&&Ua("1.9.1");x&&Ua("9");function Wa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Xa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(z))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ya(a,b):!c&&Wa(e,b)?-1*Za(a,b):!d&&Wa(f,a)?Za(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Za(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ya(d,a)}function Ya(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};var $a=u("Firefox"),ab=Ka()||u("iPod"),bb=u("iPad"),cb=u("Android")&&!(Ja()||u("Firefox")||Ia()||u("Silk")),db=Ja(),eb=u("Safari")&&!(Ja()||u("Coast")||Ia()||u("Edge")||u("Silk")||u("Android"))&&!(Ka()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function fb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(z)),gb=x&&!(8<=Number(z));function hb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function ib(a,b){var c=gb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new hb(b,a,b.nodeName,c)};function jb(a){this.b=a;this.a=0}function kb(a){a=a.match(lb);for(var b=0;b<a.length;b++)mb.test(a[b])&&a.splice(b,1);return new jb(a)}var lb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),mb=/^\s/;function C(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function nb(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}gb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function ob(a,b,c,d,e){return(A?pb:qb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new G)} -function pb(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=rb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}sb(a,b,c,d,e);return e} -function qb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?sb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function tb(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=rb(a);if("*"!=h&&(f=pa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=pa(f,function(a){return F(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return ub(a,b,c,d,e)}function ub(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function sb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),sb(a,b,c,d,e)}function rb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function vb(a){this.node=a;this.a=this.b=null}function wb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof hb&&k instanceof hb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Xa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new vb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new vb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function xb(a){return(a=a.a)?a.node:null}function yb(a){return(a=xb(a))?E(a):""}function K(a,b){return new zb(a,!!b)}function zb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function Ab(a,b){a.i=b}function Bb(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+yb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?yb(c):""+c}function Cb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function Db(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Eb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}n(Db,M); -function Fb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Db.prototype.a=function(a){return this.c.v(this.j,this.w,a)};Db.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function Gb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}Gb.prototype.toString=function(){return this.a};var Hb={}; -function R(a,b,c,d){if(Hb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Gb(a,b,c,d);return Hb[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return Fb(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return Fb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return Fb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return Fb(function(a,b){return a>=b},a,b,c)});var Eb=R("=",3,2,function(a,b,c){return Fb(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return Fb(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return Cb(a,c)&&Cb(b,c)});R("or",1,2,function(a,b,c){return Cb(a,c)||Cb(b,c)});function Ib(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}n(Ib,M);Ib.prototype.a=function(a){a=this.c.a(a);return Jb(this.j,a)};Ib.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Kb(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;Ab(this,a.i||ra(b,function(a){return a.i}));Bb(this,a.J&&!b.length||a.I&&!!b.length||ra(b,function(a){return a.b}))} -n(Kb,M);Kb.prototype.a=function(a){return this.j.v.apply(null,ta(a,this.c))};Kb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=q(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Lb(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Lb.prototype.toString=function(){return this.o};var Mb={}; -function S(a,b,c,d,e,f,h,k){if(Mb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Mb[a]=new Lb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return Cb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return q(ua(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1);S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return sa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);!a||0<=oa(f,a)||f.push(a)});f.sort(Xa);var h=new G;p(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?xb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?xb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!Cb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Nb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Ob(a){M.call(this,3);this.c=a.substring(1,a.length-1)}n(Ob,M);Ob.prototype.a=function(){return this.c};Ob.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Pb(a){M.call(this,1);this.c=a}n(Pb,M);Pb.prototype.a=function(){return this.c};Pb.prototype.toString=function(){return"Number: "+this.c};function Qb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Rb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}n(Qb,M);function Sb(){M.call(this,4)}n(Sb,M);Sb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Sb.prototype.toString=function(){return"Root Helper Expression"};function Tb(){M.call(this,4)}n(Tb,M);Tb.prototype.a=function(a){var b=new G;I(b,a.a);return b};Tb.prototype.toString=function(){return"Context Helper Expression"}; -function Ub(a){return"/"==a||"//"==a}Qb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Vb)if(e.i||e.c!=Wb)for(h=L(f),b=e.a(new fb(h));null!=(h=L(f));)h=e.a(new fb(h)),b=wb(b,h);else h=L(f),b=e.a(new fb(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new fb(h))}}return b}; -Qb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=q(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Xb(a,b){this.a=a;this.b=!!b} -function Jb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new fb(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var B=v.a;if(!B)throw Error("Next must be called at least once before remove.");var O=B.b,B=B.a;O?O.a=B:h.a=B;B?B.b=O:h.b=O;h.s--;v.a=null}}return b} -Xb.prototype.toString=function(){return q(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Xb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}n(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Yb)if(a=K((new T(Zb,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=wb(c,this.v(b,d,e,f));else c=new G;else c=ob(this.w,b,d,e),c=Jb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Jb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=q(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function $b(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}$b.prototype.toString=function(){return this.o};var ac={};function U(a,b,c,d){if(ac.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new $b(a,b,c,!!d);return ac[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Rb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new hb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,ib(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,ib(b,f)):I(c,f));return c},!1),Yb=U("child",function(a,b,c,d,e){return(A?tb:ub).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new G)},!1,!0);U("descendant",ob,!1,!0); -var Zb=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return ob(a,b,c,d,e)},!1,!0),Vb=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=ob(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var bc=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Wb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var B=0,O=v.length;B<O;B++)b=v[B],F(b,c,d)&&a.a(b)&&I(e,b),e=ob(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var cc=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function dc(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}n(dc,M);dc.prototype.a=function(a){return-P(this.c,a)};dc.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function ec(a){M.call(this,4);this.c=a;Ab(this,ra(this.c,function(a){return a.i}));Bb(this,ra(this.c,function(a){return a.b}))}n(ec,M);ec.prototype.a=function(a){var b=new G;p(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=wb(b,c)});return b};ec.prototype.toString=function(){return q(this.c,function(a,b){return a+N(b)},"Union Expression:")};function fc(a,b){this.a=a;this.b=b}function gc(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=hc(a);var d=D(a.a);if(!d)break;var e=(d=Hb[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new Db(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Db(c.pop(),c.pop(),b);return b}function V(a,b){if(nb(a.a))throw Error(b);}function ic(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function jc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function kc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Ob(a)} -function lc(a){var b,c=[],d;if(Ub(C(a.a))){b=D(a.a);d=C(a.a);if("/"==b&&(nb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Sb;d=new Sb;V(a,"Missing next location step.");b=mc(a,b);c.push(b)}else{a:{b=C(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=gc(a);V(a,'unclosed "("');ic(a,")");break;case '"':case "'":b=kc(a);break;default:if(isNaN(+b))if(!Nb(b)&&/(?![0-9])[\w]/.test(d)&&"("==C(a.a,1)){b=D(a.a); -b=Mb[b]||null;D(a.a);for(d=[];")"!=C(a.a);){V(a,"Missing function argument list.");d.push(gc(a));if(","!=C(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");jc(a);b=new Kb(b,d)}else{b=null;break a}else b=new Pb(+D(a.a))}"["==C(a.a)&&(d=new Xb(nc(a)),b=new Ib(b,d))}if(b)if(Ub(C(a.a)))d=b;else return b;else b=mc(a,"/"),d=new Tb,c.push(b)}for(;Ub(C(a.a));)b=D(a.a),V(a,"Missing next location step."),b=mc(a,b),c.push(b);return new Qb(d,c)} -function mc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==C(a.a))return d=new T(cc,new J("node")),D(a.a),d;if(".."==C(a.a))return d=new T(bc,new J("node")),D(a.a),d;var f;if("@"==C(a.a))f=Rb,D(a.a),V(a,"Missing attribute name");else if("::"==C(a.a,1)){if(!/(?![0-9])[\w]/.test(C(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=ac[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Yb;c=C(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -C(a.a,1)){if(!Nb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Nb(c))throw Error("Invalid type name: "+c);ic(a,"(");V(a,"Bad nodetype");e=C(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=kc(a);V(a,"Bad nodetype");jc(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Xb(nc(a),f.a);return d|| -new T(f,c,e,"//"==b)}function nc(a){for(var b=[];"["==C(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=gc(a);b.push(c);V(a,"Unclosed predicate expression.");ic(a,"]")}return b}function hc(a){if("-"==C(a.a))return D(a.a),new dc(hc(a));var b=lc(a);if("|"!=C(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(lc(a));a.a.a--;a=new ec(b)}return a};function oc(a){switch(a.nodeType){case 1:return ia(pc,a);case 9:return oc(a.documentElement);case 11:case 10:case 6:case 12:return qc;default:return a.parentNode?oc(a.parentNode):qc}}function qc(){return null}function pc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?pc(a.parentNode,b):null};function rc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=kb(a);if(nb(c))throw Error("Invalid XPath expression.");b?"function"==l(b)||(b=ha(b.lookupNamespaceURI,b)):b=function(){return null};var d=gc(new fc(c,b));if(!nb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new fb(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?yb(a):""+a;break;case 1:this.numberValue=a instanceof G?+yb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof hb?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=xb(a);this.singleNodeValue=d instanceof hb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function sc(a){this.lookupNamespaceURI=oc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new rc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new rc(a,b)},d.createNSResolver=function(a){return new sc(a)}});function tc(a){return(a=a.exec(t))?a[1]:""}var uc=function(){if($a)return tc(/Firefox\/([0-9.]+)/);if(x||Ma||La)return Sa;if(db)return tc(/Chrome\/([0-9.]+)/);if(eb&&!(Ka()||u("iPad")||u("iPod")))return tc(/Version\/([0-9.]+)/);if(ab||bb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(cb)return(a=tc(/Android\s+([0-9.]+)/))?a:tc(/Version\/([0-9.]+)/);return""}();var vc,wc;function xc(a){return yc?vc(a):x?0<=la(z,a):Ua(a)}function zc(a){yc?wc(a):cb?la(Ac,a):la(uc,a)} -var yc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;vc=function(a){return 0<=c.compare(d,""+a)};wc=function(a){c.compare(e,""+a)};return!0}(),Bc;if(cb){var Cc=/Android\s+([0-9\.]+)/.exec(t);Bc=Cc?Cc[1]:"0"}else Bc="0"; -var Ac=Bc,Dc=x&&!(9<=Number(z));cb&&zc(2.3);cb&&zc(4);eb&&zc(6);function Ec(a,b){var c=na(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=Dc?"styleFloat":"cssFloat";var d;a:{d=c;var e=9==a.nodeType?a:a.ownerDocument||a.document;if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){d=e[d]||e.getPropertyValue(d)||"";break a}d=""}d=d||Fc(a,c);if(null===d)d=null;else if(0<=oa(wa,c)){b:{var f=d.match(za);if(f){var c=Number(f[1]),e=Number(f[2]),h=Number(f[3]),f=Number(f[4]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=h&&255>=h&&0<=f&& -1>=f){c=[c,e,h,f];break b}}c=null}if(!c)b:{if(h=d.match(Aa))if(c=Number(h[1]),e=Number(h[2]),h=Number(h[3]),0<=c&&255>=c&&0<=e&&255>=e&&0<=h&&255>=h){c=[c,e,h,1];break b}c=null}if(!c)b:{c=d.toLowerCase();e=va[c.toLowerCase()];if(!e&&(e="#"==c.charAt(0)?c:"#"+c,4==e.length&&(e=e.replace(xa,"#$1$1$2$2$3$3")),!ya.test(e))){c=null;break b}c=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d} -function Fc(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==l(c.getPropertyValue)&&(d=c.getPropertyValue(b));if("inherit"!=d)return void 0!==d?d:null;for(c=a.parentNode;c&&1!=c.nodeType&&9!=c.nodeType&&11!=c.nodeType;)c=c.parentNode;return(c=c&&1==c.nodeType?c:null)?Fc(c,b):null};Na||yc&&zc(3.6);x&&xc(10);cb&&zc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=Gc(a),Hc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function Gc(a){Hc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function Hc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=Gc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var Ic={};function Z(a,b,c){ca(a)&&(a=y?a.f:a.g);a=new Jc(a);!b||b in Ic&&!c||(Ic[b]={key:a,shift:!1},c&&(Ic[c]={key:a,shift:!0}));return a}function Jc(a){this.code=a}Z(8);Z(9);Z(13);var Kc=Z(16),Lc=Z(17),Mc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Nc=Z(Pa?{f:91,g:91}:Oa?{f:224,g:91}:{f:0,g:91});Z(Pa?{f:92,g:92}:Oa?{f:224,g:93}:{f:0,g:92});Z(Pa?{f:93,g:93}:Oa?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Oc=new X;Y(Oc,1,Kc);Y(Oc,2,Lc);Y(Oc,4,Mc);Y(Oc,8,Nc);(function(a){var b=new X;p(Gc(a),function(c){Y(b,a.get(c).code,c)});return b})(Oc);y&&xc(12);function Pc(){} -function Qc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==l(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Qc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Rc(d,c),c.push(":"),Qc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Rc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Sc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Tc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Rc(a,b){b.push('"',a.replace(Tc,function(a){var b=Sc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Sc[a]=b);return b}),'"')};Na||y&&xc(3.5)||x&&xc(8);function Uc(a){switch(l(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return qa(a,Uc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Vc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Vc(a),b;if(ba(a))return qa(a,Uc);a=Fa(a,function(a,b){return"number"==typeof b||m(b)});return Ga(a,Uc);default:return null}} -function Wc(a,b){return"array"==l(a)?qa(a,function(a){return Wc(a,b)}):ca(a)?"function"==typeof a?a:w(a,"ELEMENT")?Xc(a.ELEMENT,b):w(a,"WINDOW")?Xc(a.WINDOW,b):Ga(a,function(a){return Wc(a,b)}):a}function Yc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ja());b.B||(b.B=ja());return b}function Vc(a){var b=Yc(a.ownerDocument),c=Ha(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function Xc(a,b){a=decodeURIComponent(a);var c=b||document,d=Yc(c);if(!w(d,a))throw new Ba(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new Ba(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new Ba(10,"Element is no longer attached to the DOM");};aa("_",function(a,b,c){a=[a,b];var d;try{var e;c?e=Xc(c.WINDOW):e=window;var f=Wc(a,e.document),h=Ec.apply(null,f);d={status:0,value:Uc(h)}}catch(k){d={status:w(k,"code")?k.code:13,value:{message:k.message}}}c=[];Qc(new Pc,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/is_content_editable.js b/src/ghostdriver/third_party/webdriver-atoms/is_content_editable.js deleted file mode 100644 index 16cda2b78a..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/is_content_editable.js +++ /dev/null @@ -1,90 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var n=window;var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",C=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var fa=C.exec(k)||["","",""],ga=O.exec(v)||["","",""];if(0==fa[0].length&&0==ga[0].length)break;c=na(0==fa[1].length?0:parseInt(fa[1],10),0==ga[1].length?0:parseInt(ga[1],10))||na(0==fa[2].length,0==ga[2].length)||na(fa[2],ga[2])}while(0==c)}return c} -function na(a,b){return a<b?-1:a>b?1:0};function p(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function oa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function pa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function q(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function qa(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ra(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]}function sa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ta(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function ua(a,b){this.code=a;this.a=r[a]||va;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(ua,Error);var va="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=va;r[30]=va;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=va;r[9]="unknown command";ua.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var wa=g.navigator;if(wa){var xa=wa.userAgent;if(xa){t=xa;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function ya(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function za(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return u("Opera")||u("OPR")}function Ca(){return(u("Chrome")||u("CriOS"))&&!Ba()&&!u("Edge")};function Da(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Ea=Ba(),x=u("Trident")||u("MSIE"),Fa=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ga=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ha=u("Macintosh"),Ia=u("Windows");function Ja(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ga)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=g.document;return a?a.documentMode:void 0} -var La=function(){if(Ea&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),null!=b&&b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=ma(La,a))}var Oa=g.document,Pa=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!y&&!x||x&&9<=Number(Pa)||y&&Na("1.9.1");x&&Na("9");function Qa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Ra(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(Pa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Sa(a,b):!c&&Qa(e,b)?-1*Ta(a,b):!d&&Qa(f,a)?Ta(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Ta(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Sa(d,a)}function Sa(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};var Ua=u("Firefox"),Va=Da()||u("iPod"),Wa=u("iPad"),z=u("Android")&&!(Ca()||u("Firefox")||Ba()||u("Silk")),Xa=Ca(),Ya=u("Safari")&&!(Ca()||u("Coast")||Ba()||u("Edge")||u("Silk")||u("Android"))&&!(Da()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Za(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(Pa)),$a=x&&!(8<=Number(Pa));function ab(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function bb(a,b){var c=$a&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new ab(b,a,b.nodeName,c)};function cb(a){this.b=a;this.a=0}function db(a){a=a.match(eb);for(var b=0;b<a.length;b++)fb.test(a[b])&&a.splice(b,1);return new cb(a)}var eb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),fb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function gb(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}$a&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function hb(a,b,c,d,e){return(A?ib:jb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function ib(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=kb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}lb(a,b,c,d,e);return e} -function jb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?lb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function mb(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=kb(a);if("*"!=h&&(f=oa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=oa(f,function(a){return F(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return nb(a,b,c,d,e)}function nb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function lb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),lb(a,b,c,d,e)}function kb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function ob(a){this.node=a;this.a=this.b=null}function pb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof ab&&k instanceof ab&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Ra(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new ob(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new ob(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function qb(a){return(a=a.a)?a.node:null}function rb(a){return(a=qb(a))?E(a):""}function K(a,b){return new sb(a,!!b)}function sb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function tb(a,b){a.i=b}function ub(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+rb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?rb(c):""+c}function vb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function wb(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==xb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(wb,M); -function yb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}wb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};wb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function zb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}zb.prototype.toString=function(){return this.a};var Ab={}; -function R(a,b,c,d){if(Ab.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new zb(a,b,c,d);return Ab[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return yb(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return yb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return yb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return yb(function(a,b){return a>=b},a,b,c)});var xb=R("=",3,2,function(a,b,c){return yb(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return yb(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return vb(a,c)&&vb(b,c)});R("or",1,2,function(a,b,c){return vb(a,c)||vb(b,c)});function Bb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Bb,M);Bb.prototype.a=function(a){a=this.c.a(a);return Cb(this.j,a)};Bb.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Db(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;tb(this,a.i||qa(b,function(a){return a.i}));ub(this,a.J&&!b.length||a.I&&!!b.length||qa(b,function(a){return a.b}))} -m(Db,M);Db.prototype.a=function(a){return this.j.v.apply(null,sa(a,this.c))};Db.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=q(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Eb(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Eb.prototype.toString=function(){return this.o};var Fb={}; -function S(a,b,c,d,e,f,h,k){if(Fb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Fb[a]=new Eb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return vb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return q(ta(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1); -S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ra(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(l(f))b=l(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Ra);var h=new G;p(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!vb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Gb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Hb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Hb,M);Hb.prototype.a=function(){return this.c};Hb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Ib(a){M.call(this,1);this.c=a}m(Ib,M);Ib.prototype.a=function(){return this.c};Ib.prototype.toString=function(){return"Number: "+this.c};function Jb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Kb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Jb,M);function Lb(){M.call(this,4)}m(Lb,M);Lb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Lb.prototype.toString=function(){return"Root Helper Expression"};function Mb(){M.call(this,4)}m(Mb,M);Mb.prototype.a=function(a){var b=new G;I(b,a.a);return b};Mb.prototype.toString=function(){return"Context Helper Expression"}; -function Nb(a){return"/"==a||"//"==a}Jb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Ob)if(e.i||e.c!=Pb)for(h=L(f),b=e.a(new Za(h));null!=(h=L(f));)h=e.a(new Za(h)),b=pb(b,h);else h=L(f),b=e.a(new Za(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new Za(h))}}return b}; -Jb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=q(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Qb(a,b){this.a=a;this.b=!!b} -function Cb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new Za(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var C=v.a;if(!C)throw Error("Next must be called at least once before remove.");var O=C.b,C=C.a;O?O.a=C:h.a=C;C?C.b=O:h.b=O;h.s--;v.a=null}}return b} -Qb.prototype.toString=function(){return q(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Qb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Rb)if(a=K((new T(Sb,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=pb(c,this.v(b,d,e,f));else c=new G;else c=hb(this.w,b,d,e),c=Cb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Cb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=q(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Tb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Tb.prototype.toString=function(){return this.o};var Ub={};function U(a,b,c,d){if(Ub.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Tb(a,b,c,!!d);return Ub[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Kb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new ab(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,bb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,bb(b,f)):I(c,f));return c},!1),Rb=U("child",function(a,b,c,d,e){return(A?mb:nb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",hb,!1,!0); -var Sb=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return hb(a,b,c,d,e)},!1,!0),Ob=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=hb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Vb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Pb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var C=0,O=v.length;C<O;C++)b=v[C],F(b,c,d)&&a.a(b)&&I(e,b),e=hb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Wb=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function Xb(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m(Xb,M);Xb.prototype.a=function(a){return-P(this.c,a)};Xb.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function Yb(a){M.call(this,4);this.c=a;tb(this,qa(this.c,function(a){return a.i}));ub(this,qa(this.c,function(a){return a.b}))}m(Yb,M);Yb.prototype.a=function(a){var b=new G;p(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=pb(b,c)});return b};Yb.prototype.toString=function(){return q(this.c,function(a,b){return a+N(b)},"Union Expression:")};function Zb(a,b){this.a=a;this.b=b}function $b(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=ac(a);var d=D(a.a);if(!d)break;var e=(d=Ab[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new wb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new wb(c.pop(),c.pop(),b);return b}function V(a,b){if(gb(a.a))throw Error(b);}function bc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function cc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function dc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Hb(a)} -function ec(a){var b,c=[],d;if(Nb(B(a.a))){b=D(a.a);d=B(a.a);if("/"==b&&(gb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Lb;d=new Lb;V(a,"Missing next location step.");b=fc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=$b(a);V(a,'unclosed "("');bc(a,")");break;case '"':case "'":b=dc(a);break;default:if(isNaN(+b))if(!Gb(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=D(a.a); -b=Fb[b]||null;D(a.a);for(d=[];")"!=B(a.a);){V(a,"Missing function argument list.");d.push($b(a));if(","!=B(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");cc(a);b=new Db(b,d)}else{b=null;break a}else b=new Ib(+D(a.a))}"["==B(a.a)&&(d=new Qb(gc(a)),b=new Bb(b,d))}if(b)if(Nb(B(a.a)))d=b;else return b;else b=fc(a,"/"),d=new Mb,c.push(b)}for(;Nb(B(a.a));)b=D(a.a),V(a,"Missing next location step."),b=fc(a,b),c.push(b);return new Jb(d,c)} -function fc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new T(Wb,new J("node")),D(a.a),d;if(".."==B(a.a))return d=new T(Vb,new J("node")),D(a.a),d;var f;if("@"==B(a.a))f=Kb,D(a.a),V(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Ub[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Rb;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!Gb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Gb(c))throw Error("Invalid type name: "+c);bc(a,"(");V(a,"Bad nodetype");e=B(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=dc(a);V(a,"Bad nodetype");cc(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Qb(gc(a),f.a);return d|| -new T(f,c,e,"//"==b)}function gc(a){for(var b=[];"["==B(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=$b(a);b.push(c);V(a,"Unclosed predicate expression.");bc(a,"]")}return b}function ac(a){if("-"==B(a.a))return D(a.a),new Xb(ac(a));var b=ec(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(ec(a));a.a.a--;a=new Yb(b)}return a};function hc(a){switch(a.nodeType){case 1:return ja(ic,a);case 9:return hc(a.documentElement);case 11:case 10:case 6:case 12:return jc;default:return a.parentNode?hc(a.parentNode):jc}}function jc(){return null}function ic(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?ic(a.parentNode,b):null};function kc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=db(a);if(gb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=$b(new Zb(c,b));if(!gb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new Za(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?rb(a):""+a;break;case 1:this.numberValue=a instanceof G?+rb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof ab?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=qb(a);this.singleNodeValue=d instanceof ab?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function lc(a){this.lookupNamespaceURI=hc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new kc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new kc(a,b)},d.createNSResolver=function(a){return new lc(a)}});function mc(a){return(a=a.exec(t))?a[1]:""}var nc=function(){if(Ua)return mc(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return La;if(Xa)return mc(/Chrome\/([0-9.]+)/);if(Ya&&!(Da()||u("iPad")||u("iPod")))return mc(/Version\/([0-9.]+)/);if(Va||Wa){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(z)return(a=mc(/Android\s+([0-9.]+)/))?a:mc(/Version\/([0-9.]+)/);return""}();var oc,pc;function qc(a){return rc?oc(a):x?0<=ma(Pa,a):Na(a)}function sc(a){rc?pc(a):z?ma(tc,a):ma(nc,a)} -var rc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;oc=function(a){return 0<=c.compare(d,""+a)};pc=function(a){c.compare(e,""+a)};return!0}(),uc;if(z){var vc=/Android\s+([0-9\.]+)/.exec(t);uc=vc?vc[1]:"0"}else uc="0";var tc=uc;z&&sc(2.3); -z&&sc(4);Ya&&sc(6);Ga||rc&&sc(3.6);x&&qc(10);z&&sc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=wc(a),xc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function wc(a){xc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function xc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=wc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var yc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new zc(a);!b||b in yc&&!c||(yc[b]={key:a,shift:!1},c&&(yc[c]={key:a,shift:!0}));return a}function zc(a){this.code=a}Z(8);Z(9);Z(13);var Ac=Z(16),Bc=Z(17),Cc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Dc=Z(Ia?{f:91,g:91}:Ha?{f:224,g:91}:{f:0,g:91});Z(Ia?{f:92,g:92}:Ha?{f:224,g:93}:{f:0,g:92});Z(Ia?{f:93,g:93}:Ha?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Ec=new X;Y(Ec,1,Ac);Y(Ec,2,Bc);Y(Ec,4,Cc);Y(Ec,8,Dc);(function(a){var b=new X;p(wc(a),function(c){Y(b,a.get(c).code,c)});return b})(Ec);y&&qc(12);function Fc(){} -function Gc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Gc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Hc(d,c),c.push(":"),Gc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Hc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Ic={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Jc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Hc(a,b){b.push('"',a.replace(Jc,function(a){var b=Ic[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ic[a]=b);return b}),'"')};Ga||y&&qc(3.5)||x&&qc(8);function Kc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return pa(a,Kc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Lc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Lc(a),b;if(ca(a))return pa(a,Kc);a=ya(a,function(a,b){return"number"==typeof b||l(b)});return za(a,Kc);default:return null}} -function Mc(a,b){return"array"==ba(a)?pa(a,function(a){return Mc(a,b)}):da(a)?"function"==typeof a?a:w(a,"ELEMENT")?Nc(a.ELEMENT,b):w(a,"WINDOW")?Nc(a.WINDOW,b):za(a,function(a){return Mc(a,b)}):a} -function Oc(a,b){var c;try{a:{var d=a;if(l(d))try{a=new n.Function(d);break a}catch(h){if(x&&n.execScript){n.execScript(";");a=new n.Function(d);break a}throw h;}a=n==window?d:new n.Function("return ("+d+").apply(null,arguments);")}var e=Mc(b,n.document),f=a.apply(null,e);c={status:0,value:Kc(f)}}catch(h){c={status:w(h,"code")?h.code:13,value:{message:h.message}}}d=[];Gc(new Fc,c,d);return d.join("")}function Pc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b} -function Lc(a){var b=Pc(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c}function Nc(a,b){a=decodeURIComponent(a);var c=b||document,d=Pc(c);if(!w(d,a))throw new ua(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new ua(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new ua(10,"Element is no longer attached to the DOM");};aa("_",function(a){return Oc(function(a){return a.isContentEditable},[a])});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/is_displayed.js b/src/ghostdriver/third_party/webdriver-atoms/is_displayed.js deleted file mode 100644 index e2d04781f9..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/is_displayed.js +++ /dev/null @@ -1,116 +0,0 @@ -function(){return function(){var h,l=this;function aa(a,b){var c=a.split("."),d=l;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ga(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function n(a,b){function c(){}c.prototype=b.prototype;a.R=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.O=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",u=e[g]||"",v=RegExp("(\\d*)(\\D*)","g"),p=RegExp("(\\d*)(\\D*)","g");do{var x=v.exec(k)||["","",""],E=p.exec(u)||["","",""];if(0==x[0].length&&0==E[0].length)break;c=na(0==x[1].length?0:parseInt(x[1],10),0==E[1].length?0:parseInt(E[1],10))||na(0==x[2].length,0==E[2].length)||na(x[2],E[2])}while(0==c)}return c}function na(a,b){return a<b?-1:a>b?1:0} -function oa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function pa(a,b){if(m(a))return m(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function q(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function qa(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d} -function ra(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function sa(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ta(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ua(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0} -function va(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function wa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ya(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var za={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Aa="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ba=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ca=/^#(?:[0-9a-f]{3}){1,2}$/i,Da=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ea=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Fa(a,b){this.code=a;this.a=r[a]||Ga;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}n(Fa,Error);var Ga="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=Ga;r[30]=Ga;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=Ga;r[9]="unknown command";Fa.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var Ha=l.navigator;if(Ha){var Ia=Ha.userAgent;if(Ia){t=Ia;break a}}t=""}function w(a){return-1!=t.indexOf(a)};function Ja(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ka(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function La(a,b){return null!==a&&b in a}function Ma(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Na(){return w("Opera")||w("OPR")}function Oa(){return(w("Chrome")||w("CriOS"))&&!Na()&&!w("Edge")};function Pa(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Qa=Na(),y=w("Trident")||w("MSIE"),Ra=w("Edge"),z=w("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Sa=-1!=t.toLowerCase().indexOf("webkit")&&!w("Edge"),Ta=w("Macintosh"),Ua=w("Windows");function Va(){var a=t;if(z)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ra)return/Edge\/([\d\.]+)/.exec(a);if(y)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Sa)return/WebKit\/(\S+)/.exec(a)}function Wa(){var a=l.document;return a?a.documentMode:void 0} -var Xa=function(){if(Qa&&l.opera){var a;var b=l.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Va())&&(a=b?b[1]:"");return y&&(b=Wa(),null!=b&&b>parseFloat(a))?String(b):a}(),Ya={};function Za(a){return Ya[a]||(Ya[a]=0<=ma(Xa,a))}var $a=l.document,ab=$a&&y?Wa()||("CSS1Compat"==$a.compatMode?parseInt(Xa,10):5):void 0;!z&&!y||y&&9<=Number(ab)||z&&Za("1.9.1");y&&Za("9");function bb(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}h=bb.prototype;h.clone=function(){return new bb(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=ea(b)?b:a;this.x*=a;this.y*=c;return this};function cb(a,b){this.width=a;this.height=b}h=cb.prototype;h.clone=function(){return new cb(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.width*=a;this.height*=c;return this};function db(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function eb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(y&&!(9<=Number(ab))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?fb(a,b):!c&&db(e,b)?-1*gb(a,b):!d&&db(f,a)?gb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=A(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function gb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return fb(d,a)}function fb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function A(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function hb(a,b){a=a.parentNode;for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null} -function ib(a){this.a=a||l.document||document}ib.prototype.contains=db;var jb=w("Firefox"),kb=Pa()||w("iPod"),lb=w("iPad"),mb=w("Android")&&!(Oa()||w("Firefox")||Na()||w("Silk")),nb=Oa(),ob=w("Safari")&&!(Oa()||w("Coast")||Na()||w("Edge")||w("Silk")||w("Android"))&&!(Pa()||w("iPad")||w("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function pb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var B=y&&!(9<=Number(ab)),qb=y&&!(8<=Number(ab));function rb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function sb(a,b){var c=qb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new rb(b,a,b.nodeName,c)};function tb(a){this.b=a;this.a=0}function ub(a){a=a.match(vb);for(var b=0;b<a.length;b++)wb.test(a[b])&&a.splice(b,1);return new tb(a)}var vb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),wb=/^\s/;function C(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function xb(a){return a.b.length<=a.a};function F(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(B&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),B&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function G(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}qb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function yb(a,b,c,d,e){return(B?zb:Ab).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new H)} -function zb(a,b,c,d,e){if(a instanceof Bb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Cb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)G(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}Db(a,b,c,d,e);return e} -function Ab(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!y?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?Db(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),q(b,function(a){G(a,c,d)&&I(e,a)}));return e} -function Eb(a,b,c,d,e){var f;if((a instanceof Bb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Cb(a);if("*"!=g&&(f=qa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=qa(f,function(a){return G(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||I(e,a)});return e}return Fb(a,b,c,d,e)}function Fb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&I(e,b);return e} -function Db(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)G(b,c,d)&&a.a(b)&&I(e,b),Db(a,b,c,d,e)}function Cb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function H(){this.b=this.a=null;this.s=0}function Gb(a){this.node=a;this.a=this.b=null}function Hb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof rb&&k instanceof rb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<eb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.s=g;return a} -H.prototype.unshift=function(a){a=new Gb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new Gb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function Ib(a){return(a=a.a)?a.node:null}function Jb(a){return(a=Ib(a))?F(a):""}function Kb(a,b){return new Lb(a,!!b)}function Lb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function K(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function L(a){this.m=a;this.b=this.i=!1;this.h=null}function M(a){return"\n "+a.toString().split("\n").join("\n ")}function Mb(a,b){a.i=b}function Nb(a,b){a.b=b}function N(a,b){var c=a.a(b);return c instanceof H?+Jb(c):+c}function O(a,b){var c=a.a(b);return c instanceof H?Jb(c):""+c}function Ob(a,b){var c=a.a(b);return c instanceof H?!!c.s:!!c};function Pb(a,b,c){L.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Qb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}n(Pb,L); -function Rb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof H&&c instanceof H){b=Kb(b);for(d=K(b);d;d=K(b))for(e=Kb(c),f=K(e);f;f=K(e))if(a(F(d),F(f)))return!0;return!1}if(b instanceof H||c instanceof H){b instanceof H?(e=b,d=c):(e=c,d=b);f=Kb(e);for(var g=typeof d,k=K(f);k;k=K(f)){switch(g){case "number":k=+F(k);break;case "boolean":k=!!F(k);break;case "string":k=F(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Pb.prototype.a=function(a){return this.c.u(this.j,this.w,a)};Pb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+M(this.j);return a+=M(this.w)};function Sb(a,b,c,d){this.a=a;this.I=b;this.m=c;this.u=d}Sb.prototype.toString=function(){return this.a};var Tb={}; -function P(a,b,c,d){if(Tb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Sb(a,b,c,d);return Tb[a.toString()]=a}P("div",6,1,function(a,b,c){return N(a,c)/N(b,c)});P("mod",6,1,function(a,b,c){return N(a,c)%N(b,c)});P("*",6,1,function(a,b,c){return N(a,c)*N(b,c)});P("+",5,1,function(a,b,c){return N(a,c)+N(b,c)});P("-",5,1,function(a,b,c){return N(a,c)-N(b,c)});P("<",4,2,function(a,b,c){return Rb(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return Rb(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return Rb(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return Rb(function(a,b){return a>=b},a,b,c)});var Qb=P("=",3,2,function(a,b,c){return Rb(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return Rb(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return Ob(a,c)&&Ob(b,c)});P("or",1,2,function(a,b,c){return Ob(a,c)||Ob(b,c)});function Ub(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");L.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}n(Ub,L);Ub.prototype.a=function(a){a=this.c.a(a);return Vb(this.j,a)};Ub.prototype.toString=function(){var a;a="Filter:"+M(this.c);return a+=M(this.j)};function Wb(a,b){if(b.length<a.J)throw Error("Function "+a.o+" expects at least"+a.J+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.N&&q(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});L.call(this,a.m);this.j=a;this.c=b;Mb(this,a.i||ta(b,function(a){return a.i}));Nb(this,a.M&&!b.length||a.L&&!!b.length||ta(b,function(a){return a.b}))} -n(Wb,L);Wb.prototype.a=function(a){return this.j.u.apply(null,wa(a,this.c))};Wb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=sa(this.c,function(a,b){return a+M(b)},"Arguments:"),a=a+M(b);return a};function Xb(a,b,c,d,e,f,g,k,u){this.o=a;this.m=b;this.i=c;this.M=d;this.L=e;this.u=f;this.J=g;this.D=void 0!==k?k:g;this.N=!!u}Xb.prototype.toString=function(){return this.o};var Yb={}; -function Q(a,b,c,d,e,f,g,k){if(Yb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Yb[a]=new Xb(a,b,c,d,!1,e,f,g,k)}Q("boolean",2,!1,!1,function(a,b){return Ob(b,a)},1);Q("ceiling",1,!1,!1,function(a,b){return Math.ceil(N(b,a))},1);Q("concat",3,!1,!1,function(a,b){return sa(ya(arguments,1),function(b,d){return b+O(d,a)},"")},2,null);Q("contains",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return-1!=b.indexOf(a)},2);Q("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -Q("false",2,!1,!1,function(){return!1},0);Q("floor",1,!1,!1,function(a,b){return Math.floor(N(b,a))},1);Q("id",4,!1,!1,function(a,b){function c(a){if(B){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return va(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=O(b,a).split(/\s+/),f=[];q(d,function(a){a=c(a);!a||0<=pa(f,a)||f.push(a)});f.sort(eb);var g=new H;q(f,function(a){I(g,a)});return g},1); -Q("lang",2,!1,!1,function(){return!1},1);Q("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);Q("local-name",3,!1,!0,function(a,b){var c=b?Ib(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);Q("name",3,!1,!0,function(a,b){var c=b?Ib(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);Q("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -Q("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);Q("not",2,!1,!1,function(a,b){return!Ob(b,a)},1);Q("number",1,!1,!0,function(a,b){return b?N(b,a):+F(a.a)},0,1);Q("position",1,!0,!1,function(a){return a.b},0);Q("round",1,!1,!1,function(a,b){return Math.round(N(b,a))},1);Q("starts-with",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return 0==b.lastIndexOf(a,0)},2);Q("string",3,!1,!0,function(a,b){return b?O(b,a):F(a.a)},0,1); -Q("string-length",1,!1,!0,function(a,b){return(b?O(b,a):F(a.a)).length},0,1);Q("substring",3,!1,!1,function(a,b,c,d){c=N(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?N(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=O(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);Q("substring-after",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -Q("substring-before",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);Q("sum",1,!1,!1,function(a,b){for(var c=Kb(b.a(a)),d=0,e=K(c);e;e=K(c))d+=+F(e);return d},1,1,!0);Q("translate",3,!1,!1,function(a,b,c,d){b=O(b,a);c=O(c,a);var e=O(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);Q("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Zb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=M(this.c));return a};function $b(a){L.call(this,3);this.c=a.substring(1,a.length-1)}n($b,L);$b.prototype.a=function(){return this.c};$b.prototype.toString=function(){return"Literal: "+this.c};function Bb(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Bb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Bb.prototype.h=function(){return this.o};Bb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function ac(a){L.call(this,1);this.c=a}n(ac,L);ac.prototype.a=function(){return this.c};ac.prototype.toString=function(){return"Number: "+this.c};function bc(a,b){L.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.B||c.c!=cc||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}n(bc,L);function dc(){L.call(this,4)}n(dc,L);dc.prototype.a=function(a){var b=new H;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};dc.prototype.toString=function(){return"Root Helper Expression"};function ec(){L.call(this,4)}n(ec,L);ec.prototype.a=function(a){var b=new H;I(b,a.a);return b};ec.prototype.toString=function(){return"Context Helper Expression"}; -function fc(a){return"/"==a||"//"==a}bc.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof H))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=Kb(b,e.c.a),g;if(e.i||e.c!=gc)if(e.i||e.c!=hc)for(g=K(f),b=e.a(new pb(g));null!=(g=K(f));)g=e.a(new pb(g)),b=Hb(b,g);else g=K(f),b=e.a(new pb(g));else{for(g=K(f);(b=K(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new pb(g))}}return b}; -bc.prototype.toString=function(){var a;a="Path Expression:"+M(this.j);if(this.c.length){var b=sa(this.c,function(a,b){return a+M(b)},"Steps:");a+=M(b)}return a};function ic(a,b){this.a=a;this.b=!!b} -function Vb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=Kb(b),f=b.s,g,k=0;g=K(e);k++){var u=a.b?f-k:k+1;g=d.a(new pb(g,u,f));if("number"==typeof g)u=u==g;else if("string"==typeof g||"boolean"==typeof g)u=!!g;else if(g instanceof H)u=0<g.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!u){u=e;g=u.h;var v=u.a;if(!v)throw Error("Next must be called at least once before remove.");var p=v.b,v=v.a;p?p.a=v:g.a=v;v?v.b=p:g.b=p;g.s--;u.a=null}}return b} -ic.prototype.toString=function(){return sa(this.a,function(a,b){return a+M(b)},"Predicates:")};function jc(a,b,c,d){L.call(this,4);this.c=a;this.w=b;this.j=c||new ic([]);this.B=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=B?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}n(jc,L); -jc.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?O(c.A,a):null,f=1);if(this.B)if(this.i||this.c!=kc)if(a=Kb((new jc(lc,new J("node"))).a(a)),b=K(a))for(c=this.u(b,d,e,f);null!=(b=K(a));)c=Hb(c,this.u(b,d,e,f));else c=new H;else c=yb(this.w,b,d,e),c=Vb(this.j,c,f);else c=this.u(a.a,d,e,f);return c};jc.prototype.u=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Vb(this.j,a,d)}; -jc.prototype.toString=function(){var a;a="Step:"+M("Operator: "+(this.B?"//":"/"));this.c.o&&(a+=M("Axis: "+this.c));a+=M(this.w);if(this.j.a.length){var b=sa(this.j.a,function(a,b){return a+M(b)},"Predicates:");a+=M(b)}return a};function mc(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}mc.prototype.toString=function(){return this.o};var nc={};function R(a,b,c,d){if(nc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new mc(a,b,c,!!d);return nc[a]=b} -R("ancestor",function(a,b){for(var c=new H,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);R("ancestor-or-self",function(a,b){var c=new H,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var cc=R("attribute",function(a,b){var c=new H,d=a.h();if("style"==d&&b.style&&B)return I(c,new rb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)B?f.nodeValue&&I(c,sb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(B?f.nodeValue&&I(c,sb(b,f)):I(c,f));return c},!1),kc=R("child",function(a,b,c,d,e){return(B?Eb:Fb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new H)},!1,!0);R("descendant",yb,!1,!0); -var lc=R("descendant-or-self",function(a,b,c,d){var e=new H;G(b,c,d)&&a.a(b)&&I(e,b);return yb(a,b,c,d,e)},!1,!0),gc=R("following",function(a,b,c,d){var e=new H;do for(var f=b;f=f.nextSibling;)G(f,c,d)&&a.a(f)&&I(e,f),e=yb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);R("following-sibling",function(a,b){for(var c=new H,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);R("namespace",function(){return new H},!1); -var oc=R("parent",function(a,b){var c=new H;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),hc=R("preceding",function(a,b,c,d){var e=new H,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var u=[];for(b=f[g];b=b.previousSibling;)u.unshift(b);for(var v=0,p=u.length;v<p;v++)b=u[v],G(b,c,d)&&a.a(b)&&I(e,b),e=yb(a,b,c,d,e)}return e},!0,!0); -R("preceding-sibling",function(a,b){for(var c=new H,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var pc=R("self",function(a,b){var c=new H;a.a(b)&&I(c,b);return c},!1);function qc(a){L.call(this,1);this.c=a;this.i=a.i;this.b=a.b}n(qc,L);qc.prototype.a=function(a){return-N(this.c,a)};qc.prototype.toString=function(){return"Unary Expression: -"+M(this.c)};function rc(a){L.call(this,4);this.c=a;Mb(this,ta(this.c,function(a){return a.i}));Nb(this,ta(this.c,function(a){return a.b}))}n(rc,L);rc.prototype.a=function(a){var b=new H;q(this.c,function(c){c=c.a(a);if(!(c instanceof H))throw Error("Path expression must evaluate to NodeSet.");b=Hb(b,c)});return b};rc.prototype.toString=function(){return sa(this.c,function(a,b){return a+M(b)},"Union Expression:")};function sc(a,b){this.a=a;this.b=b}function tc(a){for(var b,c=[];;){S(a,"Missing right hand side of binary expression.");b=uc(a);var d=D(a.a);if(!d)break;var e=(d=Tb[d]||null)&&d.I;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].I;)b=new Pb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Pb(c.pop(),c.pop(),b);return b}function S(a,b){if(xb(a.a))throw Error(b);}function vc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function wc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function xc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new $b(a)} -function yc(a){var b,c=[],d;if(fc(C(a.a))){b=D(a.a);d=C(a.a);if("/"==b&&(xb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new dc;d=new dc;S(a,"Missing next location step.");b=zc(a,b);c.push(b)}else{a:{b=C(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=tc(a);S(a,'unclosed "("');vc(a,")");break;case '"':case "'":b=xc(a);break;default:if(isNaN(+b))if(!Zb(b)&&/(?![0-9])[\w]/.test(d)&&"("==C(a.a,1)){b=D(a.a); -b=Yb[b]||null;D(a.a);for(d=[];")"!=C(a.a);){S(a,"Missing function argument list.");d.push(tc(a));if(","!=C(a.a))break;D(a.a)}S(a,"Unclosed function argument list.");wc(a);b=new Wb(b,d)}else{b=null;break a}else b=new ac(+D(a.a))}"["==C(a.a)&&(d=new ic(Ac(a)),b=new Ub(b,d))}if(b)if(fc(C(a.a)))d=b;else return b;else b=zc(a,"/"),d=new ec,c.push(b)}for(;fc(C(a.a));)b=D(a.a),S(a,"Missing next location step."),b=zc(a,b),c.push(b);return new bc(d,c)} -function zc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==C(a.a))return d=new jc(pc,new J("node")),D(a.a),d;if(".."==C(a.a))return d=new jc(oc,new J("node")),D(a.a),d;var f;if("@"==C(a.a))f=cc,D(a.a),S(a,"Missing attribute name");else if("::"==C(a.a,1)){if(!/(?![0-9])[\w]/.test(C(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=nc[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);S(a,"Missing node name")}else f=kc;c=C(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -C(a.a,1)){if(!Zb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Zb(c))throw Error("Invalid type name: "+c);vc(a,"(");S(a,"Bad nodetype");e=C(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=xc(a);S(a,"Bad nodetype");wc(a);c=new J(c,g)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new Bb(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Bb(c,k)}else throw Error("Bad token: "+D(a.a));e=new ic(Ac(a),f.a);return d|| -new jc(f,c,e,"//"==b)}function Ac(a){for(var b=[];"["==C(a.a);){D(a.a);S(a,"Missing predicate expression.");var c=tc(a);b.push(c);S(a,"Unclosed predicate expression.");vc(a,"]")}return b}function uc(a){if("-"==C(a.a))return D(a.a),new qc(uc(a));var b=yc(a);if("|"!=C(a.a))a=b;else{for(b=[b];"|"==D(a.a);)S(a,"Missing next union location path."),b.push(yc(a));a.a.a--;a=new rc(b)}return a};function Bc(a){switch(a.nodeType){case 1:return ja(Cc,a);case 9:return Bc(a.documentElement);case 11:case 10:case 6:case 12:return Dc;default:return a.parentNode?Bc(a.parentNode):Dc}}function Dc(){return null}function Cc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Cc(a.parentNode,b):null};function Ec(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=ub(a);if(xb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=tc(new sc(c,b));if(!xb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new pb(a));return new T(c,b)}} -function T(a,b){if(0==b)if(a instanceof H)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof H))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof H?Jb(a):""+a;break;case 1:this.numberValue=a instanceof H?+Jb(a):+a;break;case 3:this.booleanValue=a instanceof H?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -Kb(a);c=[];for(var e=K(d);e;e=K(d))c.push(e instanceof rb?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=Ib(a);this.singleNodeValue=d instanceof rb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}T.ANY_TYPE=0;T.NUMBER_TYPE=1;T.STRING_TYPE=2;T.BOOLEAN_TYPE=3;T.UNORDERED_NODE_ITERATOR_TYPE=4;T.ORDERED_NODE_ITERATOR_TYPE=5;T.UNORDERED_NODE_SNAPSHOT_TYPE=6;T.ORDERED_NODE_SNAPSHOT_TYPE=7;T.ANY_UNORDERED_NODE_TYPE=8;T.FIRST_ORDERED_NODE_TYPE=9;function Fc(a){this.lookupNamespaceURI=Bc(a)} -function Gc(a,b){var c=a||l,d=c.document;if(!d.evaluate||b)c.XPathResult=T,d.evaluate=function(a,b,c,d){return(new Ec(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Ec(a,b)},d.createNSResolver=function(a){return new Fc(a)}}aa("wgxpath.install",Gc);var U={};U.F=function(){var a={S:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -U.u=function(a,b,c){var d=A(a);if(!d.documentElement)return null;(y||mb)&&Gc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):U.F;if(y&&!Za(7))return d.evaluate.call(d,b,a,e,c,null);if(!y||9<=Number(ab)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var u=g[k],v=u.namespaceURI;if(v&&!f[v]){var p=u.lookupPrefix(v);if(!p)var x=v.match(".*/(\\w+)/?$"),p=x?x[1]:"xhtml";f[v]=p}}var E={},ca;for(ca in f)E[f[ca]]=ca;e=function(a){return E[a]|| -null}}try{return d.evaluate(b,a,e,c,null)}catch(xa){if("TypeError"===xa.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):U.F,d.evaluate(b,a,e,c,null);throw xa;}}catch(xa){if(!z||"NS_ERROR_ILLEGAL_VALUE"!=xa.name)throw new Fa(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+xa);}};U.G=function(a,b){if(!a||1!=a.nodeType)throw new Fa(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -U.K=function(a,b){var c=function(){var c=U.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||U.G(c,a);return c}; -U.P=function(a,b){var c=function(){var c=U.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();q(c,function(b){U.G(b,a)});return c};function Hc(a){return(a=a.exec(t))?a[1]:""}var Ic=function(){if(jb)return Hc(/Firefox\/([0-9.]+)/);if(y||Ra||Qa)return Xa;if(nb)return Hc(/Chrome\/([0-9.]+)/);if(ob&&!(Pa()||w("iPad")||w("iPod")))return Hc(/Version\/([0-9.]+)/);if(kb||lb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(mb)return(a=Hc(/Android\s+([0-9.]+)/))?a:Hc(/Version\/([0-9.]+)/);return""}();var Jc,Kc;function Lc(a){return Mc?Jc(a):y?0<=ma(ab,a):Za(a)}function Nc(a){Mc?Kc(a):mb?ma(Oc,a):ma(Ic,a)} -var Mc=function(){if(!z)return!1;var a=l.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;Jc=function(a){return 0<=c.compare(d,""+a)};Kc=function(a){c.compare(e,""+a)};return!0}(),Pc;if(mb){var Qc=/Android\s+([0-9\.]+)/.exec(t);Pc=Qc?Qc[1]:"0"}else Pc="0"; -var Oc=Pc,Rc=y&&!(9<=Number(ab));mb&&Nc(2.3);mb&&Nc(4);ob&&Nc(6);function Sc(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=Sc.prototype;h.clone=function(){return new Sc(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof Sc?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function V(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=V.prototype;h.clone=function(){return new V(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof V?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function W(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Tc(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return W(a)?a:null} -function X(a,b){var c=oa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=Rc?"styleFloat":"cssFloat";var d;a:{d=c;var e=A(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){d=e[d]||e.getPropertyValue(d)||"";break a}d=""}d=d||Uc(a,c);if(null===d)d=null;else if(0<=pa(Aa,c)){b:{var f=d.match(Da);if(f){var c=Number(f[1]),e=Number(f[2]),g=Number(f[3]),f=Number(f[4]);if(0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g&&0<=f&&1>=f){c=[c,e,g,f];break b}}c=null}if(!c)b:{if(g= -d.match(Ea))if(c=Number(g[1]),e=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=e&&255>=e&&0<=g&&255>=g){c=[c,e,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase();e=za[c.toLowerCase()];if(!e&&(e="#"==c.charAt(0)?c:"#"+c,4==e.length&&(e=e.replace(Ba,"#$1$1$2$2$3$3")),!Ca.test(e))){c=null;break b}c=[parseInt(e.substr(1,2),16),parseInt(e.substr(3,2),16),parseInt(e.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d} -function Uc(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(c=Tc(a))?Uc(c,b):null} -function Vc(a,b,c){function d(a){var b=Wc(a);return 0<b.height&&0<b.width?!0:W(a,"PATH")&&(0<b.height||0<b.width)?(a=X(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=X(a,"overflow")&&ta(a.childNodes,function(a){return 3==a.nodeType||W(a)&&d(a)})}function e(a){return Xc(a)==Y&&ua(a.childNodes,function(a){return!W(a)||e(a)||!d(a)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=hb(a,function(a){return W(a,"SELECT")}), -!!a&&Vc(a,!0,c);var f=Yc(a);if(f)return!!f.H&&0<f.rect.width&&0<f.rect.height&&Vc(f.H,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=X(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Zc(a))&&d(a)?!e(a):!1}function $c(a,b){function c(a){if("none"==X(a,"display"))return!1;a=Tc(a);return!a||c(a)}return Vc(a,!!b,c)}var Y="hidden"; -function Xc(a){function b(a){function b(a){return a==g?!0:0==X(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==X(a,"position")?!1:!0}var c=X(a,"position");if("fixed"==c)return v=!0,a==g?null:g;for(a=Tc(a);a&&!b(a);)a=Tc(a);return a}function c(a){var b=a;if("visible"==u)if(a==g&&k)b=k;else if(a==k)return{x:"visible",y:"visible"};b={x:X(b,"overflow-x"),y:X(b,"overflow-y")};a==g&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function d(a){if(a==g){var b=(new ib(f)).a; -a=b.scrollingElement?b.scrollingElement:Sa||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=y&&Za("10")&&b.pageYOffset!=a.scrollTop?new bb(a.scrollLeft,a.scrollTop):new bb(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new bb(a.scrollLeft,a.scrollTop);return a}var e=ad(a),f=A(a),g=f.documentElement,k=f.body,u=X(g,"overflow"),v;for(a=b(a);a;a=b(a)){var p=c(a);if("visible"!=p.x||"visible"!=p.y){var x=Wc(a);if(0==x.width||0==x.height)return Y; -var E=e.right<x.left,ca=e.bottom<x.top;if(E&&"hidden"==p.x||ca&&"hidden"==p.y)return Y;if(E&&"visible"!=p.x||ca&&"visible"!=p.y){E=d(a);ca=e.bottom<x.top-E.y;if(e.right<x.left-E.x&&"visible"!=p.x||ca&&"visible"!=p.x)return Y;e=Xc(a);return e==Y?Y:"scroll"}E=e.left>=x.left+x.width;x=e.top>=x.top+x.height;if(E&&"hidden"==p.x||x&&"hidden"==p.y)return Y;if(E&&"visible"!=p.x||x&&"visible"!=p.y){if(v&&(p=d(a),e.left>=g.scrollWidth-p.x||e.right>=g.scrollHeight-p.y))return Y;e=Xc(a);return e==Y?Y:"scroll"}}}return"none"} -function Wc(a){var b=Yc(a);if(b)return b.rect;if(W(a,"HTML"))return a=A(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new cb(a.clientWidth,a.clientHeight),new V(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new V(0,0,0,0)}b=new V(c.left,c.top,c.right-c.left,c.bottom-c.top);y&&a.ownerDocument.body&&(a=A(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+ -a.body.clientTop);return b}function Yc(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=U.K('/descendant::*[@usemap = "#'+c.name+'"]',A(c)))&&(e=Wc(d),b||"default"==a.shape.toLowerCase()||(a=bd(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new V(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{H:d,rect:e||new V(0,0,0,0)}} -function bd(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new V(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new V(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new V(b,c,d-b,e-c)}return new V(0,0,0,0)}function ad(a){a=Wc(a);return new Sc(a.top,a.left+a.width,a.top+a.height,a.left)} -function Zc(a){if(Rc){if("relative"==X(a,"position"))return 1;a=X(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return cd(a)}function cd(a){var b=1,c=X(a,"opacity");c&&(b=Number(c));(a=Tc(a))&&(b*=cd(a));return b};Sa||Mc&&Nc(3.6);y&&Lc(10);mb&&Nc(4);function dd(a,b){this.v={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)ed(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof dd)for(d=fd(a),gd(a),e=[],c=0;c<a.l.length;c++)e.push(a.v[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)ed(this,d[c],e[c])}}function fd(a){gd(a);return a.l.concat()} -dd.prototype.clear=function(){this.v={};this.b=this.a=this.l.length=0};function gd(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.v,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}dd.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.v,a)?this.v[a]:b}; -function ed(a,b,c){Object.prototype.hasOwnProperty.call(a.v,b)||(a.a++,a.l.push(b),a.b++);a.v[b]=c}dd.prototype.forEach=function(a,b){for(var c=fd(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};dd.prototype.clone=function(){return new dd(this)};var hd={};function Z(a,b,c){fa(a)&&(a=z?a.f:a.g);a=new id(a);!b||b in hd&&!c||(hd[b]={key:a,shift:!1},c&&(hd[c]={key:a,shift:!0}));return a}function id(a){this.code=a}Z(8);Z(9);Z(13);var jd=Z(16),kd=Z(17),ld=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var md=Z(Ua?{f:91,g:91}:Ta?{f:224,g:91}:{f:0,g:91});Z(Ua?{f:92,g:92}:Ta?{f:224,g:93}:{f:0,g:92});Z(Ua?{f:93,g:93}:Ta?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var nd=new dd;ed(nd,1,jd);ed(nd,2,kd);ed(nd,4,ld);ed(nd,8,md);(function(a){var b=new dd;q(fd(a),function(c){ed(b,a.get(c).code,c)});return b})(nd);z&&Lc(12);function od(){} -function pd(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),pd(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),qd(d,c),c.push(":"),pd(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":qd(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var rd={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},sd=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function qd(a,b){b.push('"',a.replace(sd,function(a){var b=rd[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),rd[a]=b);return b}),'"')};Sa||z&&Lc(3.5)||y&&Lc(8);function td(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return ra(a,td);case "object":if(La(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=ud(a);return b}if(La(a,"document"))return b={},b.WINDOW=ud(a),b;if(da(a))return ra(a,td);a=Ja(a,function(a,b){return ea(b)||m(b)});return Ka(a,td);default:return null}} -function vd(a,b){return"array"==ba(a)?ra(a,function(a){return vd(a,b)}):fa(a)?"function"==typeof a?a:La(a,"ELEMENT")?wd(a.ELEMENT,b):La(a,"WINDOW")?wd(a.WINDOW,b):Ka(a,function(a){return vd(a,b)}):a}function xd(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.C=ka());b.C||(b.C=ka());return b}function ud(a){var b=xd(a.ownerDocument),c=Ma(b,function(b){return b==a});c||(c=":wdc:"+b.C++,b[c]=a);return c} -function wd(a,b){a=decodeURIComponent(a);var c=b||document,d=xd(c);if(!La(d,a))throw new Fa(10,"Element does not exist in cache");var e=d[a];if(La(e,"setInterval")){if(e.closed)throw delete d[a],new Fa(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new Fa(10,"Element is no longer attached to the DOM");};aa("_",function(a,b){var c=[a,!0],d;try{var e;b?e=wd(b.WINDOW):e=window;var f=vd(c,e.document),g=$c.apply(null,f);d={status:0,value:td(g)}}catch(k){d={status:La(k,"code")?k.code:13,value:{message:k.message}}}c=[];pd(new od,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/is_element_clickable_chrome.js b/src/ghostdriver/third_party/webdriver-atoms/is_element_clickable_chrome.js deleted file mode 100644 index d7e76d719c..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/is_element_clickable_chrome.js +++ /dev/null @@ -1,69 +0,0 @@ -function(){return function(){var aa=this;function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function h(a){return"string"==typeof a}function da(a,b,c){return a.call.apply(a.bind,arguments)}function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}} -function fa(a,b,c){fa=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?da:ea;return fa.apply(null,arguments)}function ga(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}} -function l(a){var b=m;function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.F=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};function n(a,b){for(var c=a.length,d=h(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function p(a,b,c){var d=c;n(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function q(a,b){for(var c=a.length,d=h(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ha(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ia(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function ja(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function ka(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?la(a,b):!c&&ja(e,b)?-1*ma(a,b):!d&&ja(f,a)?ma(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType?a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0); -d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function ma(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return la(d,a)}function la(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function r(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function na(a){this.b=a;this.a=0}function oa(a){a=a.match(pa);for(var b=0;b<a.length;b++)qa.test(a[b])&&a.splice(b,1);return new na(a)}var pa=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),qa=/^\s/;function t(a,b){return a.b[a.a+(b||0)]}function u(a){return a.b[a.a++]}function w(a){return a.b.length<=a.a};function x(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function y(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function z(a,b,c,d,e){return ra.call(null,a,b,h(c)?c:null,h(d)?d:null,e||new B)} -function ra(a,b,c,d,e){b.getElementsByName&&d&&"name"==c?(b=b.getElementsByName(d),n(b,function(b){a.a(b)&&C(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(b){b.className==d&&a.a(b)&&C(e,b)})):a instanceof D?sa(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),n(b,function(a){y(a,c,d)&&C(e,a)}));return e}function ta(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)y(b,c,d)&&a.a(b)&&C(e,b);return e} -function sa(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)y(b,c,d)&&a.a(b)&&C(e,b),sa(a,b,c,d,e)};function B(){this.b=this.a=null;this.l=0}function ua(a){this.node=a;this.a=this.b=null}function va(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;)c.node==d.node?(f=c,c=c.a,d=d.a):0<ka(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a),(f.b=e)?e.a=f:a.a=f,e=f,g++;for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}B.prototype.unshift=function(a){a=new ua(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.l++}; -function C(a,b){var c=new ua(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function E(a){return(a=a.a)?a.node:null}function F(a){return(a=E(a))?x(a):""}function G(a,b){return new wa(a,!!b)}function wa(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function H(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function m(a){this.i=a;this.b=this.g=!1;this.f=null}function I(a){return"\n "+a.toString().split("\n").join("\n ")}function xa(a,b){a.g=b}function ya(a,b){a.b=b}function J(a,b){var c=a.a(b);return c instanceof B?+F(c):+c}function K(a,b){var c=a.a(b);return c instanceof B?F(c):""+c}function L(a,b){var c=a.a(b);return c instanceof B?!!c.l:!!c};function M(a,b,c){m.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==za&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,s:b}):this.f={name:b.f.name,s:c})}l(M); -function N(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof B&&c instanceof B){b=G(b);for(d=H(b);d;d=H(b))for(e=G(c),f=H(e);f;f=H(e))if(a(x(d),x(f)))return!0;return!1}if(b instanceof B||c instanceof B){b instanceof B?(e=b,d=c):(e=c,d=b);f=G(e);for(var g=typeof d,k=H(f);k;k=H(f)){switch(g){case "number":k=+x(k);break;case "boolean":k=!!x(k);break;case "string":k=x(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}M.prototype.a=function(a){return this.c.m(this.h,this.o,a)};M.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+I(this.h);return a+=I(this.o)};function Aa(a,b,c,d){this.a=a;this.w=b;this.i=c;this.m=d}Aa.prototype.toString=function(){return this.a};var Ba={}; -function P(a,b,c,d){if(Ba.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Aa(a,b,c,d);return Ba[a.toString()]=a}P("div",6,1,function(a,b,c){return J(a,c)/J(b,c)});P("mod",6,1,function(a,b,c){return J(a,c)%J(b,c)});P("*",6,1,function(a,b,c){return J(a,c)*J(b,c)});P("+",5,1,function(a,b,c){return J(a,c)+J(b,c)});P("-",5,1,function(a,b,c){return J(a,c)-J(b,c)});P("<",4,2,function(a,b,c){return N(function(a,b){return a<b},a,b,c)}); -P(">",4,2,function(a,b,c){return N(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return N(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return N(function(a,b){return a>=b},a,b,c)});var za=P("=",3,2,function(a,b,c){return N(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return N(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return L(a,c)&&L(b,c)});P("or",1,2,function(a,b,c){return L(a,c)||L(b,c)});function Q(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");m.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}l(Q);Q.prototype.a=function(a){a=this.c.a(a);return Ca(this.h,a)};Q.prototype.toString=function(){var a;a="Filter:"+I(this.c);return a+=I(this.h)};function R(a,b){if(b.length<a.A)throw Error("Function "+a.j+" expects at least"+a.A+" arguments, "+b.length+" given");if(null!==a.v&&b.length>a.v)throw Error("Function "+a.j+" expects at most "+a.v+" arguments, "+b.length+" given");a.B&&n(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});m.call(this,a.i);this.h=a;this.c=b;xa(this,a.g||q(b,function(a){return a.g}));ya(this,a.D&&!b.length||a.C&&!!b.length||q(b,function(a){return a.b}))}l(R); -R.prototype.a=function(a){return this.h.m.apply(null,ha(a,this.c))};R.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=p(this.c,function(a,b){return a+I(b)},"Arguments:"),a=a+I(b);return a};function Da(a,b,c,d,e,f,g,k,v){this.j=a;this.i=b;this.g=c;this.D=d;this.C=e;this.m=f;this.A=g;this.v=void 0!==k?k:g;this.B=!!v}Da.prototype.toString=function(){return this.j};var Ea={}; -function S(a,b,c,d,e,f,g,k){if(Ea.hasOwnProperty(a))throw Error("Function already created: "+a+".");Ea[a]=new Da(a,b,c,d,!1,e,f,g,k)}S("boolean",2,!1,!1,function(a,b){return L(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(J(b,a))},1);S("concat",3,!1,!1,function(a,b){return p(ia(arguments,1),function(b,d){return b+K(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(J(b,a))},1);S("id",4,!1,!1,function(a,b){var c=a.a,d=9==c.nodeType?c:c.ownerDocument,c=K(b,a).split(/\s+/),e=[];n(c,function(a){a=d.getElementById(a);var b;if(!(b=!a)){a:if(h(e))b=h(a)&&1==a.length?e.indexOf(a,0):-1;else{for(b=0;b<e.length;b++)if(b in e&&e[b]===a)break a;b=-1}b=0<=b}b||e.push(a)});e.sort(ka);var f=new B;n(e,function(a){C(f,a)});return f},1);S("lang",2,!1,!1,function(){return!1},1); -S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);S("local-name",3,!1,!0,function(a,b){var c=b?E(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?E(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0);S("normalize-space",3,!1,!0,function(a,b){return(b?K(b,a):x(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1); -S("not",2,!1,!1,function(a,b){return!L(b,a)},1);S("number",1,!1,!0,function(a,b){return b?J(b,a):+x(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(J(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?K(b,a):x(a.a)},0,1);S("string-length",1,!1,!0,function(a,b){return(b?K(b,a):x(a.a)).length},0,1); -S("substring",3,!1,!1,function(a,b,c,d){c=J(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?J(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=K(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=G(b.a(a)),d=0,e=H(c);e;e=H(c))d+=+x(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=K(b,a);c=K(c,a);var e=K(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function D(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Fa(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}D.prototype.a=function(a){return null===this.b||this.b==a.nodeType};D.prototype.f=function(){return this.h}; -D.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=I(this.c));return a};function T(a){m.call(this,3);this.c=a.substring(1,a.length-1)}l(T);T.prototype.a=function(){return this.c};T.prototype.toString=function(){return"Literal: "+this.c};function U(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.b=b?b.toLowerCase():c}U.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.j&&this.j!=a.localName.toLowerCase()?!1:"*"==this.b?!0:this.b==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};U.prototype.f=function(){return this.j};U.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.b?"":this.b+":")+this.j};function Ga(a){m.call(this,1);this.c=a}l(Ga);Ga.prototype.a=function(){return this.c};Ga.prototype.toString=function(){return"Number: "+this.c};function Ha(a,b){m.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.u||c.c!=Ia||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}l(Ha);function V(){m.call(this,4)}l(V);V.prototype.a=function(a){var b=new B;a=a.a;9==a.nodeType?C(b,a):C(b,a.ownerDocument);return b};V.prototype.toString=function(){return"Root Helper Expression"};function Ja(){m.call(this,4)}l(Ja);Ja.prototype.a=function(a){var b=new B;C(b,a.a);return b};Ja.prototype.toString=function(){return"Context Helper Expression"}; -function Ka(a){return"/"==a||"//"==a}Ha.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof B))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=G(b,e.c.a),g;if(e.g||e.c!=La)if(e.g||e.c!=Ma)for(g=H(f),b=e.a(new r(g));null!=(g=H(f));)g=e.a(new r(g)),b=va(b,g);else g=H(f),b=e.a(new r(g));else{for(g=H(f);(b=H(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new r(g))}}return b}; -Ha.prototype.toString=function(){var a;a="Path Expression:"+I(this.h);if(this.c.length){var b=p(this.c,function(a,b){return a+I(b)},"Steps:");a+=I(b)}return a};function Na(a,b){this.a=a;this.b=!!b} -function Ca(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=G(b),f=b.l,g,k=0;g=H(e);k++){var v=a.b?f-k:k+1;g=d.a(new r(g,v,f));if("number"==typeof g)v=v==g;else if("string"==typeof g||"boolean"==typeof g)v=!!g;else if(g instanceof B)v=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;g=v.f;var A=v.a;if(!A)throw Error("Next must be called at least once before remove.");var O=A.b,A=A.a;O?O.a=A:g.a=A;A?A.b=O:g.b=O;g.l--;v.a=null}}return b} -Na.prototype.toString=function(){return p(this.a,function(a,b){return a+I(b)},"Predicates:")};function W(a,b,c,d){m.call(this,4);this.c=a;this.o=b;this.h=c||new Na([]);this.u=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(this.f={name:b.name,s:b.s});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}l(W); -W.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.s?K(c.s,a):null,f=1);if(this.u)if(this.g||this.c!=Oa)if(a=G((new W(Pa,new D("node"))).a(a)),b=H(a))for(c=this.m(b,d,e,f);null!=(b=H(a));)c=va(c,this.m(b,d,e,f));else c=new B;else c=z(this.o,b,d,e),c=Ca(this.h,c,f);else c=this.m(a.a,d,e,f);return c};W.prototype.m=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=Ca(this.h,a,d)}; -W.prototype.toString=function(){var a;a="Step:"+I("Operator: "+(this.u?"//":"/"));this.c.j&&(a+=I("Axis: "+this.c));a+=I(this.o);if(this.h.a.length){var b=p(this.h.a,function(a,b){return a+I(b)},"Predicates:");a+=I(b)}return a};function Qa(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}Qa.prototype.toString=function(){return this.j};var Ra={};function X(a,b,c,d){if(Ra.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Qa(a,b,c,!!d);return Ra[a]=b} -X("ancestor",function(a,b){for(var c=new B,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);X("ancestor-or-self",function(a,b){var c=new B,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0);var Ia=X("attribute",function(a,b){var c=new B,d=a.f(),e=b.attributes;if(e)if(a instanceof D&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C(c,f);else(f=e.getNamedItem(d))&&C(c,f);return c},!1),Oa=X("child",function(a,b,c,d,e){return ta.call(null,a,b,h(c)?c:null,h(d)?d:null,e||new B)},!1,!0); -X("descendant",z,!1,!0);var Pa=X("descendant-or-self",function(a,b,c,d){var e=new B;y(b,c,d)&&a.a(b)&&C(e,b);return z(a,b,c,d,e)},!1,!0),La=X("following",function(a,b,c,d){var e=new B;do for(var f=b;f=f.nextSibling;)y(f,c,d)&&a.a(f)&&C(e,f),e=z(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);X("following-sibling",function(a,b){for(var c=new B,d=b;d=d.nextSibling;)a.a(d)&&C(c,d);return c},!1);X("namespace",function(){return new B},!1); -var Sa=X("parent",function(a,b){var c=new B;if(9==b.nodeType)return c;if(2==b.nodeType)return C(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&C(c,d);return c},!1),Ma=X("preceding",function(a,b,c,d){var e=new B,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var v=[];for(b=f[g];b=b.previousSibling;)v.unshift(b);for(var A=0,O=v.length;A<O;A++)b=v[A],y(b,c,d)&&a.a(b)&&C(e,b),e=z(a,b,c,d,e)}return e},!0,!0); -X("preceding-sibling",function(a,b){for(var c=new B,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Ta=X("self",function(a,b){var c=new B;a.a(b)&&C(c,b);return c},!1);function Ua(a){m.call(this,1);this.c=a;this.g=a.g;this.b=a.b}l(Ua);Ua.prototype.a=function(a){return-J(this.c,a)};Ua.prototype.toString=function(){return"Unary Expression: -"+I(this.c)};function Va(a){m.call(this,4);this.c=a;xa(this,q(this.c,function(a){return a.g}));ya(this,q(this.c,function(a){return a.b}))}l(Va);Va.prototype.a=function(a){var b=new B;n(this.c,function(c){c=c.a(a);if(!(c instanceof B))throw Error("Path expression must evaluate to NodeSet.");b=va(b,c)});return b};Va.prototype.toString=function(){return p(this.c,function(a,b){return a+I(b)},"Union Expression:")};function Wa(a,b){this.a=a;this.b=b}function Xa(a){for(var b,c=[];;){Y(a,"Missing right hand side of binary expression.");b=Ya(a);var d=u(a.a);if(!d)break;var e=(d=Ba[d]||null)&&d.w;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].w;)b=new M(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new M(c.pop(),c.pop(),b);return b}function Y(a,b){if(w(a.a))throw Error(b);}function Za(a,b){var c=u(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function $a(a){a=u(a.a);if(")"!=a)throw Error("Bad token: "+a);}function ab(a){a=u(a.a);if(2>a.length)throw Error("Unclosed literal string");return new T(a)} -function bb(a){var b,c=[],d;if(Ka(t(a.a))){b=u(a.a);d=t(a.a);if("/"==b&&(w(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new V;d=new V;Y(a,"Missing next location step.");b=cb(a,b);c.push(b)}else{a:{b=t(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":u(a.a);b=Xa(a);Y(a,'unclosed "("');Za(a,")");break;case '"':case "'":b=ab(a);break;default:if(isNaN(+b))if(!Fa(b)&&/(?![0-9])[\w]/.test(d)&&"("==t(a.a,1)){b=u(a.a);b= -Ea[b]||null;u(a.a);for(d=[];")"!=t(a.a);){Y(a,"Missing function argument list.");d.push(Xa(a));if(","!=t(a.a))break;u(a.a)}Y(a,"Unclosed function argument list.");$a(a);b=new R(b,d)}else{b=null;break a}else b=new Ga(+u(a.a))}"["==t(a.a)&&(d=new Na(db(a)),b=new Q(b,d))}if(b)if(Ka(t(a.a)))d=b;else return b;else b=cb(a,"/"),d=new Ja,c.push(b)}for(;Ka(t(a.a));)b=u(a.a),Y(a,"Missing next location step."),b=cb(a,b),c.push(b);return new Ha(d,c)} -function cb(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==t(a.a))return d=new W(Ta,new D("node")),u(a.a),d;if(".."==t(a.a))return d=new W(Sa,new D("node")),u(a.a),d;var f;if("@"==t(a.a))f=Ia,u(a.a),Y(a,"Missing attribute name");else if("::"==t(a.a,1)){if(!/(?![0-9])[\w]/.test(t(a.a).charAt(0)))throw Error("Bad token: "+u(a.a));c=u(a.a);f=Ra[c]||null;if(!f)throw Error("No axis with name: "+c);u(a.a);Y(a,"Missing node name")}else f=Oa;c=t(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -t(a.a,1)){if(!Fa(c))throw Error("Invalid node type: "+c);c=u(a.a);if(!Fa(c))throw Error("Invalid type name: "+c);Za(a,"(");Y(a,"Bad nodetype");e=t(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=ab(a);Y(a,"Bad nodetype");$a(a);c=new D(c,g)}else if(c=u(a.a),e=c.indexOf(":"),-1==e)c=new U(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new U(c,k)}else throw Error("Bad token: "+u(a.a));e=new Na(db(a),f.a);return d|| -new W(f,c,e,"//"==b)}function db(a){for(var b=[];"["==t(a.a);){u(a.a);Y(a,"Missing predicate expression.");var c=Xa(a);b.push(c);Y(a,"Unclosed predicate expression.");Za(a,"]")}return b}function Ya(a){if("-"==t(a.a))return u(a.a),new Ua(Ya(a));var b=bb(a);if("|"!=t(a.a))a=b;else{for(b=[b];"|"==u(a.a);)Y(a,"Missing next union location path."),b.push(bb(a));a.a.a--;a=new Va(b)}return a};function eb(a){switch(a.nodeType){case 1:return ga(fb,a);case 9:return eb(a.documentElement);case 11:case 10:case 6:case 12:return gb;default:return a.parentNode?eb(a.parentNode):gb}}function gb(){return null}function fb(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?fb(a.parentNode,b):null};function hb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=oa(a);if(w(c))throw Error("Invalid XPath expression.");b?"function"==ca(b)||(b=fa(b.lookupNamespaceURI,b)):b=function(){return null};var d=Xa(new Wa(c,b));if(!w(c))throw Error("Bad token: "+u(c));this.evaluate=function(a,b){var c=d.a(new r(a));return new Z(c,b)}} -function Z(a,b){if(0==b)if(a instanceof B)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof B))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof B?F(a):""+a;break;case 1:this.numberValue=a instanceof B?+F(a):+a;break;case 3:this.booleanValue=a instanceof B?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d= -G(a);c=[];for(var e=H(d);e;e=H(d))c.push(e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:this.singleNodeValue=E(a);break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||0>a?null:c[a]}}Z.ANY_TYPE=0; -Z.NUMBER_TYPE=1;Z.STRING_TYPE=2;Z.BOOLEAN_TYPE=3;Z.UNORDERED_NODE_ITERATOR_TYPE=4;Z.ORDERED_NODE_ITERATOR_TYPE=5;Z.UNORDERED_NODE_SNAPSHOT_TYPE=6;Z.ORDERED_NODE_SNAPSHOT_TYPE=7;Z.ANY_UNORDERED_NODE_TYPE=8;Z.FIRST_ORDERED_NODE_TYPE=9;function ib(a){this.lookupNamespaceURI=eb(a)} -ba("wgxpath.install",function(a,b){var c=a||aa,d=c.document;if(!d.evaluate||b)c.XPathResult=Z,d.evaluate=function(a,b,c,d){return(new hb(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new hb(a,b)},d.createNSResolver=function(a){return new ib(a)}});ba("_",function(a,b){function c(a,b){var c={clickable:a};b&&(c.message=b);return c}for(var d=a;d.parentNode;)d=d.parentNode;var e=d.elementFromPoint(b.x,b.y);if(e==a)return c(!0);d="("+b.x+", "+b.y+")";if(null==e)return c(!1,"Element is not clickable at point "+d);var f=e.outerHTML;if(e.hasChildNodes())var g=e.innerHTML,k=f.length-g.length-("</"+e.tagName+">").length,f=f.substring(0,k)+"..."+f.substring(k+g.length);for(e=e.parentNode;e;){if(e==a)return c(!0,"Element's descendant would receive the click. Consider clicking the descendant instead. Descendant: "+ -f);e=e.parentNode}return c(!1,"Element is not clickable at point "+d+". Other element would receive the click: "+f)});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/is_enabled.js b/src/ghostdriver/third_party/webdriver-atoms/is_enabled.js deleted file mode 100644 index ca07c7cde3..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/is_enabled.js +++ /dev/null @@ -1,90 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ga(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",t=e[h]||"",A=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var ea=A.exec(k)||["","",""],fa=O.exec(t)||["","",""];if(0==ea[0].length&&0==fa[0].length)break;c=na(0==ea[1].length?0:parseInt(ea[1],10),0==fa[1].length?0:parseInt(fa[1],10))||na(0==ea[2].length,0==fa[2].length)||na(ea[2],fa[2])}while(0==c)}return c} -function na(a,b){return a<b?-1:a>b?1:0};function oa(a,b){if(l(a))return l(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function n(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function pa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d} -function qa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function p(a,b,c){var d=c;n(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ra(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function sa(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]} -function ta(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ua(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function va(a,b){this.code=a;this.a=q[a]||wa;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(va,Error);var wa="unknown error",q={15:"element not selectable",11:"element not visible"};q[31]=wa;q[30]=wa;q[24]="invalid cookie domain";q[29]="invalid element coordinates";q[12]="invalid element state"; -q[32]="invalid selector";q[51]="invalid selector";q[52]="invalid selector";q[17]="javascript error";q[405]="unsupported operation";q[34]="move target out of bounds";q[27]="no such alert";q[7]="no such element";q[8]="no such frame";q[23]="no such window";q[28]="script timeout";q[33]="session not created";q[10]="stale element reference";q[21]="timeout";q[25]="unable to set cookie";q[26]="unexpected alert open";q[13]=wa;q[9]="unknown command";va.prototype.toString=function(){return this.name+": "+this.message};var r;a:{var xa=g.navigator;if(xa){var ya=xa.userAgent;if(ya){r=ya;break a}}r=""}function u(a){return-1!=r.indexOf(a)};function za(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Aa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function v(a,b){return null!==a&&b in a}function Ba(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ca(){return u("Opera")||u("OPR")}function Da(){return(u("Chrome")||u("CriOS"))&&!Ca()&&!u("Edge")};function Ea(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Fa=Ca(),w=u("Trident")||u("MSIE"),Ga=u("Edge"),x=u("Gecko")&&!(-1!=r.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ha=-1!=r.toLowerCase().indexOf("webkit")&&!u("Edge"),Ia=u("Macintosh"),Ja=u("Windows");function Ka(){var a=r;if(x)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ga)return/Edge\/([\d\.]+)/.exec(a);if(w)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ha)return/WebKit\/(\S+)/.exec(a)}function La(){var a=g.document;return a?a.documentMode:void 0} -var Ma=function(){if(Fa&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ka())&&(a=b?b[1]:"");return w&&(b=La(),null!=b&&b>parseFloat(a))?String(b):a}(),Na={};function Oa(a){return Na[a]||(Na[a]=0<=ma(Ma,a))}var Pa=g.document,Qa=Pa&&w?La()||("CSS1Compat"==Pa.compatMode?parseInt(Ma,10):5):void 0;!x&&!w||w&&9<=Number(Qa)||x&&Oa("1.9.1");w&&Oa("9");function Ra(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function Sa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Ta(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(w&&!(9<=Number(Qa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ua(a,b):!c&&Sa(e,b)?-1*Va(a,b):!d&&Sa(f,a)?Va(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Va(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ua(d,a)}function Ua(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function Wa(a,b){for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null};var Xa=u("Firefox"),Ya=Ea()||u("iPod"),Za=u("iPad"),y=u("Android")&&!(Da()||u("Firefox")||Ca()||u("Silk")),$a=Da(),ab=u("Safari")&&!(Da()||u("Coast")||Ca()||u("Edge")||u("Silk")||u("Android"))&&!(Ea()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function z(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var B=w&&!(9<=Number(Qa)),bb=w&&!(8<=Number(Qa));function cb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function db(a,b){var c=bb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new cb(b,a,b.nodeName,c)};function eb(a){this.b=a;this.a=0}function fb(a){a=a.match(gb);for(var b=0;b<a.length;b++)hb.test(a[b])&&a.splice(b,1);return new eb(a)}var gb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),hb=/^\s/;function C(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function ib(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(B&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),B&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}bb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function jb(a,b,c,d,e){return(B?kb:lb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function kb(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=mb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}nb(a,b,c,d,e);return e} -function lb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!w?(b=b.getElementsByName(d),n(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?nb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),n(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function ob(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=mb(a);if("*"!=h&&(f=pa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=pa(f,function(a){return F(a,c,d)}));n(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return pb(a,b,c,d,e)}function pb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function nb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),nb(a,b,c,d,e)}function mb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function qb(a){this.node=a;this.a=this.b=null}function rb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof cb&&k instanceof cb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Ta(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new qb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new qb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function sb(a){return(a=a.a)?a.node:null}function tb(a){return(a=sb(a))?E(a):""}function K(a,b){return new ub(a,!!b)}function ub(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function vb(a,b){a.i=b}function wb(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+tb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?tb(c):""+c}function xb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function yb(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==zb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(yb,M); -function Ab(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}yb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};yb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function Bb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}Bb.prototype.toString=function(){return this.a};var Cb={}; -function R(a,b,c,d){if(Cb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Bb(a,b,c,d);return Cb[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return Ab(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return Ab(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return Ab(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return Ab(function(a,b){return a>=b},a,b,c)});var zb=R("=",3,2,function(a,b,c){return Ab(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return Ab(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return xb(a,c)&&xb(b,c)});R("or",1,2,function(a,b,c){return xb(a,c)||xb(b,c)});function Db(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Db,M);Db.prototype.a=function(a){a=this.c.a(a);return Eb(this.j,a)};Db.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Fb(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&n(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;vb(this,a.i||ra(b,function(a){return a.i}));wb(this,a.J&&!b.length||a.I&&!!b.length||ra(b,function(a){return a.b}))} -m(Fb,M);Fb.prototype.a=function(a){return this.j.v.apply(null,ta(a,this.c))};Fb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=p(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Gb(a,b,c,d,e,f,h,k,t){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!t}Gb.prototype.toString=function(){return this.o};var Hb={}; -function S(a,b,c,d,e,f,h,k){if(Hb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Hb[a]=new Gb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return xb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return p(ua(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1);S("id",4,!1,!1,function(a,b){function c(a){if(B){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return sa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];n(d,function(a){a=c(a);!a||0<=oa(f,a)||f.push(a)});f.sort(Ta);var h=new G;n(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?sb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?sb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!xb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ib(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Jb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Jb,M);Jb.prototype.a=function(){return this.c};Jb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Kb(a){M.call(this,1);this.c=a}m(Kb,M);Kb.prototype.a=function(){return this.c};Kb.prototype.toString=function(){return"Number: "+this.c};function Lb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Mb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Lb,M);function Nb(){M.call(this,4)}m(Nb,M);Nb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Nb.prototype.toString=function(){return"Root Helper Expression"};function Ob(){M.call(this,4)}m(Ob,M);Ob.prototype.a=function(a){var b=new G;I(b,a.a);return b};Ob.prototype.toString=function(){return"Context Helper Expression"}; -function Pb(a){return"/"==a||"//"==a}Lb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Qb)if(e.i||e.c!=Rb)for(h=L(f),b=e.a(new z(h));null!=(h=L(f));)h=e.a(new z(h)),b=rb(b,h);else h=L(f),b=e.a(new z(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new z(h))}}return b}; -Lb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=p(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Sb(a,b){this.a=a;this.b=!!b} -function Eb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var t=a.b?f-k:k+1;h=d.a(new z(h,t,f));if("number"==typeof h)t=t==h;else if("string"==typeof h||"boolean"==typeof h)t=!!h;else if(h instanceof G)t=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!t){t=e;h=t.h;var A=t.a;if(!A)throw Error("Next must be called at least once before remove.");var O=A.b,A=A.a;O?O.a=A:h.a=A;A?A.b=O:h.b=O;h.s--;t.a=null}}return b} -Sb.prototype.toString=function(){return p(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Sb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=B?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Tb)if(a=K((new T(Ub,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=rb(c,this.v(b,d,e,f));else c=new G;else c=jb(this.w,b,d,e),c=Eb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Eb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=p(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Vb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Vb.prototype.toString=function(){return this.o};var Wb={};function U(a,b,c,d){if(Wb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Vb(a,b,c,!!d);return Wb[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Mb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&B)return I(c,new cb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)B?f.nodeValue&&I(c,db(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(B?f.nodeValue&&I(c,db(b,f)):I(c,f));return c},!1),Tb=U("child",function(a,b,c,d,e){return(B?ob:pb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",jb,!1,!0); -var Ub=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return jb(a,b,c,d,e)},!1,!0),Qb=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=jb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Xb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Rb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var t=[];for(b=f[h];b=b.previousSibling;)t.unshift(b);for(var A=0,O=t.length;A<O;A++)b=t[A],F(b,c,d)&&a.a(b)&&I(e,b),e=jb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Yb=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function Zb(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m(Zb,M);Zb.prototype.a=function(a){return-P(this.c,a)};Zb.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function $b(a){M.call(this,4);this.c=a;vb(this,ra(this.c,function(a){return a.i}));wb(this,ra(this.c,function(a){return a.b}))}m($b,M);$b.prototype.a=function(a){var b=new G;n(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=rb(b,c)});return b};$b.prototype.toString=function(){return p(this.c,function(a,b){return a+N(b)},"Union Expression:")};function ac(a,b){this.a=a;this.b=b}function bc(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=cc(a);var d=D(a.a);if(!d)break;var e=(d=Cb[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new yb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new yb(c.pop(),c.pop(),b);return b}function V(a,b){if(ib(a.a))throw Error(b);}function dc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function ec(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function fc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Jb(a)} -function gc(a){var b,c=[],d;if(Pb(C(a.a))){b=D(a.a);d=C(a.a);if("/"==b&&(ib(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Nb;d=new Nb;V(a,"Missing next location step.");b=hc(a,b);c.push(b)}else{a:{b=C(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=bc(a);V(a,'unclosed "("');dc(a,")");break;case '"':case "'":b=fc(a);break;default:if(isNaN(+b))if(!Ib(b)&&/(?![0-9])[\w]/.test(d)&&"("==C(a.a,1)){b=D(a.a); -b=Hb[b]||null;D(a.a);for(d=[];")"!=C(a.a);){V(a,"Missing function argument list.");d.push(bc(a));if(","!=C(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");ec(a);b=new Fb(b,d)}else{b=null;break a}else b=new Kb(+D(a.a))}"["==C(a.a)&&(d=new Sb(ic(a)),b=new Db(b,d))}if(b)if(Pb(C(a.a)))d=b;else return b;else b=hc(a,"/"),d=new Ob,c.push(b)}for(;Pb(C(a.a));)b=D(a.a),V(a,"Missing next location step."),b=hc(a,b),c.push(b);return new Lb(d,c)} -function hc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==C(a.a))return d=new T(Yb,new J("node")),D(a.a),d;if(".."==C(a.a))return d=new T(Xb,new J("node")),D(a.a),d;var f;if("@"==C(a.a))f=Mb,D(a.a),V(a,"Missing attribute name");else if("::"==C(a.a,1)){if(!/(?![0-9])[\w]/.test(C(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Wb[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Tb;c=C(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -C(a.a,1)){if(!Ib(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Ib(c))throw Error("Invalid type name: "+c);dc(a,"(");V(a,"Bad nodetype");e=C(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=fc(a);V(a,"Bad nodetype");ec(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Sb(ic(a),f.a);return d|| -new T(f,c,e,"//"==b)}function ic(a){for(var b=[];"["==C(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=bc(a);b.push(c);V(a,"Unclosed predicate expression.");dc(a,"]")}return b}function cc(a){if("-"==C(a.a))return D(a.a),new Zb(cc(a));var b=gc(a);if("|"!=C(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(gc(a));a.a.a--;a=new $b(b)}return a};function jc(a){switch(a.nodeType){case 1:return ja(kc,a);case 9:return jc(a.documentElement);case 11:case 10:case 6:case 12:return lc;default:return a.parentNode?jc(a.parentNode):lc}}function lc(){return null}function kc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?kc(a.parentNode,b):null};function mc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=fb(a);if(ib(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=bc(new ac(c,b));if(!ib(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new z(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?tb(a):""+a;break;case 1:this.numberValue=a instanceof G?+tb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof cb?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=sb(a);this.singleNodeValue=d instanceof cb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function nc(a){this.lookupNamespaceURI=jc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new mc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new mc(a,b)},d.createNSResolver=function(a){return new nc(a)}});function oc(a){return(a=a.exec(r))?a[1]:""}var pc=function(){if(Xa)return oc(/Firefox\/([0-9.]+)/);if(w||Ga||Fa)return Ma;if($a)return oc(/Chrome\/([0-9.]+)/);if(ab&&!(Ea()||u("iPad")||u("iPod")))return oc(/Version\/([0-9.]+)/);if(Ya||Za){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(r))return a[1]+"."+a[2]}else if(y)return(a=oc(/Android\s+([0-9.]+)/))?a:oc(/Version\/([0-9.]+)/);return""}();var qc,rc;function sc(a){return tc?qc(a):w?0<=ma(Qa,a):Oa(a)}function uc(a){tc?rc(a):y?ma(vc,a):ma(pc,a)} -var tc=function(){if(!x)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;qc=function(a){return 0<=c.compare(d,""+a)};rc=function(a){c.compare(e,""+a)};return!0}(),wc;if(y){var xc=/Android\s+([0-9\.]+)/.exec(r);wc=xc?xc[1]:"0"}else wc="0";var vc=wc;y&&uc(2.3); -y&&uc(4);ab&&uc(6);function yc(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}var zc="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" "); -function Ac(a){var b=a.tagName.toUpperCase();return 0<=oa(zc,b)?a.disabled?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?Ac(a.parentNode):!Wa(a,function(a){var b=a.parentNode;if(b&&yc(b,"FIELDSET")&&b.disabled){if(!yc(a,"LEGEND"))return!0;for(;a=void 0!==a.previousElementSibling?a.previousElementSibling:Ra(a.previousSibling);)if(yc(a,"LEGEND"))return!0}return!1}):!0};Ha||tc&&uc(3.6);w&&sc(10);y&&uc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=Bc(a),Cc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function Bc(a){Cc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function Cc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=Bc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var Dc={};function Z(a,b,c){da(a)&&(a=x?a.f:a.g);a=new Ec(a);!b||b in Dc&&!c||(Dc[b]={key:a,shift:!1},c&&(Dc[c]={key:a,shift:!0}));return a}function Ec(a){this.code=a}Z(8);Z(9);Z(13);var Fc=Z(16),Gc=Z(17),Hc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Ic=Z(Ja?{f:91,g:91}:Ia?{f:224,g:91}:{f:0,g:91});Z(Ja?{f:92,g:92}:Ia?{f:224,g:93}:{f:0,g:92});Z(Ja?{f:93,g:93}:Ia?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Jc=new X;Y(Jc,1,Fc);Y(Jc,2,Gc);Y(Jc,4,Hc);Y(Jc,8,Ic);(function(a){var b=new X;n(Bc(a),function(c){Y(b,a.get(c).code,c)});return b})(Jc);x&&sc(12);function Kc(){} -function Lc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Lc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Mc(d,c),c.push(":"),Lc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Mc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Nc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Oc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Mc(a,b){b.push('"',a.replace(Oc,function(a){var b=Nc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Nc[a]=b);return b}),'"')};Ha||x&&sc(3.5)||w&&sc(8);function Pc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return qa(a,Pc);case "object":if(v(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Qc(a);return b}if(v(a,"document"))return b={},b.WINDOW=Qc(a),b;if(ca(a))return qa(a,Pc);a=za(a,function(a,b){return"number"==typeof b||l(b)});return Aa(a,Pc);default:return null}} -function Rc(a,b){return"array"==ba(a)?qa(a,function(a){return Rc(a,b)}):da(a)?"function"==typeof a?a:v(a,"ELEMENT")?Sc(a.ELEMENT,b):v(a,"WINDOW")?Sc(a.WINDOW,b):Aa(a,function(a){return Rc(a,b)}):a}function Tc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b}function Qc(a){var b=Tc(a.ownerDocument),c=Ba(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function Sc(a,b){a=decodeURIComponent(a);var c=b||document,d=Tc(c);if(!v(d,a))throw new va(10,"Element does not exist in cache");var e=d[a];if(v(e,"setInterval")){if(e.closed)throw delete d[a],new va(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new va(10,"Element is no longer attached to the DOM");};aa("_",function(a,b){var c=[a],d=Ac,e;try{var f;b?f=Sc(b.WINDOW):f=window;var h=Rc(c,f.document),k=d.apply(null,h);e={status:0,value:Pc(k)}}catch(t){e={status:v(t,"code")?t.code:13,value:{message:t.message}}}c=[];Lc(new Kc,e,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/is_file_input.js b/src/ghostdriver/third_party/webdriver-atoms/is_file_input.js deleted file mode 100644 index 5df5381634..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/is_file_input.js +++ /dev/null @@ -1,90 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function ha(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:ha;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var n=window;var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",C=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var fa=C.exec(k)||["","",""],ga=O.exec(v)||["","",""];if(0==fa[0].length&&0==ga[0].length)break;c=na(0==fa[1].length?0:parseInt(fa[1],10),0==ga[1].length?0:parseInt(ga[1],10))||na(0==fa[2].length,0==ga[2].length)||na(fa[2],ga[2])}while(0==c)}return c} -function na(a,b){return a<b?-1:a>b?1:0};function p(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function oa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function pa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function q(a,b,c){var d=c;p(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function qa(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ra(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]}function sa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ta(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function ua(a,b){this.code=a;this.a=r[a]||va;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(ua,Error);var va="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=va;r[30]=va;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=va;r[9]="unknown command";ua.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var wa=g.navigator;if(wa){var xa=wa.userAgent;if(xa){t=xa;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function ya(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function za(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function Aa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ba(){return u("Opera")||u("OPR")}function Ca(){return(u("Chrome")||u("CriOS"))&&!Ba()&&!u("Edge")};function Da(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Ea=Ba(),x=u("Trident")||u("MSIE"),Fa=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Ga=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ha=u("Macintosh"),Ia=u("Windows");function Ja(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Fa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ga)return/WebKit\/(\S+)/.exec(a)}function Ka(){var a=g.document;return a?a.documentMode:void 0} -var La=function(){if(Ea&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ja())&&(a=b?b[1]:"");return x&&(b=Ka(),null!=b&&b>parseFloat(a))?String(b):a}(),Ma={};function Na(a){return Ma[a]||(Ma[a]=0<=ma(La,a))}var Oa=g.document,Pa=Oa&&x?Ka()||("CSS1Compat"==Oa.compatMode?parseInt(La,10):5):void 0;!y&&!x||x&&9<=Number(Pa)||y&&Na("1.9.1");x&&Na("9");function Qa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Ra(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(Pa))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Sa(a,b):!c&&Qa(e,b)?-1*Ta(a,b):!d&&Qa(f,a)?Ta(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Ta(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Sa(d,a)}function Sa(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};var Ua=u("Firefox"),Va=Da()||u("iPod"),Wa=u("iPad"),z=u("Android")&&!(Ca()||u("Firefox")||Ba()||u("Silk")),Xa=Ca(),Ya=u("Safari")&&!(Ca()||u("Coast")||Ba()||u("Edge")||u("Silk")||u("Android"))&&!(Da()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Za(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(Pa)),$a=x&&!(8<=Number(Pa));function ab(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function bb(a,b){var c=$a&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new ab(b,a,b.nodeName,c)};function cb(a){this.b=a;this.a=0}function db(a){a=a.match(eb);for(var b=0;b<a.length;b++)fb.test(a[b])&&a.splice(b,1);return new cb(a)}var eb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),fb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function gb(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}$a&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function hb(a,b,c,d,e){return(A?ib:jb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function ib(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=kb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}lb(a,b,c,d,e);return e} -function jb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),p(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),p(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?lb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),p(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function mb(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=kb(a);if("*"!=h&&(f=oa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=oa(f,function(a){return F(a,c,d)}));p(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return nb(a,b,c,d,e)}function nb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function lb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),lb(a,b,c,d,e)}function kb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function ob(a){this.node=a;this.a=this.b=null}function pb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof ab&&k instanceof ab&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Ra(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new ob(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new ob(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function qb(a){return(a=a.a)?a.node:null}function rb(a){return(a=qb(a))?E(a):""}function K(a,b){return new sb(a,!!b)}function sb(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function tb(a,b){a.i=b}function ub(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+rb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?rb(c):""+c}function vb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function wb(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==xb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(wb,M); -function yb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}wb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};wb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function zb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}zb.prototype.toString=function(){return this.a};var Ab={}; -function R(a,b,c,d){if(Ab.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new zb(a,b,c,d);return Ab[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return yb(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return yb(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return yb(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return yb(function(a,b){return a>=b},a,b,c)});var xb=R("=",3,2,function(a,b,c){return yb(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return yb(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return vb(a,c)&&vb(b,c)});R("or",1,2,function(a,b,c){return vb(a,c)||vb(b,c)});function Bb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Bb,M);Bb.prototype.a=function(a){a=this.c.a(a);return Cb(this.j,a)};Bb.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Db(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&p(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;tb(this,a.i||qa(b,function(a){return a.i}));ub(this,a.J&&!b.length||a.I&&!!b.length||qa(b,function(a){return a.b}))} -m(Db,M);Db.prototype.a=function(a){return this.j.v.apply(null,sa(a,this.c))};Db.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=q(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Eb(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Eb.prototype.toString=function(){return this.o};var Fb={}; -function S(a,b,c,d,e,f,h,k){if(Fb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Fb[a]=new Eb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return vb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return q(ta(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1); -S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ra(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];p(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(l(f))b=l(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Ra);var h=new G;p(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?qb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!vb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Gb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Hb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Hb,M);Hb.prototype.a=function(){return this.c};Hb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Ib(a){M.call(this,1);this.c=a}m(Ib,M);Ib.prototype.a=function(){return this.c};Ib.prototype.toString=function(){return"Number: "+this.c};function Jb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Kb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Jb,M);function Lb(){M.call(this,4)}m(Lb,M);Lb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Lb.prototype.toString=function(){return"Root Helper Expression"};function Mb(){M.call(this,4)}m(Mb,M);Mb.prototype.a=function(a){var b=new G;I(b,a.a);return b};Mb.prototype.toString=function(){return"Context Helper Expression"}; -function Nb(a){return"/"==a||"//"==a}Jb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Ob)if(e.i||e.c!=Pb)for(h=L(f),b=e.a(new Za(h));null!=(h=L(f));)h=e.a(new Za(h)),b=pb(b,h);else h=L(f),b=e.a(new Za(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new Za(h))}}return b}; -Jb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=q(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Qb(a,b){this.a=a;this.b=!!b} -function Cb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new Za(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var C=v.a;if(!C)throw Error("Next must be called at least once before remove.");var O=C.b,C=C.a;O?O.a=C:h.a=C;C?C.b=O:h.b=O;h.s--;v.a=null}}return b} -Qb.prototype.toString=function(){return q(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Qb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Rb)if(a=K((new T(Sb,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=pb(c,this.v(b,d,e,f));else c=new G;else c=hb(this.w,b,d,e),c=Cb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Cb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=q(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Tb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Tb.prototype.toString=function(){return this.o};var Ub={};function U(a,b,c,d){if(Ub.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Tb(a,b,c,!!d);return Ub[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Kb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new ab(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,bb(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,bb(b,f)):I(c,f));return c},!1),Rb=U("child",function(a,b,c,d,e){return(A?mb:nb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",hb,!1,!0); -var Sb=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return hb(a,b,c,d,e)},!1,!0),Ob=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=hb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Vb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Pb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var C=0,O=v.length;C<O;C++)b=v[C],F(b,c,d)&&a.a(b)&&I(e,b),e=hb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Wb=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function Xb(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m(Xb,M);Xb.prototype.a=function(a){return-P(this.c,a)};Xb.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function Yb(a){M.call(this,4);this.c=a;tb(this,qa(this.c,function(a){return a.i}));ub(this,qa(this.c,function(a){return a.b}))}m(Yb,M);Yb.prototype.a=function(a){var b=new G;p(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=pb(b,c)});return b};Yb.prototype.toString=function(){return q(this.c,function(a,b){return a+N(b)},"Union Expression:")};function Zb(a,b){this.a=a;this.b=b}function $b(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=ac(a);var d=D(a.a);if(!d)break;var e=(d=Ab[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new wb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new wb(c.pop(),c.pop(),b);return b}function V(a,b){if(gb(a.a))throw Error(b);}function bc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function cc(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function dc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Hb(a)} -function ec(a){var b,c=[],d;if(Nb(B(a.a))){b=D(a.a);d=B(a.a);if("/"==b&&(gb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Lb;d=new Lb;V(a,"Missing next location step.");b=fc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=$b(a);V(a,'unclosed "("');bc(a,")");break;case '"':case "'":b=dc(a);break;default:if(isNaN(+b))if(!Gb(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=D(a.a); -b=Fb[b]||null;D(a.a);for(d=[];")"!=B(a.a);){V(a,"Missing function argument list.");d.push($b(a));if(","!=B(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");cc(a);b=new Db(b,d)}else{b=null;break a}else b=new Ib(+D(a.a))}"["==B(a.a)&&(d=new Qb(gc(a)),b=new Bb(b,d))}if(b)if(Nb(B(a.a)))d=b;else return b;else b=fc(a,"/"),d=new Mb,c.push(b)}for(;Nb(B(a.a));)b=D(a.a),V(a,"Missing next location step."),b=fc(a,b),c.push(b);return new Jb(d,c)} -function fc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new T(Wb,new J("node")),D(a.a),d;if(".."==B(a.a))return d=new T(Vb,new J("node")),D(a.a),d;var f;if("@"==B(a.a))f=Kb,D(a.a),V(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Ub[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Rb;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!Gb(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Gb(c))throw Error("Invalid type name: "+c);bc(a,"(");V(a,"Bad nodetype");e=B(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=dc(a);V(a,"Bad nodetype");cc(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Qb(gc(a),f.a);return d|| -new T(f,c,e,"//"==b)}function gc(a){for(var b=[];"["==B(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=$b(a);b.push(c);V(a,"Unclosed predicate expression.");bc(a,"]")}return b}function ac(a){if("-"==B(a.a))return D(a.a),new Xb(ac(a));var b=ec(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(ec(a));a.a.a--;a=new Yb(b)}return a};function hc(a){switch(a.nodeType){case 1:return ja(ic,a);case 9:return hc(a.documentElement);case 11:case 10:case 6:case 12:return jc;default:return a.parentNode?hc(a.parentNode):jc}}function jc(){return null}function ic(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?ic(a.parentNode,b):null};function kc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=db(a);if(gb(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=$b(new Zb(c,b));if(!gb(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new Za(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?rb(a):""+a;break;case 1:this.numberValue=a instanceof G?+rb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof ab?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=qb(a);this.singleNodeValue=d instanceof ab?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function lc(a){this.lookupNamespaceURI=hc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new kc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new kc(a,b)},d.createNSResolver=function(a){return new lc(a)}});function mc(a){return(a=a.exec(t))?a[1]:""}var nc=function(){if(Ua)return mc(/Firefox\/([0-9.]+)/);if(x||Fa||Ea)return La;if(Xa)return mc(/Chrome\/([0-9.]+)/);if(Ya&&!(Da()||u("iPad")||u("iPod")))return mc(/Version\/([0-9.]+)/);if(Va||Wa){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(z)return(a=mc(/Android\s+([0-9.]+)/))?a:mc(/Version\/([0-9.]+)/);return""}();var oc,pc;function qc(a){return rc?oc(a):x?0<=ma(Pa,a):Na(a)}function sc(a){rc?pc(a):z?ma(tc,a):ma(nc,a)} -var rc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;oc=function(a){return 0<=c.compare(d,""+a)};pc=function(a){c.compare(e,""+a)};return!0}(),uc;if(z){var vc=/Android\s+([0-9\.]+)/.exec(t);uc=vc?vc[1]:"0"}else uc="0";var tc=uc;z&&sc(2.3); -z&&sc(4);Ya&&sc(6);Ga||rc&&sc(3.6);x&&qc(10);z&&sc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=wc(a),xc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function wc(a){xc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function xc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=wc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var yc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new zc(a);!b||b in yc&&!c||(yc[b]={key:a,shift:!1},c&&(yc[c]={key:a,shift:!0}));return a}function zc(a){this.code=a}Z(8);Z(9);Z(13);var Ac=Z(16),Bc=Z(17),Cc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Dc=Z(Ia?{f:91,g:91}:Ha?{f:224,g:91}:{f:0,g:91});Z(Ia?{f:92,g:92}:Ha?{f:224,g:93}:{f:0,g:92});Z(Ia?{f:93,g:93}:Ha?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Ec=new X;Y(Ec,1,Ac);Y(Ec,2,Bc);Y(Ec,4,Cc);Y(Ec,8,Dc);(function(a){var b=new X;p(wc(a),function(c){Y(b,a.get(c).code,c)});return b})(Ec);y&&qc(12);function Fc(){} -function Gc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Gc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Hc(d,c),c.push(":"),Gc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Hc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Ic={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Jc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Hc(a,b){b.push('"',a.replace(Jc,function(a){var b=Ic[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Ic[a]=b);return b}),'"')};Ga||y&&qc(3.5)||x&&qc(8);function Kc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return pa(a,Kc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Lc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Lc(a),b;if(ca(a))return pa(a,Kc);a=ya(a,function(a,b){return"number"==typeof b||l(b)});return za(a,Kc);default:return null}} -function Mc(a,b){return"array"==ba(a)?pa(a,function(a){return Mc(a,b)}):da(a)?"function"==typeof a?a:w(a,"ELEMENT")?Nc(a.ELEMENT,b):w(a,"WINDOW")?Nc(a.WINDOW,b):za(a,function(a){return Mc(a,b)}):a} -function Oc(a,b){var c;try{a:{var d=a;if(l(d))try{a=new n.Function(d);break a}catch(h){if(x&&n.execScript){n.execScript(";");a=new n.Function(d);break a}throw h;}a=n==window?d:new n.Function("return ("+d+").apply(null,arguments);")}var e=Mc(b,n.document),f=a.apply(null,e);c={status:0,value:Kc(f)}}catch(h){c={status:w(h,"code")?h.code:13,value:{message:h.message}}}d=[];Gc(new Fc,c,d);return d.join("")}function Pc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b} -function Lc(a){var b=Pc(a.ownerDocument),c=Aa(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c}function Nc(a,b){a=decodeURIComponent(a);var c=b||document,d=Pc(c);if(!w(d,a))throw new ua(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new ua(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new ua(10,"Element is no longer attached to the DOM");};aa("_",function(a){return Oc(function(a){return"input"===a.tagName.toLowerCase()?"file"===a.type.toLowerCase():!1},[a])});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/is_selected.js b/src/ghostdriver/third_party/webdriver-atoms/is_selected.js deleted file mode 100644 index e346468888..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/is_selected.js +++ /dev/null @@ -1,91 +0,0 @@ -function(){return function(){var g=this;function aa(a,b){var c=a.split("."),d=g;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function l(a){return"string"==typeof a}function da(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ea(a,b,c){return a.call.apply(a.bind,arguments)} -function fa(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ia(a,b,c){ia=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa;return ia.apply(null,arguments)} -function ja(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ka=Date.now||function(){return+new Date};function m(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.K=function(a,c,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[c].apply(a,h)}};var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",v=e[h]||"",B=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var ga=B.exec(k)||["","",""],ha=O.exec(v)||["","",""];if(0==ga[0].length&&0==ha[0].length)break;c=na(0==ga[1].length?0:parseInt(ga[1],10),0==ha[1].length?0:parseInt(ha[1],10))||na(0==ga[2].length,0==ha[2].length)||na(ga[2],ha[2])}while(0==c)}return c} -function na(a,b){return a<b?-1:a>b?1:0};function n(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function oa(a,b){for(var c=a.length,d=[],e=0,f=l(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var k=f[h];b.call(void 0,k,h,a)&&(d[e++]=k)}return d}function pa(a,b){for(var c=a.length,d=Array(c),e=l(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function p(a,b,c){var d=c;n(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function qa(a,b){for(var c=a.length,d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ra(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]}function sa(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ta(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function q(a,b){this.code=a;this.a=r[a]||ua;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}m(q,Error);var ua="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=ua;r[30]=ua;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=ua;r[9]="unknown command";q.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var va=g.navigator;if(va){var wa=va.userAgent;if(wa){t=wa;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function xa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function ya(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function w(a,b){return null!==a&&b in a}function za(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Aa(){return u("Opera")||u("OPR")}function Ba(){return(u("Chrome")||u("CriOS"))&&!Aa()&&!u("Edge")};function Ca(){return u("iPhone")&&!u("iPod")&&!u("iPad")};var Da=Aa(),x=u("Trident")||u("MSIE"),Ea=u("Edge"),y=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),Fa=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),Ga=u("Macintosh"),Ha=u("Windows");function Ia(){var a=t;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Ea)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Fa)return/WebKit\/(\S+)/.exec(a)}function Ja(){var a=g.document;return a?a.documentMode:void 0} -var Ka=function(){if(Da&&g.opera){var a;var b=g.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ia())&&(a=b?b[1]:"");return x&&(b=Ja(),null!=b&&b>parseFloat(a))?String(b):a}(),La={};function Ma(a){return La[a]||(La[a]=0<=ma(Ka,a))}var Na=g.document,z=Na&&x?Ja()||("CSS1Compat"==Na.compatMode?parseInt(Ka,10):5):void 0;!y&&!x||x&&9<=Number(z)||y&&Ma("1.9.1");x&&Ma("9");function Oa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function Pa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(z))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Qa(a,b):!c&&Oa(e,b)?-1*Ra(a,b):!d&&Oa(f,a)?Ra(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? -a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,d)}function Ra(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Qa(d,a)}function Qa(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}var Sa={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Ta={IMG:" ",BR:"\n"}; -function Ua(a,b,c){if(!(a.nodeName in Sa))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in Ta)b.push(Ta[a.nodeName]);else for(a=a.firstChild;a;)Ua(a,b,c),a=a.nextSibling};var Va=u("Firefox"),Wa=Ca()||u("iPod"),Xa=u("iPad"),Ya=u("Android")&&!(Ba()||u("Firefox")||Aa()||u("Silk")),Za=Ba(),$a=u("Safari")&&!(Ba()||u("Coast")||Aa()||u("Edge")||u("Silk")||u("Android"))&&!(Ca()||u("iPad")||u("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function ab(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var A=x&&!(9<=Number(z)),bb=x&&!(8<=Number(z));function cb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function db(a,b){var c=bb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new cb(b,a,b.nodeName,c)};function eb(a){this.b=a;this.a=0}function fb(a){a=a.match(gb);for(var b=0;b<a.length;b++)hb.test(a[b])&&a.splice(b,1);return new eb(a)}var gb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),hb=/^\s/;function C(a,b){return a.b[a.a+(b||0)]}function D(a){return a.b[a.a++]}function ib(a){return a.b.length<=a.a};function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(A&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),A&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}bb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function jb(a,b,c,d,e){return(A?kb:lb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)} -function kb(a,b,c,d,e){if(a instanceof H||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=mb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var h=[],k=0;b=f[k++];)F(b,c,d)&&h.push(b);f=h}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||I(e,b);return e}nb(a,b,c,d,e);return e} -function lb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),n(b,function(b){a.a(b)&&I(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(b){b.className==d&&a.a(b)&&I(e,b)})):a instanceof J?nb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),n(b,function(a){F(a,c,d)&&I(e,a)}));return e} -function ob(a,b,c,d,e){var f;if((a instanceof H||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=mb(a);if("*"!=h&&(f=oa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=oa(f,function(a){return F(a,c,d)}));n(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||I(e,a)});return e}return pb(a,b,c,d,e)}function pb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b);return e} -function nb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&I(e,b),nb(a,b,c,d,e)}function mb(a){if(a instanceof J){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function G(){this.b=this.a=null;this.s=0}function qb(a){this.node=a;this.a=this.b=null}function rb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,h=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof cb&&k instanceof cb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<Pa(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;h++}for(f=c||d;f;)f.b=e,e=e.a=f,h++,f=f.a;a.b=e;a.s=h;return a} -G.prototype.unshift=function(a){a=new qb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function I(a,b){var c=new qb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function sb(a){return(a=a.a)?a.node:null}function tb(a){return(a=sb(a))?E(a):""}function K(a,b){return new ub(a,!!b)}function ub(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function L(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function M(a){this.m=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function vb(a,b){a.i=b}function wb(a,b){a.b=b}function P(a,b){var c=a.a(b);return c instanceof G?+tb(c):+c}function Q(a,b){var c=a.a(b);return c instanceof G?tb(c):""+c}function xb(a,b){var c=a.a(b);return c instanceof G?!!c.s:!!c};function yb(a,b,c){M.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==zb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}m(yb,M); -function Ab(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=K(b);for(d=L(b);d;d=L(b))for(e=K(c),f=L(e);f;f=L(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=K(e);for(var h=typeof d,k=L(f);k;k=L(f)){switch(h){case "number":k=+E(k);break;case "boolean":k=!!E(k);break;case "string":k=E(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e?"boolean"== -typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}yb.prototype.a=function(a){return this.c.v(this.j,this.w,a)};yb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.w)};function Bb(a,b,c,d){this.a=a;this.F=b;this.m=c;this.v=d}Bb.prototype.toString=function(){return this.a};var Cb={}; -function R(a,b,c,d){if(Cb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Bb(a,b,c,d);return Cb[a.toString()]=a}R("div",6,1,function(a,b,c){return P(a,c)/P(b,c)});R("mod",6,1,function(a,b,c){return P(a,c)%P(b,c)});R("*",6,1,function(a,b,c){return P(a,c)*P(b,c)});R("+",5,1,function(a,b,c){return P(a,c)+P(b,c)});R("-",5,1,function(a,b,c){return P(a,c)-P(b,c)});R("<",4,2,function(a,b,c){return Ab(function(a,b){return a<b},a,b,c)}); -R(">",4,2,function(a,b,c){return Ab(function(a,b){return a>b},a,b,c)});R("<=",4,2,function(a,b,c){return Ab(function(a,b){return a<=b},a,b,c)});R(">=",4,2,function(a,b,c){return Ab(function(a,b){return a>=b},a,b,c)});var zb=R("=",3,2,function(a,b,c){return Ab(function(a,b){return a==b},a,b,c,!0)});R("!=",3,2,function(a,b,c){return Ab(function(a,b){return a!=b},a,b,c,!0)});R("and",2,2,function(a,b,c){return xb(a,c)&&xb(b,c)});R("or",1,2,function(a,b,c){return xb(a,c)||xb(b,c)});function Db(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}m(Db,M);Db.prototype.a=function(a){a=this.c.a(a);return Eb(this.j,a)};Db.prototype.toString=function(){var a;a="Filter:"+N(this.c);return a+=N(this.j)};function Fb(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.H&&n(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.m);this.j=a;this.c=b;vb(this,a.i||qa(b,function(a){return a.i}));wb(this,a.J&&!b.length||a.I&&!!b.length||qa(b,function(a){return a.b}))} -m(Fb,M);Fb.prototype.a=function(a){return this.j.v.apply(null,sa(a,this.c))};Fb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=p(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function Gb(a,b,c,d,e,f,h,k,v){this.o=a;this.m=b;this.i=c;this.J=d;this.I=e;this.v=f;this.G=h;this.D=void 0!==k?k:h;this.H=!!v}Gb.prototype.toString=function(){return this.o};var Hb={}; -function S(a,b,c,d,e,f,h,k){if(Hb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Hb[a]=new Gb(a,b,c,d,!1,e,f,h,k)}S("boolean",2,!1,!1,function(a,b){return xb(b,a)},1);S("ceiling",1,!1,!1,function(a,b){return Math.ceil(P(b,a))},1);S("concat",3,!1,!1,function(a,b){return p(ta(arguments,1),function(b,d){return b+Q(d,a)},"")},2,null);S("contains",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return-1!=b.indexOf(a)},2);S("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -S("false",2,!1,!1,function(){return!1},0);S("floor",1,!1,!1,function(a,b){return Math.floor(P(b,a))},1); -S("id",4,!1,!1,function(a,b){function c(a){if(A){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ra(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=Q(b,a).split(/\s+/),f=[];n(d,function(a){a=c(a);var b;if(!(b=!a)){a:if(l(f))b=l(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Pa);var h=new G;n(f,function(a){I(h,a)});return h},1); -S("lang",2,!1,!1,function(){return!1},1);S("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);S("local-name",3,!1,!0,function(a,b){var c=b?sb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);S("name",3,!1,!0,function(a,b){var c=b?sb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);S("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -S("normalize-space",3,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);S("not",2,!1,!1,function(a,b){return!xb(b,a)},1);S("number",1,!1,!0,function(a,b){return b?P(b,a):+E(a.a)},0,1);S("position",1,!0,!1,function(a){return a.b},0);S("round",1,!1,!1,function(a,b){return Math.round(P(b,a))},1);S("starts-with",2,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);return 0==b.lastIndexOf(a,0)},2);S("string",3,!1,!0,function(a,b){return b?Q(b,a):E(a.a)},0,1); -S("string-length",1,!1,!0,function(a,b){return(b?Q(b,a):E(a.a)).length},0,1);S("substring",3,!1,!1,function(a,b,c,d){c=P(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?P(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=Q(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);S("substring-after",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -S("substring-before",3,!1,!1,function(a,b,c){b=Q(b,a);a=Q(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);S("sum",1,!1,!1,function(a,b){for(var c=K(b.a(a)),d=0,e=L(c);e;e=L(c))d+=+E(e);return d},1,1,!0);S("translate",3,!1,!1,function(a,b,c,d){b=Q(b,a);c=Q(c,a);var e=Q(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);S("true",2,!1,!1,function(){return!0},0);function J(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ib(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}J.prototype.a=function(a){return null===this.b||this.b==a.nodeType};J.prototype.h=function(){return this.j}; -J.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Jb(a){M.call(this,3);this.c=a.substring(1,a.length-1)}m(Jb,M);Jb.prototype.a=function(){return this.c};Jb.prototype.toString=function(){return"Literal: "+this.c};function H(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}H.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};H.prototype.h=function(){return this.o};H.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Kb(a){M.call(this,1);this.c=a}m(Kb,M);Kb.prototype.a=function(){return this.c};Kb.prototype.toString=function(){return"Number: "+this.c};function Lb(a,b){M.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.C||c.c!=Mb||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}m(Lb,M);function Nb(){M.call(this,4)}m(Nb,M);Nb.prototype.a=function(a){var b=new G;a=a.a;9==a.nodeType?I(b,a):I(b,a.ownerDocument);return b};Nb.prototype.toString=function(){return"Root Helper Expression"};function Ob(){M.call(this,4)}m(Ob,M);Ob.prototype.a=function(a){var b=new G;I(b,a.a);return b};Ob.prototype.toString=function(){return"Context Helper Expression"}; -function Pb(a){return"/"==a||"//"==a}Lb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof G))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=K(b,e.c.a),h;if(e.i||e.c!=Qb)if(e.i||e.c!=Rb)for(h=L(f),b=e.a(new ab(h));null!=(h=L(f));)h=e.a(new ab(h)),b=rb(b,h);else h=L(f),b=e.a(new ab(h));else{for(h=L(f);(b=L(f))&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new ab(h))}}return b}; -Lb.prototype.toString=function(){var a;a="Path Expression:"+N(this.j);if(this.c.length){var b=p(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Sb(a,b){this.a=a;this.b=!!b} -function Eb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=K(b),f=b.s,h,k=0;h=L(e);k++){var v=a.b?f-k:k+1;h=d.a(new ab(h,v,f));if("number"==typeof h)v=v==h;else if("string"==typeof h||"boolean"==typeof h)v=!!h;else if(h instanceof G)v=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!v){v=e;h=v.h;var B=v.a;if(!B)throw Error("Next must be called at least once before remove.");var O=B.b,B=B.a;O?O.a=B:h.a=B;B?B.b=O:h.b=O;h.s--;v.a=null}}return b} -Sb.prototype.toString=function(){return p(this.a,function(a,b){return a+N(b)},"Predicates:")};function T(a,b,c,d){M.call(this,4);this.c=a;this.w=b;this.j=c||new Sb([]);this.C=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=A?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}m(T,M); -T.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?Q(c.A,a):null,f=1);if(this.C)if(this.i||this.c!=Tb)if(a=K((new T(Ub,new J("node"))).a(a)),b=L(a))for(c=this.v(b,d,e,f);null!=(b=L(a));)c=rb(c,this.v(b,d,e,f));else c=new G;else c=jb(this.w,b,d,e),c=Eb(this.j,c,f);else c=this.v(a.a,d,e,f);return c};T.prototype.v=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Eb(this.j,a,d)}; -T.prototype.toString=function(){var a;a="Step:"+N("Operator: "+(this.C?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.w);if(this.j.a.length){var b=p(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Vb(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}Vb.prototype.toString=function(){return this.o};var Wb={};function U(a,b,c,d){if(Wb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Vb(a,b,c,!!d);return Wb[a]=b} -U("ancestor",function(a,b){for(var c=new G,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new G,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var Mb=U("attribute",function(a,b){var c=new G,d=a.h();if("style"==d&&b.style&&A)return I(c,new cb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof J&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)A?f.nodeValue&&I(c,db(b,f)):I(c,f);else(f=e.getNamedItem(d))&&(A?f.nodeValue&&I(c,db(b,f)):I(c,f));return c},!1),Tb=U("child",function(a,b,c,d,e){return(A?ob:pb).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new G)},!1,!0);U("descendant",jb,!1,!0); -var Ub=U("descendant-or-self",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&I(e,b);return jb(a,b,c,d,e)},!1,!0),Qb=U("following",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&I(e,f),e=jb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new G,d=b;d=d.nextSibling;)a.a(d)&&I(c,d);return c},!1);U("namespace",function(){return new G},!1); -var Xb=U("parent",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return I(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&I(c,d);return c},!1),Rb=U("preceding",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,k=f.length;h<k;h++){var v=[];for(b=f[h];b=b.previousSibling;)v.unshift(b);for(var B=0,O=v.length;B<O;B++)b=v[B],F(b,c,d)&&a.a(b)&&I(e,b),e=jb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new G,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Yb=U("self",function(a,b){var c=new G;a.a(b)&&I(c,b);return c},!1);function Zb(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}m(Zb,M);Zb.prototype.a=function(a){return-P(this.c,a)};Zb.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function $b(a){M.call(this,4);this.c=a;vb(this,qa(this.c,function(a){return a.i}));wb(this,qa(this.c,function(a){return a.b}))}m($b,M);$b.prototype.a=function(a){var b=new G;n(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error("Path expression must evaluate to NodeSet.");b=rb(b,c)});return b};$b.prototype.toString=function(){return p(this.c,function(a,b){return a+N(b)},"Union Expression:")};function ac(a,b){this.a=a;this.b=b}function bc(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=cc(a);var d=D(a.a);if(!d)break;var e=(d=Cb[d]||null)&&d.F;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].F;)b=new yb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new yb(c.pop(),c.pop(),b);return b}function V(a,b){if(ib(a.a))throw Error(b);}function dc(a,b){var c=D(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function ec(a){a=D(a.a);if(")"!=a)throw Error("Bad token: "+a);}function fc(a){a=D(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Jb(a)} -function gc(a){var b,c=[],d;if(Pb(C(a.a))){b=D(a.a);d=C(a.a);if("/"==b&&(ib(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Nb;d=new Nb;V(a,"Missing next location step.");b=hc(a,b);c.push(b)}else{a:{b=C(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":D(a.a);b=bc(a);V(a,'unclosed "("');dc(a,")");break;case '"':case "'":b=fc(a);break;default:if(isNaN(+b))if(!Ib(b)&&/(?![0-9])[\w]/.test(d)&&"("==C(a.a,1)){b=D(a.a); -b=Hb[b]||null;D(a.a);for(d=[];")"!=C(a.a);){V(a,"Missing function argument list.");d.push(bc(a));if(","!=C(a.a))break;D(a.a)}V(a,"Unclosed function argument list.");ec(a);b=new Fb(b,d)}else{b=null;break a}else b=new Kb(+D(a.a))}"["==C(a.a)&&(d=new Sb(ic(a)),b=new Db(b,d))}if(b)if(Pb(C(a.a)))d=b;else return b;else b=hc(a,"/"),d=new Ob,c.push(b)}for(;Pb(C(a.a));)b=D(a.a),V(a,"Missing next location step."),b=hc(a,b),c.push(b);return new Lb(d,c)} -function hc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==C(a.a))return d=new T(Yb,new J("node")),D(a.a),d;if(".."==C(a.a))return d=new T(Xb,new J("node")),D(a.a),d;var f;if("@"==C(a.a))f=Mb,D(a.a),V(a,"Missing attribute name");else if("::"==C(a.a,1)){if(!/(?![0-9])[\w]/.test(C(a.a).charAt(0)))throw Error("Bad token: "+D(a.a));c=D(a.a);f=Wb[c]||null;if(!f)throw Error("No axis with name: "+c);D(a.a);V(a,"Missing node name")}else f=Tb;c=C(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -C(a.a,1)){if(!Ib(c))throw Error("Invalid node type: "+c);c=D(a.a);if(!Ib(c))throw Error("Invalid type name: "+c);dc(a,"(");V(a,"Bad nodetype");e=C(a.a).charAt(0);var h=null;if('"'==e||"'"==e)h=fc(a);V(a,"Bad nodetype");ec(a);c=new J(c,h)}else if(c=D(a.a),e=c.indexOf(":"),-1==e)c=new H(c);else{var h=c.substring(0,e),k;if("*"==h)k="*";else if(k=a.b(h),!k)throw Error("Namespace prefix not declared: "+h);c=c.substr(e+1);c=new H(c,k)}else throw Error("Bad token: "+D(a.a));e=new Sb(ic(a),f.a);return d|| -new T(f,c,e,"//"==b)}function ic(a){for(var b=[];"["==C(a.a);){D(a.a);V(a,"Missing predicate expression.");var c=bc(a);b.push(c);V(a,"Unclosed predicate expression.");dc(a,"]")}return b}function cc(a){if("-"==C(a.a))return D(a.a),new Zb(cc(a));var b=gc(a);if("|"!=C(a.a))a=b;else{for(b=[b];"|"==D(a.a);)V(a,"Missing next union location path."),b.push(gc(a));a.a.a--;a=new $b(b)}return a};function jc(a){switch(a.nodeType){case 1:return ja(kc,a);case 9:return jc(a.documentElement);case 11:case 10:case 6:case 12:return lc;default:return a.parentNode?jc(a.parentNode):lc}}function lc(){return null}function kc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?kc(a.parentNode,b):null};function mc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=fb(a);if(ib(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ia(b.lookupNamespaceURI,b)):b=function(){return null};var d=bc(new ac(c,b));if(!ib(c))throw Error("Bad token: "+D(c));this.evaluate=function(a,b){var c=d.a(new ab(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof G)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof G))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof G?tb(a):""+a;break;case 1:this.numberValue=a instanceof G?+tb(a):+a;break;case 3:this.booleanValue=a instanceof G?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -K(a);c=[];for(var e=L(d);e;e=L(d))c.push(e instanceof cb?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=sb(a);this.singleNodeValue=d instanceof cb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function nc(a){this.lookupNamespaceURI=jc(a)} -aa("wgxpath.install",function(a,b){var c=a||g,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new mc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new mc(a,b)},d.createNSResolver=function(a){return new nc(a)}});function oc(a){return(a=a.exec(t))?a[1]:""}var pc=function(){if(Va)return oc(/Firefox\/([0-9.]+)/);if(x||Ea||Da)return Ka;if(Za)return oc(/Chrome\/([0-9.]+)/);if($a&&!(Ca()||u("iPad")||u("iPod")))return oc(/Version\/([0-9.]+)/);if(Wa||Xa){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t))return a[1]+"."+a[2]}else if(Ya)return(a=oc(/Android\s+([0-9.]+)/))?a:oc(/Version\/([0-9.]+)/);return""}();var qc,rc;function sc(a){return tc?qc(a):x?0<=ma(z,a):Ma(a)}function uc(a){tc?rc(a):Ya?ma(vc,a):ma(pc,a)} -var tc=function(){if(!y)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;qc=function(a){return 0<=c.compare(d,""+a)};rc=function(a){c.compare(e,""+a)};return!0}(),wc;if(Ya){var xc=/Android\s+([0-9\.]+)/.exec(t);wc=xc?xc[1]:"0"}else wc="0"; -var vc=wc,yc=x&&!(8<=Number(z)),zc=x&&!(9<=Number(z));Ya&&uc(2.3);Ya&&uc(4);$a&&uc(6);function Ac(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Bc(a){var b;Ac(a,"OPTION")?b=!0:Ac(a,"INPUT")?(b=a.type.toLowerCase(),b="checkbox"==b||"radio"==b):b=!1;if(!b)throw new q(15,"Element is not selectable");b="selected";var c=a.type&&a.type.toLowerCase();if("checkbox"==c||"radio"==c)b="checked";if(c=yc&&"value"==b&&Ac(a,"OPTION"))c=null===Cc(a);c?(b=[],Ua(a,b,!1),a=!b.join("")):a=!a[b];return!a}var Dc=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; -function Ec(a){var b=[];n(a.split(Dc),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function Cc(a){var b;b="value";return"style"==b?Ec(a.style.cssText):yc&&"value"==b&&Ac(a,"INPUT")?a.value:zc&&!0===a[b]?String(a.getAttribute(b)):(a=a.getAttributeNode(b))&&a.specified?a.value:null};Fa||tc&&uc(3.6);x&&sc(10);Ya&&uc(4);function X(a,b){this.u={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Y(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof X)for(d=Fc(a),Gc(a),e=[],c=0;c<a.l.length;c++)e.push(a.u[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)Y(this,d[c],e[c])}}function Fc(a){Gc(a);return a.l.concat()} -X.prototype.clear=function(){this.u={};this.b=this.a=this.l.length=0};function Gc(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.u,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}X.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.u,a)?this.u[a]:b}; -function Y(a,b,c){Object.prototype.hasOwnProperty.call(a.u,b)||(a.a++,a.l.push(b),a.b++);a.u[b]=c}X.prototype.forEach=function(a,b){for(var c=Fc(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};X.prototype.clone=function(){return new X(this)};var Hc={};function Z(a,b,c){da(a)&&(a=y?a.f:a.g);a=new Ic(a);!b||b in Hc&&!c||(Hc[b]={key:a,shift:!1},c&&(Hc[c]={key:a,shift:!0}));return a}function Ic(a){this.code=a}Z(8);Z(9);Z(13);var Jc=Z(16),Kc=Z(17),Lc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var Mc=Z(Ha?{f:91,g:91}:Ga?{f:224,g:91}:{f:0,g:91});Z(Ha?{f:92,g:92}:Ga?{f:224,g:93}:{f:0,g:92});Z(Ha?{f:93,g:93}:Ga?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var Nc=new X;Y(Nc,1,Jc);Y(Nc,2,Kc);Y(Nc,4,Lc);Y(Nc,8,Mc);(function(a){var b=new X;n(Fc(a),function(c){Y(b,a.get(c).code,c)});return b})(Nc);y&&sc(12);function Oc(){} -function Pc(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),Pc(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),Qc(d,c),c.push(":"),Pc(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":Qc(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var Rc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Sc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function Qc(a,b){b.push('"',a.replace(Sc,function(a){var b=Rc[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),Rc[a]=b);return b}),'"')};Fa||y&&sc(3.5)||x&&sc(8);function Tc(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return pa(a,Tc);case "object":if(w(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=Uc(a);return b}if(w(a,"document"))return b={},b.WINDOW=Uc(a),b;if(ca(a))return pa(a,Tc);a=xa(a,function(a,b){return"number"==typeof b||l(b)});return ya(a,Tc);default:return null}} -function Vc(a,b){return"array"==ba(a)?pa(a,function(a){return Vc(a,b)}):da(a)?"function"==typeof a?a:w(a,"ELEMENT")?Wc(a.ELEMENT,b):w(a,"WINDOW")?Wc(a.WINDOW,b):ya(a,function(a){return Vc(a,b)}):a}function Xc(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.B=ka());b.B||(b.B=ka());return b}function Uc(a){var b=Xc(a.ownerDocument),c=za(b,function(b){return b==a});c||(c=":wdc:"+b.B++,b[c]=a);return c} -function Wc(a,b){a=decodeURIComponent(a);var c=b||document,d=Xc(c);if(!w(d,a))throw new q(10,"Element does not exist in cache");var e=d[a];if(w(e,"setInterval")){if(e.closed)throw delete d[a],new q(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new q(10,"Element is no longer attached to the DOM");};aa("_",function(a,b){var c=[a],d;try{var e;b?e=Wc(b.WINDOW):e=window;var f=Vc(c,e.document),h=Bc.apply(null,f);d={status:0,value:Tc(h)}}catch(k){d={status:w(k,"code")?k.code:13,value:{message:k.message}}}c=[];Pc(new Oc,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/lastupdate b/src/ghostdriver/third_party/webdriver-atoms/lastupdate deleted file mode 100644 index 4514c13d89..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/lastupdate +++ /dev/null @@ -1,7 +0,0 @@ -2017-01-30 06:02:16 - -commit 35ae25b1534ae328c771e0856c93e187490ca824 (HEAD, tag: refs/tags/selenium-2.53.0) -Author: Luke Inman-Semerau <luke.semerau@gmail.com> -Date: Tue Mar 15 09:39:24 2016 -0700 - - bumping version numbers and updating changelog for 2.53 (python & java) diff --git a/src/ghostdriver/third_party/webdriver-atoms/scroll_into_view.js b/src/ghostdriver/third_party/webdriver-atoms/scroll_into_view.js deleted file mode 100644 index df28f8c0e3..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/scroll_into_view.js +++ /dev/null @@ -1,115 +0,0 @@ -function(){return function(){var h,m=this;function aa(a,b){var c=a.split("."),d=m;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)c.length||void 0===b?d[e]?d=d[e]:d=d[e]={}:d[e]=b} -function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function n(a){return"string"==typeof a}function da(a){return"number"==typeof a}function ea(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function fa(a,b,c){return a.call.apply(a.bind,arguments)} -function ga(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function ha(a,b,c){ha=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa:ga;return ha.apply(null,arguments)} -function ia(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var ja=Date.now||function(){return+new Date};function p(a,b){function c(){}c.prototype=b.prototype;a.P=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.N=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var ka=window;var la=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function ma(a,b){for(var c=0,d=la(String(a)).split("."),e=la(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",l=e[g]||"",r=RegExp("(\\d*)(\\D*)","g"),G=RegExp("(\\d*)(\\D*)","g");do{var A=r.exec(k)||["","",""],t=G.exec(l)||["","",""];if(0==A[0].length&&0==t[0].length)break;c=na(0==A[1].length?0:parseInt(A[1],10),0==t[1].length?0:parseInt(t[1],10))||na(0==A[2].length,0==t[2].length)||na(A[2],t[2])}while(0==c)}return c}function na(a,b){return a<b?-1:a>b?1:0} -function oa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function pa(a,b){if(n(a))return n(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1}function q(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function qa(a,b){for(var c=a.length,d=[],e=0,f=n(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d} -function ra(a,b){for(var c=a.length,d=Array(c),e=n(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function sa(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function ta(a,b){for(var c=a.length,d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function ua(a,b){var c;a:{c=a.length;for(var d=n(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:n(a)?a.charAt(c):a[c]} -function va(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function wa(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var xa={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var ya="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),za=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Aa=/^#(?:[0-9a-f]{3}){1,2}$/i,Ba=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ca=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Da(a,b){this.code=a;this.a=u[a]||Ea;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}p(Da,Error);var Ea="unknown error",u={15:"element not selectable",11:"element not visible"};u[31]=Ea;u[30]=Ea;u[24]="invalid cookie domain";u[29]="invalid element coordinates";u[12]="invalid element state"; -u[32]="invalid selector";u[51]="invalid selector";u[52]="invalid selector";u[17]="javascript error";u[405]="unsupported operation";u[34]="move target out of bounds";u[27]="no such alert";u[7]="no such element";u[8]="no such frame";u[23]="no such window";u[28]="script timeout";u[33]="session not created";u[10]="stale element reference";u[21]="timeout";u[25]="unable to set cookie";u[26]="unexpected alert open";u[13]=Ea;u[9]="unknown command";Da.prototype.toString=function(){return this.name+": "+this.message};var v;a:{var Fa=m.navigator;if(Fa){var Ga=Fa.userAgent;if(Ga){v=Ga;break a}}v=""}function w(a){return-1!=v.indexOf(a)};function Ha(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Ia(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Ja(a,b){return null!==a&&b in a}function Ka(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function La(){return w("Opera")||w("OPR")}function Ma(){return(w("Chrome")||w("CriOS"))&&!La()&&!w("Edge")};function Na(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Oa=La(),x=w("Trident")||w("MSIE"),Pa=w("Edge"),y=w("Gecko")&&!(-1!=v.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Qa=-1!=v.toLowerCase().indexOf("webkit")&&!w("Edge"),Ra=w("Macintosh"),Sa=w("Windows");function Ta(){var a=v;if(y)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Pa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Qa)return/WebKit\/(\S+)/.exec(a)}function Ua(){var a=m.document;return a?a.documentMode:void 0} -var Va=function(){if(Oa&&m.opera){var a;var b=m.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=Ta())&&(a=b?b[1]:"");return x&&(b=Ua(),null!=b&&b>parseFloat(a))?String(b):a}(),Wa={};function Xa(a){return Wa[a]||(Wa[a]=0<=ma(Va,a))}var Ya=m.document,z=Ya&&x?Ua()||("CSS1Compat"==Ya.compatMode?parseInt(Va,10):5):void 0;!y&&!x||x&&9<=Number(z)||y&&Xa("1.9.1");x&&Xa("9");function $a(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}h=$a.prototype;h.clone=function(){return new $a(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=da(b)?b:a;this.x*=a;this.y*=c;return this};function ab(a,b){this.width=a;this.height=b}h=ab.prototype;h.clone=function(){return new ab(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=da(b)?b:a;this.width*=a;this.height*=c;return this};function bb(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function cb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(z))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?db(a,b):!c&&bb(e,b)?-1*eb(a,b):!d&&bb(f,a)?eb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=B(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(m.Range.START_TO_END,d)}function eb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return db(d,a)}function db(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function B(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function fb(a){this.a=a||m.document||document}fb.prototype.contains=bb;var gb=w("Firefox"),hb=Na()||w("iPod"),ib=w("iPad"),jb=w("Android")&&!(Ma()||w("Firefox")||La()||w("Silk")),kb=Ma(),lb=w("Safari")&&!(Ma()||w("Coast")||La()||w("Edge")||w("Silk")||w("Android"))&&!(Na()||w("iPad")||w("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function mb(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var C=x&&!(9<=Number(z)),nb=x&&!(8<=Number(z));function ob(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function pb(a,b){var c=nb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new ob(b,a,b.nodeName,c)};function qb(a){this.b=a;this.a=0}function rb(a){a=a.match(sb);for(var b=0;b<a.length;b++)tb.test(a[b])&&a.splice(b,1);return new qb(a)}var sb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),tb=/^\s/;function D(a,b){return a.b[a.a+(b||0)]}function E(a){return a.b[a.a++]}function ub(a){return a.b.length<=a.a};function H(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(C&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),C&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function J(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}nb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function vb(a,b,c,d,e){return(C?wb:xb).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new K)} -function wb(a,b,c,d,e){if(a instanceof yb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=zb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)J(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||L(e,b);return e}Ab(a,b,c,d,e);return e} -function xb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&L(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&L(e,b)})):a instanceof M?Ab(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),q(b,function(a){J(a,c,d)&&L(e,a)}));return e} -function Bb(a,b,c,d,e){var f;if((a instanceof yb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=zb(a);if("*"!=g&&(f=qa(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=qa(f,function(a){return J(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||L(e,a)});return e}return Cb(a,b,c,d,e)}function Cb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)J(b,c,d)&&a.a(b)&&L(e,b);return e} -function Ab(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)J(b,c,d)&&a.a(b)&&L(e,b),Ab(a,b,c,d,e)}function zb(a){if(a instanceof M){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function K(){this.b=this.a=null;this.s=0}function Db(a){this.node=a;this.a=this.b=null}function Eb(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof ob&&k instanceof ob&&f.a==k.a?(f=c,c=c.a,d=d.a):0<cb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.s=g;return a} -K.prototype.unshift=function(a){a=new Db(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.s++};function L(a,b){var c=new Db(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.s++}function Fb(a){return(a=a.a)?a.node:null}function Gb(a){return(a=Fb(a))?H(a):""}function Hb(a,b){return new Ib(a,!!b)}function Ib(a,b){this.h=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function N(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function O(a){this.m=a;this.b=this.i=!1;this.h=null}function P(a){return"\n "+a.toString().split("\n").join("\n ")}function Jb(a,b){a.i=b}function Kb(a,b){a.b=b}function Q(a,b){var c=a.a(b);return c instanceof K?+Gb(c):+c}function R(a,b){var c=a.a(b);return c instanceof K?Gb(c):""+c}function Lb(a,b){var c=a.a(b);return c instanceof K?!!c.s:!!c};function Mb(a,b,c){O.call(this,a.m);this.c=a;this.j=b;this.w=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==Nb&&(c.b||c.i||4==c.m||0==c.m||!b.h?b.b||b.i||4==b.m||0==b.m||!c.h||(this.h={name:c.h.name,A:b}):this.h={name:b.h.name,A:c})}p(Mb,O); -function Ob(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof K&&c instanceof K){b=Hb(b);for(d=N(b);d;d=N(b))for(e=Hb(c),f=N(e);f;f=N(e))if(a(H(d),H(f)))return!0;return!1}if(b instanceof K||c instanceof K){b instanceof K?(e=b,d=c):(e=c,d=b);f=Hb(e);for(var g=typeof d,k=N(f);k;k=N(f)){switch(g){case "number":k=+H(k);break;case "boolean":k=!!H(k);break;case "string":k=H(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Mb.prototype.a=function(a){return this.c.u(this.j,this.w,a)};Mb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+P(this.j);return a+=P(this.w)};function Pb(a,b,c,d){this.a=a;this.H=b;this.m=c;this.u=d}Pb.prototype.toString=function(){return this.a};var Qb={}; -function S(a,b,c,d){if(Qb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Pb(a,b,c,d);return Qb[a.toString()]=a}S("div",6,1,function(a,b,c){return Q(a,c)/Q(b,c)});S("mod",6,1,function(a,b,c){return Q(a,c)%Q(b,c)});S("*",6,1,function(a,b,c){return Q(a,c)*Q(b,c)});S("+",5,1,function(a,b,c){return Q(a,c)+Q(b,c)});S("-",5,1,function(a,b,c){return Q(a,c)-Q(b,c)});S("<",4,2,function(a,b,c){return Ob(function(a,b){return a<b},a,b,c)}); -S(">",4,2,function(a,b,c){return Ob(function(a,b){return a>b},a,b,c)});S("<=",4,2,function(a,b,c){return Ob(function(a,b){return a<=b},a,b,c)});S(">=",4,2,function(a,b,c){return Ob(function(a,b){return a>=b},a,b,c)});var Nb=S("=",3,2,function(a,b,c){return Ob(function(a,b){return a==b},a,b,c,!0)});S("!=",3,2,function(a,b,c){return Ob(function(a,b){return a!=b},a,b,c,!0)});S("and",2,2,function(a,b,c){return Lb(a,c)&&Lb(b,c)});S("or",1,2,function(a,b,c){return Lb(a,c)||Lb(b,c)});function Rb(a,b){if(b.a.length&&4!=a.m)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");O.call(this,a.m);this.c=a;this.j=b;this.i=a.i;this.b=a.b}p(Rb,O);Rb.prototype.a=function(a){a=this.c.a(a);return Sb(this.j,a)};Rb.prototype.toString=function(){var a;a="Filter:"+P(this.c);return a+=P(this.j)};function Tb(a,b){if(b.length<a.I)throw Error("Function "+a.o+" expects at least"+a.I+" arguments, "+b.length+" given");if(null!==a.D&&b.length>a.D)throw Error("Function "+a.o+" expects at most "+a.D+" arguments, "+b.length+" given");a.M&&q(b,function(b,d){if(4!=b.m)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});O.call(this,a.m);this.j=a;this.c=b;Jb(this,a.i||ta(b,function(a){return a.i}));Kb(this,a.L&&!b.length||a.K&&!!b.length||ta(b,function(a){return a.b}))} -p(Tb,O);Tb.prototype.a=function(a){return this.j.u.apply(null,va(a,this.c))};Tb.prototype.toString=function(){var a="Function: "+this.j;if(this.c.length)var b=sa(this.c,function(a,b){return a+P(b)},"Arguments:"),a=a+P(b);return a};function Ub(a,b,c,d,e,f,g,k,l){this.o=a;this.m=b;this.i=c;this.L=d;this.K=e;this.u=f;this.I=g;this.D=void 0!==k?k:g;this.M=!!l}Ub.prototype.toString=function(){return this.o};var Vb={}; -function T(a,b,c,d,e,f,g,k){if(Vb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Vb[a]=new Ub(a,b,c,d,!1,e,f,g,k)}T("boolean",2,!1,!1,function(a,b){return Lb(b,a)},1);T("ceiling",1,!1,!1,function(a,b){return Math.ceil(Q(b,a))},1);T("concat",3,!1,!1,function(a,b){return sa(wa(arguments,1),function(b,d){return b+R(d,a)},"")},2,null);T("contains",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return-1!=b.indexOf(a)},2);T("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -T("false",2,!1,!1,function(){return!1},0);T("floor",1,!1,!1,function(a,b){return Math.floor(Q(b,a))},1);T("id",4,!1,!1,function(a,b){function c(a){if(C){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ua(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=R(b,a).split(/\s+/),f=[];q(d,function(a){a=c(a);!a||0<=pa(f,a)||f.push(a)});f.sort(cb);var g=new K;q(f,function(a){L(g,a)});return g},1); -T("lang",2,!1,!1,function(){return!1},1);T("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);T("local-name",3,!1,!0,function(a,b){var c=b?Fb(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);T("name",3,!1,!0,function(a,b){var c=b?Fb(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);T("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -T("normalize-space",3,!1,!0,function(a,b){return(b?R(b,a):H(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);T("not",2,!1,!1,function(a,b){return!Lb(b,a)},1);T("number",1,!1,!0,function(a,b){return b?Q(b,a):+H(a.a)},0,1);T("position",1,!0,!1,function(a){return a.b},0);T("round",1,!1,!1,function(a,b){return Math.round(Q(b,a))},1);T("starts-with",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return 0==b.lastIndexOf(a,0)},2);T("string",3,!1,!0,function(a,b){return b?R(b,a):H(a.a)},0,1); -T("string-length",1,!1,!0,function(a,b){return(b?R(b,a):H(a.a)).length},0,1);T("substring",3,!1,!1,function(a,b,c,d){c=Q(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?Q(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=R(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);T("substring-after",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -T("substring-before",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);T("sum",1,!1,!1,function(a,b){for(var c=Hb(b.a(a)),d=0,e=N(c);e;e=N(c))d+=+H(e);return d},1,1,!0);T("translate",3,!1,!1,function(a,b,c,d){b=R(b,a);c=R(c,a);var e=R(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);T("true",2,!1,!1,function(){return!0},0);function M(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Wb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}M.prototype.a=function(a){return null===this.b||this.b==a.nodeType};M.prototype.h=function(){return this.j}; -M.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=P(this.c));return a};function Xb(a){O.call(this,3);this.c=a.substring(1,a.length-1)}p(Xb,O);Xb.prototype.a=function(){return this.c};Xb.prototype.toString=function(){return"Literal: "+this.c};function yb(a,b){this.o=a.toLowerCase();var c;c="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}yb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.o&&this.o!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};yb.prototype.h=function(){return this.o};yb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Yb(a){O.call(this,1);this.c=a}p(Yb,O);Yb.prototype.a=function(){return this.c};Yb.prototype.toString=function(){return"Number: "+this.c};function Zb(a,b){O.call(this,a.m);this.j=a;this.c=b;this.i=a.i;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.B||c.c!=$b||(c=c.w,"*"!=c.h()&&(this.h={name:c.h(),A:null}))}}p(Zb,O);function ac(){O.call(this,4)}p(ac,O);ac.prototype.a=function(a){var b=new K;a=a.a;9==a.nodeType?L(b,a):L(b,a.ownerDocument);return b};ac.prototype.toString=function(){return"Root Helper Expression"};function bc(){O.call(this,4)}p(bc,O);bc.prototype.a=function(a){var b=new K;L(b,a.a);return b};bc.prototype.toString=function(){return"Context Helper Expression"}; -function cc(a){return"/"==a||"//"==a}Zb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof K))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.s;c++){var e=a[c],f=Hb(b,e.c.a),g;if(e.i||e.c!=dc)if(e.i||e.c!=ec)for(g=N(f),b=e.a(new mb(g));null!=(g=N(f));)g=e.a(new mb(g)),b=Eb(b,g);else g=N(f),b=e.a(new mb(g));else{for(g=N(f);(b=N(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new mb(g))}}return b}; -Zb.prototype.toString=function(){var a;a="Path Expression:"+P(this.j);if(this.c.length){var b=sa(this.c,function(a,b){return a+P(b)},"Steps:");a+=P(b)}return a};function fc(a,b){this.a=a;this.b=!!b} -function Sb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=Hb(b),f=b.s,g,k=0;g=N(e);k++){var l=a.b?f-k:k+1;g=d.a(new mb(g,l,f));if("number"==typeof g)l=l==g;else if("string"==typeof g||"boolean"==typeof g)l=!!g;else if(g instanceof K)l=0<g.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!l){l=e;g=l.h;var r=l.a;if(!r)throw Error("Next must be called at least once before remove.");var G=r.b,r=r.a;G?G.a=r:g.a=r;r?r.b=G:g.b=G;g.s--;l.a=null}}return b} -fc.prototype.toString=function(){return sa(this.a,function(a,b){return a+P(b)},"Predicates:")};function gc(a,b,c,d){O.call(this,4);this.c=a;this.w=b;this.j=c||new fc([]);this.B=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.b&&b&&(a=b.name,a=C?a.toLowerCase():a,this.h={name:a,A:b.A});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.m||0==c.m){a=!0;break a}a=!1}this.i=a}p(gc,O); -gc.prototype.a=function(a){var b=a.a,c=null,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.A?R(c.A,a):null,f=1);if(this.B)if(this.i||this.c!=hc)if(a=Hb((new gc(ic,new M("node"))).a(a)),b=N(a))for(c=this.u(b,d,e,f);null!=(b=N(a));)c=Eb(c,this.u(b,d,e,f));else c=new K;else c=vb(this.w,b,d,e),c=Sb(this.j,c,f);else c=this.u(a.a,d,e,f);return c};gc.prototype.u=function(a,b,c,d){a=this.c.h(this.w,a,b,c);return a=Sb(this.j,a,d)}; -gc.prototype.toString=function(){var a;a="Step:"+P("Operator: "+(this.B?"//":"/"));this.c.o&&(a+=P("Axis: "+this.c));a+=P(this.w);if(this.j.a.length){var b=sa(this.j.a,function(a,b){return a+P(b)},"Predicates:");a+=P(b)}return a};function jc(a,b,c,d){this.o=a;this.h=b;this.a=c;this.b=d}jc.prototype.toString=function(){return this.o};var kc={};function U(a,b,c,d){if(kc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new jc(a,b,c,!!d);return kc[a]=b} -U("ancestor",function(a,b){for(var c=new K,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);U("ancestor-or-self",function(a,b){var c=new K,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var $b=U("attribute",function(a,b){var c=new K,d=a.h();if("style"==d&&b.style&&C)return L(c,new ob(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof M&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)C?f.nodeValue&&L(c,pb(b,f)):L(c,f);else(f=e.getNamedItem(d))&&(C?f.nodeValue&&L(c,pb(b,f)):L(c,f));return c},!1),hc=U("child",function(a,b,c,d,e){return(C?Bb:Cb).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new K)},!1,!0);U("descendant",vb,!1,!0); -var ic=U("descendant-or-self",function(a,b,c,d){var e=new K;J(b,c,d)&&a.a(b)&&L(e,b);return vb(a,b,c,d,e)},!1,!0),dc=U("following",function(a,b,c,d){var e=new K;do for(var f=b;f=f.nextSibling;)J(f,c,d)&&a.a(f)&&L(e,f),e=vb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);U("following-sibling",function(a,b){for(var c=new K,d=b;d=d.nextSibling;)a.a(d)&&L(c,d);return c},!1);U("namespace",function(){return new K},!1); -var lc=U("parent",function(a,b){var c=new K;if(9==b.nodeType)return c;if(2==b.nodeType)return L(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&L(c,d);return c},!1),ec=U("preceding",function(a,b,c,d){var e=new K,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var l=[];for(b=f[g];b=b.previousSibling;)l.unshift(b);for(var r=0,G=l.length;r<G;r++)b=l[r],J(b,c,d)&&a.a(b)&&L(e,b),e=vb(a,b,c,d,e)}return e},!0,!0); -U("preceding-sibling",function(a,b){for(var c=new K,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var mc=U("self",function(a,b){var c=new K;a.a(b)&&L(c,b);return c},!1);function nc(a){O.call(this,1);this.c=a;this.i=a.i;this.b=a.b}p(nc,O);nc.prototype.a=function(a){return-Q(this.c,a)};nc.prototype.toString=function(){return"Unary Expression: -"+P(this.c)};function oc(a){O.call(this,4);this.c=a;Jb(this,ta(this.c,function(a){return a.i}));Kb(this,ta(this.c,function(a){return a.b}))}p(oc,O);oc.prototype.a=function(a){var b=new K;q(this.c,function(c){c=c.a(a);if(!(c instanceof K))throw Error("Path expression must evaluate to NodeSet.");b=Eb(b,c)});return b};oc.prototype.toString=function(){return sa(this.c,function(a,b){return a+P(b)},"Union Expression:")};function pc(a,b){this.a=a;this.b=b}function qc(a){for(var b,c=[];;){V(a,"Missing right hand side of binary expression.");b=rc(a);var d=E(a.a);if(!d)break;var e=(d=Qb[d]||null)&&d.H;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].H;)b=new Mb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Mb(c.pop(),c.pop(),b);return b}function V(a,b){if(ub(a.a))throw Error(b);}function sc(a,b){var c=E(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function tc(a){a=E(a.a);if(")"!=a)throw Error("Bad token: "+a);}function uc(a){a=E(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Xb(a)} -function vc(a){var b,c=[],d;if(cc(D(a.a))){b=E(a.a);d=D(a.a);if("/"==b&&(ub(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new ac;d=new ac;V(a,"Missing next location step.");b=wc(a,b);c.push(b)}else{a:{b=D(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":E(a.a);b=qc(a);V(a,'unclosed "("');sc(a,")");break;case '"':case "'":b=uc(a);break;default:if(isNaN(+b))if(!Wb(b)&&/(?![0-9])[\w]/.test(d)&&"("==D(a.a,1)){b=E(a.a); -b=Vb[b]||null;E(a.a);for(d=[];")"!=D(a.a);){V(a,"Missing function argument list.");d.push(qc(a));if(","!=D(a.a))break;E(a.a)}V(a,"Unclosed function argument list.");tc(a);b=new Tb(b,d)}else{b=null;break a}else b=new Yb(+E(a.a))}"["==D(a.a)&&(d=new fc(xc(a)),b=new Rb(b,d))}if(b)if(cc(D(a.a)))d=b;else return b;else b=wc(a,"/"),d=new bc,c.push(b)}for(;cc(D(a.a));)b=E(a.a),V(a,"Missing next location step."),b=wc(a,b),c.push(b);return new Zb(d,c)} -function wc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==D(a.a))return d=new gc(mc,new M("node")),E(a.a),d;if(".."==D(a.a))return d=new gc(lc,new M("node")),E(a.a),d;var f;if("@"==D(a.a))f=$b,E(a.a),V(a,"Missing attribute name");else if("::"==D(a.a,1)){if(!/(?![0-9])[\w]/.test(D(a.a).charAt(0)))throw Error("Bad token: "+E(a.a));c=E(a.a);f=kc[c]||null;if(!f)throw Error("No axis with name: "+c);E(a.a);V(a,"Missing node name")}else f=hc;c=D(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -D(a.a,1)){if(!Wb(c))throw Error("Invalid node type: "+c);c=E(a.a);if(!Wb(c))throw Error("Invalid type name: "+c);sc(a,"(");V(a,"Bad nodetype");e=D(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=uc(a);V(a,"Bad nodetype");tc(a);c=new M(c,g)}else if(c=E(a.a),e=c.indexOf(":"),-1==e)c=new yb(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new yb(c,k)}else throw Error("Bad token: "+E(a.a));e=new fc(xc(a),f.a);return d|| -new gc(f,c,e,"//"==b)}function xc(a){for(var b=[];"["==D(a.a);){E(a.a);V(a,"Missing predicate expression.");var c=qc(a);b.push(c);V(a,"Unclosed predicate expression.");sc(a,"]")}return b}function rc(a){if("-"==D(a.a))return E(a.a),new nc(rc(a));var b=vc(a);if("|"!=D(a.a))a=b;else{for(b=[b];"|"==E(a.a);)V(a,"Missing next union location path."),b.push(vc(a));a.a.a--;a=new oc(b)}return a};function yc(a){switch(a.nodeType){case 1:return ia(zc,a);case 9:return yc(a.documentElement);case 11:case 10:case 6:case 12:return Ac;default:return a.parentNode?yc(a.parentNode):Ac}}function Ac(){return null}function zc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?zc(a.parentNode,b):null};function Bc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=rb(a);if(ub(c))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ha(b.lookupNamespaceURI,b)):b=function(){return null};var d=qc(new pc(c,b));if(!ub(c))throw Error("Bad token: "+E(c));this.evaluate=function(a,b){var c=d.a(new mb(a));return new W(c,b)}} -function W(a,b){if(0==b)if(a instanceof K)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof K))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof K?Gb(a):""+a;break;case 1:this.numberValue=a instanceof K?+Gb(a):+a;break;case 3:this.booleanValue=a instanceof K?0<a.s:!!a;break;case 4:case 5:case 6:case 7:var d= -Hb(a);c=[];for(var e=N(d);e;e=N(d))c.push(e instanceof ob?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:d=Fb(a);this.singleNodeValue=d instanceof ob?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}W.ANY_TYPE=0;W.NUMBER_TYPE=1;W.STRING_TYPE=2;W.BOOLEAN_TYPE=3;W.UNORDERED_NODE_ITERATOR_TYPE=4;W.ORDERED_NODE_ITERATOR_TYPE=5;W.UNORDERED_NODE_SNAPSHOT_TYPE=6;W.ORDERED_NODE_SNAPSHOT_TYPE=7;W.ANY_UNORDERED_NODE_TYPE=8;W.FIRST_ORDERED_NODE_TYPE=9;function Cc(a){this.lookupNamespaceURI=yc(a)} -function Dc(a,b){var c=a||m,d=c.document;if(!d.evaluate||b)c.XPathResult=W,d.evaluate=function(a,b,c,d){return(new Bc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Bc(a,b)},d.createNSResolver=function(a){return new Cc(a)}}aa("wgxpath.install",Dc);var X={};X.F=function(){var a={R:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -X.u=function(a,b,c){var d=B(a);if(!d.documentElement)return null;(x||jb)&&Dc(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):X.F;if(x&&!Xa(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=Number(z)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var l=g[k],r=l.namespaceURI;if(r&&!f[r]){var G=l.lookupPrefix(r);if(!G)var A=r.match(".*/(\\w+)/?$"),G=A?A[1]:"xhtml";f[r]=G}}var t={},F;for(F in f)t[f[F]]=F;e=function(a){return t[a]|| -null}}try{return d.evaluate(b,a,e,c,null)}catch(I){if("TypeError"===I.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):X.F,d.evaluate(b,a,e,c,null);throw I;}}catch(I){if(!y||"NS_ERROR_ILLEGAL_VALUE"!=I.name)throw new Da(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+I);}};X.G=function(a,b){if(!a||1!=a.nodeType)throw new Da(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -X.J=function(a,b){var c=function(){var c=X.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||X.G(c,a);return c}; -X.O=function(a,b){var c=function(){var c=X.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=B(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();q(c,function(b){X.G(b,a)});return c};function Ec(a){return(a=a.exec(v))?a[1]:""}var Fc=function(){if(gb)return Ec(/Firefox\/([0-9.]+)/);if(x||Pa||Oa)return Va;if(kb)return Ec(/Chrome\/([0-9.]+)/);if(lb&&!(Na()||w("iPad")||w("iPod")))return Ec(/Version\/([0-9.]+)/);if(hb||ib){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(v))return a[1]+"."+a[2]}else if(jb)return(a=Ec(/Android\s+([0-9.]+)/))?a:Ec(/Version\/([0-9.]+)/);return""}();var Gc,Hc;function Ic(a){return Jc?Gc(a):x?0<=ma(z,a):Xa(a)}function Kc(a){Jc?Hc(a):jb?ma(Lc,a):ma(Fc,a)} -var Jc=function(){if(!y)return!1;var a=m.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;Gc=function(a){return 0<=c.compare(d,""+a)};Hc=function(a){c.compare(e,""+a)};return!0}(),Mc;if(jb){var Nc=/Android\s+([0-9\.]+)/.exec(v);Mc=Nc?Nc[1]:"0"}else Mc="0"; -var Lc=Mc,Oc=x&&!(9<=Number(z));jb&&Kc(2.3);jb&&Kc(4);lb&&Kc(6);function Pc(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=Pc.prototype;h.clone=function(){return new Pc(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof Pc?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -h.scale=function(a,b){var c=da(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function Y(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=Y.prototype;h.clone=function(){return new Y(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof Y?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=da(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Qc(a,b){var c=B(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}var Rc={thin:2,medium:4,thick:6}; -function Sc(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in Rc)d=Rc[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};function Tc(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function Uc(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return Tc(a)?a:null} -function Vc(a,b){var c=oa(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=Oc?"styleFloat":"cssFloat";var d=Qc(a,c)||Wc(a,c);if(null===d)d=null;else if(0<=pa(ya,c)){b:{var e=d.match(Ba);if(e){var c=Number(e[1]),f=Number(e[2]),g=Number(e[3]),e=Number(e[4]);if(0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g&&0<=e&&1>=e){c=[c,f,g,e];break b}}c=null}if(!c)b:{if(g=d.match(Ca))if(c=Number(g[1]),f=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g){c=[c,f,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase(); -f=xa[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(za,"#$1$1$2$2$3$3")),!Aa.test(f))){c=null;break b}c=[parseInt(f.substr(1,2),16),parseInt(f.substr(3,2),16),parseInt(f.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}function Wc(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(c=Uc(a))?Wc(c,b):null} -function Xc(a,b){function c(a){function b(a){return a==k?!0:0==Vc(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==Vc(a,"position")?!1:!0}var c=Vc(a,"position");if("fixed"==c)return G=!0,a==k?null:k;for(a=Uc(a);a&&!b(a);)a=Uc(a);return a}function d(a){var b=a;if("visible"==r)if(a==k&&l)b=l;else if(a==l)return{x:"visible",y:"visible"};b={x:Vc(b,"overflow-x"),y:Vc(b,"overflow-y")};a==k&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==k){var b= -(new fb(g)).a;a=b.scrollingElement?b.scrollingElement:Qa||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=x&&Xa("10")&&b.pageYOffset!=a.scrollTop?new $a(a.scrollLeft,a.scrollTop):new $a(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new $a(a.scrollLeft,a.scrollTop);return a}for(var f=Yc(a,b),g=B(a),k=g.documentElement,l=g.body,r=Vc(k,"overflow"),G,A=c(a);A;A=c(A)){var t=d(A);if("visible"!=t.x||"visible"!=t.y){var F=Zc(A);if(0== -F.width||0==F.height)return"hidden";var I=f.right<F.left,Za=f.bottom<F.top;if(I&&"hidden"==t.x||Za&&"hidden"==t.y)return"hidden";if(I&&"visible"!=t.x||Za&&"visible"!=t.y){I=e(A);Za=f.bottom<F.top-I.y;if(f.right<F.left-I.x&&"visible"!=t.x||Za&&"visible"!=t.x)return"hidden";f=Xc(A);return"hidden"==f?"hidden":"scroll"}I=f.left>=F.left+F.width;F=f.top>=F.top+F.height;if(I&&"hidden"==t.x||F&&"hidden"==t.y)return"hidden";if(I&&"visible"!=t.x||F&&"visible"!=t.y){if(G&&(t=e(A),f.left>=k.scrollWidth-t.x|| -f.right>=k.scrollHeight-t.y))return"hidden";f=Xc(A);return"hidden"==f?"hidden":"scroll"}}}return"none"} -function Zc(a){var b;var c=Tc(a,"MAP");if(c||Tc(a,"AREA")){var d=c?a:Tc(a.parentNode,"MAP")?a.parentNode:null,e=b=null;if(d&&d.name&&(b=X.J('/descendant::*[@usemap = "#'+d.name+'"]',B(d)))&&(e=Zc(b),!c&&"default"!=a.shape.toLowerCase()))var c=$c(a),d=Math.min(Math.max(c.left,0),e.width),f=Math.min(Math.max(c.top,0),e.height),e=new Y(d+e.left,f+e.top,Math.min(c.width,e.width-d),Math.min(c.height,e.height-f));b={a:b,rect:e||new Y(0,0,0,0)}}else b=null;if(b)return b.rect;if(Tc(a,"HTML"))return a=B(a), -a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new ab(a.clientWidth,a.clientHeight),new Y(0,0,a.width,a.height);var g;try{g=a.getBoundingClientRect()}catch(k){return new Y(0,0,0,0)}g=new Y(g.left,g.top,g.right-g.left,g.bottom-g.top);x&&a.ownerDocument.body&&(a=B(a),g.left-=a.documentElement.clientLeft+a.body.clientLeft,g.top-=a.documentElement.clientTop+a.body.clientTop);return g} -function $c(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new Y(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new Y(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new Y(b,c,d-b,e-c)}return new Y(0,0,0,0)} -function Yc(a,b){var c;c=Zc(a);c=new Pc(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof Y?b:new Y(b.x,b.y,1,1);c.left=Math.min(Math.max(c.left+d.left,c.left),c.right);c.top=Math.min(Math.max(c.top+d.top,c.top),c.bottom);c.right=Math.min(Math.max(c.left+d.width,c.left),c.right);c.bottom=Math.min(Math.max(c.top+d.height,c.top),c.bottom)}return c};Qa||Jc&&Kc(3.6);x&&Ic(10);jb&&Kc(4);function ad(a,b){this.v={};this.l=[];this.b=this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)bd(this,arguments[d],arguments[d+1])}else if(a){var e;if(a instanceof ad)for(d=cd(a),dd(a),e=[],c=0;c<a.l.length;c++)e.push(a.v[a.l[c]]);else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)bd(this,d[c],e[c])}}function cd(a){dd(a);return a.l.concat()} -ad.prototype.clear=function(){this.v={};this.b=this.a=this.l.length=0};function dd(a){if(a.a!=a.l.length){for(var b=0,c=0;b<a.l.length;){var d=a.l[b];Object.prototype.hasOwnProperty.call(a.v,d)&&(a.l[c++]=d);b++}a.l.length=c}if(a.a!=a.l.length){for(var e={},c=b=0;b<a.l.length;)d=a.l[b],Object.prototype.hasOwnProperty.call(e,d)||(a.l[c++]=d,e[d]=1),b++;a.l.length=c}}ad.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.v,a)?this.v[a]:b}; -function bd(a,b,c){Object.prototype.hasOwnProperty.call(a.v,b)||(a.a++,a.l.push(b),a.b++);a.v[b]=c}ad.prototype.forEach=function(a,b){for(var c=cd(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};ad.prototype.clone=function(){return new ad(this)};var ed={};function Z(a,b,c){ea(a)&&(a=y?a.f:a.g);a=new fd(a);!b||b in ed&&!c||(ed[b]={key:a,shift:!1},c&&(ed[c]={key:a,shift:!0}));return a}function fd(a){this.code=a}Z(8);Z(9);Z(13);var gd=Z(16),hd=Z(17),id=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","(");Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D"); -Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var jd=Z(Sa?{f:91,g:91}:Ra?{f:224,g:91}:{f:0,g:91});Z(Sa?{f:92,g:92}:Ra?{f:224,g:93}:{f:0,g:92});Z(Sa?{f:93,g:93}:Ra?{f:0,g:0}:{f:93,g:null});Z({f:96,g:96},"0");Z({f:97,g:97},"1"); -Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?");Z(192,"`","~");Z(219,"[","{"); -Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var kd=new ad;bd(kd,1,gd);bd(kd,2,hd);bd(kd,4,id);bd(kd,8,jd);(function(a){var b=new ad;q(cd(a),function(c){bd(b,a.get(c).code,c)});return b})(kd);y&&Ic(12);function ld(a,b){var c=Xc(a,b);if("scroll"!=c)return"none"==c;if(a.scrollIntoView&&(a.scrollIntoView(),"none"==Xc(a,b)))return!0;for(var c=Yc(a,b),d=Uc(a);d;d=Uc(d)){var e=d,f=Zc(e),g;var k=e;if(!x||9<=Number(z))l=Qc(k,"borderLeftWidth"),g=Qc(k,"borderRightWidth"),r=Qc(k,"borderTopWidth"),k=Qc(k,"borderBottomWidth"),g=new Pc(parseFloat(r),parseFloat(g),parseFloat(k),parseFloat(l));else{var l=Sc(k,"borderLeft");g=Sc(k,"borderRight");var r=Sc(k,"borderTop"),k=Sc(k,"borderBottom");g=new Pc(r,g,k,l)}l= -c.left-f.left-g.left;f=c.top-f.top-g.top;g=e.clientHeight+c.top-c.bottom;e.scrollLeft+=Math.min(l,Math.max(l-(e.clientWidth+c.left-c.right),0));e.scrollTop+=Math.min(f,Math.max(f-g,0))}return"none"==Xc(a,b)};function md(){} -function nd(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ba(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),nd(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),od(d,c),c.push(":"),nd(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":od(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var pd={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},qd=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function od(a,b){b.push('"',a.replace(qd,function(a){var b=pd[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),pd[a]=b);return b}),'"')};Qa||y&&Ic(3.5)||x&&Ic(8);function rd(a){switch(ba(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return ra(a,rd);case "object":if(Ja(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=sd(a);return b}if(Ja(a,"document"))return b={},b.WINDOW=sd(a),b;if(ca(a))return ra(a,rd);a=Ha(a,function(a,b){return da(b)||n(b)});return Ia(a,rd);default:return null}} -function td(a,b){return"array"==ba(a)?ra(a,function(a){return td(a,b)}):ea(a)?"function"==typeof a?a:Ja(a,"ELEMENT")?ud(a.ELEMENT,b):Ja(a,"WINDOW")?ud(a.WINDOW,b):Ia(a,function(a){return td(a,b)}):a}function vd(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.C=ja());b.C||(b.C=ja());return b}function sd(a){var b=vd(a.ownerDocument),c=Ka(b,function(b){return b==a});c||(c=":wdc:"+b.C++,b[c]=a);return c} -function ud(a,b){a=decodeURIComponent(a);var c=b||document,d=vd(c);if(!Ja(d,a))throw new Da(10,"Element does not exist in cache");var e=d[a];if(Ja(e,"setInterval")){if(e.closed)throw delete d[a],new Da(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new Da(10,"Element is no longer attached to the DOM");};aa("_",function(a,b){var c=[a,b],d=ld,e;try{a:{var f=d;if(n(f))try{d=new ka.Function(f);break a}catch(l){if(x&&ka.execScript){ka.execScript(";");d=new ka.Function(f);break a}throw l;}d=ka==window?f:new ka.Function("return ("+f+").apply(null,arguments);")}var g=td(c,ka.document),k=d.apply(null,g);e={status:0,value:rd(k)}}catch(l){e={status:Ja(l,"code")?l.code:13,value:{message:l.message}}}c=[];nd(new md,e,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/submit.js b/src/ghostdriver/third_party/webdriver-atoms/submit.js deleted file mode 100644 index 752d07bb58..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/submit.js +++ /dev/null @@ -1,156 +0,0 @@ -function(){return function(){var h,aa=this;function l(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){return"function"==ca(a)}function ga(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ha="closure_uid_"+(1E9*Math.random()>>>0),ia=0;function ja(a,b,c){return a.call.apply(a.bind,arguments)} -function ka(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function la(a,b,c){la=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ja:ka;return la.apply(null,arguments)} -function ma(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var na=Date.now||function(){return+new Date};function p(a,b){function c(){}c.prototype=b.prototype;a.X=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.W=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var oa=window;var pa;function qa(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var ra=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function sa(a,b){for(var c=0,d=ra(String(a)).split("."),e=ra(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",n=e[g]||"",v=RegExp("(\\d*)(\\D*)","g"),u=RegExp("(\\d*)(\\D*)","g");do{var E=v.exec(k)||["","",""],y=u.exec(n)||["","",""];if(0==E[0].length&&0==y[0].length)break;c=ta(0==E[1].length?0:parseInt(E[1],10),0==y[1].length?0:parseInt(y[1],10))||ta(0==E[2].length,0==y[2].length)||ta(E[2],y[2])}while(0==c)}return c}function ta(a,b){return a<b?-1:a>b?1:0} -function ua(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function q(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)}function va(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}function wa(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function xa(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function ya(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function za(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0}function Aa(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]} -function Ba(a,b){var c;a:if(m(a))c=m(b)&&1==b.length?a.indexOf(b,0):-1;else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function Ca(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function Da(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Ea={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Fa="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ga=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ha=/^#(?:[0-9a-f]{3}){1,2}$/i,Ia=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ja=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function r(a,b){this.code=a;this.a=t[a]||Ka;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}p(r,Error);var Ka="unknown error",t={15:"element not selectable",11:"element not visible"};t[31]=Ka;t[30]=Ka;t[24]="invalid cookie domain";t[29]="invalid element coordinates";t[12]="invalid element state"; -t[32]="invalid selector";t[51]="invalid selector";t[52]="invalid selector";t[17]="javascript error";t[405]="unsupported operation";t[34]="move target out of bounds";t[27]="no such alert";t[7]="no such element";t[8]="no such frame";t[23]="no such window";t[28]="script timeout";t[33]="session not created";t[10]="stale element reference";t[21]="timeout";t[25]="unable to set cookie";t[26]="unexpected alert open";t[13]=Ka;t[9]="unknown command";r.prototype.toString=function(){return this.name+": "+this.message};var La;a:{var Ma=aa.navigator;if(Ma){var Na=Ma.userAgent;if(Na){La=Na;break a}}La=""}function w(a){return-1!=La.indexOf(a)};function Oa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Pa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Qa(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ra(a,b){return null!==a&&b in a}function Sa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ta(){return w("Opera")||w("OPR")}function Ua(){return(w("Chrome")||w("CriOS"))&&!Ta()&&!w("Edge")};function Va(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Wa=Ta(),x=w("Trident")||w("MSIE"),Xa=w("Edge"),z=w("Gecko")&&!(-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Ya=-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"),Za=Ya&&w("Mobile"),$a=w("Macintosh"),ab=w("Windows");function bb(){var a=La;if(z)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Xa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ya)return/WebKit\/(\S+)/.exec(a)} -function cb(){var a=aa.document;return a?a.documentMode:void 0}var db=function(){if(Wa&&aa.opera){var a;var b=aa.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=bb())&&(a=b?b[1]:"");return x&&(b=cb(),null!=b&&b>parseFloat(a))?String(b):a}(),eb={};function fb(a){return eb[a]||(eb[a]=0<=sa(db,a))}var gb=aa.document,hb=gb&&x?cb()||("CSS1Compat"==gb.compatMode?parseInt(db,10):5):void 0;!z&&!x||x&&9<=Number(hb)||z&&fb("1.9.1");x&&fb("9");function ib(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}h=ib.prototype;h.clone=function(){return new ib(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=ea(b)?b:a;this.x*=a;this.y*=c;return this};function jb(a,b){this.width=a;this.height=b}h=jb.prototype;h.clone=function(){return new jb(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.width*=a;this.height*=c;return this};function kb(a){return a?new lb(A(a)):pa||(pa=new lb)}function mb(a){return a?a.parentWindow||a.defaultView:window}function nb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function ob(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function pb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(hb))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?qb(a,b):!c&&ob(e,b)?-1*rb(a,b):!d&&ob(f,a)?rb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=A(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function rb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return qb(d,a)}function qb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function A(a){return 9==a.nodeType?a:a.ownerDocument||a.document}var sb={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},tb={IMG:" ",BR:"\n"}; -function ub(a,b,c){if(!(a.nodeName in sb))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in tb)b.push(tb[a.nodeName]);else for(a=a.firstChild;a;)ub(a,b,c),a=a.nextSibling}function vb(a,b,c){c||(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function lb(a){this.a=a||aa.document||document} -function wb(a,b,c,d){a=d||a.a;b=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(b||c))c=a.querySelectorAll(b+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(a=a.getElementsByClassName(c),b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g.nodeName&&(d[e++]=g);d.length=e;c=d}else c=a;else if(a=a.getElementsByTagName(b||"*"),c){d={};for(f=e=0;g=a[f];f++)b=g.className,"function"==typeof b.split&&Ba(b.split(/\s+/),c)&&(d[e++]=g);d.length=e;c=d}else c=a;return c} -lb.prototype.contains=ob;var xb=w("Firefox"),yb=Va()||w("iPod"),zb=w("iPad"),Ab=w("Android")&&!(Ua()||w("Firefox")||Ta()||w("Silk")),Bb=Ua(),Cb=w("Safari")&&!(Ua()||w("Coast")||Ta()||w("Edge")||w("Silk")||w("Android"))&&!(Va()||w("iPad")||w("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Db(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var Eb=x&&!(9<=Number(hb)),Fb=x&&!(8<=Number(hb));function Gb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Hb(a,b){var c=Fb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Gb(b,a,b.nodeName,c)};function Ib(a){this.b=a;this.a=0}function Kb(a){a=a.match(Lb);for(var b=0;b<a.length;b++)Mb.test(a[b])&&a.splice(b,1);return new Ib(a)}var Lb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Mb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function C(a){return a.b[a.a++]}function Nb(a){return a.b.length<=a.a};function Ob(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(Eb&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),Eb&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function Pb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Fb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Qb(a,b,c,d,e){return(Eb?Rb:Sb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)} -function Rb(a,b,c,d,e){if(a instanceof Tb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Ub(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)Pb(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||F(e,b);return e}Vb(a,b,c,d,e);return e} -function Sb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&F(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&F(e,b)})):a instanceof Wb?Vb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),q(b,function(a){Pb(a,c,d)&&F(e,a)}));return e} -function Xb(a,b,c,d,e){var f;if((a instanceof Tb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ub(a);if("*"!=g&&(f=va(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=va(f,function(a){return Pb(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||F(e,a)});return e}return Yb(a,b,c,d,e)}function Yb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&F(e,b);return e} -function Vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&F(e,b),Vb(a,b,c,d,e)}function Ub(a){if(a instanceof Wb){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function D(){this.b=this.a=null;this.o=0}function Zb(a){this.node=a;this.a=this.b=null}function $b(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof Gb&&k instanceof Gb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<pb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.o=g;return a} -D.prototype.unshift=function(a){a=new Zb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.o++};function F(a,b){var c=new Zb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.o++}function ac(a){return(a=a.a)?a.node:null}function bc(a){return(a=ac(a))?Ob(a):""}function cc(a,b){return new dc(a,!!b)}function dc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function G(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function H(a){this.l=a;this.b=this.j=!1;this.f=null}function I(a){return"\n "+a.toString().split("\n").join("\n ")}function ec(a,b){a.j=b}function fc(a,b){a.b=b}function J(a,b){var c=a.a(b);return c instanceof D?+bc(c):+c}function K(a,b){var c=a.a(b);return c instanceof D?bc(c):""+c}function gc(a,b){var c=a.a(b);return c instanceof D?!!c.o:!!c};function hc(a,b,c){H.call(this,a.l);this.c=a;this.i=b;this.v=c;this.j=b.j||c.j;this.b=b.b||c.b;this.c==ic&&(c.b||c.j||4==c.l||0==c.l||!b.f?b.b||b.j||4==b.l||0==b.l||!c.f||(this.f={name:c.f.name,B:b}):this.f={name:b.f.name,B:c})}p(hc,H); -function jc(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof D&&c instanceof D){b=cc(b);for(d=G(b);d;d=G(b))for(e=cc(c),f=G(e);f;f=G(e))if(a(Ob(d),Ob(f)))return!0;return!1}if(b instanceof D||c instanceof D){b instanceof D?(e=b,d=c):(e=c,d=b);f=cc(e);for(var g=typeof d,k=G(f);k;k=G(f)){switch(g){case "number":k=+Ob(k);break;case "boolean":k=!!Ob(k);break;case "string":k=Ob(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}hc.prototype.a=function(a){return this.c.u(this.i,this.v,a)};hc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+I(this.i);return a+=I(this.v)};function kc(a,b,c,d){this.a=a;this.N=b;this.l=c;this.u=d}kc.prototype.toString=function(){return this.a};var lc={}; -function L(a,b,c,d){if(lc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new kc(a,b,c,d);return lc[a.toString()]=a}L("div",6,1,function(a,b,c){return J(a,c)/J(b,c)});L("mod",6,1,function(a,b,c){return J(a,c)%J(b,c)});L("*",6,1,function(a,b,c){return J(a,c)*J(b,c)});L("+",5,1,function(a,b,c){return J(a,c)+J(b,c)});L("-",5,1,function(a,b,c){return J(a,c)-J(b,c)});L("<",4,2,function(a,b,c){return jc(function(a,b){return a<b},a,b,c)}); -L(">",4,2,function(a,b,c){return jc(function(a,b){return a>b},a,b,c)});L("<=",4,2,function(a,b,c){return jc(function(a,b){return a<=b},a,b,c)});L(">=",4,2,function(a,b,c){return jc(function(a,b){return a>=b},a,b,c)});var ic=L("=",3,2,function(a,b,c){return jc(function(a,b){return a==b},a,b,c,!0)});L("!=",3,2,function(a,b,c){return jc(function(a,b){return a!=b},a,b,c,!0)});L("and",2,2,function(a,b,c){return gc(a,c)&&gc(b,c)});L("or",1,2,function(a,b,c){return gc(a,c)||gc(b,c)});function mc(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");H.call(this,a.l);this.c=a;this.i=b;this.j=a.j;this.b=a.b}p(mc,H);mc.prototype.a=function(a){a=this.c.a(a);return nc(this.i,a)};mc.prototype.toString=function(){var a;a="Filter:"+I(this.c);return a+=I(this.i)};function oc(a,b){if(b.length<a.O)throw Error("Function "+a.m+" expects at least"+a.O+" arguments, "+b.length+" given");if(null!==a.G&&b.length>a.G)throw Error("Function "+a.m+" expects at most "+a.G+" arguments, "+b.length+" given");a.V&&q(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.m+" is not of type Nodeset: "+b);});H.call(this,a.l);this.i=a;this.c=b;ec(this,a.j||ya(b,function(a){return a.j}));fc(this,a.U&&!b.length||a.T&&!!b.length||ya(b,function(a){return a.b}))} -p(oc,H);oc.prototype.a=function(a){return this.i.u.apply(null,Ca(a,this.c))};oc.prototype.toString=function(){var a="Function: "+this.i;if(this.c.length)var b=xa(this.c,function(a,b){return a+I(b)},"Arguments:"),a=a+I(b);return a};function pc(a,b,c,d,e,f,g,k,n){this.m=a;this.l=b;this.j=c;this.U=d;this.T=e;this.u=f;this.O=g;this.G=l(k)?k:g;this.V=!!n}pc.prototype.toString=function(){return this.m};var qc={}; -function N(a,b,c,d,e,f,g,k){if(qc.hasOwnProperty(a))throw Error("Function already created: "+a+".");qc[a]=new pc(a,b,c,d,!1,e,f,g,k)}N("boolean",2,!1,!1,function(a,b){return gc(b,a)},1);N("ceiling",1,!1,!1,function(a,b){return Math.ceil(J(b,a))},1);N("concat",3,!1,!1,function(a,b){return xa(Da(arguments,1),function(b,d){return b+K(d,a)},"")},2,null);N("contains",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return-1!=b.indexOf(a)},2);N("count",1,!1,!1,function(a,b){return b.a(a).o},1,1,!0); -N("false",2,!1,!1,function(){return!1},0);N("floor",1,!1,!1,function(a,b){return Math.floor(J(b,a))},1);N("id",4,!1,!1,function(a,b){function c(a){if(Eb){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return Aa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=K(b,a).split(/\s+/),f=[];q(d,function(a){(a=c(a))&&!Ba(f,a)&&f.push(a)});f.sort(pb);var g=new D;q(f,function(a){F(g,a)});return g},1); -N("lang",2,!1,!1,function(){return!1},1);N("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);N("local-name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);N("name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);N("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -N("normalize-space",3,!1,!0,function(a,b){return(b?K(b,a):Ob(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);N("not",2,!1,!1,function(a,b){return!gc(b,a)},1);N("number",1,!1,!0,function(a,b){return b?J(b,a):+Ob(a.a)},0,1);N("position",1,!0,!1,function(a){return a.b},0);N("round",1,!1,!1,function(a,b){return Math.round(J(b,a))},1);N("starts-with",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return 0==b.lastIndexOf(a,0)},2);N("string",3,!1,!0,function(a,b){return b?K(b,a):Ob(a.a)},0,1); -N("string-length",1,!1,!0,function(a,b){return(b?K(b,a):Ob(a.a)).length},0,1);N("substring",3,!1,!1,function(a,b,c,d){c=J(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?J(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=K(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);N("substring-after",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -N("substring-before",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);N("sum",1,!1,!1,function(a,b){for(var c=cc(b.a(a)),d=0,e=G(c);e;e=G(c))d+=+Ob(e);return d},1,1,!0);N("translate",3,!1,!1,function(a,b,c,d){b=K(b,a);c=K(c,a);var e=K(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);N("true",2,!1,!1,function(){return!0},0);function Wb(a,b){this.i=a;this.c=l(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function rc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}Wb.prototype.a=function(a){return null===this.b||this.b==a.nodeType};Wb.prototype.f=function(){return this.i}; -Wb.prototype.toString=function(){var a="Kind Test: "+this.i;null===this.c||(a+=I(this.c));return a};function sc(a){H.call(this,3);this.c=a.substring(1,a.length-1)}p(sc,H);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Literal: "+this.c};function Tb(a,b){this.m=a.toLowerCase();var c;c="*"==this.m?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Tb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.m&&this.m!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Tb.prototype.f=function(){return this.m};Tb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.m};function tc(a){H.call(this,1);this.c=a}p(tc,H);tc.prototype.a=function(){return this.c};tc.prototype.toString=function(){return"Number: "+this.c};function uc(a,b){H.call(this,a.l);this.i=a;this.c=b;this.j=a.j;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.D||c.c!=vc||(c=c.v,"*"!=c.f()&&(this.f={name:c.f(),B:null}))}}p(uc,H);function wc(){H.call(this,4)}p(wc,H);wc.prototype.a=function(a){var b=new D;a=a.a;9==a.nodeType?F(b,a):F(b,a.ownerDocument);return b};wc.prototype.toString=function(){return"Root Helper Expression"};function xc(){H.call(this,4)}p(xc,H);xc.prototype.a=function(a){var b=new D;F(b,a.a);return b};xc.prototype.toString=function(){return"Context Helper Expression"}; -function yc(a){return"/"==a||"//"==a}uc.prototype.a=function(a){var b=this.i.a(a);if(!(b instanceof D))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.o;c++){var e=a[c],f=cc(b,e.c.a),g;if(e.j||e.c!=zc)if(e.j||e.c!=Ac)for(g=G(f),b=e.a(new Db(g));null!=(g=G(f));)g=e.a(new Db(g)),b=$b(b,g);else g=G(f),b=e.a(new Db(g));else{for(g=G(f);(b=G(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Db(g))}}return b}; -uc.prototype.toString=function(){var a;a="Path Expression:"+I(this.i);if(this.c.length){var b=xa(this.c,function(a,b){return a+I(b)},"Steps:");a+=I(b)}return a};function Bc(a,b){this.a=a;this.b=!!b} -function nc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=cc(b),f=b.o,g,k=0;g=G(e);k++){var n=a.b?f-k:k+1;g=d.a(new Db(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof D)n=0<g.o;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var v=n.a;if(!v)throw Error("Next must be called at least once before remove.");var u=v.b,v=v.a;u?u.a=v:g.a=v;v?v.b=u:g.b=u;g.o--;n.a=null}}return b} -Bc.prototype.toString=function(){return xa(this.a,function(a,b){return a+I(b)},"Predicates:")};function Cc(a,b,c,d){H.call(this,4);this.c=a;this.v=b;this.i=c||new Bc([]);this.D=!!d;b=this.i;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=Eb?a.toLowerCase():a,this.f={name:a,B:b.B});a:{a=this.i;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.j||1==c.l||0==c.l){a=!0;break a}a=!1}this.j=a}p(Cc,H); -Cc.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.B?K(c.B,a):null,f=1);if(this.D)if(this.j||this.c!=Dc)if(a=cc((new Cc(Ec,new Wb("node"))).a(a)),b=G(a))for(c=this.u(b,d,e,f);null!=(b=G(a));)c=$b(c,this.u(b,d,e,f));else c=new D;else c=Qb(this.v,b,d,e),c=nc(this.i,c,f);else c=this.u(a.a,d,e,f);return c};Cc.prototype.u=function(a,b,c,d){a=this.c.f(this.v,a,b,c);return a=nc(this.i,a,d)}; -Cc.prototype.toString=function(){var a;a="Step:"+I("Operator: "+(this.D?"//":"/"));this.c.m&&(a+=I("Axis: "+this.c));a+=I(this.v);if(this.i.a.length){var b=xa(this.i.a,function(a,b){return a+I(b)},"Predicates:");a+=I(b)}return a};function Fc(a,b,c,d){this.m=a;this.f=b;this.a=c;this.b=d}Fc.prototype.toString=function(){return this.m};var Gc={};function O(a,b,c,d){if(Gc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Fc(a,b,c,!!d);return Gc[a]=b} -O("ancestor",function(a,b){for(var c=new D,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);O("ancestor-or-self",function(a,b){var c=new D,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var vc=O("attribute",function(a,b){var c=new D,d=a.f();if("style"==d&&b.style&&Eb)return F(c,new Gb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof Wb&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)Eb?f.nodeValue&&F(c,Hb(b,f)):F(c,f);else(f=e.getNamedItem(d))&&(Eb?f.nodeValue&&F(c,Hb(b,f)):F(c,f));return c},!1),Dc=O("child",function(a,b,c,d,e){return(Eb?Xb:Yb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)},!1,!0);O("descendant",Qb,!1,!0); -var Ec=O("descendant-or-self",function(a,b,c,d){var e=new D;Pb(b,c,d)&&a.a(b)&&F(e,b);return Qb(a,b,c,d,e)},!1,!0),zc=O("following",function(a,b,c,d){var e=new D;do for(var f=b;f=f.nextSibling;)Pb(f,c,d)&&a.a(f)&&F(e,f),e=Qb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);O("following-sibling",function(a,b){for(var c=new D,d=b;d=d.nextSibling;)a.a(d)&&F(c,d);return c},!1);O("namespace",function(){return new D},!1); -var Hc=O("parent",function(a,b){var c=new D;if(9==b.nodeType)return c;if(2==b.nodeType)return F(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&F(c,d);return c},!1),Ac=O("preceding",function(a,b,c,d){var e=new D,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var v=0,u=n.length;v<u;v++)b=n[v],Pb(b,c,d)&&a.a(b)&&F(e,b),e=Qb(a,b,c,d,e)}return e},!0,!0); -O("preceding-sibling",function(a,b){for(var c=new D,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Ic=O("self",function(a,b){var c=new D;a.a(b)&&F(c,b);return c},!1);function Jc(a){H.call(this,1);this.c=a;this.j=a.j;this.b=a.b}p(Jc,H);Jc.prototype.a=function(a){return-J(this.c,a)};Jc.prototype.toString=function(){return"Unary Expression: -"+I(this.c)};function Kc(a){H.call(this,4);this.c=a;ec(this,ya(this.c,function(a){return a.j}));fc(this,ya(this.c,function(a){return a.b}))}p(Kc,H);Kc.prototype.a=function(a){var b=new D;q(this.c,function(c){c=c.a(a);if(!(c instanceof D))throw Error("Path expression must evaluate to NodeSet.");b=$b(b,c)});return b};Kc.prototype.toString=function(){return xa(this.c,function(a,b){return a+I(b)},"Union Expression:")};function Lc(a,b){this.a=a;this.b=b}function Mc(a){for(var b,c=[];;){P(a,"Missing right hand side of binary expression.");b=Nc(a);var d=C(a.a);if(!d)break;var e=(d=lc[d]||null)&&d.N;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].N;)b=new hc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new hc(c.pop(),c.pop(),b);return b}function P(a,b){if(Nb(a.a))throw Error(b);}function Oc(a,b){var c=C(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function Pc(a){a=C(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Qc(a){a=C(a.a);if(2>a.length)throw Error("Unclosed literal string");return new sc(a)} -function Rc(a){var b,c=[],d;if(yc(B(a.a))){b=C(a.a);d=B(a.a);if("/"==b&&(Nb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new wc;d=new wc;P(a,"Missing next location step.");b=Sc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":C(a.a);b=Mc(a);P(a,'unclosed "("');Oc(a,")");break;case '"':case "'":b=Qc(a);break;default:if(isNaN(+b))if(!rc(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=C(a.a); -b=qc[b]||null;C(a.a);for(d=[];")"!=B(a.a);){P(a,"Missing function argument list.");d.push(Mc(a));if(","!=B(a.a))break;C(a.a)}P(a,"Unclosed function argument list.");Pc(a);b=new oc(b,d)}else{b=null;break a}else b=new tc(+C(a.a))}"["==B(a.a)&&(d=new Bc(Tc(a)),b=new mc(b,d))}if(b)if(yc(B(a.a)))d=b;else return b;else b=Sc(a,"/"),d=new xc,c.push(b)}for(;yc(B(a.a));)b=C(a.a),P(a,"Missing next location step."),b=Sc(a,b),c.push(b);return new uc(d,c)} -function Sc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new Cc(Ic,new Wb("node")),C(a.a),d;if(".."==B(a.a))return d=new Cc(Hc,new Wb("node")),C(a.a),d;var f;if("@"==B(a.a))f=vc,C(a.a),P(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+C(a.a));c=C(a.a);f=Gc[c]||null;if(!f)throw Error("No axis with name: "+c);C(a.a);P(a,"Missing node name")}else f=Dc;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!rc(c))throw Error("Invalid node type: "+c);c=C(a.a);if(!rc(c))throw Error("Invalid type name: "+c);Oc(a,"(");P(a,"Bad nodetype");e=B(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Qc(a);P(a,"Bad nodetype");Pc(a);c=new Wb(c,g)}else if(c=C(a.a),e=c.indexOf(":"),-1==e)c=new Tb(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Tb(c,k)}else throw Error("Bad token: "+C(a.a));e=new Bc(Tc(a),f.a);return d|| -new Cc(f,c,e,"//"==b)}function Tc(a){for(var b=[];"["==B(a.a);){C(a.a);P(a,"Missing predicate expression.");var c=Mc(a);b.push(c);P(a,"Unclosed predicate expression.");Oc(a,"]")}return b}function Nc(a){if("-"==B(a.a))return C(a.a),new Jc(Nc(a));var b=Rc(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==C(a.a);)P(a,"Missing next union location path."),b.push(Rc(a));a.a.a--;a=new Kc(b)}return a};function Uc(a){switch(a.nodeType){case 1:return ma(Vc,a);case 9:return Uc(a.documentElement);case 11:case 10:case 6:case 12:return Wc;default:return a.parentNode?Uc(a.parentNode):Wc}}function Wc(){return null}function Vc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Vc(a.parentNode,b):null};function Xc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Kb(a);if(Nb(c))throw Error("Invalid XPath expression.");b?fa(b)||(b=la(b.lookupNamespaceURI,b)):b=function(){return null};var d=Mc(new Lc(c,b));if(!Nb(c))throw Error("Bad token: "+C(c));this.evaluate=function(a,b){var c=d.a(new Db(a));return new Q(c,b)}} -function Q(a,b){if(0==b)if(a instanceof D)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof D))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof D?bc(a):""+a;break;case 1:this.numberValue=a instanceof D?+bc(a):+a;break;case 3:this.booleanValue=a instanceof D?0<a.o:!!a;break;case 4:case 5:case 6:case 7:var d= -cc(a);c=[];for(var e=G(d);e;e=G(d))c.push(e instanceof Gb?e.a:e);this.snapshotLength=a.o;this.invalidIteratorState=!1;break;case 8:case 9:d=ac(a);this.singleNodeValue=d instanceof Gb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}Q.ANY_TYPE=0;Q.NUMBER_TYPE=1;Q.STRING_TYPE=2;Q.BOOLEAN_TYPE=3;Q.UNORDERED_NODE_ITERATOR_TYPE=4;Q.ORDERED_NODE_ITERATOR_TYPE=5;Q.UNORDERED_NODE_SNAPSHOT_TYPE=6;Q.ORDERED_NODE_SNAPSHOT_TYPE=7;Q.ANY_UNORDERED_NODE_TYPE=8;Q.FIRST_ORDERED_NODE_TYPE=9;function Yc(a){this.lookupNamespaceURI=Uc(a)} -function Zc(a,b){var c=a||aa,d=c.document;if(!d.evaluate||b)c.XPathResult=Q,d.evaluate=function(a,b,c,d){return(new Xc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Xc(a,b)},d.createNSResolver=function(a){return new Yc(a)}}ba("wgxpath.install",Zc);var S={};S.H=function(){var a={Y:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -S.u=function(a,b,c){var d=A(a);if(!d.documentElement)return null;(x||Ab)&&Zc(mb(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):S.H;if(x&&!fb(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=Number(hb)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var n=g[k],v=n.namespaceURI;if(v&&!f[v]){var u=n.lookupPrefix(v);if(!u)var E=v.match(".*/(\\w+)/?$"),u=E?E[1]:"xhtml";f[v]=u}}var y={},M;for(M in f)y[f[M]]=M;e=function(a){return y[a]||null}}try{return d.evaluate(b, -a,e,c,null)}catch(R){if("TypeError"===R.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):S.H,d.evaluate(b,a,e,c,null);throw R;}}catch(R){if(!z||"NS_ERROR_ILLEGAL_VALUE"!=R.name)throw new r(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+R);}};S.I=function(a,b){if(!a||1!=a.nodeType)throw new r(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -S.w=function(a,b){var c=function(){var c=S.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||S.I(c,a);return c}; -S.s=function(a,b){var c=function(){var c=S.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();q(c,function(b){S.I(b,a)});return c};function $c(a){return(a=a.exec(La))?a[1]:""}var ad=function(){if(xb)return $c(/Firefox\/([0-9.]+)/);if(x||Xa||Wa)return db;if(Bb)return $c(/Chrome\/([0-9.]+)/);if(Cb&&!(Va()||w("iPad")||w("iPod")))return $c(/Version\/([0-9.]+)/);if(yb||zb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(La))return a[1]+"."+a[2]}else if(Ab)return(a=$c(/Android\s+([0-9.]+)/))?a:$c(/Version\/([0-9.]+)/);return""}();var bd,cd;function dd(a){return ed?bd(a):x?0<=sa(hb,a):fb(a)}function fd(a){return ed?cd(a):Ab?0<=sa(gd,a):0<=sa(ad,a)} -var ed=function(){if(!z)return!1;var a=aa.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;bd=function(a){return 0<=c.compare(d,""+a)};cd=function(a){return 0<=c.compare(e,""+a)};return!0}(),hd=zb||yb,id; -if(Ab){var jd=/Android\s+([0-9\.]+)/.exec(La);id=jd?jd[1]:"0"}else id="0";var gd=id,kd=x&&!(8<=Number(hb)),ld=x&&!(9<=Number(hb));Ab&&fd(2.3);Ab&&fd(4);Cb&&fd(6);function md(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=md.prototype;h.clone=function(){return new md(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof md?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function T(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=T.prototype;h.clone=function(){return new T(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof T?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function nd(a,b){var c=A(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}var od={thin:2,medium:4,thick:6}; -function pd(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in od)d=od[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};function qd(a){var b;a:{a=A(a);try{b=a&&a.activeElement;break a}catch(c){}b=null}return x&&b&&"undefined"===typeof b.nodeType?null:b}function U(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function rd(a){var b;if(b=sd(a,!0)&&td(a))b=!(x||z&&!dd("1.9.2")?0:"none"==V(a,"pointer-events"));return b}function ud(a,b){var c;if(c=kd&&"value"==b&&U(a,"OPTION"))c=null===vd(a,"value");c?(c=[],ub(a,c,!1),c=c.join("")):c=a[b];return c}var wd=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; -function xd(a){var b=[];q(a.split(wd),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function vd(a,b){b=b.toLowerCase();if("style"==b)return xd(a.style.cssText);if(kd&&"value"==b&&U(a,"INPUT"))return a.value;if(ld&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}var yd="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" "); -function td(a){var b=a.tagName.toUpperCase();return Ba(yd,b)?ud(a,"disabled")?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?td(a.parentNode):!vb(a,function(a){var b=a.parentNode;if(b&&U(b,"FIELDSET")&&ud(b,"disabled")){if(!U(a,"LEGEND"))return!0;for(;a=l(a.previousElementSibling)?a.previousElementSibling:nb(a.previousSibling);)if(U(a,"LEGEND"))return!0}return!1},!0):!0}var zd="text search tel url email password number".split(" "); -function Ad(a){function b(a){return"inherit"==a.contentEditable?(a=Bd(a))?b(a):!1:"true"==a.contentEditable}return l(a.contentEditable)?!x&&l(a.isContentEditable)?a.isContentEditable:b(a):!1}function Cd(a){return((U(a,"TEXTAREA")?!0:U(a,"INPUT")?Ba(zd,a.type.toLowerCase()):Ad(a)?!0:!1)||(U(a,"INPUT")?"file"==a.type.toLowerCase():!1))&&!ud(a,"readOnly")}function Bd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return U(a)?a:null} -function V(a,b){var c=ua(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=ld?"styleFloat":"cssFloat";var d=nd(a,c)||Dd(a,c);if(null===d)d=null;else if(Ba(Fa,c)){b:{var e=d.match(Ia);if(e){var c=Number(e[1]),f=Number(e[2]),g=Number(e[3]),e=Number(e[4]);if(0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g&&0<=e&&1>=e){c=[c,f,g,e];break b}}c=null}if(!c)b:{if(g=d.match(Ja))if(c=Number(g[1]),f=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g){c=[c,f,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase(); -f=Ea[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(Ga,"#$1$1$2$2$3$3")),!Ha.test(f))){c=null;break b}c=[parseInt(f.substr(1,2),16),parseInt(f.substr(3,2),16),parseInt(f.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}function Dd(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&fa(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(c=Bd(a))?Dd(c,b):null} -function Ed(a,b,c){function d(a){var b=Fd(a);return 0<b.height&&0<b.width?!0:U(a,"PATH")&&(0<b.height||0<b.width)?(a=V(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=V(a,"overflow")&&ya(a.childNodes,function(a){return 3==a.nodeType||U(a)&&d(a)})}function e(a){return Gd(a)==Hd&&za(a.childNodes,function(a){return!U(a)||e(a)||!d(a)})}if(!U(a))throw Error("Argument to isShown must be of type Element");if(U(a,"BODY"))return!0;if(U(a,"OPTION")||U(a,"OPTGROUP"))return a=vb(a,function(a){return U(a,"SELECT")}), -!!a&&Ed(a,!0,c);var f=Id(a);if(f)return!!f.J&&0<f.rect.width&&0<f.rect.height&&Ed(f.J,b,c);if(U(a,"INPUT")&&"hidden"==a.type.toLowerCase()||U(a,"NOSCRIPT"))return!1;f=V(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Jd(a))&&d(a)?!e(a):!1}function sd(a,b){function c(a){if("none"==V(a,"display"))return!1;a=Bd(a);return!a||c(a)}return Ed(a,!!b,c)}var Hd="hidden"; -function Gd(a,b){function c(a){function b(a){return a==k?!0:0==V(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==V(a,"position")?!1:!0}var c=V(a,"position");if("fixed"==c)return u=!0,a==k?null:k;for(a=Bd(a);a&&!b(a);)a=Bd(a);return a}function d(a){var b=a;if("visible"==v)if(a==k&&n)b=n;else if(a==n)return{x:"visible",y:"visible"};b={x:V(b,"overflow-x"),y:V(b,"overflow-y")};a==k&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==k){var b=(new lb(g)).a; -a=b.scrollingElement?b.scrollingElement:Ya||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=x&&fb("10")&&b.pageYOffset!=a.scrollTop?new ib(a.scrollLeft,a.scrollTop):new ib(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new ib(a.scrollLeft,a.scrollTop);return a}for(var f=Kd(a,b),g=A(a),k=g.documentElement,n=g.body,v=V(k,"overflow"),u,E=c(a);E;E=c(E)){var y=d(E);if("visible"!=y.x||"visible"!=y.y){var M=Fd(E);if(0==M.width||0== -M.height)return Hd;var R=f.right<M.left,Jb=f.bottom<M.top;if(R&&"hidden"==y.x||Jb&&"hidden"==y.y)return Hd;if(R&&"visible"!=y.x||Jb&&"visible"!=y.y){R=e(E);Jb=f.bottom<M.top-R.y;if(f.right<M.left-R.x&&"visible"!=y.x||Jb&&"visible"!=y.x)return Hd;f=Gd(E);return f==Hd?Hd:"scroll"}R=f.left>=M.left+M.width;M=f.top>=M.top+M.height;if(R&&"hidden"==y.x||M&&"hidden"==y.y)return Hd;if(R&&"visible"!=y.x||M&&"visible"!=y.y){if(u&&(y=e(E),f.left>=k.scrollWidth-y.x||f.right>=k.scrollHeight-y.y))return Hd;f=Gd(E); -return f==Hd?Hd:"scroll"}}}return"none"} -function Fd(a){var b=Id(a);if(b)return b.rect;if(U(a,"HTML"))return a=A(a),a=(mb(a)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new jb(a.clientWidth,a.clientHeight),new T(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new T(0,0,0,0)}b=new T(c.left,c.top,c.right-c.left,c.bottom-c.top);x&&a.ownerDocument.body&&(a=A(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b} -function Id(a){var b=U(a,"MAP");if(!b&&!U(a,"AREA"))return null;var c=b?a:U(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=S.w('/descendant::*[@usemap = "#'+c.name+'"]',A(c)))&&(e=Fd(d),b||"default"==a.shape.toLowerCase()||(a=Ld(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new T(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{J:d,rect:e||new T(0,0,0,0)}} -function Ld(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new T(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new T(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new T(b,c,d-b,e-c)}return new T(0,0,0,0)} -function Kd(a,b){var c;c=Fd(a);c=new md(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof T?b:new T(b.x,b.y,1,1);c.left=Math.min(Math.max(c.left+d.left,c.left),c.right);c.top=Math.min(Math.max(c.top+d.top,c.top),c.bottom);c.right=Math.min(Math.max(c.left+d.width,c.left),c.right);c.bottom=Math.min(Math.max(c.top+d.height,c.top),c.bottom)}return c}function Md(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")} -function Nd(a){var b=[];Od(a,b);a=wa(b,Md);return Md(a.join("\n")).replace(/\xa0/g," ")} -function Pd(a,b,c){var d=sd;if(U(a,"BR"))b.push("");else{var e=U(a,"TD"),f=V(a,"display"),g=!e&&!Ba(Qd,f),k=l(a.previousElementSibling)?a.previousElementSibling:nb(a.previousSibling),k=k?V(k,"display"):"",n=V(a,"float")||V(a,"cssFloat")||V(a,"styleFloat");!g||"run-in"==k&&"none"==n||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var v=d(a),u=null,E=null;v&&(u=V(a,"white-space"),E=V(a,"text-transform"));q(a.childNodes,function(a){c(a,b,v,u,E)});a=b[b.length-1]||"";!e&&"table-cell"!=f||!a||qa(a)|| -(b[b.length-1]+=" ");g&&"run-in"!=f&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function Od(a,b){Pd(a,b,function(a,b,e,f,g){3==a.nodeType&&e?Rd(a,b,f,g):U(a)&&Od(a,b)})}var Qd="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); -function Rd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";qa(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} -function Jd(a){if(ld){if("relative"==V(a,"position"))return 1;a=V(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Sd(a)}function Sd(a){var b=1,c=V(a,"opacity");c&&(b=Number(c));(a=Bd(a))&&(b*=Sd(a));return b};var Td={C:function(a){return!(!a.querySelectorAll||!a.querySelector)},w:function(a,b){if(!a)throw new r(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new r(32,"Compound class names not permitted");if(Td.C(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(d){throw new r(32,"An invalid or illegal class name was specified");}var c=wb(kb(b),"*",a,b);return c.length?c[0]:null},s:function(a,b){if(!a)throw new r(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new r(32, -"Compound class names not permitted");if(Td.C(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new r(32,"An invalid or illegal class name was specified");}return wb(kb(b),"*",a,b)}};var Ud={w:function(a,b){if(!fa(b.querySelector)&&x&&dd(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new r(32,"No selector specified");a=ra(a);var c;try{c=b.querySelector(a)}catch(d){throw new r(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},s:function(a,b){if(!fa(b.querySelectorAll)&&x&&dd(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new r(32,"No selector specified");a=ra(a);try{return b.querySelectorAll(a)}catch(c){throw new r(32, -"An invalid or illegal selector was specified");}}};var Vd={C:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},w:function(a,b){var c=kb(b),d=m(a)?c.a.getElementById(a):a;if(!d)return null;if(vd(d,"id")==a&&ob(b,d))return d;c=wb(c,"*");return Aa(c,function(c){return vd(c,"id")==a&&ob(b,c)})},s:function(a,b){if(!a)return[];if(Vd.C(b,a))try{return b.querySelectorAll("#"+Vd.R(a))}catch(d){return[]}var c=wb(kb(b),"*",null,b);return va(c,function(b){return vd(b,"id")==a})},R:function(a){return a.replace(/(['"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g, -"\\$1")}};var Wd={},Xd={};Wd.P=function(a,b,c){var d;try{d=Ud.s("a",b)}catch(e){d=wb(kb(b),"A",null,b)}return Aa(d,function(b){b=Nd(b);return c&&-1!=b.indexOf(a)||b==a})};Wd.L=function(a,b,c){var d;try{d=Ud.s("a",b)}catch(e){d=wb(kb(b),"A",null,b)}return va(d,function(b){b=Nd(b);return c&&-1!=b.indexOf(a)||b==a})};Wd.w=function(a,b){return Wd.P(a,b,!1)};Wd.s=function(a,b){return Wd.L(a,b,!1)};Xd.w=function(a,b){return Wd.P(a,b,!0)};Xd.s=function(a,b){return Wd.L(a,b,!0)};var Yd={w:function(a,b){if(""===a)throw new r(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},s:function(a,b){if(""===a)throw new r(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var Zd={className:Td,"class name":Td,css:Ud,"css selector":Ud,id:Vd,linkText:Wd,"link text":Wd,name:{w:function(a,b){var c=wb(kb(b),"*",null,b);return Aa(c,function(b){return vd(b,"name")==a})},s:function(a,b){var c=wb(kb(b),"*",null,b);return va(c,function(b){return vd(b,"name")==a})}},partialLinkText:Xd,"partial link text":Xd,tagName:Yd,"tag name":Yd,xpath:S}; -function $d(a,b){var c;a:{for(c in a)if(a.hasOwnProperty(c))break a;c=null}if(c){var d=Zd[c];if(d&&fa(d.s))return d.s(a[c],b||oa.document)}throw Error("Unsupported locator strategy: "+c);};function ae(a){this.a=oa.document.documentElement;this.i=null;var b=qd(this.a);b&&be(this,b);this.v=a||new ce}function be(a,b){a.a=b;U(b,"OPTION")?a.i=vb(b,function(a){return U(a,"SELECT")}):a.i=null}Ya||ed&&fd(3.6);function de(a){return U(a,"FORM")} -function ee(a){if(!de(a))throw new r(12,"Element is not a form, so could not submit.");if(fe(a,ge))if(U(a.submit))if(!x||dd(8))a.constructor.prototype.submit.call(a);else{var b=$d({id:"submit"},a),c=$d({name:"submit"},a);q(b,function(a){a.removeAttribute("id")});q(c,function(a){a.removeAttribute("name")});a=a.submit;q(b,function(a){a.setAttribute("id","submit")});q(c,function(a){a.setAttribute("name","submit")});a()}else a.submit()}function ce(){this.a=0};var he=!(x&&!dd(10)),ie=Ab?!fd(4):!hd;function je(a,b,c){this.a=a;this.b=b;this.f=c}je.prototype.c=function(a){a=A(a);ld&&a.createEventObject?a=a.createEventObject():(a=a.createEvent("HTMLEvents"),a.initEvent(this.a,this.b,this.f));return a};je.prototype.toString=function(){return this.a};function ke(a,b,c){je.call(this,a,b,c)}p(ke,je); -ke.prototype.c=function(a,b){var c=A(a);if(z){var d=mb(c),e=b.charCode?0:b.keyCode,c=c.createEvent("KeyboardEvent");c.initKeyEvent(this.a,this.b,this.f,d,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,e,b.charCode);this.a==le&&b.preventDefault&&c.preventDefault()}else if(ld?c=c.createEventObject():(c=c.createEvent("Events"),c.initEvent(this.a,this.b,this.f)),c.altKey=b.altKey,c.ctrlKey=b.ctrlKey,c.metaKey=b.metaKey,c.shiftKey=b.shiftKey,c.keyCode=b.charCode||b.keyCode,Ya||Xa)c.charCode=this==le?c.keyCode: -0;return c};function me(a,b,c){je.call(this,a,b,c)}p(me,je); -me.prototype.c=function(a,b){function c(b){b=wa(b,function(b){return f.createTouch(g,a,b.identifier,b.pageX,b.pageY,b.screenX,b.screenY)});return f.createTouchList.apply(f,b)}function d(b){var c=wa(b,function(b){return{identifier:b.identifier,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY,pageX:b.pageX,pageY:b.pageY,target:a}});c.item=function(a){return c[a]};return c}function e(a){return ie?d(a):c(a)}if(!he)throw new r(9,"Browser does not support firing touch events.");var f= -A(a),g=mb(f),k=e(b.changedTouches),n=b.touches==b.changedTouches?k:e(b.touches),v=b.targetTouches==b.changedTouches?k:e(b.targetTouches),u;ie?(u=f.createEvent("MouseEvents"),u.initMouseEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,0,b.relatedTarget),u.touches=n,u.targetTouches=v,u.changedTouches=k,u.scale=b.scale,u.rotation=b.rotation):(u=f.createEvent("TouchEvent"),0==u.initTouchEvent.length?u.initTouchEvent(n,v,k,this.a,g,0,0,b.clientX,b.clientY, -b.ctrlKey,b.altKey,b.shiftKey,b.metaKey):u.initTouchEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,n,v,k,b.scale,b.rotation),u.relatedTarget=b.relatedTarget);return u}; -var ne=new je("blur",!1,!1),oe=new je("change",!0,!1),pe=new je("focus",!1,!1),qe=new je("input",!0,!1),ge=new je("submit",!0,!0),re=new je("textInput",!0,!0),se=new ke("keydown",!0,!0),le=new ke("keypress",!0,!0),te=new ke("keyup",!0,!0),ue=new me("touchend",!0,!0),ve=new me("touchstart",!0,!0);function fe(a,b,c){c=b.c(a,c);"isTrusted"in c||(c.isTrusted=!1);return ld&&a.fireEvent?a.fireEvent("on"+b.a,c):a.dispatchEvent(c)};function we(a,b){if(xe(a))a.selectionStart=b;else if(x){var c=ye(a),d=c[0];d.inRange(c[1])&&(b=ze(a,b),d.collapse(!0),d.move("character",b),d.select())}} -function Ae(a,b){var c=0,d=0;if(xe(a))c=a.selectionStart,d=b?-1:a.selectionEnd;else if(x){var e=ye(a),f=e[0],e=e[1];if(f.inRange(e)){f.setEndPoint("EndToStart",e);if("textarea"==a.type){for(var c=e.duplicate(),g=f.text,d=g,k=e=c.text,n=!1;!n;)0==f.compareEndPoints("StartToEnd",f)?n=!0:(f.moveEnd("character",-1),f.text==g?d+="\r\n":n=!0);if(b)f=[d.length,-1];else{for(f=!1;!f;)0==c.compareEndPoints("StartToEnd",c)?f=!0:(c.moveEnd("character",-1),c.text==e?k+="\r\n":f=!0);f=[d.length,d.length+k.length]}return f}c= -f.text.length;b?d=-1:d=f.text.length+e.text.length}}return[c,d]}function Be(a,b){if(xe(a))a.selectionEnd=b;else if(x){var c=ye(a),d=c[1];c[0].inRange(d)&&(b=ze(a,b),c=ze(a,Ae(a,!0)[0]),d.collapse(!0),d.moveEnd("character",b-c),d.select())}}function Ce(a,b){if(xe(a))a.selectionStart=b,a.selectionEnd=b;else if(x){b=ze(a,b);var c=a.createTextRange();c.collapse(!0);c.move("character",b);c.select()}} -function De(a,b){if(xe(a)){var c=a.value,d=a.selectionStart;a.value=c.substr(0,d)+b+c.substr(a.selectionEnd);a.selectionStart=d;a.selectionEnd=d+b.length}else if(x)d=ye(a),c=d[1],d[0].inRange(c)&&(d=c.duplicate(),c.text=b,c.setEndPoint("StartToStart",d),c.select());else throw Error("Cannot set the selection end");}function ye(a){var b=a.ownerDocument||a.document,c=b.selection.createRange();"textarea"==a.type?(b=b.body.createTextRange(),b.moveToElementText(a)):b=a.createTextRange();return[b,c]} -function ze(a,b){"textarea"==a.type&&(b=a.value.substring(0,b).replace(/(\r\n|\r|\n)/g,"\n").length);return b}function xe(a){try{return"number"==typeof a.selectionStart}catch(b){return!1}};function Ee(a,b){this.b={};this.a=[];this.c=this.f=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Fe(this,arguments[d],arguments[d+1])}else if(a){if(a instanceof Ee)d=Ge(a),c=a.A();else{var c=[],e=0;for(d in a)c[e++]=d;d=c;c=Qa(a)}for(e=0;e<d.length;e++)Fe(this,d[e],c[e])}}h=Ee.prototype;h.A=function(){He(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};function Ge(a){He(a);return a.a.concat()} -h.clear=function(){this.b={};this.c=this.f=this.a.length=0};function He(a){if(a.f!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Ie(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.f!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],Ie(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}h.get=function(a,b){return Ie(this.b,a)?this.b[a]:b};function Fe(a,b,c){Ie(a.b,b)||(a.f++,a.a.push(b),a.c++);a.b[b]=c} -h.forEach=function(a,b){for(var c=Ge(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new Ee(this)};function Ie(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Je(a){if(a.A&&"function"==typeof a.A)return a.A();if(m(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Qa(a)};function Ke(a){this.a=new Ee;if(a){a=Je(a);for(var b=a.length,c=0;c<b;c++){var d=a[c];Fe(this.a,Le(d),d)}}}function Le(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[ha]||(a[ha]=++ia)):b.substr(0,1)+a}Ke.prototype.clear=function(){this.a.clear()};Ke.prototype.contains=function(a){a=Le(a);return Ie(this.a.b,a)};Ke.prototype.A=function(){return this.a.A()};Ke.prototype.clone=function(){return new Ke(this)};function Me(a){ae.call(this);this.f=Cd(this.a);this.b=0;this.c=new Ke;a&&(q(a.pressed,function(a){Ne(this,a,!0)},this),this.b=a.currentPos||0)}p(Me,ae);var Oe={};function W(a,b,c){ga(a)&&(a=z?a.g:a.h);a=new Pe(a,b,c);!b||b in Oe&&!c||(Oe[b]={key:a,shift:!1},c&&(Oe[c]={key:a,shift:!0}));return a}function Pe(a,b,c){this.code=a;this.a=b||null;this.b=c||this.a}var Qe=W(8),Re=W(9),Se=W(13),X=W(16),Te=W(17),Ue=W(18),Ve=W(19);W(20); -var We=W(27),Xe=W(32," "),Ye=W(33),Ze=W(34),$e=W(35),af=W(36),bf=W(37),cf=W(38),df=W(39),ef=W(40);W(44);var ff=W(45),gf=W(46);W(48,"0",")");W(49,"1","!");W(50,"2","@");W(51,"3","#");W(52,"4","$");W(53,"5","%");W(54,"6","^");W(55,"7","&");W(56,"8","*");W(57,"9","(");W(65,"a","A");W(66,"b","B");W(67,"c","C");W(68,"d","D");W(69,"e","E");W(70,"f","F");W(71,"g","G");W(72,"h","H");W(73,"i","I");W(74,"j","J");W(75,"k","K");W(76,"l","L");W(77,"m","M");W(78,"n","N");W(79,"o","O");W(80,"p","P");W(81,"q","Q"); -W(82,"r","R");W(83,"s","S");W(84,"t","T");W(85,"u","U");W(86,"v","V");W(87,"w","W");W(88,"x","X");W(89,"y","Y");W(90,"z","Z"); -var hf=W(ab?{g:91,h:91}:$a?{g:224,h:91}:{g:0,h:91}),jf=W(ab?{g:92,h:92}:$a?{g:224,h:93}:{g:0,h:92}),kf=W(ab?{g:93,h:93}:$a?{g:0,h:0}:{g:93,h:null}),lf=W({g:96,h:96},"0"),mf=W({g:97,h:97},"1"),nf=W({g:98,h:98},"2"),of=W({g:99,h:99},"3"),pf=W({g:100,h:100},"4"),qf=W({g:101,h:101},"5"),rf=W({g:102,h:102},"6"),sf=W({g:103,h:103},"7"),tf=W({g:104,h:104},"8"),uf=W({g:105,h:105},"9"),vf=W({g:106,h:106},"*"),wf=W({g:107,h:107},"+"),xf=W({g:109,h:109},"-"),yf=W({g:110,h:110},"."),zf=W({g:111,h:111},"/");W(144); -var Af=W(112),Bf=W(113),Cf=W(114),Df=W(115),Ef=W(116),Ff=W(117),Gf=W(118),Hf=W(119),If=W(120),Jf=W(121),Kf=W(122),Lf=W(123),Mf=W({g:107,h:187},"=","+"),Nf=W(108,",");W({g:109,h:189},"-","_");W(188,",","<");W(190,".",">");W(191,"/","?");W(192,"`","~");W(219,"[","{");W(220,"\\","|");W(221,"]","}");var Of=W({g:59,h:186},";",":");W(222,"'",'"');var Pf=[Ue,Te,hf,X],Qf=new Ee;Fe(Qf,1,X);Fe(Qf,2,Te);Fe(Qf,4,Ue);Fe(Qf,8,hf);var Rf=function(a){var b=new Ee;q(Ge(a),function(c){Fe(b,a.get(c).code,c)});return b}(Qf); -function Ne(a,b,c){if(Ba(Pf,b)){var d=Rf.get(b.code),e=a.v;e.a=c?e.a|d:e.a&~d}c?Fe(a.c.a,Le(b),b):(a=a.c.a,b=Le(b),Ie(a.b,b)&&(delete a.b[b],a.f--,a.c++,a.a.length>2*a.f&&He(a)))}var Sf=x?"\r\n":"\n";function Y(a,b){return a.c.contains(b)} -function Tf(a,b){if(Ba(Pf,b)&&Y(a,b))throw new r(13,"Cannot press a modifier key that is already pressed.");var c=null!==b.code&&Uf(a,se,b);if((c||z)&&(!Vf(b)||Uf(a,le,b,!c))&&c&&(Wf(a,b),a.f))if(b.a){if(!Xf){var c=Yf(a,b),d=Ae(a.a,!0)[0]+1;Zf(a.a)?(De(a.a,c),we(a.a,d)):a.a.value+=c;Ya&&fe(a.a,re);ld||fe(a.a,qe);a.b=d}}else switch(b){case Se:Xf||(Ya&&fe(a.a,re),U(a.a,"TEXTAREA")&&(c=Ae(a.a,!0)[0]+Sf.length,Zf(a.a)?(De(a.a,Sf),we(a.a,c)):a.a.value+=Sf,x||fe(a.a,qe),a.b=c));break;case Qe:case gf:Xf|| -($f(a.a),c=Ae(a.a,!1),c[0]==c[1]&&(b==Qe?(we(a.a,c[1]-1),Be(a.a,c[1])):Be(a.a,c[1]+1)),c=Ae(a.a,!1),c=!(c[0]==a.a.value.length||0==c[1]),De(a.a,""),(!x&&c||z&&b==Qe)&&fe(a.a,qe),c=Ae(a.a,!1),a.b=c[1]);break;case bf:case df:$f(a.a);var c=a.a,e=Ae(c,!0)[0],f=Ae(c,!1)[1],g=d=0;b==bf?Y(a,X)?a.b==e?(d=Math.max(e-1,0),g=f,e=d):(d=e,e=g=f-1):e=e==f?Math.max(e-1,0):e:Y(a,X)?a.b==f?(d=e,e=g=Math.min(f+1,c.value.length)):(d=e+1,g=f,e=d):e=e==f?Math.min(f+1,c.value.length):f;Y(a,X)?(we(c,d),Be(c,g)):Ce(c,e); -a.b=e;break;case af:case $e:$f(a.a),c=a.a,d=Ae(c,!0)[0],g=Ae(c,!1)[1],b==af?(Y(a,X)?(we(c,0),Be(c,a.b==d?g:d)):Ce(c,0),a.b=0):(Y(a,X)?(a.b==d&&we(c,g),Be(c,c.value.length)):Ce(c,c.value.length),a.b=c.value.length)}Ne(a,b,!0)}function Vf(a){if(a.a||a==Se)return!0;if(Ya||Xa)return!1;if(x)return a==We;switch(a){case X:case Te:case Ue:return!1;case hf:case jf:case kf:return z;default:return!0}} -function Wf(a,b){if(b==Se&&!z&&U(a.a,"INPUT")){var c=vb(a.a,de,!0);if(c){var d=c.getElementsByTagName("input");(ya(d,function(a){a:{if(U(a,"INPUT")){var b=a.type.toLowerCase();if("submit"==b||"image"==b){a=!0;break a}}if(U(a,"BUTTON")&&(b=a.type.toLowerCase(),"submit"==b)){a=!0;break a}a=!1}return a})||1==d.length||Ya&&!dd(534))&&ee(c)}}}function ag(a,b){if(!Y(a,b))throw new r(13,"Cannot release a key that is not pressed. ("+b.code+")");null===b.code||Uf(a,te,b);Ne(a,b,!1)} -function Yf(a,b){if(!b.a)throw new r(13,"not a character key");return Y(a,X)?b.b:b.a}var Xf=z&&!dd(12);function $f(a){try{a.selectionStart}catch(b){if(-1!=b.message.indexOf("does not support selection."))throw Error(b.message+" (For more information, see https://code.google.com/p/chromium/issues/detail?id=330456)");throw b;}}function Zf(a){try{$f(a)}catch(b){return!1}return!0} -function Uf(a,b,c,d){if(null===c.code)throw new r(13,"Key must have a keycode to be fired.");c={altKey:Y(a,Ue),ctrlKey:Y(a,Te),metaKey:Y(a,hf),shiftKey:Y(a,X),keyCode:c.code,charCode:c.a&&b==le?Yf(a,c).charCodeAt(0):0,preventDefault:!!d};return fe(a.a,b,c)} -function bg(a,b){be(a,b);a.f=Cd(b);var c;c=a.i||a.a;var d=qd(c);if(c==d)c=!1;else{if(d&&(fa(d.blur)||x&&ga(d.blur))){if(!U(d,"BODY"))try{d.blur()}catch(e){if(!x||"Unspecified error."!=e.message)throw e;}x&&!dd(8)&&mb(A(c)).focus()}fa(c.focus)||x&&ga(c.focus)?(c.focus(),c=!0):c=!1}a.f&&c&&(Ce(b,b.value.length),a.b=b.value.length)};function cg(a,b,c,d){function e(a){m(a)?q(a.split(""),function(a){if(1!=a.length)throw new r(13,"Argument not a single character: "+a);var b=Oe[a];b||(b=a.toUpperCase(),b=W(b.charCodeAt(0),a.toLowerCase(),b),b={key:b,shift:a!=b.a});a=b;b=Y(f,X);a.shift&&!b&&Tf(f,X);Tf(f,a.key);ag(f,a.key);a.shift&&!b&&ag(f,X)}):Ba(Pf,a)?Y(f,a)?ag(f,a):Tf(f,a):(Tf(f,a),ag(f,a))}if(a!=qd(a)){if(!rd(a))throw new r(12,"Element is not currently interactable and may not be manipulated");dg(a)}var f=c||new Me;bg(f,a);if((!Cb|| -Za)&&Ya&&"date"==a.type){c="array"==ca(b)?b=b.join(""):b;var g=/\d{4}-\d{2}-\d{2}/;if(c.match(g)){Za&&Cb&&(fe(a,ve),fe(a,ue));fe(a,pe);a.value=c.match(g)[0];fe(a,oe);fe(a,ne);return}}"array"==ca(b)?q(b,e):e(b);d||q(Pf,function(a){Y(f,a)&&ag(f,a)})}function eg(a){var b=vb(a,de,!0);if(!b)throw new r(7,"Element was not in a form, so could not submit.");var c=fg.S();be(c,a);ee(b)}function fg(){ae.call(this)}p(fg,ae);(function(){var a=fg;a.S=function(){return a.K?a.K:a.K=new a}})(); -function dg(a){if("scroll"==Gd(a,void 0)){if(a.scrollIntoView&&(a.scrollIntoView(),"none"==Gd(a,void 0)))return;for(var b=Kd(a,void 0),c=Bd(a);c;c=Bd(c)){var d=c,e=Fd(d),f;var g=d;if(!x||9<=Number(hb))k=nd(g,"borderLeftWidth"),f=nd(g,"borderRightWidth"),n=nd(g,"borderTopWidth"),g=nd(g,"borderBottomWidth"),f=new md(parseFloat(n),parseFloat(f),parseFloat(g),parseFloat(k));else{var k=pd(g,"borderLeft");f=pd(g,"borderRight");var n=pd(g,"borderTop"),g=pd(g,"borderBottom");f=new md(n,f,g,k)}k=b.left-e.left- -f.left;e=b.top-e.top-f.top;f=d.clientHeight+b.top-b.bottom;d.scrollLeft+=Math.min(k,Math.max(k-(d.clientWidth+b.left-b.right),0));d.scrollTop+=Math.min(e,Math.max(e-f,0))}Gd(a,void 0)}};function Z(a,b,c,d){function e(){return{M:f,keys:[]}}var f=!!d,g=[],k=e();g.push(k);q(b,function(a){q(a.split(""),function(a){if("\ue000"<=a&&"\ue03d">=a){var b=Z.a[a];if(null===b)g.push(k=e()),f&&(k.M=!1,g.push(k=e()));else if(l(b))k.keys.push(b);else throw Error("Unsupported WebDriver key: \\u"+a.charCodeAt(0).toString(16));}else switch(a){case "\n":k.keys.push(Se);break;case "\t":k.keys.push(Re);break;case "\b":k.keys.push(Qe);break;default:k.keys.push(a)}})});q(g,function(b){cg(a,b.keys,c,b.M)})} -Z.a={};Z.a["\ue000"]=null;Z.a["\ue003"]=Qe;Z.a["\ue004"]=Re;Z.a["\ue006"]=Se;Z.a["\ue007"]=Se;Z.a["\ue008"]=X;Z.a["\ue009"]=Te;Z.a["\ue00a"]=Ue;Z.a["\ue00b"]=Ve;Z.a["\ue00c"]=We;Z.a["\ue00d"]=Xe;Z.a["\ue00e"]=Ye;Z.a["\ue00f"]=Ze;Z.a["\ue010"]=$e;Z.a["\ue011"]=af;Z.a["\ue012"]=bf;Z.a["\ue013"]=cf;Z.a["\ue014"]=df;Z.a["\ue015"]=ef;Z.a["\ue016"]=ff;Z.a["\ue017"]=gf;Z.a["\ue018"]=Of;Z.a["\ue019"]=Mf;Z.a["\ue01a"]=lf;Z.a["\ue01b"]=mf;Z.a["\ue01c"]=nf;Z.a["\ue01d"]=of;Z.a["\ue01e"]=pf;Z.a["\ue01f"]=qf; -Z.a["\ue020"]=rf;Z.a["\ue021"]=sf;Z.a["\ue022"]=tf;Z.a["\ue023"]=uf;Z.a["\ue024"]=vf;Z.a["\ue025"]=wf;Z.a["\ue027"]=xf;Z.a["\ue028"]=yf;Z.a["\ue029"]=zf;Z.a["\ue026"]=Nf;Z.a["\ue031"]=Af;Z.a["\ue032"]=Bf;Z.a["\ue033"]=Cf;Z.a["\ue034"]=Df;Z.a["\ue035"]=Ef;Z.a["\ue036"]=Ff;Z.a["\ue037"]=Gf;Z.a["\ue038"]=Hf;Z.a["\ue039"]=If;Z.a["\ue03a"]=Jf;Z.a["\ue03b"]=Kf;Z.a["\ue03c"]=Lf;Z.a["\ue03d"]=hf;function gg(){} -function hg(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ca(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),hg(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),ig(d,c),c.push(":"),hg(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":ig(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var jg={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},kg=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function ig(a,b){b.push('"',a.replace(kg,function(a){var b=jg[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),jg[a]=b);return b}),'"')};Ya||z&&dd(3.5)||x&&dd(8);function lg(a){switch(ca(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return wa(a,lg);case "object":if(Ra(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=mg(a);return b}if(Ra(a,"document"))return b={},b.WINDOW=mg(a),b;if(da(a))return wa(a,lg);a=Oa(a,function(a,b){return ea(b)||m(b)});return Pa(a,lg);default:return null}} -function ng(a,b){return"array"==ca(a)?wa(a,function(a){return ng(a,b)}):ga(a)?"function"==typeof a?a:Ra(a,"ELEMENT")?og(a.ELEMENT,b):Ra(a,"WINDOW")?og(a.WINDOW,b):Pa(a,function(a){return ng(a,b)}):a}function pg(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.F=na());b.F||(b.F=na());return b}function mg(a){var b=pg(a.ownerDocument),c=Sa(b,function(b){return b==a});c||(c=":wdc:"+b.F++,b[c]=a);return c} -function og(a,b){a=decodeURIComponent(a);var c=b||document,d=pg(c);if(!Ra(d,a))throw new r(10,"Element does not exist in cache");var e=d[a];if(Ra(e,"setInterval")){if(e.closed)throw delete d[a],new r(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new r(10,"Element is no longer attached to the DOM");};ba("_",function(a,b){var c=[a],d;try{var e;b?e=og(b.WINDOW):e=window;var f=ng(c,e.document),g=eg.apply(null,f);d={status:0,value:lg(g)}}catch(k){d={status:Ra(k,"code")?k.code:13,value:{message:k.message}}}c=[];hg(new gg,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/third_party/webdriver-atoms/type.js b/src/ghostdriver/third_party/webdriver-atoms/type.js deleted file mode 100644 index 08c1458207..0000000000 --- a/src/ghostdriver/third_party/webdriver-atoms/type.js +++ /dev/null @@ -1,156 +0,0 @@ -function(){return function(){var h,aa=this;function l(a){return void 0!==a}function ba(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&l(b)?d[e]=b:d[e]?d=d[e]:d=d[e]={}} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function m(a){return"string"==typeof a}function ea(a){return"number"==typeof a}function fa(a){return"function"==ca(a)}function ga(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ha="closure_uid_"+(1E9*Math.random()>>>0),ia=0;function ja(a,b,c){return a.call.apply(a.bind,arguments)} -function ka(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function la(a,b,c){la=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ja:ka;return la.apply(null,arguments)} -function ma(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var na=Date.now||function(){return+new Date};function p(a,b){function c(){}c.prototype=b.prototype;a.V=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.U=function(a,c,f){for(var g=Array(arguments.length-2),k=2;k<arguments.length;k++)g[k-2]=arguments[k];return b.prototype[c].apply(a,g)}};var oa=window;var pa;function qa(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var ra=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; -function sa(a,b){for(var c=0,d=ra(String(a)).split("."),e=ra(String(b)).split("."),f=Math.max(d.length,e.length),g=0;0==c&&g<f;g++){var k=d[g]||"",n=e[g]||"",v=RegExp("(\\d*)(\\D*)","g"),u=RegExp("(\\d*)(\\D*)","g");do{var E=v.exec(k)||["","",""],y=u.exec(n)||["","",""];if(0==E[0].length&&0==y[0].length)break;c=ta(0==E[1].length?0:parseInt(E[1],10),0==y[1].length?0:parseInt(y[1],10))||ta(0==E[2].length,0==y[2].length)||ta(E[2],y[2])}while(0==c)}return c}function ta(a,b){return a<b?-1:a>b?1:0} -function ua(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})};function q(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)}function va(a,b){for(var c=a.length,d=[],e=0,f=m(a)?a.split(""):a,g=0;g<c;g++)if(g in f){var k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d}function wa(a,b){for(var c=a.length,d=Array(c),e=m(a)?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d}function xa(a,b,c){var d=c;q(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d} -function ya(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1}function za(a,b){for(var c=a.length,d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0}function Aa(a,b){var c;a:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]} -function Ba(a,b){var c;a:if(m(a))c=m(b)&&1==b.length?a.indexOf(b,0):-1;else{for(c=0;c<a.length;c++)if(c in a&&a[c]===b)break a;c=-1}return 0<=c}function Ca(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function Da(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Ea={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var Fa="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Ga=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Ha=/^#(?:[0-9a-f]{3}){1,2}$/i,Ia=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Ja=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function r(a,b){this.code=a;this.a=t[a]||Ka;this.message=b||"";var c=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")}),d=c.length-5;if(0>d||c.indexOf("Error",d)!=d)c+="Error";this.name=c;c=Error(this.message);c.name=this.name;this.stack=c.stack||""}p(r,Error);var Ka="unknown error",t={15:"element not selectable",11:"element not visible"};t[31]=Ka;t[30]=Ka;t[24]="invalid cookie domain";t[29]="invalid element coordinates";t[12]="invalid element state"; -t[32]="invalid selector";t[51]="invalid selector";t[52]="invalid selector";t[17]="javascript error";t[405]="unsupported operation";t[34]="move target out of bounds";t[27]="no such alert";t[7]="no such element";t[8]="no such frame";t[23]="no such window";t[28]="script timeout";t[33]="session not created";t[10]="stale element reference";t[21]="timeout";t[25]="unable to set cookie";t[26]="unexpected alert open";t[13]=Ka;t[9]="unknown command";r.prototype.toString=function(){return this.name+": "+this.message};var La;a:{var Ma=aa.navigator;if(Ma){var Na=Ma.userAgent;if(Na){La=Na;break a}}La=""}function w(a){return-1!=La.indexOf(a)};function Oa(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function Pa(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function Qa(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Ra(a,b){return null!==a&&b in a}function Sa(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function Ta(){return w("Opera")||w("OPR")}function Ua(){return(w("Chrome")||w("CriOS"))&&!Ta()&&!w("Edge")};function Va(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var Wa=Ta(),x=w("Trident")||w("MSIE"),Xa=w("Edge"),z=w("Gecko")&&!(-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),Ya=-1!=La.toLowerCase().indexOf("webkit")&&!w("Edge"),Za=Ya&&w("Mobile"),$a=w("Macintosh"),ab=w("Windows");function bb(){var a=La;if(z)return/rv\:([^\);]+)(\)|;)/.exec(a);if(Xa)return/Edge\/([\d\.]+)/.exec(a);if(x)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Ya)return/WebKit\/(\S+)/.exec(a)} -function cb(){var a=aa.document;return a?a.documentMode:void 0}var db=function(){if(Wa&&aa.opera){var a;var b=aa.opera.version;try{a=b()}catch(c){a=b}return a}a="";(b=bb())&&(a=b?b[1]:"");return x&&(b=cb(),null!=b&&b>parseFloat(a))?String(b):a}(),eb={};function fb(a){return eb[a]||(eb[a]=0<=sa(db,a))}var gb=aa.document,hb=gb&&x?cb()||("CSS1Compat"==gb.compatMode?parseInt(db,10):5):void 0;!z&&!x||x&&9<=Number(hb)||z&&fb("1.9.1");x&&fb("9");function ib(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}h=ib.prototype;h.clone=function(){return new ib(this.x,this.y)};h.toString=function(){return"("+this.x+", "+this.y+")"};h.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};h.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};h.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};h.scale=function(a,b){var c=ea(b)?b:a;this.x*=a;this.y*=c;return this};function jb(a,b){this.width=a;this.height=b}h=jb.prototype;h.clone=function(){return new jb(this.width,this.height)};h.toString=function(){return"("+this.width+" x "+this.height+")"};h.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.width*=a;this.height*=c;return this};function kb(a){return a?new lb(A(a)):pa||(pa=new lb)}function mb(a){return a?a.parentWindow||a.defaultView:window}function nb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function ob(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function pb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(x&&!(9<=Number(hb))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?qb(a,b):!c&&ob(e,b)?-1*rb(a,b):!d&&ob(f,a)?rb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=A(a);c=d.createRange(); -c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,d)}function rb(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return qb(d,a)}function qb(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1}function A(a){return 9==a.nodeType?a:a.ownerDocument||a.document}var sb={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},tb={IMG:" ",BR:"\n"}; -function ub(a,b,c){if(!(a.nodeName in sb))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in tb)b.push(tb[a.nodeName]);else for(a=a.firstChild;a;)ub(a,b,c),a=a.nextSibling}function vb(a,b,c){c||(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function lb(a){this.a=a||aa.document||document} -function wb(a,b,c,d){a=d||a.a;b=b&&"*"!=b?b.toUpperCase():"";if(a.querySelectorAll&&a.querySelector&&(b||c))c=a.querySelectorAll(b+(c?"."+c:""));else if(c&&a.getElementsByClassName)if(a=a.getElementsByClassName(c),b){d={};for(var e=0,f=0,g;g=a[f];f++)b==g.nodeName&&(d[e++]=g);d.length=e;c=d}else c=a;else if(a=a.getElementsByTagName(b||"*"),c){d={};for(f=e=0;g=a[f];f++)b=g.className,"function"==typeof b.split&&Ba(b.split(/\s+/),c)&&(d[e++]=g);d.length=e;c=d}else c=a;return c} -lb.prototype.contains=ob;var xb=w("Firefox"),yb=Va()||w("iPod"),zb=w("iPad"),Ab=w("Android")&&!(Ua()||w("Firefox")||Ta()||w("Silk")),Bb=Ua(),Cb=w("Safari")&&!(Ua()||w("Coast")||Ta()||w("Edge")||w("Silk")||w("Android"))&&!(Va()||w("iPad")||w("iPod"));/* - - The MIT License - - Copyright (c) 2007 Cybozu Labs, Inc. - Copyright (c) 2012 Google Inc. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ -function Db(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var Eb=x&&!(9<=Number(hb)),Fb=x&&!(8<=Number(hb));function Gb(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Hb(a,b){var c=Fb&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Gb(b,a,b.nodeName,c)};function Ib(a){this.b=a;this.a=0}function Kb(a){a=a.match(Lb);for(var b=0;b<a.length;b++)Mb.test(a[b])&&a.splice(b,1);return new Ib(a)}var Lb=RegExp("\\$?(?:(?![0-9-\\.])(?:\\*|[\\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Mb=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function C(a){return a.b[a.a++]}function Nb(a){return a.b.length<=a.a};function Ob(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(Eb&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),Eb&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function Pb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Fb&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Qb(a,b,c,d,e){return(Eb?Rb:Sb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)} -function Rb(a,b,c,d,e){if(a instanceof Tb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Ub(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],k=0;b=f[k++];)Pb(b,c,d)&&g.push(b);f=g}for(k=0;b=f[k++];)"*"==a&&"!"==b.tagName||F(e,b);return e}Vb(a,b,c,d,e);return e} -function Sb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!x?(b=b.getElementsByName(d),q(b,function(b){a.a(b)&&F(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),q(b,function(b){b.className==d&&a.a(b)&&F(e,b)})):a instanceof Wb?Vb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),q(b,function(a){Pb(a,c,d)&&F(e,a)}));return e} -function Xb(a,b,c,d,e){var f;if((a instanceof Tb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ub(a);if("*"!=g&&(f=va(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=va(f,function(a){return Pb(a,c,d)}));q(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||F(e,a)});return e}return Yb(a,b,c,d,e)}function Yb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&F(e,b);return e} -function Vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)Pb(b,c,d)&&a.a(b)&&F(e,b),Vb(a,b,c,d,e)}function Ub(a){if(a instanceof Wb){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function D(){this.b=this.a=null;this.o=0}function Zb(a){this.node=a;this.a=this.b=null}function $b(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,k=d.node;f==k||f instanceof Gb&&k instanceof Gb&&f.a==k.a?(f=c,c=c.a,d=d.a):0<pb(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.o=g;return a} -D.prototype.unshift=function(a){a=new Zb(a);a.a=this.a;this.b?this.a.b=a:this.a=this.b=a;this.a=a;this.o++};function F(a,b){var c=new Zb(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.o++}function ac(a){return(a=a.a)?a.node:null}function bc(a){return(a=ac(a))?Ob(a):""}function cc(a,b){return new dc(a,!!b)}function dc(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function G(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function H(a){this.l=a;this.b=this.j=!1;this.f=null}function I(a){return"\n "+a.toString().split("\n").join("\n ")}function ec(a,b){a.j=b}function fc(a,b){a.b=b}function J(a,b){var c=a.a(b);return c instanceof D?+bc(c):+c}function K(a,b){var c=a.a(b);return c instanceof D?bc(c):""+c}function gc(a,b){var c=a.a(b);return c instanceof D?!!c.o:!!c};function hc(a,b,c){H.call(this,a.l);this.c=a;this.i=b;this.v=c;this.j=b.j||c.j;this.b=b.b||c.b;this.c==ic&&(c.b||c.j||4==c.l||0==c.l||!b.f?b.b||b.j||4==b.l||0==b.l||!c.f||(this.f={name:c.f.name,B:b}):this.f={name:b.f.name,B:c})}p(hc,H); -function jc(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof D&&c instanceof D){b=cc(b);for(d=G(b);d;d=G(b))for(e=cc(c),f=G(e);f;f=G(e))if(a(Ob(d),Ob(f)))return!0;return!1}if(b instanceof D||c instanceof D){b instanceof D?(e=b,d=c):(e=c,d=b);f=cc(e);for(var g=typeof d,k=G(f);k;k=G(f)){switch(g){case "number":k=+Ob(k);break;case "boolean":k=!!Ob(k);break;case "string":k=Ob(k);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(k,d)||e==c&&a(d,k))return!0}return!1}return e? -"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}hc.prototype.a=function(a){return this.c.u(this.i,this.v,a)};hc.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+I(this.i);return a+=I(this.v)};function kc(a,b,c,d){this.a=a;this.M=b;this.l=c;this.u=d}kc.prototype.toString=function(){return this.a};var lc={}; -function L(a,b,c,d){if(lc.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new kc(a,b,c,d);return lc[a.toString()]=a}L("div",6,1,function(a,b,c){return J(a,c)/J(b,c)});L("mod",6,1,function(a,b,c){return J(a,c)%J(b,c)});L("*",6,1,function(a,b,c){return J(a,c)*J(b,c)});L("+",5,1,function(a,b,c){return J(a,c)+J(b,c)});L("-",5,1,function(a,b,c){return J(a,c)-J(b,c)});L("<",4,2,function(a,b,c){return jc(function(a,b){return a<b},a,b,c)}); -L(">",4,2,function(a,b,c){return jc(function(a,b){return a>b},a,b,c)});L("<=",4,2,function(a,b,c){return jc(function(a,b){return a<=b},a,b,c)});L(">=",4,2,function(a,b,c){return jc(function(a,b){return a>=b},a,b,c)});var ic=L("=",3,2,function(a,b,c){return jc(function(a,b){return a==b},a,b,c,!0)});L("!=",3,2,function(a,b,c){return jc(function(a,b){return a!=b},a,b,c,!0)});L("and",2,2,function(a,b,c){return gc(a,c)&&gc(b,c)});L("or",1,2,function(a,b,c){return gc(a,c)||gc(b,c)});function mc(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");H.call(this,a.l);this.c=a;this.i=b;this.j=a.j;this.b=a.b}p(mc,H);mc.prototype.a=function(a){a=this.c.a(a);return nc(this.i,a)};mc.prototype.toString=function(){var a;a="Filter:"+I(this.c);return a+=I(this.i)};function oc(a,b){if(b.length<a.N)throw Error("Function "+a.m+" expects at least"+a.N+" arguments, "+b.length+" given");if(null!==a.G&&b.length>a.G)throw Error("Function "+a.m+" expects at most "+a.G+" arguments, "+b.length+" given");a.T&&q(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.m+" is not of type Nodeset: "+b);});H.call(this,a.l);this.i=a;this.c=b;ec(this,a.j||ya(b,function(a){return a.j}));fc(this,a.S&&!b.length||a.R&&!!b.length||ya(b,function(a){return a.b}))} -p(oc,H);oc.prototype.a=function(a){return this.i.u.apply(null,Ca(a,this.c))};oc.prototype.toString=function(){var a="Function: "+this.i;if(this.c.length)var b=xa(this.c,function(a,b){return a+I(b)},"Arguments:"),a=a+I(b);return a};function pc(a,b,c,d,e,f,g,k,n){this.m=a;this.l=b;this.j=c;this.S=d;this.R=e;this.u=f;this.N=g;this.G=l(k)?k:g;this.T=!!n}pc.prototype.toString=function(){return this.m};var qc={}; -function N(a,b,c,d,e,f,g,k){if(qc.hasOwnProperty(a))throw Error("Function already created: "+a+".");qc[a]=new pc(a,b,c,d,!1,e,f,g,k)}N("boolean",2,!1,!1,function(a,b){return gc(b,a)},1);N("ceiling",1,!1,!1,function(a,b){return Math.ceil(J(b,a))},1);N("concat",3,!1,!1,function(a,b){return xa(Da(arguments,1),function(b,d){return b+K(d,a)},"")},2,null);N("contains",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return-1!=b.indexOf(a)},2);N("count",1,!1,!1,function(a,b){return b.a(a).o},1,1,!0); -N("false",2,!1,!1,function(){return!1},0);N("floor",1,!1,!1,function(a,b){return Math.floor(J(b,a))},1);N("id",4,!1,!1,function(a,b){function c(a){if(Eb){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return Aa(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=K(b,a).split(/\s+/),f=[];q(d,function(a){(a=c(a))&&!Ba(f,a)&&f.push(a)});f.sort(pb);var g=new D;q(f,function(a){F(g,a)});return g},1); -N("lang",2,!1,!1,function(){return!1},1);N("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);N("local-name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);N("name",3,!1,!0,function(a,b){var c=b?ac(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);N("namespace-uri",3,!0,!1,function(){return""},0,1,!0); -N("normalize-space",3,!1,!0,function(a,b){return(b?K(b,a):Ob(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);N("not",2,!1,!1,function(a,b){return!gc(b,a)},1);N("number",1,!1,!0,function(a,b){return b?J(b,a):+Ob(a.a)},0,1);N("position",1,!0,!1,function(a){return a.b},0);N("round",1,!1,!1,function(a,b){return Math.round(J(b,a))},1);N("starts-with",2,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);return 0==b.lastIndexOf(a,0)},2);N("string",3,!1,!0,function(a,b){return b?K(b,a):Ob(a.a)},0,1); -N("string-length",1,!1,!0,function(a,b){return(b?K(b,a):Ob(a.a)).length},0,1);N("substring",3,!1,!1,function(a,b,c,d){c=J(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?J(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=K(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);N("substring-after",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -N("substring-before",3,!1,!1,function(a,b,c){b=K(b,a);a=K(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);N("sum",1,!1,!1,function(a,b){for(var c=cc(b.a(a)),d=0,e=G(c);e;e=G(c))d+=+Ob(e);return d},1,1,!0);N("translate",3,!1,!1,function(a,b,c,d){b=K(b,a);c=K(c,a);var e=K(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);N("true",2,!1,!1,function(){return!0},0);function Wb(a,b){this.i=a;this.c=l(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function rc(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}Wb.prototype.a=function(a){return null===this.b||this.b==a.nodeType};Wb.prototype.f=function(){return this.i}; -Wb.prototype.toString=function(){var a="Kind Test: "+this.i;null===this.c||(a+=I(this.c));return a};function sc(a){H.call(this,3);this.c=a.substring(1,a.length-1)}p(sc,H);sc.prototype.a=function(){return this.c};sc.prototype.toString=function(){return"Literal: "+this.c};function Tb(a,b){this.m=a.toLowerCase();var c;c="*"==this.m?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}Tb.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.m&&this.m!=a.localName.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Tb.prototype.f=function(){return this.m};Tb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.m};function tc(a){H.call(this,1);this.c=a}p(tc,H);tc.prototype.a=function(){return this.c};tc.prototype.toString=function(){return"Number: "+this.c};function uc(a,b){H.call(this,a.l);this.i=a;this.c=b;this.j=a.j;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.D||c.c!=vc||(c=c.v,"*"!=c.f()&&(this.f={name:c.f(),B:null}))}}p(uc,H);function wc(){H.call(this,4)}p(wc,H);wc.prototype.a=function(a){var b=new D;a=a.a;9==a.nodeType?F(b,a):F(b,a.ownerDocument);return b};wc.prototype.toString=function(){return"Root Helper Expression"};function xc(){H.call(this,4)}p(xc,H);xc.prototype.a=function(a){var b=new D;F(b,a.a);return b};xc.prototype.toString=function(){return"Context Helper Expression"}; -function yc(a){return"/"==a||"//"==a}uc.prototype.a=function(a){var b=this.i.a(a);if(!(b instanceof D))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.o;c++){var e=a[c],f=cc(b,e.c.a),g;if(e.j||e.c!=zc)if(e.j||e.c!=Ac)for(g=G(f),b=e.a(new Db(g));null!=(g=G(f));)g=e.a(new Db(g)),b=$b(b,g);else g=G(f),b=e.a(new Db(g));else{for(g=G(f);(b=G(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Db(g))}}return b}; -uc.prototype.toString=function(){var a;a="Path Expression:"+I(this.i);if(this.c.length){var b=xa(this.c,function(a,b){return a+I(b)},"Steps:");a+=I(b)}return a};function Bc(a,b){this.a=a;this.b=!!b} -function nc(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=cc(b),f=b.o,g,k=0;g=G(e);k++){var n=a.b?f-k:k+1;g=d.a(new Db(g,n,f));if("number"==typeof g)n=n==g;else if("string"==typeof g||"boolean"==typeof g)n=!!g;else if(g instanceof D)n=0<g.o;else throw Error("Predicate.evaluate returned an unexpected type.");if(!n){n=e;g=n.f;var v=n.a;if(!v)throw Error("Next must be called at least once before remove.");var u=v.b,v=v.a;u?u.a=v:g.a=v;v?v.b=u:g.b=u;g.o--;n.a=null}}return b} -Bc.prototype.toString=function(){return xa(this.a,function(a,b){return a+I(b)},"Predicates:")};function Cc(a,b,c,d){H.call(this,4);this.c=a;this.v=b;this.i=c||new Bc([]);this.D=!!d;b=this.i;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=Eb?a.toLowerCase():a,this.f={name:a,B:b.B});a:{a=this.i;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.j||1==c.l||0==c.l){a=!0;break a}a=!1}this.j=a}p(Cc,H); -Cc.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.B?K(c.B,a):null,f=1);if(this.D)if(this.j||this.c!=Dc)if(a=cc((new Cc(Ec,new Wb("node"))).a(a)),b=G(a))for(c=this.u(b,d,e,f);null!=(b=G(a));)c=$b(c,this.u(b,d,e,f));else c=new D;else c=Qb(this.v,b,d,e),c=nc(this.i,c,f);else c=this.u(a.a,d,e,f);return c};Cc.prototype.u=function(a,b,c,d){a=this.c.f(this.v,a,b,c);return a=nc(this.i,a,d)}; -Cc.prototype.toString=function(){var a;a="Step:"+I("Operator: "+(this.D?"//":"/"));this.c.m&&(a+=I("Axis: "+this.c));a+=I(this.v);if(this.i.a.length){var b=xa(this.i.a,function(a,b){return a+I(b)},"Predicates:");a+=I(b)}return a};function Fc(a,b,c,d){this.m=a;this.f=b;this.a=c;this.b=d}Fc.prototype.toString=function(){return this.m};var Gc={};function O(a,b,c,d){if(Gc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Fc(a,b,c,!!d);return Gc[a]=b} -O("ancestor",function(a,b){for(var c=new D,d=b;d=d.parentNode;)a.a(d)&&c.unshift(d);return c},!0);O("ancestor-or-self",function(a,b){var c=new D,d=b;do a.a(d)&&c.unshift(d);while(d=d.parentNode);return c},!0); -var vc=O("attribute",function(a,b){var c=new D,d=a.f();if("style"==d&&b.style&&Eb)return F(c,new Gb(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof Wb&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)Eb?f.nodeValue&&F(c,Hb(b,f)):F(c,f);else(f=e.getNamedItem(d))&&(Eb?f.nodeValue&&F(c,Hb(b,f)):F(c,f));return c},!1),Dc=O("child",function(a,b,c,d,e){return(Eb?Xb:Yb).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new D)},!1,!0);O("descendant",Qb,!1,!0); -var Ec=O("descendant-or-self",function(a,b,c,d){var e=new D;Pb(b,c,d)&&a.a(b)&&F(e,b);return Qb(a,b,c,d,e)},!1,!0),zc=O("following",function(a,b,c,d){var e=new D;do for(var f=b;f=f.nextSibling;)Pb(f,c,d)&&a.a(f)&&F(e,f),e=Qb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);O("following-sibling",function(a,b){for(var c=new D,d=b;d=d.nextSibling;)a.a(d)&&F(c,d);return c},!1);O("namespace",function(){return new D},!1); -var Hc=O("parent",function(a,b){var c=new D;if(9==b.nodeType)return c;if(2==b.nodeType)return F(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&F(c,d);return c},!1),Ac=O("preceding",function(a,b,c,d){var e=new D,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,k=f.length;g<k;g++){var n=[];for(b=f[g];b=b.previousSibling;)n.unshift(b);for(var v=0,u=n.length;v<u;v++)b=n[v],Pb(b,c,d)&&a.a(b)&&F(e,b),e=Qb(a,b,c,d,e)}return e},!0,!0); -O("preceding-sibling",function(a,b){for(var c=new D,d=b;d=d.previousSibling;)a.a(d)&&c.unshift(d);return c},!0);var Ic=O("self",function(a,b){var c=new D;a.a(b)&&F(c,b);return c},!1);function Jc(a){H.call(this,1);this.c=a;this.j=a.j;this.b=a.b}p(Jc,H);Jc.prototype.a=function(a){return-J(this.c,a)};Jc.prototype.toString=function(){return"Unary Expression: -"+I(this.c)};function Kc(a){H.call(this,4);this.c=a;ec(this,ya(this.c,function(a){return a.j}));fc(this,ya(this.c,function(a){return a.b}))}p(Kc,H);Kc.prototype.a=function(a){var b=new D;q(this.c,function(c){c=c.a(a);if(!(c instanceof D))throw Error("Path expression must evaluate to NodeSet.");b=$b(b,c)});return b};Kc.prototype.toString=function(){return xa(this.c,function(a,b){return a+I(b)},"Union Expression:")};function Lc(a,b){this.a=a;this.b=b}function Mc(a){for(var b,c=[];;){P(a,"Missing right hand side of binary expression.");b=Nc(a);var d=C(a.a);if(!d)break;var e=(d=lc[d]||null)&&d.M;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].M;)b=new hc(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new hc(c.pop(),c.pop(),b);return b}function P(a,b){if(Nb(a.a))throw Error(b);}function Oc(a,b){var c=C(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} -function Pc(a){a=C(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Qc(a){a=C(a.a);if(2>a.length)throw Error("Unclosed literal string");return new sc(a)} -function Rc(a){var b,c=[],d;if(yc(B(a.a))){b=C(a.a);d=B(a.a);if("/"==b&&(Nb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new wc;d=new wc;P(a,"Missing next location step.");b=Sc(a,b);c.push(b)}else{a:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":C(a.a);b=Mc(a);P(a,'unclosed "("');Oc(a,")");break;case '"':case "'":b=Qc(a);break;default:if(isNaN(+b))if(!rc(b)&&/(?![0-9])[\w]/.test(d)&&"("==B(a.a,1)){b=C(a.a); -b=qc[b]||null;C(a.a);for(d=[];")"!=B(a.a);){P(a,"Missing function argument list.");d.push(Mc(a));if(","!=B(a.a))break;C(a.a)}P(a,"Unclosed function argument list.");Pc(a);b=new oc(b,d)}else{b=null;break a}else b=new tc(+C(a.a))}"["==B(a.a)&&(d=new Bc(Tc(a)),b=new mc(b,d))}if(b)if(yc(B(a.a)))d=b;else return b;else b=Sc(a,"/"),d=new xc,c.push(b)}for(;yc(B(a.a));)b=C(a.a),P(a,"Missing next location step."),b=Sc(a,b),c.push(b);return new uc(d,c)} -function Sc(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new Cc(Ic,new Wb("node")),C(a.a),d;if(".."==B(a.a))return d=new Cc(Hc,new Wb("node")),C(a.a),d;var f;if("@"==B(a.a))f=vc,C(a.a),P(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+C(a.a));c=C(a.a);f=Gc[c]||null;if(!f)throw Error("No axis with name: "+c);C(a.a);P(a,"Missing node name")}else f=Dc;c=B(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== -B(a.a,1)){if(!rc(c))throw Error("Invalid node type: "+c);c=C(a.a);if(!rc(c))throw Error("Invalid type name: "+c);Oc(a,"(");P(a,"Bad nodetype");e=B(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Qc(a);P(a,"Bad nodetype");Pc(a);c=new Wb(c,g)}else if(c=C(a.a),e=c.indexOf(":"),-1==e)c=new Tb(c);else{var g=c.substring(0,e),k;if("*"==g)k="*";else if(k=a.b(g),!k)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new Tb(c,k)}else throw Error("Bad token: "+C(a.a));e=new Bc(Tc(a),f.a);return d|| -new Cc(f,c,e,"//"==b)}function Tc(a){for(var b=[];"["==B(a.a);){C(a.a);P(a,"Missing predicate expression.");var c=Mc(a);b.push(c);P(a,"Unclosed predicate expression.");Oc(a,"]")}return b}function Nc(a){if("-"==B(a.a))return C(a.a),new Jc(Nc(a));var b=Rc(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==C(a.a);)P(a,"Missing next union location path."),b.push(Rc(a));a.a.a--;a=new Kc(b)}return a};function Uc(a){switch(a.nodeType){case 1:return ma(Vc,a);case 9:return Uc(a.documentElement);case 11:case 10:case 6:case 12:return Wc;default:return a.parentNode?Uc(a.parentNode):Wc}}function Wc(){return null}function Vc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Vc(a.parentNode,b):null};function Xc(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Kb(a);if(Nb(c))throw Error("Invalid XPath expression.");b?fa(b)||(b=la(b.lookupNamespaceURI,b)):b=function(){return null};var d=Mc(new Lc(c,b));if(!Nb(c))throw Error("Bad token: "+C(c));this.evaluate=function(a,b){var c=d.a(new Db(a));return new Q(c,b)}} -function Q(a,b){if(0==b)if(a instanceof D)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof D))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof D?bc(a):""+a;break;case 1:this.numberValue=a instanceof D?+bc(a):+a;break;case 3:this.booleanValue=a instanceof D?0<a.o:!!a;break;case 4:case 5:case 6:case 7:var d= -cc(a);c=[];for(var e=G(d);e;e=G(d))c.push(e instanceof Gb?e.a:e);this.snapshotLength=a.o;this.invalidIteratorState=!1;break;case 8:case 9:d=ac(a);this.singleNodeValue=d instanceof Gb?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| -0>a?null:c[a]}}Q.ANY_TYPE=0;Q.NUMBER_TYPE=1;Q.STRING_TYPE=2;Q.BOOLEAN_TYPE=3;Q.UNORDERED_NODE_ITERATOR_TYPE=4;Q.ORDERED_NODE_ITERATOR_TYPE=5;Q.UNORDERED_NODE_SNAPSHOT_TYPE=6;Q.ORDERED_NODE_SNAPSHOT_TYPE=7;Q.ANY_UNORDERED_NODE_TYPE=8;Q.FIRST_ORDERED_NODE_TYPE=9;function Yc(a){this.lookupNamespaceURI=Uc(a)} -function Zc(a,b){var c=a||aa,d=c.document;if(!d.evaluate||b)c.XPathResult=Q,d.evaluate=function(a,b,c,d){return(new Xc(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Xc(a,b)},d.createNSResolver=function(a){return new Yc(a)}}ba("wgxpath.install",Zc);var S={};S.H=function(){var a={W:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -S.u=function(a,b,c){var d=A(a);if(!d.documentElement)return null;(x||Ab)&&Zc(mb(d));try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):S.H;if(x&&!fb(7))return d.evaluate.call(d,b,a,e,c,null);if(!x||9<=Number(hb)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var n=g[k],v=n.namespaceURI;if(v&&!f[v]){var u=n.lookupPrefix(v);if(!u)var E=v.match(".*/(\\w+)/?$"),u=E?E[1]:"xhtml";f[v]=u}}var y={},M;for(M in f)y[f[M]]=M;e=function(a){return y[a]||null}}try{return d.evaluate(b, -a,e,c,null)}catch(R){if("TypeError"===R.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):S.H,d.evaluate(b,a,e,c,null);throw R;}}catch(R){if(!z||"NS_ERROR_ILLEGAL_VALUE"!=R.name)throw new r(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+R);}};S.I=function(a,b){if(!a||1!=a.nodeType)throw new r(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");}; -S.w=function(a,b){var c=function(){var c=S.u(b,a,9);return c?c.singleNodeValue||null:b.selectSingleNode?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||S.I(c,a);return c}; -S.s=function(a,b){var c=function(){var c=S.u(b,a,7);if(c){for(var e=c.snapshotLength,f=[],g=0;g<e;++g)f.push(c.snapshotItem(g));return f}return b.selectNodes?(c=A(b),c.setProperty&&c.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();q(c,function(b){S.I(b,a)});return c};function $c(a){return(a=a.exec(La))?a[1]:""}var ad=function(){if(xb)return $c(/Firefox\/([0-9.]+)/);if(x||Xa||Wa)return db;if(Bb)return $c(/Chrome\/([0-9.]+)/);if(Cb&&!(Va()||w("iPad")||w("iPod")))return $c(/Version\/([0-9.]+)/);if(yb||zb){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(La))return a[1]+"."+a[2]}else if(Ab)return(a=$c(/Android\s+([0-9.]+)/))?a:$c(/Version\/([0-9.]+)/);return""}();var bd,cd;function dd(a){return ed?bd(a):x?0<=sa(hb,a):fb(a)}function fd(a){return ed?cd(a):Ab?0<=sa(gd,a):0<=sa(ad,a)} -var ed=function(){if(!z)return!1;var a=aa.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;bd=function(a){return 0<=c.compare(d,""+a)};cd=function(a){return 0<=c.compare(e,""+a)};return!0}(),hd=zb||yb,id; -if(Ab){var jd=/Android\s+([0-9\.]+)/.exec(La);id=jd?jd[1]:"0"}else id="0";var gd=id,kd=x&&!(8<=Number(hb)),ld=x&&!(9<=Number(hb));Ab&&fd(2.3);Ab&&fd(4);Cb&&fd(6);function md(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}h=md.prototype;h.clone=function(){return new md(this.top,this.right,this.bottom,this.left)};h.toString=function(){return"("+this.top+"t, "+this.right+"r, "+this.bottom+"b, "+this.left+"l)"};h.contains=function(a){return this&&a?a instanceof md?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1}; -h.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};h.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};h.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function T(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}h=T.prototype;h.clone=function(){return new T(this.left,this.top,this.width,this.height)};h.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"};h.contains=function(a){return a instanceof T?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height}; -h.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};h.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};h.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -h.scale=function(a,b){var c=ea(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function nd(a,b){var c=A(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}var od={thin:2,medium:4,thick:6}; -function pd(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null,d;if(c in od)d=od[c];else if(/^\d+px?$/.test(c))d=parseInt(c,10);else{d=a.style.left;var e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=c;c=a.style.pixelLeft;a.style.left=d;a.runtimeStyle.left=e;d=c}return d};function qd(a){var b;a:{a=A(a);try{b=a&&a.activeElement;break a}catch(c){}b=null}return x&&b&&"undefined"===typeof b.nodeType?null:b}function U(a,b){return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)}function rd(a){var b;if(b=sd(a,!0)&&td(a))b=!(x||z&&!dd("1.9.2")?0:"none"==V(a,"pointer-events"));return b}function ud(a,b){var c;if(c=kd&&"value"==b&&U(a,"OPTION"))c=null===vd(a,"value");c?(c=[],ub(a,c,!1),c=c.join("")):c=a[b];return c}var wd=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; -function xd(a){var b=[];q(a.split(wd),function(a){var d=a.indexOf(":");0<d&&(a=[a.slice(0,d),a.slice(d+1)],2==a.length&&b.push(a[0].toLowerCase(),":",a[1],";"))});b=b.join("");return b=";"==b.charAt(b.length-1)?b:b+";"}function vd(a,b){b=b.toLowerCase();if("style"==b)return xd(a.style.cssText);if(kd&&"value"==b&&U(a,"INPUT"))return a.value;if(ld&&!0===a[b])return String(a.getAttribute(b));var c=a.getAttributeNode(b);return c&&c.specified?c.value:null}var yd="BUTTON INPUT OPTGROUP OPTION SELECT TEXTAREA".split(" "); -function td(a){var b=a.tagName.toUpperCase();return Ba(yd,b)?ud(a,"disabled")?!1:a.parentNode&&1==a.parentNode.nodeType&&"OPTGROUP"==b||"OPTION"==b?td(a.parentNode):!vb(a,function(a){var b=a.parentNode;if(b&&U(b,"FIELDSET")&&ud(b,"disabled")){if(!U(a,"LEGEND"))return!0;for(;a=l(a.previousElementSibling)?a.previousElementSibling:nb(a.previousSibling);)if(U(a,"LEGEND"))return!0}return!1},!0):!0}var zd="text search tel url email password number".split(" "); -function Ad(a){function b(a){return"inherit"==a.contentEditable?(a=Bd(a))?b(a):!1:"true"==a.contentEditable}return l(a.contentEditable)?!x&&l(a.isContentEditable)?a.isContentEditable:b(a):!1}function Cd(a){return((U(a,"TEXTAREA")?!0:U(a,"INPUT")?Ba(zd,a.type.toLowerCase()):Ad(a)?!0:!1)||(U(a,"INPUT")?"file"==a.type.toLowerCase():!1))&&!ud(a,"readOnly")}function Bd(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return U(a)?a:null} -function V(a,b){var c=ua(b);if("float"==c||"cssFloat"==c||"styleFloat"==c)c=ld?"styleFloat":"cssFloat";var d=nd(a,c)||Dd(a,c);if(null===d)d=null;else if(Ba(Fa,c)){b:{var e=d.match(Ia);if(e){var c=Number(e[1]),f=Number(e[2]),g=Number(e[3]),e=Number(e[4]);if(0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g&&0<=e&&1>=e){c=[c,f,g,e];break b}}c=null}if(!c)b:{if(g=d.match(Ja))if(c=Number(g[1]),f=Number(g[2]),g=Number(g[3]),0<=c&&255>=c&&0<=f&&255>=f&&0<=g&&255>=g){c=[c,f,g,1];break b}c=null}if(!c)b:{c=d.toLowerCase(); -f=Ea[c.toLowerCase()];if(!f&&(f="#"==c.charAt(0)?c:"#"+c,4==f.length&&(f=f.replace(Ga,"#$1$1$2$2$3$3")),!Ha.test(f))){c=null;break b}c=[parseInt(f.substr(1,2),16),parseInt(f.substr(3,2),16),parseInt(f.substr(5,2),16),1]}d=c?"rgba("+c.join(", ")+")":d}return d}function Dd(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&fa(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(c=Bd(a))?Dd(c,b):null} -function Ed(a,b,c){function d(a){var b=Fd(a);return 0<b.height&&0<b.width?!0:U(a,"PATH")&&(0<b.height||0<b.width)?(a=V(a,"stroke-width"),!!a&&0<parseInt(a,10)):"hidden"!=V(a,"overflow")&&ya(a.childNodes,function(a){return 3==a.nodeType||U(a)&&d(a)})}function e(a){return Gd(a)==Hd&&za(a.childNodes,function(a){return!U(a)||e(a)||!d(a)})}if(!U(a))throw Error("Argument to isShown must be of type Element");if(U(a,"BODY"))return!0;if(U(a,"OPTION")||U(a,"OPTGROUP"))return a=vb(a,function(a){return U(a,"SELECT")}), -!!a&&Ed(a,!0,c);var f=Id(a);if(f)return!!f.J&&0<f.rect.width&&0<f.rect.height&&Ed(f.J,b,c);if(U(a,"INPUT")&&"hidden"==a.type.toLowerCase()||U(a,"NOSCRIPT"))return!1;f=V(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Jd(a))&&d(a)?!e(a):!1}function sd(a,b){function c(a){if("none"==V(a,"display"))return!1;a=Bd(a);return!a||c(a)}return Ed(a,!!b,c)}var Hd="hidden"; -function Gd(a,b){function c(a){function b(a){return a==k?!0:0==V(a,"display").lastIndexOf("inline",0)||"absolute"==c&&"static"==V(a,"position")?!1:!0}var c=V(a,"position");if("fixed"==c)return u=!0,a==k?null:k;for(a=Bd(a);a&&!b(a);)a=Bd(a);return a}function d(a){var b=a;if("visible"==v)if(a==k&&n)b=n;else if(a==n)return{x:"visible",y:"visible"};b={x:V(b,"overflow-x"),y:V(b,"overflow-y")};a==k&&(b.x="visible"==b.x?"auto":b.x,b.y="visible"==b.y?"auto":b.y);return b}function e(a){if(a==k){var b=(new lb(g)).a; -a=b.scrollingElement?b.scrollingElement:Ya||"CSS1Compat"!=b.compatMode?b.body||b.documentElement:b.documentElement;b=b.parentWindow||b.defaultView;a=x&&fb("10")&&b.pageYOffset!=a.scrollTop?new ib(a.scrollLeft,a.scrollTop):new ib(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}else a=new ib(a.scrollLeft,a.scrollTop);return a}for(var f=Kd(a,b),g=A(a),k=g.documentElement,n=g.body,v=V(k,"overflow"),u,E=c(a);E;E=c(E)){var y=d(E);if("visible"!=y.x||"visible"!=y.y){var M=Fd(E);if(0==M.width||0== -M.height)return Hd;var R=f.right<M.left,Jb=f.bottom<M.top;if(R&&"hidden"==y.x||Jb&&"hidden"==y.y)return Hd;if(R&&"visible"!=y.x||Jb&&"visible"!=y.y){R=e(E);Jb=f.bottom<M.top-R.y;if(f.right<M.left-R.x&&"visible"!=y.x||Jb&&"visible"!=y.x)return Hd;f=Gd(E);return f==Hd?Hd:"scroll"}R=f.left>=M.left+M.width;M=f.top>=M.top+M.height;if(R&&"hidden"==y.x||M&&"hidden"==y.y)return Hd;if(R&&"visible"!=y.x||M&&"visible"!=y.y){if(u&&(y=e(E),f.left>=k.scrollWidth-y.x||f.right>=k.scrollHeight-y.y))return Hd;f=Gd(E); -return f==Hd?Hd:"scroll"}}}return"none"} -function Fd(a){var b=Id(a);if(b)return b.rect;if(U(a,"HTML"))return a=A(a),a=(mb(a)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new jb(a.clientWidth,a.clientHeight),new T(0,0,a.width,a.height);var c;try{c=a.getBoundingClientRect()}catch(d){return new T(0,0,0,0)}b=new T(c.left,c.top,c.right-c.left,c.bottom-c.top);x&&a.ownerDocument.body&&(a=A(a),b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b} -function Id(a){var b=U(a,"MAP");if(!b&&!U(a,"AREA"))return null;var c=b?a:U(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=S.w('/descendant::*[@usemap = "#'+c.name+'"]',A(c)))&&(e=Fd(d),b||"default"==a.shape.toLowerCase()||(a=Ld(a),b=Math.min(Math.max(a.left,0),e.width),c=Math.min(Math.max(a.top,0),e.height),e=new T(b+e.left,c+e.top,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{J:d,rect:e||new T(0,0,0,0)}} -function Ld(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new T(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new T(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){for(var b=a[0],c=a[1],d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new T(b,c,d-b,e-c)}return new T(0,0,0,0)} -function Kd(a,b){var c;c=Fd(a);c=new md(c.top,c.left+c.width,c.top+c.height,c.left);if(b){var d=b instanceof T?b:new T(b.x,b.y,1,1);c.left=Math.min(Math.max(c.left+d.left,c.left),c.right);c.top=Math.min(Math.max(c.top+d.top,c.top),c.bottom);c.right=Math.min(Math.max(c.left+d.width,c.left),c.right);c.bottom=Math.min(Math.max(c.top+d.height,c.top),c.bottom)}return c}function Md(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")} -function Nd(a){var b=[];Od(a,b);a=wa(b,Md);return Md(a.join("\n")).replace(/\xa0/g," ")} -function Pd(a,b,c){var d=sd;if(U(a,"BR"))b.push("");else{var e=U(a,"TD"),f=V(a,"display"),g=!e&&!Ba(Qd,f),k=l(a.previousElementSibling)?a.previousElementSibling:nb(a.previousSibling),k=k?V(k,"display"):"",n=V(a,"float")||V(a,"cssFloat")||V(a,"styleFloat");!g||"run-in"==k&&"none"==n||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var v=d(a),u=null,E=null;v&&(u=V(a,"white-space"),E=V(a,"text-transform"));q(a.childNodes,function(a){c(a,b,v,u,E)});a=b[b.length-1]||"";!e&&"table-cell"!=f||!a||qa(a)|| -(b[b.length-1]+=" ");g&&"run-in"!=f&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function Od(a,b){Pd(a,b,function(a,b,e,f,g){3==a.nodeType&&e?Rd(a,b,f,g):U(a)&&Od(a,b)})}var Qd="inline inline-block inline-table none table-cell table-column table-column-group".split(" "); -function Rd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[\ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(/(^|\s)(\S)/g,function(a,b,c){return b+c.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";qa(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)} -function Jd(a){if(ld){if("relative"==V(a,"position"))return 1;a=V(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Sd(a)}function Sd(a){var b=1,c=V(a,"opacity");c&&(b=Number(c));(a=Bd(a))&&(b*=Sd(a));return b};var Td={C:function(a){return!(!a.querySelectorAll||!a.querySelector)},w:function(a,b){if(!a)throw new r(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new r(32,"Compound class names not permitted");if(Td.C(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(d){throw new r(32,"An invalid or illegal class name was specified");}var c=wb(kb(b),"*",a,b);return c.length?c[0]:null},s:function(a,b){if(!a)throw new r(32,"No class name specified");a=ra(a);if(-1!==a.indexOf(" "))throw new r(32, -"Compound class names not permitted");if(Td.C(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new r(32,"An invalid or illegal class name was specified");}return wb(kb(b),"*",a,b)}};var Ud={w:function(a,b){if(!fa(b.querySelector)&&x&&dd(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new r(32,"No selector specified");a=ra(a);var c;try{c=b.querySelector(a)}catch(d){throw new r(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},s:function(a,b){if(!fa(b.querySelectorAll)&&x&&dd(8)&&!ga(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new r(32,"No selector specified");a=ra(a);try{return b.querySelectorAll(a)}catch(c){throw new r(32, -"An invalid or illegal selector was specified");}}};var Vd={C:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},w:function(a,b){var c=kb(b),d=m(a)?c.a.getElementById(a):a;if(!d)return null;if(vd(d,"id")==a&&ob(b,d))return d;c=wb(c,"*");return Aa(c,function(c){return vd(c,"id")==a&&ob(b,c)})},s:function(a,b){if(!a)return[];if(Vd.C(b,a))try{return b.querySelectorAll("#"+Vd.P(a))}catch(d){return[]}var c=wb(kb(b),"*",null,b);return va(c,function(b){return vd(b,"id")==a})},P:function(a){return a.replace(/(['"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g, -"\\$1")}};var Wd={},Xd={};Wd.O=function(a,b,c){var d;try{d=Ud.s("a",b)}catch(e){d=wb(kb(b),"A",null,b)}return Aa(d,function(b){b=Nd(b);return c&&-1!=b.indexOf(a)||b==a})};Wd.K=function(a,b,c){var d;try{d=Ud.s("a",b)}catch(e){d=wb(kb(b),"A",null,b)}return va(d,function(b){b=Nd(b);return c&&-1!=b.indexOf(a)||b==a})};Wd.w=function(a,b){return Wd.O(a,b,!1)};Wd.s=function(a,b){return Wd.K(a,b,!1)};Xd.w=function(a,b){return Wd.O(a,b,!0)};Xd.s=function(a,b){return Wd.K(a,b,!0)};var Yd={w:function(a,b){if(""===a)throw new r(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},s:function(a,b){if(""===a)throw new r(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var Zd={className:Td,"class name":Td,css:Ud,"css selector":Ud,id:Vd,linkText:Wd,"link text":Wd,name:{w:function(a,b){var c=wb(kb(b),"*",null,b);return Aa(c,function(b){return vd(b,"name")==a})},s:function(a,b){var c=wb(kb(b),"*",null,b);return va(c,function(b){return vd(b,"name")==a})}},partialLinkText:Xd,"partial link text":Xd,tagName:Yd,"tag name":Yd,xpath:S}; -function $d(a,b){var c;a:{for(c in a)if(a.hasOwnProperty(c))break a;c=null}if(c){var d=Zd[c];if(d&&fa(d.s))return d.s(a[c],b||oa.document)}throw Error("Unsupported locator strategy: "+c);};function ae(a){this.a=oa.document.documentElement;this.i=null;var b=qd(this.a);b&&be(this,b);this.v=a||new ce}function be(a,b){a.a=b;U(b,"OPTION")?a.i=vb(b,function(a){return U(a,"SELECT")}):a.i=null}Ya||ed&&fd(3.6);function de(a){return U(a,"FORM")} -function ee(a){if(!de(a))throw new r(12,"Element is not a form, so could not submit.");if(fe(a,ge))if(U(a.submit))if(!x||dd(8))a.constructor.prototype.submit.call(a);else{var b=$d({id:"submit"},a),c=$d({name:"submit"},a);q(b,function(a){a.removeAttribute("id")});q(c,function(a){a.removeAttribute("name")});a=a.submit;q(b,function(a){a.setAttribute("id","submit")});q(c,function(a){a.setAttribute("name","submit")});a()}else a.submit()}function ce(){this.a=0};var he=!(x&&!dd(10)),ie=Ab?!fd(4):!hd;function je(a,b,c){this.a=a;this.b=b;this.f=c}je.prototype.c=function(a){a=A(a);ld&&a.createEventObject?a=a.createEventObject():(a=a.createEvent("HTMLEvents"),a.initEvent(this.a,this.b,this.f));return a};je.prototype.toString=function(){return this.a};function ke(a,b,c){je.call(this,a,b,c)}p(ke,je); -ke.prototype.c=function(a,b){var c=A(a);if(z){var d=mb(c),e=b.charCode?0:b.keyCode,c=c.createEvent("KeyboardEvent");c.initKeyEvent(this.a,this.b,this.f,d,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,e,b.charCode);this.a==le&&b.preventDefault&&c.preventDefault()}else if(ld?c=c.createEventObject():(c=c.createEvent("Events"),c.initEvent(this.a,this.b,this.f)),c.altKey=b.altKey,c.ctrlKey=b.ctrlKey,c.metaKey=b.metaKey,c.shiftKey=b.shiftKey,c.keyCode=b.charCode||b.keyCode,Ya||Xa)c.charCode=this==le?c.keyCode: -0;return c};function me(a,b,c){je.call(this,a,b,c)}p(me,je); -me.prototype.c=function(a,b){function c(b){b=wa(b,function(b){return f.createTouch(g,a,b.identifier,b.pageX,b.pageY,b.screenX,b.screenY)});return f.createTouchList.apply(f,b)}function d(b){var c=wa(b,function(b){return{identifier:b.identifier,screenX:b.screenX,screenY:b.screenY,clientX:b.clientX,clientY:b.clientY,pageX:b.pageX,pageY:b.pageY,target:a}});c.item=function(a){return c[a]};return c}function e(a){return ie?d(a):c(a)}if(!he)throw new r(9,"Browser does not support firing touch events.");var f= -A(a),g=mb(f),k=e(b.changedTouches),n=b.touches==b.changedTouches?k:e(b.touches),v=b.targetTouches==b.changedTouches?k:e(b.targetTouches),u;ie?(u=f.createEvent("MouseEvents"),u.initMouseEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,0,b.relatedTarget),u.touches=n,u.targetTouches=v,u.changedTouches=k,u.scale=b.scale,u.rotation=b.rotation):(u=f.createEvent("TouchEvent"),0==u.initTouchEvent.length?u.initTouchEvent(n,v,k,this.a,g,0,0,b.clientX,b.clientY, -b.ctrlKey,b.altKey,b.shiftKey,b.metaKey):u.initTouchEvent(this.a,this.b,this.f,g,1,0,0,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,n,v,k,b.scale,b.rotation),u.relatedTarget=b.relatedTarget);return u}; -var ne=new je("blur",!1,!1),oe=new je("change",!0,!1),pe=new je("focus",!1,!1),qe=new je("input",!0,!1),ge=new je("submit",!0,!0),re=new je("textInput",!0,!0),se=new ke("keydown",!0,!0),le=new ke("keypress",!0,!0),te=new ke("keyup",!0,!0),ue=new me("touchend",!0,!0),ve=new me("touchstart",!0,!0);function fe(a,b,c){c=b.c(a,c);"isTrusted"in c||(c.isTrusted=!1);return ld&&a.fireEvent?a.fireEvent("on"+b.a,c):a.dispatchEvent(c)};function we(a,b){if(xe(a))a.selectionStart=b;else if(x){var c=ye(a),d=c[0];d.inRange(c[1])&&(b=ze(a,b),d.collapse(!0),d.move("character",b),d.select())}} -function Ae(a,b){var c=0,d=0;if(xe(a))c=a.selectionStart,d=b?-1:a.selectionEnd;else if(x){var e=ye(a),f=e[0],e=e[1];if(f.inRange(e)){f.setEndPoint("EndToStart",e);if("textarea"==a.type){for(var c=e.duplicate(),g=f.text,d=g,k=e=c.text,n=!1;!n;)0==f.compareEndPoints("StartToEnd",f)?n=!0:(f.moveEnd("character",-1),f.text==g?d+="\r\n":n=!0);if(b)f=[d.length,-1];else{for(f=!1;!f;)0==c.compareEndPoints("StartToEnd",c)?f=!0:(c.moveEnd("character",-1),c.text==e?k+="\r\n":f=!0);f=[d.length,d.length+k.length]}return f}c= -f.text.length;b?d=-1:d=f.text.length+e.text.length}}return[c,d]}function Be(a,b){if(xe(a))a.selectionEnd=b;else if(x){var c=ye(a),d=c[1];c[0].inRange(d)&&(b=ze(a,b),c=ze(a,Ae(a,!0)[0]),d.collapse(!0),d.moveEnd("character",b-c),d.select())}}function Ce(a,b){if(xe(a))a.selectionStart=b,a.selectionEnd=b;else if(x){b=ze(a,b);var c=a.createTextRange();c.collapse(!0);c.move("character",b);c.select()}} -function De(a,b){if(xe(a)){var c=a.value,d=a.selectionStart;a.value=c.substr(0,d)+b+c.substr(a.selectionEnd);a.selectionStart=d;a.selectionEnd=d+b.length}else if(x)d=ye(a),c=d[1],d[0].inRange(c)&&(d=c.duplicate(),c.text=b,c.setEndPoint("StartToStart",d),c.select());else throw Error("Cannot set the selection end");}function ye(a){var b=a.ownerDocument||a.document,c=b.selection.createRange();"textarea"==a.type?(b=b.body.createTextRange(),b.moveToElementText(a)):b=a.createTextRange();return[b,c]} -function ze(a,b){"textarea"==a.type&&(b=a.value.substring(0,b).replace(/(\r\n|\r|\n)/g,"\n").length);return b}function xe(a){try{return"number"==typeof a.selectionStart}catch(b){return!1}};function Ee(a,b){this.b={};this.a=[];this.c=this.f=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)Fe(this,arguments[d],arguments[d+1])}else if(a){if(a instanceof Ee)d=Ge(a),c=a.A();else{var c=[],e=0;for(d in a)c[e++]=d;d=c;c=Qa(a)}for(e=0;e<d.length;e++)Fe(this,d[e],c[e])}}h=Ee.prototype;h.A=function(){He(this);for(var a=[],b=0;b<this.a.length;b++)a.push(this.b[this.a[b]]);return a};function Ge(a){He(a);return a.a.concat()} -h.clear=function(){this.b={};this.c=this.f=this.a.length=0};function He(a){if(a.f!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Ie(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.f!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],Ie(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}h.get=function(a,b){return Ie(this.b,a)?this.b[a]:b};function Fe(a,b,c){Ie(a.b,b)||(a.f++,a.a.push(b),a.c++);a.b[b]=c} -h.forEach=function(a,b){for(var c=Ge(this),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};h.clone=function(){return new Ee(this)};function Ie(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Je(a){if(a.A&&"function"==typeof a.A)return a.A();if(m(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Qa(a)};function Ke(a){this.a=new Ee;if(a){a=Je(a);for(var b=a.length,c=0;c<b;c++){var d=a[c];Fe(this.a,Le(d),d)}}}function Le(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[ha]||(a[ha]=++ia)):b.substr(0,1)+a}Ke.prototype.clear=function(){this.a.clear()};Ke.prototype.contains=function(a){a=Le(a);return Ie(this.a.b,a)};Ke.prototype.A=function(){return this.a.A()};Ke.prototype.clone=function(){return new Ke(this)};function Me(a){ae.call(this);this.f=Cd(this.a);this.b=0;this.c=new Ke;a&&(q(a.pressed,function(a){Ne(this,a,!0)},this),this.b=a.currentPos||0)}p(Me,ae);var Oe={};function W(a,b,c){ga(a)&&(a=z?a.g:a.h);a=new Pe(a,b,c);!b||b in Oe&&!c||(Oe[b]={key:a,shift:!1},c&&(Oe[c]={key:a,shift:!0}));return a}function Pe(a,b,c){this.code=a;this.a=b||null;this.b=c||this.a}var Qe=W(8),Re=W(9),Se=W(13),X=W(16),Te=W(17),Ue=W(18),Ve=W(19);W(20); -var We=W(27),Xe=W(32," "),Ye=W(33),Ze=W(34),$e=W(35),af=W(36),bf=W(37),cf=W(38),df=W(39),ef=W(40);W(44);var ff=W(45),gf=W(46);W(48,"0",")");W(49,"1","!");W(50,"2","@");W(51,"3","#");W(52,"4","$");W(53,"5","%");W(54,"6","^");W(55,"7","&");W(56,"8","*");W(57,"9","(");W(65,"a","A");W(66,"b","B");W(67,"c","C");W(68,"d","D");W(69,"e","E");W(70,"f","F");W(71,"g","G");W(72,"h","H");W(73,"i","I");W(74,"j","J");W(75,"k","K");W(76,"l","L");W(77,"m","M");W(78,"n","N");W(79,"o","O");W(80,"p","P");W(81,"q","Q"); -W(82,"r","R");W(83,"s","S");W(84,"t","T");W(85,"u","U");W(86,"v","V");W(87,"w","W");W(88,"x","X");W(89,"y","Y");W(90,"z","Z"); -var hf=W(ab?{g:91,h:91}:$a?{g:224,h:91}:{g:0,h:91}),jf=W(ab?{g:92,h:92}:$a?{g:224,h:93}:{g:0,h:92}),kf=W(ab?{g:93,h:93}:$a?{g:0,h:0}:{g:93,h:null}),lf=W({g:96,h:96},"0"),mf=W({g:97,h:97},"1"),nf=W({g:98,h:98},"2"),of=W({g:99,h:99},"3"),pf=W({g:100,h:100},"4"),qf=W({g:101,h:101},"5"),rf=W({g:102,h:102},"6"),sf=W({g:103,h:103},"7"),tf=W({g:104,h:104},"8"),uf=W({g:105,h:105},"9"),vf=W({g:106,h:106},"*"),wf=W({g:107,h:107},"+"),xf=W({g:109,h:109},"-"),yf=W({g:110,h:110},"."),zf=W({g:111,h:111},"/");W(144); -var Af=W(112),Bf=W(113),Cf=W(114),Df=W(115),Ef=W(116),Ff=W(117),Gf=W(118),Hf=W(119),If=W(120),Jf=W(121),Kf=W(122),Lf=W(123),Mf=W({g:107,h:187},"=","+"),Nf=W(108,",");W({g:109,h:189},"-","_");W(188,",","<");W(190,".",">");W(191,"/","?");W(192,"`","~");W(219,"[","{");W(220,"\\","|");W(221,"]","}");var Of=W({g:59,h:186},";",":");W(222,"'",'"');var Pf=[Ue,Te,hf,X],Qf=new Ee;Fe(Qf,1,X);Fe(Qf,2,Te);Fe(Qf,4,Ue);Fe(Qf,8,hf);var Rf=function(a){var b=new Ee;q(Ge(a),function(c){Fe(b,a.get(c).code,c)});return b}(Qf); -function Ne(a,b,c){if(Ba(Pf,b)){var d=Rf.get(b.code),e=a.v;e.a=c?e.a|d:e.a&~d}c?Fe(a.c.a,Le(b),b):(a=a.c.a,b=Le(b),Ie(a.b,b)&&(delete a.b[b],a.f--,a.c++,a.a.length>2*a.f&&He(a)))}var Sf=x?"\r\n":"\n";function Y(a,b){return a.c.contains(b)} -function Tf(a,b){if(Ba(Pf,b)&&Y(a,b))throw new r(13,"Cannot press a modifier key that is already pressed.");var c=null!==b.code&&Uf(a,se,b);if((c||z)&&(!Vf(b)||Uf(a,le,b,!c))&&c&&(Wf(a,b),a.f))if(b.a){if(!Xf){var c=Yf(a,b),d=Ae(a.a,!0)[0]+1;Zf(a.a)?(De(a.a,c),we(a.a,d)):a.a.value+=c;Ya&&fe(a.a,re);ld||fe(a.a,qe);a.b=d}}else switch(b){case Se:Xf||(Ya&&fe(a.a,re),U(a.a,"TEXTAREA")&&(c=Ae(a.a,!0)[0]+Sf.length,Zf(a.a)?(De(a.a,Sf),we(a.a,c)):a.a.value+=Sf,x||fe(a.a,qe),a.b=c));break;case Qe:case gf:Xf|| -($f(a.a),c=Ae(a.a,!1),c[0]==c[1]&&(b==Qe?(we(a.a,c[1]-1),Be(a.a,c[1])):Be(a.a,c[1]+1)),c=Ae(a.a,!1),c=!(c[0]==a.a.value.length||0==c[1]),De(a.a,""),(!x&&c||z&&b==Qe)&&fe(a.a,qe),c=Ae(a.a,!1),a.b=c[1]);break;case bf:case df:$f(a.a);var c=a.a,e=Ae(c,!0)[0],f=Ae(c,!1)[1],g=d=0;b==bf?Y(a,X)?a.b==e?(d=Math.max(e-1,0),g=f,e=d):(d=e,e=g=f-1):e=e==f?Math.max(e-1,0):e:Y(a,X)?a.b==f?(d=e,e=g=Math.min(f+1,c.value.length)):(d=e+1,g=f,e=d):e=e==f?Math.min(f+1,c.value.length):f;Y(a,X)?(we(c,d),Be(c,g)):Ce(c,e); -a.b=e;break;case af:case $e:$f(a.a),c=a.a,d=Ae(c,!0)[0],g=Ae(c,!1)[1],b==af?(Y(a,X)?(we(c,0),Be(c,a.b==d?g:d)):Ce(c,0),a.b=0):(Y(a,X)?(a.b==d&&we(c,g),Be(c,c.value.length)):Ce(c,c.value.length),a.b=c.value.length)}Ne(a,b,!0)}function Vf(a){if(a.a||a==Se)return!0;if(Ya||Xa)return!1;if(x)return a==We;switch(a){case X:case Te:case Ue:return!1;case hf:case jf:case kf:return z;default:return!0}} -function Wf(a,b){if(b==Se&&!z&&U(a.a,"INPUT")){var c=vb(a.a,de,!0);if(c){var d=c.getElementsByTagName("input");(ya(d,function(a){a:{if(U(a,"INPUT")){var b=a.type.toLowerCase();if("submit"==b||"image"==b){a=!0;break a}}if(U(a,"BUTTON")&&(b=a.type.toLowerCase(),"submit"==b)){a=!0;break a}a=!1}return a})||1==d.length||Ya&&!dd(534))&&ee(c)}}}function ag(a,b){if(!Y(a,b))throw new r(13,"Cannot release a key that is not pressed. ("+b.code+")");null===b.code||Uf(a,te,b);Ne(a,b,!1)} -function Yf(a,b){if(!b.a)throw new r(13,"not a character key");return Y(a,X)?b.b:b.a}var Xf=z&&!dd(12);function $f(a){try{a.selectionStart}catch(b){if(-1!=b.message.indexOf("does not support selection."))throw Error(b.message+" (For more information, see https://code.google.com/p/chromium/issues/detail?id=330456)");throw b;}}function Zf(a){try{$f(a)}catch(b){return!1}return!0} -function Uf(a,b,c,d){if(null===c.code)throw new r(13,"Key must have a keycode to be fired.");c={altKey:Y(a,Ue),ctrlKey:Y(a,Te),metaKey:Y(a,hf),shiftKey:Y(a,X),keyCode:c.code,charCode:c.a&&b==le?Yf(a,c).charCodeAt(0):0,preventDefault:!!d};return fe(a.a,b,c)} -function bg(a,b){be(a,b);a.f=Cd(b);var c;c=a.i||a.a;var d=qd(c);if(c==d)c=!1;else{if(d&&(fa(d.blur)||x&&ga(d.blur))){if(!U(d,"BODY"))try{d.blur()}catch(e){if(!x||"Unspecified error."!=e.message)throw e;}x&&!dd(8)&&mb(A(c)).focus()}fa(c.focus)||x&&ga(c.focus)?(c.focus(),c=!0):c=!1}a.f&&c&&(Ce(b,b.value.length),a.b=b.value.length)};function cg(a,b,c,d){function e(a){m(a)?q(a.split(""),function(a){if(1!=a.length)throw new r(13,"Argument not a single character: "+a);var b=Oe[a];b||(b=a.toUpperCase(),b=W(b.charCodeAt(0),a.toLowerCase(),b),b={key:b,shift:a!=b.a});a=b;b=Y(f,X);a.shift&&!b&&Tf(f,X);Tf(f,a.key);ag(f,a.key);a.shift&&!b&&ag(f,X)}):Ba(Pf,a)?Y(f,a)?ag(f,a):Tf(f,a):(Tf(f,a),ag(f,a))}if(a!=qd(a)){if(!rd(a))throw new r(12,"Element is not currently interactable and may not be manipulated");dg(a)}var f=c||new Me;bg(f,a);if((!Cb|| -Za)&&Ya&&"date"==a.type){c="array"==ca(b)?b=b.join(""):b;var g=/\d{4}-\d{2}-\d{2}/;if(c.match(g)){Za&&Cb&&(fe(a,ve),fe(a,ue));fe(a,pe);a.value=c.match(g)[0];fe(a,oe);fe(a,ne);return}}"array"==ca(b)?q(b,e):e(b);d||q(Pf,function(a){Y(f,a)&&ag(f,a)})} -function dg(a){if("scroll"==Gd(a,void 0)){if(a.scrollIntoView&&(a.scrollIntoView(),"none"==Gd(a,void 0)))return;for(var b=Kd(a,void 0),c=Bd(a);c;c=Bd(c)){var d=c,e=Fd(d),f;var g=d;if(!x||9<=Number(hb))k=nd(g,"borderLeftWidth"),f=nd(g,"borderRightWidth"),n=nd(g,"borderTopWidth"),g=nd(g,"borderBottomWidth"),f=new md(parseFloat(n),parseFloat(f),parseFloat(g),parseFloat(k));else{var k=pd(g,"borderLeft");f=pd(g,"borderRight");var n=pd(g,"borderTop"),g=pd(g,"borderBottom");f=new md(n,f,g,k)}k=b.left-e.left- -f.left;e=b.top-e.top-f.top;f=d.clientHeight+b.top-b.bottom;d.scrollLeft+=Math.min(k,Math.max(k-(d.clientWidth+b.left-b.right),0));d.scrollTop+=Math.min(e,Math.max(e-f,0))}Gd(a,void 0)}};function Z(a,b,c,d){function e(){return{L:f,keys:[]}}var f=!!d,g=[],k=e();g.push(k);q(b,function(a){q(a.split(""),function(a){if("\ue000"<=a&&"\ue03d">=a){var b=Z.a[a];if(null===b)g.push(k=e()),f&&(k.L=!1,g.push(k=e()));else if(l(b))k.keys.push(b);else throw Error("Unsupported WebDriver key: \\u"+a.charCodeAt(0).toString(16));}else switch(a){case "\n":k.keys.push(Se);break;case "\t":k.keys.push(Re);break;case "\b":k.keys.push(Qe);break;default:k.keys.push(a)}})});q(g,function(b){cg(a,b.keys,c,b.L)})} -Z.a={};Z.a["\ue000"]=null;Z.a["\ue003"]=Qe;Z.a["\ue004"]=Re;Z.a["\ue006"]=Se;Z.a["\ue007"]=Se;Z.a["\ue008"]=X;Z.a["\ue009"]=Te;Z.a["\ue00a"]=Ue;Z.a["\ue00b"]=Ve;Z.a["\ue00c"]=We;Z.a["\ue00d"]=Xe;Z.a["\ue00e"]=Ye;Z.a["\ue00f"]=Ze;Z.a["\ue010"]=$e;Z.a["\ue011"]=af;Z.a["\ue012"]=bf;Z.a["\ue013"]=cf;Z.a["\ue014"]=df;Z.a["\ue015"]=ef;Z.a["\ue016"]=ff;Z.a["\ue017"]=gf;Z.a["\ue018"]=Of;Z.a["\ue019"]=Mf;Z.a["\ue01a"]=lf;Z.a["\ue01b"]=mf;Z.a["\ue01c"]=nf;Z.a["\ue01d"]=of;Z.a["\ue01e"]=pf;Z.a["\ue01f"]=qf; -Z.a["\ue020"]=rf;Z.a["\ue021"]=sf;Z.a["\ue022"]=tf;Z.a["\ue023"]=uf;Z.a["\ue024"]=vf;Z.a["\ue025"]=wf;Z.a["\ue027"]=xf;Z.a["\ue028"]=yf;Z.a["\ue029"]=zf;Z.a["\ue026"]=Nf;Z.a["\ue031"]=Af;Z.a["\ue032"]=Bf;Z.a["\ue033"]=Cf;Z.a["\ue034"]=Df;Z.a["\ue035"]=Ef;Z.a["\ue036"]=Ff;Z.a["\ue037"]=Gf;Z.a["\ue038"]=Hf;Z.a["\ue039"]=If;Z.a["\ue03a"]=Jf;Z.a["\ue03b"]=Kf;Z.a["\ue03c"]=Lf;Z.a["\ue03d"]=hf;function eg(){} -function fg(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==ca(b)){var d=b;b=d.length;c.push("[");for(var e="",f=0;f<b;f++)c.push(e),fg(a,d[f],c),e=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");e="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(e),gg(d,c),c.push(":"),fg(a,f,c),e=","));c.push("}");return}}switch(typeof b){case "string":gg(b,c);break;case "number":c.push(isFinite(b)&& -!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var hg={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},ig=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g; -function gg(a,b){b.push('"',a.replace(ig,function(a){var b=hg[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),hg[a]=b);return b}),'"')};Ya||z&&dd(3.5)||x&&dd(8);function jg(a){switch(ca(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return wa(a,jg);case "object":if(Ra(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var b={};b.ELEMENT=kg(a);return b}if(Ra(a,"document"))return b={},b.WINDOW=kg(a),b;if(da(a))return wa(a,jg);a=Oa(a,function(a,b){return ea(b)||m(b)});return Pa(a,jg);default:return null}} -function lg(a,b){return"array"==ca(a)?wa(a,function(a){return lg(a,b)}):ga(a)?"function"==typeof a?a:Ra(a,"ELEMENT")?mg(a.ELEMENT,b):Ra(a,"WINDOW")?mg(a.WINDOW,b):Pa(a,function(a){return lg(a,b)}):a}function ng(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.F=na());b.F||(b.F=na());return b}function kg(a){var b=ng(a.ownerDocument),c=Sa(b,function(b){return b==a});c||(c=":wdc:"+b.F++,b[c]=a);return c} -function mg(a,b){a=decodeURIComponent(a);var c=b||document,d=ng(c);if(!Ra(d,a))throw new r(10,"Element does not exist in cache");var e=d[a];if(Ra(e,"setInterval")){if(e.closed)throw delete d[a],new r(23,"Window has been closed.");return e}for(var f=e;f;){if(f==c.documentElement)return e;f=f.parentNode}delete d[a];throw new r(10,"Element is no longer attached to the DOM");};ba("_",function(a,b,c){a=[a,b];b=Z;var d;try{var e;c?e=mg(c.WINDOW):e=window;var f=lg(a,e.document),g=b.apply(null,f);d={status:0,value:jg(g)}}catch(k){d={status:Ra(k,"code")?k.code:13,value:{message:k.message}}}c=[];fg(new eg,d,c);return c.join("")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);} diff --git a/src/ghostdriver/webdriver_atoms.js b/src/ghostdriver/webdriver_atoms.js deleted file mode 100644 index 4f1f7477b9..0000000000 --- a/src/ghostdriver/webdriver_atoms.js +++ /dev/null @@ -1,44 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>. - -Copyright (c) 2012-2014, Ivan De Marino <http://ivandemarino.me> -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var fs = require("fs"), - atomsCache = {}; - -exports.get = function(atomName) { - var atomFileName = module.dirname + "/third_party/webdriver-atoms/" + atomName + ".js"; - - // Check if we have already loaded an cached this Atom - if (!atomsCache.hasOwnProperty(atomName)) { - try { - atomsCache[atomName] = fs.read(atomFileName); - } catch (e) { - throw new Error("Unable to load Atom '"+atomName+"' from file '"+atomFileName+"'"); - } - } - - return atomsCache[atomName]; -}; diff --git a/src/ghostdriver/webdriver_logger.js b/src/ghostdriver/webdriver_logger.js deleted file mode 100644 index 3020cf6e25..0000000000 --- a/src/ghostdriver/webdriver_logger.js +++ /dev/null @@ -1,69 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>. - -Copyright (c) 2017, Jason Gowan <gowanjason@gmail.com> -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -const -log_levels = [ - "OFF", - "SEVERE", - "WARNING", - "INFO", - "CONFIG", - "FINE", - "FINER", - "FINEST", - "ALL" -]; - -/** - * (Super-simple) Logger - * - * @param context {String} Logger level - */ -function WebDriverLogger(log_level) { - var _push; - - // default to no-opt - if (log_level === "OFF" || log_levels.indexOf(log_level) === -1) { - _push = function(_) {}; - } else { - _push = function(arg) { this.log.push(arg); }; - } - - return { - log: [], - push: _push - }; -}; - -/** - * Export: Create Logger with Log Level - * - * @param context {String} Log Level of the new Logger - */ -exports.create = function (log_level) { - return new WebDriverLogger(log_level); -}; diff --git a/src/ghostdriver/webelementlocator.js b/src/ghostdriver/webelementlocator.js deleted file mode 100644 index e9e7cfb22c..0000000000 --- a/src/ghostdriver/webelementlocator.js +++ /dev/null @@ -1,258 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino <http://ivandemarino.me>. - -Copyright (c) 2012-2014, Ivan De Marino <http://ivandemarino.me> -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -var ghostdriver = ghostdriver || {}; - -ghostdriver.WebElementLocator = function(session) { - // private: - const - _supportedStrategies = [ - "class name", "className", //< Returns an element whose class name contains the search value; compound class names are not permitted. - "css", "css selector", //< Returns an element matching a CSS selector. - "id", //< Returns an element whose ID attribute matches the search value. - "name", //< Returns an element whose NAME attribute matches the search value. - "link text", "linkText", //< Returns an anchor element whose visible text matches the search value. - "partial link text", "partialLinkText", //< Returns an anchor element whose visible text partially matches the search value. - "tag name", "tagName", //< Returns an element whose tag name matches the search value. - "xpath" //< Returns an element matching an XPath expression. - ]; - - var - _session = session, - _errors = require("./errors.js"), - _log = ghostdriver.logger.create("WebElementLocator"), - - _find = function(what, locator, rootElement) { - var currWindow = _session.getCurrentWindow(), - findRes, - findAtom = require("./webdriver_atoms.js").get( - "find_" + - (what.indexOf("element") >= 0 ? what : "element")), //< normalize - errorMsg; - - if (currWindow !== null && - locator && typeof(locator) === "object" && - locator.using && locator.value && //< if well-formed input - _supportedStrategies.indexOf(locator.using) >= 0) { //< and if strategy is recognized - - _log.debug("_find.locator", JSON.stringify(locator)); - - // Ensure "rootElement" is valid, otherwise undefine-it - if (!rootElement || typeof(rootElement) !== "object" || !rootElement["ELEMENT"]) { - rootElement = undefined; - } - - // Use Atom "find_result" to search for element in the page - findRes = currWindow.evaluate( - findAtom, - locator.using, - locator.value, - rootElement); - - // De-serialise the result of the Atom execution - try { - return JSON.parse(findRes); - } catch (e) { - errorMsg = JSON.stringify(locator); - _log.error("_find.locator.error", errorMsg); - return { - "status" : _errors.FAILED_CMD_STATUS_CODES.UnknownCommand, - "value" : errorMsg - }; - } - } - - // Window was not found - return { - "status" : _errors.FAILED_CMD_STATUS_CODES.NoSuchWindow, - "value" : "No such window" - }; - }, - - _locateElement = function(locator, rootElement) { - var findElementRes = _find("element", locator, rootElement); - - _log.debug("_locateElement.locator", JSON.stringify(locator)); - _log.debug("_locateElement.findElementResult", JSON.stringify(findElementRes)); - - // To check if element was found, the following must happen: - // 1. "findElementRes" result object must be valid - // 2. property "status" is found and is {Number} - if (findElementRes !== null && typeof(findElementRes) === "object" && - findElementRes.hasOwnProperty("status") && typeof(findElementRes.status) === "number") { - // If the atom succeeds, but returns a null value, the element was not found. - if (findElementRes.status === 0 && findElementRes.value === null) { - findElementRes.status = _errors.FAILED_CMD_STATUS_CODES.NoSuchElement; - findElementRes.value = { - "message": "Unable to find element with " + - locator.using + " '" + - locator.value + "'" - }; - } - return findElementRes; - } - - // Not found - return { - "status" : _errors.FAILED_CMD_STATUS_CODES.NoSuchElement, - "value" : "No Such Element found" - }; - }, - - _locateElements = function(locator, rootElement) { - var findElementsRes = _find("elements", locator, rootElement), - elements = []; - - _log.debug("_locateElements.locator", JSON.stringify(locator)); - _log.debug("_locateElements.findElementsResult", JSON.stringify(findElementsRes)); - - // To check if something was found, the following must happen: - // 1. "findElementsRes" result object must be valid - // 2. property "status" is found and is {Number} - // 3. property "value" is found and is and {Object} - if (findElementsRes !== null && typeof(findElementsRes) === "object" && - findElementsRes.hasOwnProperty("status") && typeof(findElementsRes.status) === "number" && - findElementsRes.hasOwnProperty("value") && findElementsRes.value !== null && typeof(findElementsRes.value) === "object") { - return findElementsRes; - } - - // Not found - return { - "status" : _errors.FAILED_CMD_STATUS_CODES.NoSuchElement, - "value" : "No Such Elements found" - }; - }, - - _locateActiveElement = function() { - var currWindow = _session.getCurrentWindow(), - activeElementRes; - - if (currWindow !== null) { - activeElementRes = currWindow.evaluate( - require("./webdriver_atoms.js").get("active_element")); - - // De-serialise the result of the Atom execution - try { - activeElementRes = JSON.parse(activeElementRes); - } catch (e) { - return { - "status" : _errors.FAILED_CMD_STATUS_CODES.NoSuchElement, - "value" : "No Active Element found" - }; - } - - // If found - if (typeof(activeElementRes.status) !== "undefined") { - return activeElementRes; - } - } - - return { - "status" : _errors.FAILED_CMD_STATUS_CODES.NoSuchWindow, - "value" : "No such window" - }; - }, - - _handleLocateCommand = function(req, res, locatorMethod, rootElement, startTime) { - // Search for a WebElement on the Page - var elementOrElements, - searchStartTime = startTime || new Date().getTime(), - stopSearchByTime, - request = {}; - - _log.debug("_handleLocateCommand", "Element(s) Search Start Time: " + searchStartTime); - - // If a "locatorMethod" was not provided, default to "locateElement" - if(typeof(locatorMethod) !== "function") { - locatorMethod = _locateElement; - } - - // Some language bindings can send a null instead of an empty - // JSON object for the getActiveElement command. - if (req.post && typeof req.post === "string") { - request = JSON.parse(req.post); - } - - // Try to find the element - elementOrElements = locatorMethod(request, rootElement); - - _log.debug("_handleLocateCommand.elements", JSON.stringify(elementOrElements)); - _log.debug("_handleLocateCommand.rootElement", (typeof(rootElement) !== "undefined" ? JSON.stringify(rootElement) : "BODY")); - - if (elementOrElements && - elementOrElements.hasOwnProperty("status") && - elementOrElements.status === 0 && - elementOrElements.hasOwnProperty("value")) { - - // return if elements found OR we passed the "stopSearchByTime" - stopSearchByTime = searchStartTime + _session.getImplicitTimeout(); - if (elementOrElements.value.length !== 0 || new Date().getTime() > stopSearchByTime) { - - _log.debug("_handleLocateCommand", "Element(s) Found. Search Stop Time: " + stopSearchByTime); - - res.success(_session.getId(), elementOrElements.value); - return; - } - } - - // retry if we haven't passed "stopSearchByTime" - stopSearchByTime = searchStartTime + _session.getImplicitTimeout(); - if (stopSearchByTime >= new Date().getTime()) { - - _log.debug("_handleLocateCommand", "Element(s) NOT Found: RETRY. Search Stop Time: " + stopSearchByTime); - - // Recursive call in 50ms - setTimeout(function(){ - _handleLocateCommand(req, res, locatorMethod, rootElement, searchStartTime); - }, 50); - return; - } - - // Error handler. We got a valid response, but it was an error response. - if (elementOrElements) { - - _log.error("_handleLocateCommand", "Element(s) NOT Found: GAVE UP. Search Stop Time: " + stopSearchByTime); - - _errors.handleFailedCommandEH(elementOrElements.status, - elementOrElements.value.message, - req, - res, - _session); - return; - } - - throw _errors.createInvalidReqVariableResourceNotFoundEH(req); - }; - - // public: - return { - locateElement : _locateElement, - locateElements : _locateElements, - locateActiveElement : _locateActiveElement, - handleLocateCommand : _handleLocateCommand - }; -}; diff --git a/src/phantom.cpp b/src/phantom.cpp index 441cbde9e1..170f66cbf4 100644 --- a/src/phantom.cpp +++ b/src/phantom.cpp @@ -205,14 +205,7 @@ bool Phantom::execute() } #endif - if (m_config.isWebdriverMode()) { // Remote WebDriver mode requested - qDebug() << "Phantom - execute: Starting Remote WebDriver mode"; - - if (!Utils::injectJsInFrame(":/ghostdriver/main.js", QString(), m_scriptFileEnc, QDir::currentPath(), m_page->mainFrame(), true)) { - m_returnValue = -1; - return false; - } - } else if (m_config.scriptFile().isEmpty()) { // REPL mode requested + if (m_config.scriptFile().isEmpty()) { // REPL mode requested qDebug() << "Phantom - execute: Starting REPL mode"; // REPL is only valid for javascript @@ -304,11 +297,6 @@ void Phantom::setCookiesEnabled(const bool value) } } -bool Phantom::webdriverMode() const -{ - return m_config.isWebdriverMode(); -} - // public slots: QObject* Phantom::createCookieJar(const QString& filePath) { @@ -399,12 +387,6 @@ bool Phantom::injectJs(const QString& jsFilePath) QString pre = ""; qDebug() << "Phantom - injectJs:" << jsFilePath; - // If in Remote Webdriver Mode, we need to manipulate the PATH, to point it to a resource in `ghostdriver.qrc` - if (webdriverMode()) { - pre = ":/ghostdriver/"; - qDebug() << "Phantom - injectJs: prepending" << pre; - } - if (m_terminated) { return false; } diff --git a/src/phantom.h b/src/phantom.h index c7e5b787f2..6d144ae244 100644 --- a/src/phantom.h +++ b/src/phantom.h @@ -54,7 +54,6 @@ class Phantom : public QObject Q_PROPERTY(QObject* page READ page) Q_PROPERTY(bool cookiesEnabled READ areCookiesEnabled WRITE setCookiesEnabled) Q_PROPERTY(QVariantList cookies READ cookies WRITE setCookies) - Q_PROPERTY(bool webdriverMode READ webdriverMode) Q_PROPERTY(int remoteDebugPort READ remoteDebugPort) private: @@ -95,8 +94,6 @@ class Phantom : public QObject bool areCookiesEnabled() const; void setCookiesEnabled(const bool value); - bool webdriverMode() const; - int remoteDebugPort() const; /** diff --git a/test/ghostdriver-test/config.ini b/test/ghostdriver-test/config.ini deleted file mode 100644 index dbfdb2fbd9..0000000000 --- a/test/ghostdriver-test/config.ini +++ /dev/null @@ -1,11 +0,0 @@ -# What WebDriver to use for the tests -driver=phantomjs -#driver=firefox -#driver=chrome -#driver=http://localhost:8910 -#driver=http://localhost:4444/wd/hub - -# PhantomJS specific config (change according to your installation) -phantomjs_exec_path=../../../bin/phantomjs -#phantomjs_driver_path=../../src/main.js -#phantomjs_driver_loglevel=DEBUG diff --git a/test/ghostdriver-test/fixtures/common/ClickTest_testClicksASurroundingStrongTag.html b/test/ghostdriver-test/fixtures/common/ClickTest_testClicksASurroundingStrongTag.html deleted file mode 100644 index 3d117df3bd..0000000000 --- a/test/ghostdriver-test/fixtures/common/ClickTest_testClicksASurroundingStrongTag.html +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - <title>ClickTest_testClicksASurroundingStrongTag - - -
- Click -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/Page.aspx b/test/ghostdriver-test/fixtures/common/Page.aspx deleted file mode 100644 index 8e3a0d4dc0..0000000000 --- a/test/ghostdriver-test/fixtures/common/Page.aspx +++ /dev/null @@ -1,17 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page.aspx.cs" Inherits="Page" %> - - - - - - Untitled Page - - - top -
-
- -
-
- - diff --git a/test/ghostdriver-test/fixtures/common/Page.aspx.cs b/test/ghostdriver-test/fixtures/common/Page.aspx.cs deleted file mode 100644 index 1a8f7fe3e2..0000000000 --- a/test/ghostdriver-test/fixtures/common/Page.aspx.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Threading; - -public partial class Page : System.Web.UI.Page -{ - protected void Page_Load(object sender, EventArgs e) - { - Response.ContentType = "text/html"; - - int lastIndex = Request.PathInfo.LastIndexOf("/"); - string pageNumber = (lastIndex == -1 ? "Unknown" : Request.PathInfo.Substring(lastIndex + 1)); - if (!string.IsNullOrEmpty(Request.QueryString["pageNumber"])) - { - pageNumber = Request.QueryString["pageNumber"]; - } - Response.Output.Write("Page" + pageNumber + ""); - Response.Output.Write("Page number "); - Response.Output.Write(pageNumber); - //Response.Output.Write("")' - Response.Output.Write(""); - } -} diff --git a/test/ghostdriver-test/fixtures/common/README b/test/ghostdriver-test/fixtures/common/README deleted file mode 100644 index c68ee4c57a..0000000000 --- a/test/ghostdriver-test/fixtures/common/README +++ /dev/null @@ -1 +0,0 @@ -Those are cut&pasted from Selenium test fixtures diff --git a/test/ghostdriver-test/fixtures/common/Redirect.aspx b/test/ghostdriver-test/fixtures/common/Redirect.aspx deleted file mode 100644 index 52d2e6786e..0000000000 --- a/test/ghostdriver-test/fixtures/common/Redirect.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Redirect.aspx.cs" Inherits="Redirect" %> - - - - - - Untitled Page - - - - diff --git a/test/ghostdriver-test/fixtures/common/Redirect.aspx.cs b/test/ghostdriver-test/fixtures/common/Redirect.aspx.cs deleted file mode 100644 index 9e0650bfb3..0000000000 --- a/test/ghostdriver-test/fixtures/common/Redirect.aspx.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -public partial class Redirect : Page -{ - protected new void Page_Load(object sender, EventArgs e) - { - Response.Redirect("resultPage.html"); - } -} diff --git a/test/ghostdriver-test/fixtures/common/Settings.StyleCop b/test/ghostdriver-test/fixtures/common/Settings.StyleCop deleted file mode 100644 index fc955f815d..0000000000 --- a/test/ghostdriver-test/fixtures/common/Settings.StyleCop +++ /dev/null @@ -1,759 +0,0 @@ - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - False - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/Web.Config b/test/ghostdriver-test/fixtures/common/Web.Config deleted file mode 100644 index 68b648f81b..0000000000 --- a/test/ghostdriver-test/fixtures/common/Web.Config +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/ghostdriver-test/fixtures/common/actualXhtmlPage.xhtml b/test/ghostdriver-test/fixtures/common/actualXhtmlPage.xhtml deleted file mode 100644 index a0f54703c1..0000000000 --- a/test/ghostdriver-test/fixtures/common/actualXhtmlPage.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Title - - - -

- Foo -

- - diff --git a/test/ghostdriver-test/fixtures/common/ajaxy_page.html b/test/ghostdriver-test/fixtures/common/ajaxy_page.html deleted file mode 100644 index 4b34031d55..0000000000 --- a/test/ghostdriver-test/fixtures/common/ajaxy_page.html +++ /dev/null @@ -1,81 +0,0 @@ - - - -
- - -
- - Red - Green -
- -
- - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/alerts.html b/test/ghostdriver-test/fixtures/common/alerts.html deleted file mode 100644 index 6cd43933d2..0000000000 --- a/test/ghostdriver-test/fixtures/common/alerts.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - Testing Alerts - - - - - -

Testing Alerts and Stuff

- -

This tests alerts: click me

-

This tests alerts: click me

-

This tests confirm: click me

- -

This tests alerts: click me

- -

Let's make the prompt happen

-

Let's make the prompt happen

- -

Let's make the prompt with default happen

- -

Let's make TWO prompts happen

- -

A SLOW alert

- -

This is a test of a confirm: - test confirm

- -

This is a test of showModalDialog: test dialog

- -

This is a test of an alert in an iframe: - -

- -

This is a test of an alert in a nested iframe: - -

- -

This is a test of an alert open from onload event handler: open new page

- -

This is a test of an alert open from onload event handler: open new window

- -

This is a test of an alert open from onunload event handler: open new page

- -

This is a test of an alert open from onclose event handler: open new window

- -

This is a test of an alert open from onclose event handler: open new window

- -
-
-
- -

-

- - diff --git a/test/ghostdriver-test/fixtures/common/animals/.gitignore b/test/ghostdriver-test/fixtures/common/animals/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/common/banner.gif b/test/ghostdriver-test/fixtures/common/banner.gif deleted file mode 100644 index 3f3435401f..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/banner.gif and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/beach.jpg b/test/ghostdriver-test/fixtures/common/beach.jpg deleted file mode 100644 index 402237cbdd..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/beach.jpg and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/blank.html b/test/ghostdriver-test/fixtures/common/blank.html deleted file mode 100644 index c3f376e768..0000000000 --- a/test/ghostdriver-test/fixtures/common/blank.html +++ /dev/null @@ -1 +0,0 @@ -blank diff --git a/test/ghostdriver-test/fixtures/common/bodyTypingTest.html b/test/ghostdriver-test/fixtures/common/bodyTypingTest.html deleted file mode 100644 index f2b1939f19..0000000000 --- a/test/ghostdriver-test/fixtures/common/bodyTypingTest.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - Testing Typing into body - - - - -

Type Stuff

- -
-   -
- -
-   -
- - - - -
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/booleanAttributes.html b/test/ghostdriver-test/fixtures/common/booleanAttributes.html deleted file mode 100644 index 16fbbe9f84..0000000000 --- a/test/ghostdriver-test/fixtures/common/booleanAttributes.html +++ /dev/null @@ -1,19 +0,0 @@ - - - Elements with boolean attributes - - -
- - - - - -
- - -
- -
Unwrappable text
- - diff --git a/test/ghostdriver-test/fixtures/common/child/childPage.html b/test/ghostdriver-test/fixtures/common/child/childPage.html deleted file mode 100644 index 9192b54a40..0000000000 --- a/test/ghostdriver-test/fixtures/common/child/childPage.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Depth one child page - - -

I'm a page in a child directory

- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/child/grandchild/grandchildPage.html b/test/ghostdriver-test/fixtures/common/child/grandchild/grandchildPage.html deleted file mode 100644 index f52685e067..0000000000 --- a/test/ghostdriver-test/fixtures/common/child/grandchild/grandchildPage.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Depth two child page - - -

I'm a page in a grandchild directory! How cute!

- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/clickEventPage.html b/test/ghostdriver-test/fixtures/common/clickEventPage.html deleted file mode 100644 index 8e0355d942..0000000000 --- a/test/ghostdriver-test/fixtures/common/clickEventPage.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Testing click events - - - -
- Click me to view my coordinates -
- -
-

 

-
- - diff --git a/test/ghostdriver-test/fixtures/common/click_frames.html b/test/ghostdriver-test/fixtures/common/click_frames.html deleted file mode 100644 index bd055c7c71..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_frames.html +++ /dev/null @@ -1,10 +0,0 @@ - - - click frames - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_jacker.html b/test/ghostdriver-test/fixtures/common/click_jacker.html deleted file mode 100644 index 0ff3900ec5..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_jacker.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - click-jacking - - - -
-
Click jacked!
-
Click Me
- -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_out_of_bounds.html b/test/ghostdriver-test/fixtures/common/click_out_of_bounds.html deleted file mode 100644 index 8a51659b20..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_out_of_bounds.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - -
-
-
-
-
- -
-
-
- - - diff --git a/test/ghostdriver-test/fixtures/common/click_out_of_bounds_overflow.html b/test/ghostdriver-test/fixtures/common/click_out_of_bounds_overflow.html deleted file mode 100644 index 15ac17f920..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_out_of_bounds_overflow.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
click me
-
- diff --git a/test/ghostdriver-test/fixtures/common/click_rtl.html b/test/ghostdriver-test/fixtures/common/click_rtl.html deleted file mode 100644 index e84fffa993..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_rtl.html +++ /dev/null @@ -1,19 +0,0 @@ - - -RTL test - - - -
- -
مفتاح معايير الويب
- -
פעילות הבינאום
- -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_source.html b/test/ghostdriver-test/fixtures/common/click_source.html deleted file mode 100644 index 22e9319a5a..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_source.html +++ /dev/null @@ -1,18 +0,0 @@ - - - Click Source - - - I go to a target - - - - - - Click Source - - - I go to a target - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_tests/google_map.html b/test/ghostdriver-test/fixtures/common/click_tests/google_map.html deleted file mode 100644 index eb2e556c9d..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/google_map.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Google Image Map - - -

Google Image Map

- - -area 1 -area 2 -area 3 - - - diff --git a/test/ghostdriver-test/fixtures/common/click_tests/google_map.png b/test/ghostdriver-test/fixtures/common/click_tests/google_map.png deleted file mode 100644 index 763f562799..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/click_tests/google_map.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/click_tests/html5_submit_buttons.html b/test/ghostdriver-test/fixtures/common/click_tests/html5_submit_buttons.html deleted file mode 100644 index 5ec11eee10..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/html5_submit_buttons.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -HTML5 Submit Buttons - - -
- - - -
- - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_tests/issue5237.html b/test/ghostdriver-test/fixtures/common/click_tests/issue5237.html deleted file mode 100644 index 464fa11387..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/issue5237.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Sample page for issue 5237 - - - - - diff --git a/test/ghostdriver-test/fixtures/common/click_tests/issue5237_frame.html b/test/ghostdriver-test/fixtures/common/click_tests/issue5237_frame.html deleted file mode 100644 index d6f4caf120..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/issue5237_frame.html +++ /dev/null @@ -1 +0,0 @@ -Continue \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_tests/issue5237_target.html b/test/ghostdriver-test/fixtures/common/click_tests/issue5237_target.html deleted file mode 100644 index cbc16e8513..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/issue5237_target.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Target page for issue 5237 - - -

Test passed

- - - diff --git a/test/ghostdriver-test/fixtures/common/click_tests/link_that_wraps.html b/test/ghostdriver-test/fixtures/common/click_tests/link_that_wraps.html deleted file mode 100644 index 04434364f2..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/link_that_wraps.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Link that continues on next line - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_tests/mapped_page1.html b/test/ghostdriver-test/fixtures/common/click_tests/mapped_page1.html deleted file mode 100644 index 245f0385b6..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/mapped_page1.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Target Page 1 - - -
Target Page 1
- - diff --git a/test/ghostdriver-test/fixtures/common/click_tests/mapped_page2.html b/test/ghostdriver-test/fixtures/common/click_tests/mapped_page2.html deleted file mode 100644 index 6f9636c5c1..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/mapped_page2.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Target Page 2 - - -
Target Page 2
- - diff --git a/test/ghostdriver-test/fixtures/common/click_tests/mapped_page3.html b/test/ghostdriver-test/fixtures/common/click_tests/mapped_page3.html deleted file mode 100644 index 87a35f388b..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/mapped_page3.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Target Page 3 - - -
Target Page 3
- - diff --git a/test/ghostdriver-test/fixtures/common/click_tests/span_that_wraps.html b/test/ghostdriver-test/fixtures/common/click_tests/span_that_wraps.html deleted file mode 100644 index 77a9d6d507..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/span_that_wraps.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Link that continues on next line - - -
-
placeholder
Span that continues on next line -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_tests/submitted_page.html b/test/ghostdriver-test/fixtures/common/click_tests/submitted_page.html deleted file mode 100644 index 0ed2cbacbf..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_tests/submitted_page.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -Submitted Successfully! - - -

Submitted Successfully!

- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/click_too_big.html b/test/ghostdriver-test/fixtures/common/click_too_big.html deleted file mode 100644 index 568ee77eb5..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_too_big.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - -
-       -
-
- - diff --git a/test/ghostdriver-test/fixtures/common/click_too_big_in_frame.html b/test/ghostdriver-test/fixtures/common/click_too_big_in_frame.html deleted file mode 100644 index cda990ed89..0000000000 --- a/test/ghostdriver-test/fixtures/common/click_too_big_in_frame.html +++ /dev/null @@ -1,11 +0,0 @@ - - - This page has iframes - - -

This is the heading

- - - - -
-I'm a normal link -
-I go to an anchor -
-I open a window with javascript -
-Click me -
- -
-I'm a green link -

looooooooooong short looooooooooong -

- -333333 -

I have a span

And another span

- - diff --git a/test/ghostdriver-test/fixtures/common/closeable_window.html b/test/ghostdriver-test/fixtures/common/closeable_window.html deleted file mode 100644 index e64c599c98..0000000000 --- a/test/ghostdriver-test/fixtures/common/closeable_window.html +++ /dev/null @@ -1,8 +0,0 @@ - - -closeable window - - -This window can be closed by clicking on this. - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/cn-test.html b/test/ghostdriver-test/fixtures/common/cn-test.html deleted file mode 100644 index df846ad46d..0000000000 --- a/test/ghostdriver-test/fixtures/common/cn-test.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - -
-
- - -

չ��2008������ƣ�������ӿ ��������


-
- 8��8����������2008����˻ᵹ��ʱһ������ף����찲�Ź㳡���С�ͼΪ��ף��е������ݳ��� �»�������������� - - �������������������ӿ���������ġ���Ҫ����һ��Ԥ�⣬����Ҫ�Խ���������������һ��������ʶ��
-
-�й�֮��
-
-
- -
- -
- - - diff --git a/test/ghostdriver-test/fixtures/common/colorPage.html b/test/ghostdriver-test/fixtures/common/colorPage.html deleted file mode 100644 index 0d1bfc0afc..0000000000 --- a/test/ghostdriver-test/fixtures/common/colorPage.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - Color Page - - -
namedColor
-
rgb
-
rgbpct
-
hex
-
hex
-
hsl
-
rgba
-
rgba
-
hsla
- - - - - diff --git a/test/ghostdriver-test/fixtures/common/cookies.html b/test/ghostdriver-test/fixtures/common/cookies.html deleted file mode 100644 index 7db5b49312..0000000000 --- a/test/ghostdriver-test/fixtures/common/cookies.html +++ /dev/null @@ -1,30 +0,0 @@ - - - Testing cookies - - - - -

Cookie Mashing

- .com Click
- . Click
- google.com Click
- .google.com Click
- 127.0.0.1 Click
- localhost:3001 Click
- .google:3001 Click
- 172.16.12.225 Click
- 172.16.12.225:port Click
- Set on a different path - -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/element_in_frame.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/element_in_frame.html deleted file mode 100644 index 7714a48ad5..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/element_in_frame.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Welcome Page - - - - - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/element_in_nested_frame.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/element_in_nested_frame.html deleted file mode 100644 index b3143b0d6d..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/element_in_nested_frame.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Welcome Page - - - - - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_element_out_of_view.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_element_out_of_view.html deleted file mode 100644 index 6f2bcd4f2c..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_element_out_of_view.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Page With Element Out Of View - - -
Placeholder
-
Red box
-
Tex after box
- - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_empty_element.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_empty_element.html deleted file mode 100644 index b07972abd8..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_empty_element.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Page With Empty Element - - -
-
Tex after box
- - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_fixed_element.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_fixed_element.html deleted file mode 100644 index b815891775..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_fixed_element.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Page With Fixed Element - - -
fixed red box
-
Placeholder
-
Element at the bottom
-
Tex after box
- - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_hidden_element.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_hidden_element.html deleted file mode 100644 index 286b04b173..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_hidden_element.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Page With Hidden Element - - - -
Tex after box
- - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_invisible_element.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_invisible_element.html deleted file mode 100644 index dc33c71856..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_invisible_element.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Page With Invisible Element - - - -
Tex after box
- - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_transparent_element.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_transparent_element.html deleted file mode 100644 index d0090d921f..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/page_with_transparent_element.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Page With Transparent Element - - -
Hidden box
-
Tex after box
- - diff --git a/test/ghostdriver-test/fixtures/common/coordinates_tests/simple_page.html b/test/ghostdriver-test/fixtures/common/coordinates_tests/simple_page.html deleted file mode 100644 index 7b857b9dfe..0000000000 --- a/test/ghostdriver-test/fixtures/common/coordinates_tests/simple_page.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Simple Page - - -
Red box
-
Tex after box
- - diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png deleted file mode 100644 index 954e22dbd9..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png deleted file mode 100644 index 64ece5707d..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png deleted file mode 100644 index abdc01082b..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png deleted file mode 100644 index 9b383f4d2e..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png deleted file mode 100644 index a23baad25b..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 42ccba269b..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png deleted file mode 100644 index 39d5824d6a..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png deleted file mode 100644 index f1273672d2..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png deleted file mode 100644 index 359397acff..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_222222_256x240.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_222222_256x240.png deleted file mode 100644 index b273ff111d..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_228ef1_256x240.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_228ef1_256x240.png deleted file mode 100644 index a641a371af..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_228ef1_256x240.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ef8c08_256x240.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ef8c08_256x240.png deleted file mode 100644 index 85e63e9f60..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ef8c08_256x240.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ffd27a_256x240.png deleted file mode 100644 index e117effa3d..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ffd27a_256x240.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ffffff_256x240.png b/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ffffff_256x240.png deleted file mode 100644 index 42f8f992c7..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/css/ui-lightness/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/css/ui-lightness/jquery-ui-1.8.10.custom.css b/test/ghostdriver-test/fixtures/common/css/ui-lightness/jquery-ui-1.8.10.custom.css deleted file mode 100644 index 1706e22077..0000000000 --- a/test/ghostdriver-test/fixtures/common/css/ui-lightness/jquery-ui-1.8.10.custom.css +++ /dev/null @@ -1,573 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/* - * jQuery UI CSS Framework 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* - * jQuery UI Resizable 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Resizable#theming - */ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* - * jQuery UI Selectable 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectable#theming - */ -.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } -/* - * jQuery UI Accordion 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Accordion#theming - */ -/* IE/Win - Fix animation bug - #4615 */ -.ui-accordion { width: 100%; } -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; } -/* - * jQuery UI Autocomplete 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete#theming - */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu 1.8.10 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/* - * jQuery UI Button 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Button#theming - */ -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } - -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ -/* - * jQuery UI Dialog 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog#theming - */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* - * jQuery UI Slider 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider#theming - */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* - * jQuery UI Tabs 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs#theming - */ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } -/* - * jQuery UI Datepicker 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker#theming - */ -.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* - * jQuery UI Progressbar 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar#theming - */ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/cssTransform.html b/test/ghostdriver-test/fixtures/common/cssTransform.html deleted file mode 100644 index c3b99648ac..0000000000 --- a/test/ghostdriver-test/fixtures/common/cssTransform.html +++ /dev/null @@ -1,61 +0,0 @@ - - -
-You shouldn't see anything other than this sentence on the page -
-
- I have a hidden child -
- I am a hidden child -
-
-
- I have a hidden child -
- I am a hidden child -
-
-
I am a hidden element
-
I am a hidden element
diff --git a/test/ghostdriver-test/fixtures/common/cssTransform2.html b/test/ghostdriver-test/fixtures/common/cssTransform2.html deleted file mode 100644 index 602924bfbb..0000000000 --- a/test/ghostdriver-test/fixtures/common/cssTransform2.html +++ /dev/null @@ -1,20 +0,0 @@ - - -
-
-
-
-
-
-
I am not a hidden element
diff --git a/test/ghostdriver-test/fixtures/common/document_write_in_onload.html b/test/ghostdriver-test/fixtures/common/document_write_in_onload.html deleted file mode 100644 index a15fc479ea..0000000000 --- a/test/ghostdriver-test/fixtures/common/document_write_in_onload.html +++ /dev/null @@ -1,13 +0,0 @@ - - - Document Write In Onload - - - -

hello world

- - diff --git a/test/ghostdriver-test/fixtures/common/dragAndDropInsideScrolledDiv.html b/test/ghostdriver-test/fixtures/common/dragAndDropInsideScrolledDiv.html deleted file mode 100644 index 0b2ee9a246..0000000000 --- a/test/ghostdriver-test/fixtures/common/dragAndDropInsideScrolledDiv.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - -
-
-
-
-
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/dragAndDropTest.html b/test/ghostdriver-test/fixtures/common/dragAndDropTest.html deleted file mode 100644 index fdee16b0b4..0000000000 --- a/test/ghostdriver-test/fixtures/common/dragAndDropTest.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - -
-
-"Hi there -
-
-
-
- - diff --git a/test/ghostdriver-test/fixtures/common/dragDropOverflow.html b/test/ghostdriver-test/fixtures/common/dragDropOverflow.html deleted file mode 100644 index ecb25625d5..0000000000 --- a/test/ghostdriver-test/fixtures/common/dragDropOverflow.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -
-
-
-
-
12am
-
1am
-
2am
-
3am
-
4am
-
5am
-
6am
-
7am
-
8am
-
9am
-
10am
-
11am
-
12pm
-
1pm
-
2pm
-
3pm
-
4pm
-
5pm
-
6pm
-
7pm
-
8pm
-
9pm
-
10pm
-
11pm
-
-
-
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/draggableLists.html b/test/ghostdriver-test/fixtures/common/draggableLists.html deleted file mode 100644 index f7e0dcace4..0000000000 --- a/test/ghostdriver-test/fixtures/common/draggableLists.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - jQuery UI Sortable - Connect lists - - - - - - - - - -
-
    -
  • LeftItem 1
  • -
  • LeftItem 2
  • -
  • LeftItem 3
  • -
  • LeftItem 4
  • -
  • LeftItem 5
  • -
- -
    -
  • RightItem 1
  • -
  • RightItem 2
  • -
  • RightItem 3
  • -
  • RightItem 4
  • -
  • RightItem 5
  • -
- -
- -
-
-

Nothing happened.

-
- - - diff --git a/test/ghostdriver-test/fixtures/common/droppableItems.html b/test/ghostdriver-test/fixtures/common/droppableItems.html deleted file mode 100644 index fc850ac96b..0000000000 --- a/test/ghostdriver-test/fixtures/common/droppableItems.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - jQuery UI Droppable - Default Demo - - - - - - - -
- -
-

Drag me to my target

-
- -
-

Drop here

-
- -
-

start

-
- -
- -
- -

Taken from the JQuery demo.

- -
- - diff --git a/test/ghostdriver-test/fixtures/common/dynamic.html b/test/ghostdriver-test/fixtures/common/dynamic.html deleted file mode 100644 index b9e60678d2..0000000000 --- a/test/ghostdriver-test/fixtures/common/dynamic.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/dynamicallyModifiedPage.html b/test/ghostdriver-test/fixtures/common/dynamicallyModifiedPage.html deleted file mode 100644 index ed7c7ed2b4..0000000000 --- a/test/ghostdriver-test/fixtures/common/dynamicallyModifiedPage.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - Delayed remove of an element - - - - - -
- -
-

element

- - diff --git a/test/ghostdriver-test/fixtures/common/errors.html b/test/ghostdriver-test/fixtures/common/errors.html deleted file mode 100644 index 78fb902077..0000000000 --- a/test/ghostdriver-test/fixtures/common/errors.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/test/ghostdriver-test/fixtures/common/fixedFooterNoScroll.html b/test/ghostdriver-test/fixtures/common/fixedFooterNoScroll.html deleted file mode 100644 index ca65d1feeb..0000000000 --- a/test/ghostdriver-test/fixtures/common/fixedFooterNoScroll.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - Fixed footer with no scrollbar - - -
-
- Click me -
-
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/fixedFooterNoScrollQuirksMode.html b/test/ghostdriver-test/fixtures/common/fixedFooterNoScrollQuirksMode.html deleted file mode 100644 index 2593bf35c6..0000000000 --- a/test/ghostdriver-test/fixtures/common/fixedFooterNoScrollQuirksMode.html +++ /dev/null @@ -1,12 +0,0 @@ - - - Fixed footer with no scrollbar - - -
-
- Click me -
-
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/formPage.html b/test/ghostdriver-test/fixtures/common/formPage.html deleted file mode 100644 index e99db14d23..0000000000 --- a/test/ghostdriver-test/fixtures/common/formPage.html +++ /dev/null @@ -1,175 +0,0 @@ - - - We Leave From Here - - - - -There should be a form here: - -
- - -
- -
- -
- -
- Here's a checkbox: - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - Cheese
- Peas
- Cheese and peas
- Not a sausage
- Not another sausage - - - -

I like cheese

- - - Cumberland sausage -
- -
- - - - - - - - -
- -
- - - - - - - - -
- -
- - - - - - - -
- - -
-
- -
- -
- - -
-

- - - -

-
- -
- - - -
-

- -

-
- - - diff --git a/test/ghostdriver-test/fixtures/common/formSelectionPage.html b/test/ghostdriver-test/fixtures/common/formSelectionPage.html deleted file mode 100644 index 4890c08e82..0000000000 --- a/test/ghostdriver-test/fixtures/common/formSelectionPage.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - Testing Typing into body - - - - -

Type Stuff

- -
-   -
- -
- -
- - - - diff --git a/test/ghostdriver-test/fixtures/common/form_handling_js_submit.html b/test/ghostdriver-test/fixtures/common/form_handling_js_submit.html deleted file mode 100644 index 3023143929..0000000000 --- a/test/ghostdriver-test/fixtures/common/form_handling_js_submit.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Form with JS action - - -
- -
- -

- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/framePage3.html b/test/ghostdriver-test/fixtures/common/framePage3.html deleted file mode 100644 index 3e62e455ce..0000000000 --- a/test/ghostdriver-test/fixtures/common/framePage3.html +++ /dev/null @@ -1,7 +0,0 @@ - - - inner - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/frameScrollChild.html b/test/ghostdriver-test/fixtures/common/frameScrollChild.html deleted file mode 100644 index 3eb3bf47d5..0000000000 --- a/test/ghostdriver-test/fixtures/common/frameScrollChild.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Child frame - - -

This is a scrolling frame test

-
- - - - - - - - - - - - - -
First row
Second row
Third row
Fourth row
-
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/frameScrollPage.html b/test/ghostdriver-test/fixtures/common/frameScrollPage.html deleted file mode 100644 index b7fb8f242a..0000000000 --- a/test/ghostdriver-test/fixtures/common/frameScrollPage.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Welcome Page - - -
- -
-
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/frameScrollParent.html b/test/ghostdriver-test/fixtures/common/frameScrollParent.html deleted file mode 100644 index 8fccb6d365..0000000000 --- a/test/ghostdriver-test/fixtures/common/frameScrollParent.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Welcome Page - - -
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/frame_switching_tests/bug4876.html b/test/ghostdriver-test/fixtures/common/frame_switching_tests/bug4876.html deleted file mode 100644 index 4ed597d379..0000000000 --- a/test/ghostdriver-test/fixtures/common/frame_switching_tests/bug4876.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -Test issue 4876 - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/frame_switching_tests/bug4876_iframe.html b/test/ghostdriver-test/fixtures/common/frame_switching_tests/bug4876_iframe.html deleted file mode 100644 index 57d47d845b..0000000000 --- a/test/ghostdriver-test/fixtures/common/frame_switching_tests/bug4876_iframe.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
- - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame.html b/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame.html deleted file mode 100644 index 9c27e04c48..0000000000 --- a/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame.html +++ /dev/null @@ -1,29 +0,0 @@ - - - Deleting frame: main page - - - - -
- - -
-
- -
- - - diff --git a/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame_iframe.html b/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame_iframe.html deleted file mode 100644 index e4b9723e9f..0000000000 --- a/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame_iframe.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Deleting frame: iframe - - - - - diff --git a/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame_iframe2.html b/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame_iframe2.html deleted file mode 100644 index 47764eb3eb..0000000000 --- a/test/ghostdriver-test/fixtures/common/frame_switching_tests/deletingFrame_iframe2.html +++ /dev/null @@ -1,7 +0,0 @@ - - - Deleting frame: iframe 2 - - -
Added back
- diff --git a/test/ghostdriver-test/fixtures/common/frameset.html b/test/ghostdriver-test/fixtures/common/frameset.html deleted file mode 100644 index 039c5f2177..0000000000 --- a/test/ghostdriver-test/fixtures/common/frameset.html +++ /dev/null @@ -1,14 +0,0 @@ - - - Unique title - - - - - - - - - - - diff --git a/test/ghostdriver-test/fixtures/common/framesetPage2.html b/test/ghostdriver-test/fixtures/common/framesetPage2.html deleted file mode 100644 index 4ea35ff71b..0000000000 --- a/test/ghostdriver-test/fixtures/common/framesetPage2.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/framesetPage3.html b/test/ghostdriver-test/fixtures/common/framesetPage3.html deleted file mode 100644 index 42a93007f9..0000000000 --- a/test/ghostdriver-test/fixtures/common/framesetPage3.html +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/galaxy/.gitignore b/test/ghostdriver-test/fixtures/common/galaxy/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/common/globalscope.html b/test/ghostdriver-test/fixtures/common/globalscope.html deleted file mode 100644 index e4ca97ab71..0000000000 --- a/test/ghostdriver-test/fixtures/common/globalscope.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Global scope - - - -
- - diff --git a/test/ghostdriver-test/fixtures/common/hidden.html b/test/ghostdriver-test/fixtures/common/hidden.html deleted file mode 100644 index 0e8097e973..0000000000 --- a/test/ghostdriver-test/fixtures/common/hidden.html +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/html5/blue.jpg b/test/ghostdriver-test/fixtures/common/html5/blue.jpg deleted file mode 100644 index 8ea27c42fa..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/html5/blue.jpg and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/html5/database.js b/test/ghostdriver-test/fixtures/common/html5/database.js deleted file mode 100644 index c6333be8cd..0000000000 --- a/test/ghostdriver-test/fixtures/common/html5/database.js +++ /dev/null @@ -1,84 +0,0 @@ -var database={}; -database.db={}; - -database.onError = function(tx, e) { - var log = document.createElement('div'); - log.setAttribute('name','error'); - log.setAttribute('style','background-color:red'); - log.innerText = e.message; - document.getElementById('logs').appendChild(log); -} - -database.onSuccess = function(tx, r) { - if (r.rows.length) { - var ol; - for (var i = 0; i < r.rows.length; i++) { - ol = document.createElement('ol'); - ol.innerHTML = r.rows.item(i).ID + ": " + r.rows.item(i).docname + " (" + r.rows.item(i).created + ")"; - document.getElementById('logs').appendChild(ol); - } - - } -} - -database.open=function(){ - database.db=openDatabase('HTML5', '1.0', 'Offline document storage', 100*1024); -} - -database.create=function(){ - database.db.transaction(function(tx) { - tx.executeSql("CREATE TABLE IF NOT EXISTS docs(ID INTEGER PRIMARY KEY ASC, docname TEXT, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP)", - [], - database.onSuccess, - database.onError); - });} - -database.add = function(message) { - database.db.transaction(function(tx){ - tx.executeSql("INSERT INTO docs(docname) VALUES (?)", - [message], database.onSuccess, database.onError); - }); -} - -database.selectAll = function() { - database.db.transaction(function(tx) { - tx.executeSql("SELECT * FROM docs", [], database.onSuccess, - database.onError); - }); -} - -database.onDeleteAllSuccess = function(tx, r) { - var doc = document.documentElement; - var db_completed = document.createElement("div"); - db_completed.setAttribute("id", "db_completed"); - db_completed.innerText = "db operation completed"; - doc.appendChild(db_completed); -} - -database.deleteAll = function() { - database.db.transaction(function(tx) { - tx.executeSql("delete from docs", [], database.onDeleteAllSuccess, - database.onError); - }); -} - -var log = document.createElement('div'); -log.setAttribute('name','notice'); -log.setAttribute('style','background-color:yellow'); -log.innerText = typeof window.openDatabase == "function" ? "Web Database is supported." : "Web Database is not supported."; -document.getElementById('logs').appendChild(log); - -try { - database.open(); - database.create(); - database.add('Doc 1'); - database.add('Doc 2'); - database.selectAll(); - database.deleteAll(); -} catch(error) { - var log = document.createElement('div'); - log.setAttribute('name','critical'); - log.setAttribute('style','background-color:pink'); - log.innerText = error; - document.getElementById('logs').appendChild(log); -} diff --git a/test/ghostdriver-test/fixtures/common/html5/geolocation.js b/test/ghostdriver-test/fixtures/common/html5/geolocation.js deleted file mode 100644 index f07af148ed..0000000000 --- a/test/ghostdriver-test/fixtures/common/html5/geolocation.js +++ /dev/null @@ -1,18 +0,0 @@ -function success(position) { - var message = document.getElementById("status"); - message.innerHTML =""; - message.innerHTML += "

Longitude: " + position.coords.longitude + "

"; - message.innerHTML += "

Latitude: " + position.coords.latitude + "

"; - message.innerHTML += "

Altitude: " + position.coords.altitude + "

"; -} - -function error(msg) { - var message = document.getElementById("status"); - message.innerHTML = "Failed to get geolocation."; -} - -if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition(success, error); -} else { - error('Geolocation is not supported.'); -} \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/html5/green.jpg b/test/ghostdriver-test/fixtures/common/html5/green.jpg deleted file mode 100644 index 6a0d3bea47..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/html5/green.jpg and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/html5/offline.html b/test/ghostdriver-test/fixtures/common/html5/offline.html deleted file mode 100644 index c24178b5f5..0000000000 --- a/test/ghostdriver-test/fixtures/common/html5/offline.html +++ /dev/null @@ -1 +0,0 @@ -Offline diff --git a/test/ghostdriver-test/fixtures/common/html5/red.jpg b/test/ghostdriver-test/fixtures/common/html5/red.jpg deleted file mode 100644 index f296e27195..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/html5/red.jpg and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/html5/status.html b/test/ghostdriver-test/fixtures/common/html5/status.html deleted file mode 100644 index 394116a522..0000000000 --- a/test/ghostdriver-test/fixtures/common/html5/status.html +++ /dev/null @@ -1 +0,0 @@ -Online diff --git a/test/ghostdriver-test/fixtures/common/html5/test.appcache b/test/ghostdriver-test/fixtures/common/html5/test.appcache deleted file mode 100644 index 3bc4e00257..0000000000 --- a/test/ghostdriver-test/fixtures/common/html5/test.appcache +++ /dev/null @@ -1,11 +0,0 @@ -CACHE MANIFEST - -CACHE: -# Additional items to cache. -yellow.jpg -red.jpg -blue.jpg -green.jpg - -FALLBACK: -status.html offline.html diff --git a/test/ghostdriver-test/fixtures/common/html5/yellow.jpg b/test/ghostdriver-test/fixtures/common/html5/yellow.jpg deleted file mode 100644 index 7c609b3712..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/html5/yellow.jpg and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/html5Page.html b/test/ghostdriver-test/fixtures/common/html5Page.html deleted file mode 100644 index 355ddc3a1a..0000000000 --- a/test/ghostdriver-test/fixtures/common/html5Page.html +++ /dev/null @@ -1,32 +0,0 @@ - - -HTML5 - - - -

Geolocation Test

-
Location unknown
- - -

Web SQL Database Test

-
- - -

Application Cache Test

-
-

Current network status:

- - - - - -
- - - diff --git a/test/ghostdriver-test/fixtures/common/icon.gif b/test/ghostdriver-test/fixtures/common/icon.gif deleted file mode 100644 index bb99461927..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/icon.gif and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/iframeAtBottom.html b/test/ghostdriver-test/fixtures/common/iframeAtBottom.html deleted file mode 100644 index a686ba3121..0000000000 --- a/test/ghostdriver-test/fixtures/common/iframeAtBottom.html +++ /dev/null @@ -1,15 +0,0 @@ - - - This page has iframes - - -

This is the heading

- -
- diff --git a/test/ghostdriver-test/fixtures/common/iframes.html b/test/ghostdriver-test/fixtures/common/iframes.html deleted file mode 100644 index e00b482aa0..0000000000 --- a/test/ghostdriver-test/fixtures/common/iframes.html +++ /dev/null @@ -1,11 +0,0 @@ - - - This page has iframes - - -

This is the heading

- -':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
', -o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& -l)?" ":""));a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
";return k},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker, -[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.10";window["DP_jQuery_"+y]=d})(jQuery); -;/* - * jQuery UI Progressbar 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* -this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.10"})})(jQuery); -;/* - * jQuery UI Effects 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], -16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, -a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= -a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", -"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, -0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, -211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, -d){if(f.isFunction(b)){d=b;b=null}return this.queue("fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l=h.splice(h.length-1,1)[0]; -h.splice(1,0,l);f.dequeue(this)})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c, -a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.10",save:function(c,a){for(var b=0;b
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent", -border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c); -return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments); -else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c), -b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c, -a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c, -a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a== -e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h
").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ -e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); -;/* - * jQuery UI Effects Fade 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fade - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Fold 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */ -(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], -10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); -;/* - * jQuery UI Effects Highlight 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */ -(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); -;/* - * jQuery UI Effects Pulsate 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */ -(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); -b.dequeue()})})}})(jQuery); -; \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/key_tests/remove_on_keypress.html b/test/ghostdriver-test/fixtures/common/key_tests/remove_on_keypress.html deleted file mode 100644 index c0f3aab4c7..0000000000 --- a/test/ghostdriver-test/fixtures/common/key_tests/remove_on_keypress.html +++ /dev/null @@ -1,36 +0,0 @@ - -
Pressing "a" while this checkbox is - focused will remove it from the DOM.
-
-
- diff --git a/test/ghostdriver-test/fixtures/common/keyboard_shortcut.html b/test/ghostdriver-test/fixtures/common/keyboard_shortcut.html deleted file mode 100644 index 741d7f4b8c..0000000000 --- a/test/ghostdriver-test/fixtures/common/keyboard_shortcut.html +++ /dev/null @@ -1,36 +0,0 @@ - - -
CTRL + 1: red
-
SHIFT + 1: green
-
CTRL + SHIFT + 1: yellow
-
ALT + 1: lightblue
-
CTRL + ALT + 1: lightgreen
-
SHIFT + ALT + 1: silver
-
CTRL + SHIFT + ALT + 1: magenta
- diff --git a/test/ghostdriver-test/fixtures/common/linked_image.html b/test/ghostdriver-test/fixtures/common/linked_image.html deleted file mode 100644 index 7c8df0031a..0000000000 --- a/test/ghostdriver-test/fixtures/common/linked_image.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - -Linking with an image - - -banner
-Click here for next page
-
-link to other link
-Just another link.
-

- - - diff --git a/test/ghostdriver-test/fixtures/common/locators_tests/boolean_attribute_selected.html b/test/ghostdriver-test/fixtures/common/locators_tests/boolean_attribute_selected.html deleted file mode 100644 index 42b0442b08..0000000000 --- a/test/ghostdriver-test/fixtures/common/locators_tests/boolean_attribute_selected.html +++ /dev/null @@ -1,13 +0,0 @@ - - - Boolean Attribute Selected - - - - - - diff --git a/test/ghostdriver-test/fixtures/common/locators_tests/boolean_attribute_selected_html4.html b/test/ghostdriver-test/fixtures/common/locators_tests/boolean_attribute_selected_html4.html deleted file mode 100644 index 60cd033817..0000000000 --- a/test/ghostdriver-test/fixtures/common/locators_tests/boolean_attribute_selected_html4.html +++ /dev/null @@ -1,13 +0,0 @@ - - - Boolean Attribute Selected - - - - - - diff --git a/test/ghostdriver-test/fixtures/common/longContentPage.html b/test/ghostdriver-test/fixtures/common/longContentPage.html deleted file mode 100644 index 99a45e7738..0000000000 --- a/test/ghostdriver-test/fixtures/common/longContentPage.html +++ /dev/null @@ -1,55 +0,0 @@ - - - TouchLongContent - - - -

Touch API

-

Page with long content

-
                   



-

Long text:                                                                                                                          This is a very long text to make the screen horizontally movable, to test the flick gesture at a long horizontal distance Normal link                                                                                                                                           at normal and fast speeds to see results of it Normal link end

-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










- Middle of the screen Normal link -










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










-










- Bottom of the screen Normal link


- - diff --git a/test/ghostdriver-test/fixtures/common/macbeth.html b/test/ghostdriver-test/fixtures/common/macbeth.html deleted file mode 100644 index 9fa39d5666..0000000000 --- a/test/ghostdriver-test/fixtures/common/macbeth.html +++ /dev/null @@ -1,5255 +0,0 @@ - - - - Macbeth: Entire Play - - - - - - - -Quick link to last speech - -

ACT I

-

SCENE I. A desert place.

-

-Thunder and lightning. Enter three Witches -
- -First Witch -
-When shall we three meet again
-In thunder, lightning, or in rain?
-
- -Second Witch -
-When the hurlyburly's done,
-When the battle's lost and won.
-
- -Third Witch -
-That will be ere the set of sun.
-
- -First Witch -
-Where the place?
-
- -Second Witch -
- Upon the heath.
-
- -Third Witch -
-There to meet with Macbeth.
-
- -First Witch -
-I come, Graymalkin!
-
- -Second Witch -
-Paddock calls.
-
- -Third Witch -
-Anon.
-
- -ALL -
-Fair is foul, and foul is fair:
-Hover through the fog and filthy air.
-

Exeunt

-
-

SCENE II. A camp near Forres.

-

-Alarum within. Enter DUNCAN, MALCOLM, DONALBAIN, LENNOX, with Attendants, meeting a bleeding Sergeant -
- -DUNCAN -
-What bloody man is that? He can report,
-As seemeth by his plight, of the revolt
-The newest state.
-
- -MALCOLM -
- This is the sergeant
-Who like a good and hardy soldier fought
-'Gainst my captivity. Hail, brave friend!
-Say to the king the knowledge of the broil
-As thou didst leave it.
-
- -Sergeant -
-Doubtful it stood;
-As two spent swimmers, that do cling together
-And choke their art. The merciless Macdonwald--
-Worthy to be a rebel, for to that
-The multiplying villanies of nature
-Do swarm upon him--from the western isles
-Of kerns and gallowglasses is supplied;
-And fortune, on his damned quarrel smiling,
-Show'd like a rebel's whore: but all's too weak:
-For brave Macbeth--well he deserves that name--
-Disdaining fortune, with his brandish'd steel,
-Which smoked with bloody execution,
-Like valour's minion carved out his passage
-Till he faced the slave;
-Which ne'er shook hands, nor bade farewell to him,
-Till he unseam'd him from the nave to the chaps,
-And fix'd his head upon our battlements.
-
- -DUNCAN -
-O valiant cousin! worthy gentleman!
-
- -Sergeant -
-As whence the sun 'gins his reflection
-Shipwrecking storms and direful thunders break,
-So from that spring whence comfort seem'd to come
-Discomfort swells. Mark, king of Scotland, mark:
-No sooner justice had with valour arm'd
-Compell'd these skipping kerns to trust their heels,
-But the Norweyan lord surveying vantage,
-With furbish'd arms and new supplies of men
-Began a fresh assault.
-
- -DUNCAN -
-Dismay'd not this
-Our captains, Macbeth and Banquo?
-
- -Sergeant -
-Yes;
-As sparrows eagles, or the hare the lion.
-If I say sooth, I must report they were
-As cannons overcharged with double cracks, so they
-Doubly redoubled strokes upon the foe:
-Except they meant to bathe in reeking wounds,
-Or memorise another Golgotha,
-I cannot tell.
-But I am faint, my gashes cry for help.
-
- -DUNCAN -
-So well thy words become thee as thy wounds;
-They smack of honour both. Go get him surgeons.
-

Exit Sergeant, attended

-Who comes here?
-

Enter ROSS

-
- -MALCOLM -
- The worthy thane of Ross.
-
- -LENNOX -
-What a haste looks through his eyes! So should he look
-That seems to speak things strange.
-
- -ROSS -
-God save the king!
-
- -DUNCAN -
-Whence camest thou, worthy thane?
-
- -ROSS -
-From Fife, great king;
-Where the Norweyan banners flout the sky
-And fan our people cold. Norway himself,
-With terrible numbers,
-Assisted by that most disloyal traitor
-The thane of Cawdor, began a dismal conflict;
-Till that Bellona's bridegroom, lapp'd in proof,
-Confronted him with self-comparisons,
-Point against point rebellious, arm 'gainst arm.
-Curbing his lavish spirit: and, to conclude,
-The victory fell on us.
-
- -DUNCAN -
-Great happiness!
-
- -ROSS -
-That now
-Sweno, the Norways' king, craves composition:
-Nor would we deign him burial of his men
-Till he disbursed at Saint Colme's inch
-Ten thousand dollars to our general use.
-
- -DUNCAN -
-No more that thane of Cawdor shall deceive
-Our bosom interest: go pronounce his present death,
-And with his former title greet Macbeth.
-
- -ROSS -
-I'll see it done.
-
- -DUNCAN -
-What he hath lost noble Macbeth hath won.
-

Exeunt

-
-

SCENE III. A heath near Forres.

-

-Thunder. Enter the three Witches -
- -First Witch -
-Where hast thou been, sister?
-
- -Second Witch -
-Killing swine.
-
- -Third Witch -
-Sister, where thou?
-
- -First Witch -
-A sailor's wife had chestnuts in her lap,
-And munch'd, and munch'd, and munch'd:--
-'Give me,' quoth I:
-'Aroint thee, witch!' the rump-fed ronyon cries.
-Her husband's to Aleppo gone, master o' the Tiger:
-But in a sieve I'll thither sail,
-And, like a rat without a tail,
-I'll do, I'll do, and I'll do.
-
- -Second Witch -
-I'll give thee a wind.
-
- -First Witch -
-Thou'rt kind.
-
- -Third Witch -
-And I another.
-
- -First Witch -
-I myself have all the other,
-And the very ports they blow,
-All the quarters that they know
-I' the shipman's card.
-I will drain him dry as hay:
-Sleep shall neither night nor day
-Hang upon his pent-house lid;
-He shall live a man forbid:
-Weary se'nnights nine times nine
-Shall he dwindle, peak and pine:
-Though his bark cannot be lost,
-Yet it shall be tempest-tost.
-Look what I have.
-
- -Second Witch -
-Show me, show me.
-
- -First Witch -
-Here I have a pilot's thumb,
-Wreck'd as homeward he did come.
-

Drum within

-
- -Third Witch -
-A drum, a drum!
-Macbeth doth come.
-
- -ALL -
-The weird sisters, hand in hand,
-Posters of the sea and land,
-Thus do go about, about:
-Thrice to thine and thrice to mine
-And thrice again, to make up nine.
-Peace! the charm's wound up.
-

Enter MACBETH and BANQUO

-
- -MACBETH -
-So foul and fair a day I have not seen.
-
- -BANQUO -
-How far is't call'd to Forres? What are these
-So wither'd and so wild in their attire,
-That look not like the inhabitants o' the earth,
-And yet are on't? Live you? or are you aught
-That man may question? You seem to understand me,
-By each at once her chappy finger laying
-Upon her skinny lips: you should be women,
-And yet your beards forbid me to interpret
-That you are so.
-
- -MACBETH -
- Speak, if you can: what are you?
-
- -First Witch -
-All hail, Macbeth! hail to thee, thane of Glamis!
-
- -Second Witch -
-All hail, Macbeth, hail to thee, thane of Cawdor!
-
- -Third Witch -
-All hail, Macbeth, thou shalt be king hereafter!
-
- -BANQUO -
-Good sir, why do you start; and seem to fear
-Things that do sound so fair? I' the name of truth,
-Are ye fantastical, or that indeed
-Which outwardly ye show? My noble partner
-You greet with present grace and great prediction
-Of noble having and of royal hope,
-That he seems rapt withal: to me you speak not.
-If you can look into the seeds of time,
-And say which grain will grow and which will not,
-Speak then to me, who neither beg nor fear
-Your favours nor your hate.
-
- -First Witch -
-Hail!
-
- -Second Witch -
-Hail!
-
- -Third Witch -
-Hail!
-
- -First Witch -
-Lesser than Macbeth, and greater.
-
- -Second Witch -
-Not so happy, yet much happier.
-
- -Third Witch -
-Thou shalt get kings, though thou be none:
-So all hail, Macbeth and Banquo!
-
- -First Witch -
-Banquo and Macbeth, all hail!
-
- -MACBETH -
-Stay, you imperfect speakers, tell me more:
-By Sinel's death I know I am thane of Glamis;
-But how of Cawdor? the thane of Cawdor lives,
-A prosperous gentleman; and to be king
-Stands not within the prospect of belief,
-No more than to be Cawdor. Say from whence
-You owe this strange intelligence? or why
-Upon this blasted heath you stop our way
-With such prophetic greeting? Speak, I charge you.
-

Witches vanish

-
- -BANQUO -
-The earth hath bubbles, as the water has,
-And these are of them. Whither are they vanish'd?
-
- -MACBETH -
-Into the air; and what seem'd corporal melted
-As breath into the wind. Would they had stay'd!
-
- -BANQUO -
-Were such things here as we do speak about?
-Or have we eaten on the insane root
-That takes the reason prisoner?
-
- -MACBETH -
-Your children shall be kings.
-
- -BANQUO -
-You shall be king.
-
- -MACBETH -
-And thane of Cawdor too: went it not so?
-
- -BANQUO -
-To the selfsame tune and words. Who's here?
-

Enter ROSS and ANGUS

-
- -ROSS -
-The king hath happily received, Macbeth,
-The news of thy success; and when he reads
-Thy personal venture in the rebels' fight,
-His wonders and his praises do contend
-Which should be thine or his: silenced with that,
-In viewing o'er the rest o' the selfsame day,
-He finds thee in the stout Norweyan ranks,
-Nothing afeard of what thyself didst make,
-Strange images of death. As thick as hail
-Came post with post; and every one did bear
-Thy praises in his kingdom's great defence,
-And pour'd them down before him.
-
- -ANGUS -
-We are sent
-To give thee from our royal master thanks;
-Only to herald thee into his sight,
-Not pay thee.
-
- -ROSS -
-And, for an earnest of a greater honour,
-He bade me, from him, call thee thane of Cawdor:
-In which addition, hail, most worthy thane!
-For it is thine.
-
- -BANQUO -
- What, can the devil speak true?
-
- -MACBETH -
-The thane of Cawdor lives: why do you dress me
-In borrow'd robes?
-
- -ANGUS -
- Who was the thane lives yet;
-But under heavy judgment bears that life
-Which he deserves to lose. Whether he was combined
-With those of Norway, or did line the rebel
-With hidden help and vantage, or that with both
-He labour'd in his country's wreck, I know not;
-But treasons capital, confess'd and proved,
-Have overthrown him.
-
- -MACBETH -
-[Aside] Glamis, and thane of Cawdor!
-The greatest is behind.
-

To ROSS and ANGUS

-Thanks for your pains.
-

To BANQUO

-Do you not hope your children shall be kings,
-When those that gave the thane of Cawdor to me
-Promised no less to them?
-
- -BANQUO -
-That trusted home
-Might yet enkindle you unto the crown,
-Besides the thane of Cawdor. But 'tis strange:
-And oftentimes, to win us to our harm,
-The instruments of darkness tell us truths,
-Win us with honest trifles, to betray's
-In deepest consequence.
-Cousins, a word, I pray you.
-
- -MACBETH -
-[Aside] Two truths are told,
-As happy prologues to the swelling act
-Of the imperial theme.--I thank you, gentlemen.
-

Aside

-Cannot be ill, cannot be good: if ill,
-Why hath it given me earnest of success,
-Commencing in a truth? I am thane of Cawdor:
-If good, why do I yield to that suggestion
-Whose horrid image doth unfix my hair
-And make my seated heart knock at my ribs,
-Against the use of nature? Present fears
-Are less than horrible imaginings:
-My thought, whose murder yet is but fantastical,
-Shakes so my single state of man that function
-Is smother'd in surmise, and nothing is
-But what is not.
-
- -BANQUO -
- Look, how our partner's rapt.
-
- -MACBETH -
-[Aside] If chance will have me king, why, chance may crown me,
-Without my stir.
-
- -BANQUO -
- New horrors come upon him,
-Like our strange garments, cleave not to their mould
-But with the aid of use.
-
- -MACBETH -
-[Aside] Come what come may,
-Time and the hour runs through the roughest day.
-
- -BANQUO -
-Worthy Macbeth, we stay upon your leisure.
-
- -MACBETH -
-Give me your favour: my dull brain was wrought
-With things forgotten. Kind gentlemen, your pains
-Are register'd where every day I turn
-The leaf to read them. Let us toward the king.
-Think upon what hath chanced, and, at more time,
-The interim having weigh'd it, let us speak
-Our free hearts each to other.
-
- -BANQUO -
-Very gladly.
-
- -MACBETH -
-Till then, enough. Come, friends.
-

Exeunt

-
-

SCENE IV. Forres. The palace.

-

-Flourish. Enter DUNCAN, MALCOLM, DONALBAIN, LENNOX, and Attendants -
- -DUNCAN -
-Is execution done on Cawdor? Are not
-Those in commission yet return'd?
-
- -MALCOLM -
-My liege,
-They are not yet come back. But I have spoke
-With one that saw him die: who did report
-That very frankly he confess'd his treasons,
-Implored your highness' pardon and set forth
-A deep repentance: nothing in his life
-Became him like the leaving it; he died
-As one that had been studied in his death
-To throw away the dearest thing he owed,
-As 'twere a careless trifle.
-
- -DUNCAN -
-There's no art
-To find the mind's construction in the face:
-He was a gentleman on whom I built
-An absolute trust.
-

Enter MACBETH, BANQUO, ROSS, and ANGUS

-O worthiest cousin!
-The sin of my ingratitude even now
-Was heavy on me: thou art so far before
-That swiftest wing of recompense is slow
-To overtake thee. Would thou hadst less deserved,
-That the proportion both of thanks and payment
-Might have been mine! only I have left to say,
-More is thy due than more than all can pay.
-
- -MACBETH -
-The service and the loyalty I owe,
-In doing it, pays itself. Your highness' part
-Is to receive our duties; and our duties
-Are to your throne and state children and servants,
-Which do but what they should, by doing every thing
-Safe toward your love and honour.
-
- -DUNCAN -
-Welcome hither:
-I have begun to plant thee, and will labour
-To make thee full of growing. Noble Banquo,
-That hast no less deserved, nor must be known
-No less to have done so, let me enfold thee
-And hold thee to my heart.
-
- -BANQUO -
-There if I grow,
-The harvest is your own.
-
- -DUNCAN -
-My plenteous joys,
-Wanton in fulness, seek to hide themselves
-In drops of sorrow. Sons, kinsmen, thanes,
-And you whose places are the nearest, know
-We will establish our estate upon
-Our eldest, Malcolm, whom we name hereafter
-The Prince of Cumberland; which honour must
-Not unaccompanied invest him only,
-But signs of nobleness, like stars, shall shine
-On all deservers. From hence to Inverness,
-And bind us further to you.
-
- -MACBETH -
-The rest is labour, which is not used for you:
-I'll be myself the harbinger and make joyful
-The hearing of my wife with your approach;
-So humbly take my leave.
-
- -DUNCAN -
-My worthy Cawdor!
-
- -MACBETH -
-[Aside] The Prince of Cumberland! that is a step
-On which I must fall down, or else o'erleap,
-For in my way it lies. Stars, hide your fires;
-Let not light see my black and deep desires:
-The eye wink at the hand; yet let that be,
-Which the eye fears, when it is done, to see.
-

Exit

-
- -DUNCAN -
-True, worthy Banquo; he is full so valiant,
-And in his commendations I am fed;
-It is a banquet to me. Let's after him,
-Whose care is gone before to bid us welcome:
-It is a peerless kinsman.
-

Flourish. Exeunt

-
-

SCENE V. Inverness. Macbeth's castle.

-

-Enter LADY MACBETH, reading a letter -
- -LADY MACBETH -
-'They met me in the day of success: and I have
-learned by the perfectest report, they have more in
-them than mortal knowledge. When I burned in desire
-to question them further, they made themselves air,
-into which they vanished. Whiles I stood rapt in
-the wonder of it, came missives from the king, who
-all-hailed me 'Thane of Cawdor;' by which title,
-before, these weird sisters saluted me, and referred
-me to the coming on of time, with 'Hail, king that
-shalt be!' This have I thought good to deliver
-thee, my dearest partner of greatness, that thou
-mightst not lose the dues of rejoicing, by being
-ignorant of what greatness is promised thee. Lay it
-to thy heart, and farewell.'
-Glamis thou art, and Cawdor; and shalt be
-What thou art promised: yet do I fear thy nature;
-It is too full o' the milk of human kindness
-To catch the nearest way: thou wouldst be great;
-Art not without ambition, but without
-The illness should attend it: what thou wouldst highly,
-That wouldst thou holily; wouldst not play false,
-And yet wouldst wrongly win: thou'ldst have, great Glamis,
-That which cries 'Thus thou must do, if thou have it;
-And that which rather thou dost fear to do
-Than wishest should be undone.' Hie thee hither,
-That I may pour my spirits in thine ear;
-And chastise with the valour of my tongue
-All that impedes thee from the golden round,
-Which fate and metaphysical aid doth seem
-To have thee crown'd withal.
-

Enter a Messenger

-What is your tidings?
-
- -Messenger -
-The king comes here to-night.
-
- -LADY MACBETH -
-Thou'rt mad to say it:
-Is not thy master with him? who, were't so,
-Would have inform'd for preparation.
-
- -Messenger -
-So please you, it is true: our thane is coming:
-One of my fellows had the speed of him,
-Who, almost dead for breath, had scarcely more
-Than would make up his message.
-
- -LADY MACBETH -
-Give him tending;
-He brings great news.
-

Exit Messenger

-The raven himself is hoarse
-That croaks the fatal entrance of Duncan
-Under my battlements. Come, you spirits
-That tend on mortal thoughts, unsex me here,
-And fill me from the crown to the toe top-full
-Of direst cruelty! make thick my blood;
-Stop up the access and passage to remorse,
-That no compunctious visitings of nature
-Shake my fell purpose, nor keep peace between
-The effect and it! Come to my woman's breasts,
-And take my milk for gall, you murdering ministers,
-Wherever in your sightless substances
-You wait on nature's mischief! Come, thick night,
-And pall thee in the dunnest smoke of hell,
-That my keen knife see not the wound it makes,
-Nor heaven peep through the blanket of the dark,
-To cry 'Hold, hold!'
-

Enter MACBETH

-Great Glamis! worthy Cawdor!
-Greater than both, by the all-hail hereafter!
-Thy letters have transported me beyond
-This ignorant present, and I feel now
-The future in the instant.
-
- -MACBETH -
-My dearest love,
-Duncan comes here to-night.
-
- -LADY MACBETH -
-And when goes hence?
-
- -MACBETH -
-To-morrow, as he purposes.
-
- -LADY MACBETH -
-O, never
-Shall sun that morrow see!
-Your face, my thane, is as a book where men
-May read strange matters. To beguile the time,
-Look like the time; bear welcome in your eye,
-Your hand, your tongue: look like the innocent flower,
-But be the serpent under't. He that's coming
-Must be provided for: and you shall put
-This night's great business into my dispatch;
-Which shall to all our nights and days to come
-Give solely sovereign sway and masterdom.
-
- -MACBETH -
-We will speak further.
-
- -LADY MACBETH -
-Only look up clear;
-To alter favour ever is to fear:
-Leave all the rest to me.
-

Exeunt

-
-

SCENE VI. Before Macbeth's castle.

-

-Hautboys and torches. Enter DUNCAN, MALCOLM, DONALBAIN, BANQUO, LENNOX, MACDUFF, ROSS, ANGUS, and Attendants -
- -DUNCAN -
-This castle hath a pleasant seat; the air
-Nimbly and sweetly recommends itself
-Unto our gentle senses.
-
- -BANQUO -
-This guest of summer,
-The temple-haunting martlet, does approve,
-By his loved mansionry, that the heaven's breath
-Smells wooingly here: no jutty, frieze,
-Buttress, nor coign of vantage, but this bird
-Hath made his pendent bed and procreant cradle:
-Where they most breed and haunt, I have observed,
-The air is delicate.
-

Enter LADY MACBETH

-
- -DUNCAN -
-See, see, our honour'd hostess!
-The love that follows us sometime is our trouble,
-Which still we thank as love. Herein I teach you
-How you shall bid God 'ild us for your pains,
-And thank us for your trouble.
-
- -LADY MACBETH -
-All our service
-In every point twice done and then done double
-Were poor and single business to contend
-Against those honours deep and broad wherewith
-Your majesty loads our house: for those of old,
-And the late dignities heap'd up to them,
-We rest your hermits.
-
- -DUNCAN -
-Where's the thane of Cawdor?
-We coursed him at the heels, and had a purpose
-To be his purveyor: but he rides well;
-And his great love, sharp as his spur, hath holp him
-To his home before us. Fair and noble hostess,
-We are your guest to-night.
-
- -LADY MACBETH -
-Your servants ever
-Have theirs, themselves and what is theirs, in compt,
-To make their audit at your highness' pleasure,
-Still to return your own.
-
- -DUNCAN -
-Give me your hand;
-Conduct me to mine host: we love him highly,
-And shall continue our graces towards him.
-By your leave, hostess.
-

Exeunt

-
-

SCENE VII. Macbeth's castle.

-

-Hautboys and torches. Enter a Sewer, and divers Servants with dishes and service, and pass over the stage. Then enter MACBETH -
- -MACBETH -
-If it were done when 'tis done, then 'twere well
-It were done quickly: if the assassination
-Could trammel up the consequence, and catch
-With his surcease success; that but this blow
-Might be the be-all and the end-all here,
-But here, upon this bank and shoal of time,
-We'ld jump the life to come. But in these cases
-We still have judgment here; that we but teach
-Bloody instructions, which, being taught, return
-To plague the inventor: this even-handed justice
-Commends the ingredients of our poison'd chalice
-To our own lips. He's here in double trust;
-First, as I am his kinsman and his subject,
-Strong both against the deed; then, as his host,
-Who should against his murderer shut the door,
-Not bear the knife myself. Besides, this Duncan
-Hath borne his faculties so meek, hath been
-So clear in his great office, that his virtues
-Will plead like angels, trumpet-tongued, against
-The deep damnation of his taking-off;
-And pity, like a naked new-born babe,
-Striding the blast, or heaven's cherubim, horsed
-Upon the sightless couriers of the air,
-Shall blow the horrid deed in every eye,
-That tears shall drown the wind. I have no spur
-To prick the sides of my intent, but only
-Vaulting ambition, which o'erleaps itself
-And falls on the other.
-

Enter LADY MACBETH

-How now! what news?
-
- -LADY MACBETH -
-He has almost supp'd: why have you left the chamber?
-
- -MACBETH -
-Hath he ask'd for me?
-
- -LADY MACBETH -
-Know you not he has?
-
- -MACBETH -
-We will proceed no further in this business:
-He hath honour'd me of late; and I have bought
-Golden opinions from all sorts of people,
-Which would be worn now in their newest gloss,
-Not cast aside so soon.
-
- -LADY MACBETH -
-Was the hope drunk
-Wherein you dress'd yourself? hath it slept since?
-And wakes it now, to look so green and pale
-At what it did so freely? From this time
-Such I account thy love. Art thou afeard
-To be the same in thine own act and valour
-As thou art in desire? Wouldst thou have that
-Which thou esteem'st the ornament of life,
-And live a coward in thine own esteem,
-Letting 'I dare not' wait upon 'I would,'
-Like the poor cat i' the adage?
-
- -MACBETH -
-Prithee, peace:
-I dare do all that may become a man;
-Who dares do more is none.
-
- -LADY MACBETH -
-What beast was't, then,
-That made you break this enterprise to me?
-When you durst do it, then you were a man;
-And, to be more than what you were, you would
-Be so much more the man. Nor time nor place
-Did then adhere, and yet you would make both:
-They have made themselves, and that their fitness now
-Does unmake you. I have given suck, and know
-How tender 'tis to love the babe that milks me:
-I would, while it was smiling in my face,
-Have pluck'd my nipple from his boneless gums,
-And dash'd the brains out, had I so sworn as you
-Have done to this.
-
- -MACBETH -
- If we should fail?
-
- -LADY MACBETH -
-We fail!
-But screw your courage to the sticking-place,
-And we'll not fail. When Duncan is asleep--
-Whereto the rather shall his day's hard journey
-Soundly invite him--his two chamberlains
-Will I with wine and wassail so convince
-That memory, the warder of the brain,
-Shall be a fume, and the receipt of reason
-A limbeck only: when in swinish sleep
-Their drenched natures lie as in a death,
-What cannot you and I perform upon
-The unguarded Duncan? what not put upon
-His spongy officers, who shall bear the guilt
-Of our great quell?
-
- -MACBETH -
-Bring forth men-children only;
-For thy undaunted mettle should compose
-Nothing but males. Will it not be received,
-When we have mark'd with blood those sleepy two
-Of his own chamber and used their very daggers,
-That they have done't?
-
- -LADY MACBETH -
-Who dares receive it other,
-As we shall make our griefs and clamour roar
-Upon his death?
-
- -MACBETH -
- I am settled, and bend up
-Each corporal agent to this terrible feat.
-Away, and mock the time with fairest show:
-False face must hide what the false heart doth know.
-

Exeunt

-

-

ACT II

-

SCENE I. Court of Macbeth's castle.

-

-Enter BANQUO, and FLEANCE bearing a torch before him -
- -BANQUO -
-How goes the night, boy?
-
- -FLEANCE -
-The moon is down; I have not heard the clock.
-
- -BANQUO -
-And she goes down at twelve.
-
- -FLEANCE -
-I take't, 'tis later, sir.
-
- -BANQUO -
-Hold, take my sword. There's husbandry in heaven;
-Their candles are all out. Take thee that too.
-A heavy summons lies like lead upon me,
-And yet I would not sleep: merciful powers,
-Restrain in me the cursed thoughts that nature
-Gives way to in repose!
-

Enter MACBETH, and a Servant with a torch

-Give me my sword.
-Who's there?
-
- -MACBETH -
-A friend.
-
- -BANQUO -
-What, sir, not yet at rest? The king's a-bed:
-He hath been in unusual pleasure, and
-Sent forth great largess to your offices.
-This diamond he greets your wife withal,
-By the name of most kind hostess; and shut up
-In measureless content.
-
- -MACBETH -
-Being unprepared,
-Our will became the servant to defect;
-Which else should free have wrought.
-
- -BANQUO -
-All's well.
-I dreamt last night of the three weird sisters:
-To you they have show'd some truth.
-
- -MACBETH -
-I think not of them:
-Yet, when we can entreat an hour to serve,
-We would spend it in some words upon that business,
-If you would grant the time.
-
- -BANQUO -
-At your kind'st leisure.
-
- -MACBETH -
-If you shall cleave to my consent, when 'tis,
-It shall make honour for you.
-
- -BANQUO -
-So I lose none
-In seeking to augment it, but still keep
-My bosom franchised and allegiance clear,
-I shall be counsell'd.
-
- -MACBETH -
-Good repose the while!
-
- -BANQUO -
-Thanks, sir: the like to you!
-

Exeunt BANQUO and FLEANCE

-
- -MACBETH -
-Go bid thy mistress, when my drink is ready,
-She strike upon the bell. Get thee to bed.
-

Exit Servant

-Is this a dagger which I see before me,
-The handle toward my hand? Come, let me clutch thee.
-I have thee not, and yet I see thee still.
-Art thou not, fatal vision, sensible
-To feeling as to sight? or art thou but
-A dagger of the mind, a false creation,
-Proceeding from the heat-oppressed brain?
-I see thee yet, in form as palpable
-As this which now I draw.
-Thou marshall'st me the way that I was going;
-And such an instrument I was to use.
-Mine eyes are made the fools o' the other senses,
-Or else worth all the rest; I see thee still,
-And on thy blade and dudgeon gouts of blood,
-Which was not so before. There's no such thing:
-It is the bloody business which informs
-Thus to mine eyes. Now o'er the one halfworld
-Nature seems dead, and wicked dreams abuse
-The curtain'd sleep; witchcraft celebrates
-Pale Hecate's offerings, and wither'd murder,
-Alarum'd by his sentinel, the wolf,
-Whose howl's his watch, thus with his stealthy pace.
-With Tarquin's ravishing strides, towards his design
-Moves like a ghost. Thou sure and firm-set earth,
-Hear not my steps, which way they walk, for fear
-Thy very stones prate of my whereabout,
-And take the present horror from the time,
-Which now suits with it. Whiles I threat, he lives:
-Words to the heat of deeds too cold breath gives.
-

A bell rings

-I go, and it is done; the bell invites me.
-Hear it not, Duncan; for it is a knell
-That summons thee to heaven or to hell.
-

Exit

-
-

SCENE II. The same.

-

-Enter LADY MACBETH -
- -LADY MACBETH -
-That which hath made them drunk hath made me bold;
-What hath quench'd them hath given me fire.
-Hark! Peace!
-It was the owl that shriek'd, the fatal bellman,
-Which gives the stern'st good-night. He is about it:
-The doors are open; and the surfeited grooms
-Do mock their charge with snores: I have drugg'd
-their possets,
-That death and nature do contend about them,
-Whether they live or die.
-
- -MACBETH -
-[Within] Who's there? what, ho!
-
- -LADY MACBETH -
-Alack, I am afraid they have awaked,
-And 'tis not done. The attempt and not the deed
-Confounds us. Hark! I laid their daggers ready;
-He could not miss 'em. Had he not resembled
-My father as he slept, I had done't.
-

Enter MACBETH

-My husband!
-
- -MACBETH -
-I have done the deed. Didst thou not hear a noise?
-
- -LADY MACBETH -
-I heard the owl scream and the crickets cry.
-Did not you speak?
-
- -MACBETH -
- When?
-
- -LADY MACBETH -
-Now.
-
- -MACBETH -
-As I descended?
-
- -LADY MACBETH -
-Ay.
-
- -MACBETH -
-Hark!
-Who lies i' the second chamber?
-
- -LADY MACBETH -
-Donalbain.
-
- -MACBETH -
-This is a sorry sight.
-

Looking on his hands

-
- -LADY MACBETH -
-A foolish thought, to say a sorry sight.
-
- -MACBETH -
-There's one did laugh in's sleep, and one cried
-'Murder!'
-That they did wake each other: I stood and heard them:
-But they did say their prayers, and address'd them
-Again to sleep.
-
- -LADY MACBETH -
- There are two lodged together.
-
- -MACBETH -
-One cried 'God bless us!' and 'Amen' the other;
-As they had seen me with these hangman's hands.
-Listening their fear, I could not say 'Amen,'
-When they did say 'God bless us!'
-
- -LADY MACBETH -
-Consider it not so deeply.
-
- -MACBETH -
-But wherefore could not I pronounce 'Amen'?
-I had most need of blessing, and 'Amen'
-Stuck in my throat.
-
- -LADY MACBETH -
-These deeds must not be thought
-After these ways; so, it will make us mad.
-
- -MACBETH -
-Methought I heard a voice cry 'Sleep no more!
-Macbeth does murder sleep', the innocent sleep,
-Sleep that knits up the ravell'd sleeve of care,
-The death of each day's life, sore labour's bath,
-Balm of hurt minds, great nature's second course,
-Chief nourisher in life's feast,--
-
- -LADY MACBETH -
-What do you mean?
-
- -MACBETH -
-Still it cried 'Sleep no more!' to all the house:
-'Glamis hath murder'd sleep, and therefore Cawdor
-Shall sleep no more; Macbeth shall sleep no more.'
-
- -LADY MACBETH -
-Who was it that thus cried? Why, worthy thane,
-You do unbend your noble strength, to think
-So brainsickly of things. Go get some water,
-And wash this filthy witness from your hand.
-Why did you bring these daggers from the place?
-They must lie there: go carry them; and smear
-The sleepy grooms with blood.
-
- -MACBETH -
-I'll go no more:
-I am afraid to think what I have done;
-Look on't again I dare not.
-
- -LADY MACBETH -
-Infirm of purpose!
-Give me the daggers: the sleeping and the dead
-Are but as pictures: 'tis the eye of childhood
-That fears a painted devil. If he do bleed,
-I'll gild the faces of the grooms withal;
-For it must seem their guilt.
-

Exit. Knocking within

-
- -MACBETH -
-Whence is that knocking?
-How is't with me, when every noise appals me?
-What hands are here? ha! they pluck out mine eyes.
-Will all great Neptune's ocean wash this blood
-Clean from my hand? No, this my hand will rather
-The multitudinous seas in incarnadine,
-Making the green one red.
-

Re-enter LADY MACBETH

-
- -LADY MACBETH -
-My hands are of your colour; but I shame
-To wear a heart so white.
-

Knocking within

-I hear a knocking
-At the south entry: retire we to our chamber;
-A little water clears us of this deed:
-How easy is it, then! Your constancy
-Hath left you unattended.
-

Knocking within

-Hark! more knocking.
-Get on your nightgown, lest occasion call us,
-And show us to be watchers. Be not lost
-So poorly in your thoughts.
-
- -MACBETH -
-To know my deed, 'twere best not know myself.
-

Knocking within

-Wake Duncan with thy knocking! I would thou couldst!
-

Exeunt

-
-

SCENE III. The same.

-

-Knocking within. Enter a Porter -
- -Porter -
-Here's a knocking indeed! If a
-man were porter of hell-gate, he should have
-old turning the key.
-

Knocking within

-Knock,
-knock, knock! Who's there, i' the name of
-Beelzebub? Here's a farmer, that hanged
-himself on the expectation of plenty: come in
-time; have napkins enow about you; here
-you'll sweat for't.
-

Knocking within

-Knock,
-knock! Who's there, in the other devil's
-name? Faith, here's an equivocator, that could
-swear in both the scales against either scale;
-who committed treason enough for God's sake,
-yet could not equivocate to heaven: O, come
-in, equivocator.
-

Knocking within

-Knock,
-knock, knock! Who's there? Faith, here's an
-English tailor come hither, for stealing out of
-a French hose: come in, tailor; here you may
-roast your goose.
-

Knocking within

-Knock,
-knock; never at quiet! What are you? But
-this place is too cold for hell. I'll devil-porter
-it no further: I had thought to have let in
-some of all professions that go the primrose
-way to the everlasting bonfire.
-

Knocking within

-Anon, anon! I pray you, remember the porter.
-

Opens the gate

-

Enter MACDUFF and LENNOX

-
- -MACDUFF -
-Was it so late, friend, ere you went to bed,
-That you do lie so late?
-
- -Porter -
-'Faith sir, we were carousing till the
-second cock: and drink, sir, is a great
-provoker of three things.
-
- -MACDUFF -
-What three things does drink especially provoke?
-
- -Porter -
-Marry, sir, nose-painting, sleep, and
-urine. Lechery, sir, it provokes, and unprovokes;
-it provokes the desire, but it takes
-away the performance: therefore, much drink
-may be said to be an equivocator with lechery:
-it makes him, and it mars him; it sets
-him on, and it takes him off; it persuades him,
-and disheartens him; makes him stand to, and
-not stand to; in conclusion, equivocates him
-in a sleep, and, giving him the lie, leaves him.
-
- -MACDUFF -
-I believe drink gave thee the lie last night.
-
- -Porter -
-That it did, sir, i' the very throat on
-me: but I requited him for his lie; and, I
-think, being too strong for him, though he took
-up my legs sometime, yet I made a shift to cast
-him.
-
- -MACDUFF -
-Is thy master stirring?
-

Enter MACBETH

-Our knocking has awaked him; here he comes.
-
- -LENNOX -
-Good morrow, noble sir.
-
- -MACBETH -
-Good morrow, both.
-
- -MACDUFF -
-Is the king stirring, worthy thane?
-
- -MACBETH -
-Not yet.
-
- -MACDUFF -
-He did command me to call timely on him:
-I have almost slipp'd the hour.
-
- -MACBETH -
-I'll bring you to him.
-
- -MACDUFF -
-I know this is a joyful trouble to you;
-But yet 'tis one.
-
- -MACBETH -
-The labour we delight in physics pain.
-This is the door.
-
- -MACDUFF -
- I'll make so bold to call,
-For 'tis my limited service.
-

Exit

-
- -LENNOX -
-Goes the king hence to-day?
-
- -MACBETH -
-He does: he did appoint so.
-
- -LENNOX -
-The night has been unruly: where we lay,
-Our chimneys were blown down; and, as they say,
-Lamentings heard i' the air; strange screams of death,
-And prophesying with accents terrible
-Of dire combustion and confused events
-New hatch'd to the woeful time: the obscure bird
-Clamour'd the livelong night: some say, the earth
-Was feverous and did shake.
-
- -MACBETH -
-'Twas a rough night.
-
- -LENNOX -
-My young remembrance cannot parallel
-A fellow to it.
-

Re-enter MACDUFF

-
- -MACDUFF -
-O horror, horror, horror! Tongue nor heart
-Cannot conceive nor name thee!
-
- -MACBETH - -LENNOX -
-What's the matter.
-
- -MACDUFF -
-Confusion now hath made his masterpiece!
-Most sacrilegious murder hath broke ope
-The Lord's anointed temple, and stole thence
-The life o' the building!
-
- -MACBETH -
-What is 't you say? the life?
-
- -LENNOX -
-Mean you his majesty?
-
- -MACDUFF -
-Approach the chamber, and destroy your sight
-With a new Gorgon: do not bid me speak;
-See, and then speak yourselves.
-

Exeunt MACBETH and LENNOX

-Awake, awake!
-Ring the alarum-bell. Murder and treason!
-Banquo and Donalbain! Malcolm! awake!
-Shake off this downy sleep, death's counterfeit,
-And look on death itself! up, up, and see
-The great doom's image! Malcolm! Banquo!
-As from your graves rise up, and walk like sprites,
-To countenance this horror! Ring the bell.
-

Bell rings

-

Enter LADY MACBETH

-
- -LADY MACBETH -
-What's the business,
-That such a hideous trumpet calls to parley
-The sleepers of the house? speak, speak!
-
- -MACDUFF -
-O gentle lady,
-'Tis not for you to hear what I can speak:
-The repetition, in a woman's ear,
-Would murder as it fell.
-

Enter BANQUO

-O Banquo, Banquo,
-Our royal master 's murder'd!
-
- -LADY MACBETH -
-Woe, alas!
-What, in our house?
-
- -BANQUO -
-Too cruel any where.
-Dear Duff, I prithee, contradict thyself,
-And say it is not so.
-

Re-enter MACBETH and LENNOX, with ROSS

-
- -MACBETH -
-Had I but died an hour before this chance,
-I had lived a blessed time; for, from this instant,
-There 's nothing serious in mortality:
-All is but toys: renown and grace is dead;
-The wine of life is drawn, and the mere lees
-Is left this vault to brag of.
-

Enter MALCOLM and DONALBAIN

-
- -DONALBAIN -
-What is amiss?
-
- -MACBETH -
- You are, and do not know't:
-The spring, the head, the fountain of your blood
-Is stopp'd; the very source of it is stopp'd.
-
- -MACDUFF -
-Your royal father 's murder'd.
-
- -MALCOLM -
-O, by whom?
-
- -LENNOX -
-Those of his chamber, as it seem'd, had done 't:
-Their hands and faces were an badged with blood;
-So were their daggers, which unwiped we found
-Upon their pillows:
-They stared, and were distracted; no man's life
-Was to be trusted with them.
-
- -MACBETH -
-O, yet I do repent me of my fury,
-That I did kill them.
-
- -MACDUFF -
-Wherefore did you so?
-
- -MACBETH -
-Who can be wise, amazed, temperate and furious,
-Loyal and neutral, in a moment? No man:
-The expedition my violent love
-Outrun the pauser, reason. Here lay Duncan,
-His silver skin laced with his golden blood;
-And his gash'd stabs look'd like a breach in nature
-For ruin's wasteful entrance: there, the murderers,
-Steep'd in the colours of their trade, their daggers
-Unmannerly breech'd with gore: who could refrain,
-That had a heart to love, and in that heart
-Courage to make 's love kno wn?
-
- -LADY MACBETH -
-Help me hence, ho!
-
- -MACDUFF -
-Look to the lady.
-
- -MALCOLM -
-[Aside to DONALBAIN] Why do we hold our tongues,
-That most may claim this argument for ours?
-
- -DONALBAIN -
-[Aside to MALCOLM] What should be spoken here,
-where our fate,
-Hid in an auger-hole, may rush, and seize us?
-Let 's away;
-Our tears are not yet brew'd.
-
- -MALCOLM -
-[Aside to DONALBAIN] Nor our strong sorrow
-Upon the foot of motion.
-
- -BANQUO -
-Look to the lady:
-

LADY MACBETH is carried out

-And when we have our naked frailties hid,
-That suffer in exposure, let us meet,
-And question this most bloody piece of work,
-To know it further. Fears and scruples shake us:
-In the great hand of God I stand; and thence
-Against the undivulged pretence I fight
-Of treasonous malice.
-
- -MACDUFF -
-And so do I.
-
- -ALL -
-So all.
-
- -MACBETH -
-Let's briefly put on manly readiness,
-And meet i' the hall together.
-
- -ALL -
-Well contented.
-

Exeunt all but Malcolm and Donalbain.

-
- -MALCOLM -
-What will you do? Let's not consort with them:
-To show an unfelt sorrow is an office
-Which the false man does easy. I'll to England.
-
- -DONALBAIN -
-To Ireland, I; our separated fortune
-Shall keep us both the safer: where we are,
-There's daggers in men's smiles: the near in blood,
-The nearer bloody.
-
- -MALCOLM -
- This murderous shaft that's shot
-Hath not yet lighted, and our safest way
-Is to avoid the aim. Therefore, to horse;
-And let us not be dainty of leave-taking,
-But shift away: there's warrant in that theft
-Which steals itself, when there's no mercy left.
-

Exeunt

-
-

SCENE IV. Outside Macbeth's castle.

-

-Enter ROSS and an old Man -
- -Old Man -
-Threescore and ten I can remember well:
-Within the volume of which time I have seen
-Hours dreadful and things strange; but this sore night
-Hath trifled former knowings.
-
- -ROSS -
-Ah, good father,
-Thou seest, the heavens, as troubled with man's act,
-Threaten his bloody stage: by the clock, 'tis day,
-And yet dark night strangles the travelling lamp:
-Is't night's predominance, or the day's shame,
-That darkness does the face of earth entomb,
-When living light should kiss it?
-
- -Old Man -
-'Tis unnatural,
-Even like the deed that's done. On Tuesday last,
-A falcon, towering in her pride of place,
-Was by a mousing owl hawk'd at and kill'd.
-
- -ROSS -
-And Duncan's horses--a thing most strange and certain--
-Beauteous and swift, the minions of their race,
-Turn'd wild in nature, broke their stalls, flung out,
-Contending 'gainst obedience, as they would make
-War with mankind.
-
- -Old Man -
-'Tis said they eat each other.
-
- -ROSS -
-They did so, to the amazement of mine eyes
-That look'd upon't. Here comes the good Macduff.
-

Enter MACDUFF

-How goes the world, sir, now?
-
- -MACDUFF -
-Why, see you not?
-
- -ROSS -
-Is't known who did this more than bloody deed?
-
- -MACDUFF -
-Those that Macbeth hath slain.
-
- -ROSS -
-Alas, the day!
-What good could they pretend?
-
- -MACDUFF -
-They were suborn'd:
-Malcolm and Donalbain, the king's two sons,
-Are stol'n away and fled; which puts upon them
-Suspicion of the deed.
-
- -ROSS -
-'Gainst nature still!
-Thriftless ambition, that wilt ravin up
-Thine own life's means! Then 'tis most like
-The sovereignty will fall upon Macbeth.
-
- -MACDUFF -
-He is already named, and gone to Scone
-To be invested.
-
- -ROSS -
- Where is Duncan's body?
-
- -MACDUFF -
-Carried to Colmekill,
-The sacred storehouse of his predecessors,
-And guardian of their bones.
-
- -ROSS -
-Will you to Scone?
-
- -MACDUFF -
-No, cousin, I'll to Fife.
-
- -ROSS -
-Well, I will thither.
-
- -MACDUFF -
-Well, may you see things well done there: adieu!
-Lest our old robes sit easier than our new!
-
- -ROSS -
-Farewell, father.
-
- -Old Man -
-God's benison go with you; and with those
-That would make good of bad, and friends of foes!
-

Exeunt

-

-

ACT III

-

SCENE I. Forres. The palace.

-

-Enter BANQUO -
- -BANQUO -
-Thou hast it now: king, Cawdor, Glamis, all,
-As the weird women promised, and, I fear,
-Thou play'dst most foully for't: yet it was said
-It should not stand in thy posterity,
-But that myself should be the root and father
-Of many kings. If there come truth from them--
-As upon thee, Macbeth, their speeches shine--
-Why, by the verities on thee made good,
-May they not be my oracles as well,
-And set me up in hope? But hush! no more.
-

Sennet sounded. Enter MACBETH, as king, LADY MACBETH, as queen, LENNOX, ROSS, Lords, Ladies, and Attendants

-
- -MACBETH -
-Here's our chief guest.
-
- -LADY MACBETH -
-If he had been forgotten,
-It had been as a gap in our great feast,
-And all-thing unbecoming.
-
- -MACBETH -
-To-night we hold a solemn supper sir,
-And I'll request your presence.
-
- -BANQUO -
-Let your highness
-Command upon me; to the which my duties
-Are with a most indissoluble tie
-For ever knit.
-
- -MACBETH -
- Ride you this afternoon?
-
- -BANQUO -
-Ay, my good lord.
-
- -MACBETH -
-We should have else desired your good advice,
-Which still hath been both grave and prosperous,
-In this day's council; but we'll take to-morrow.
-Is't far you ride?
-
- -BANQUO -
-As far, my lord, as will fill up the time
-'Twixt this and supper: go not my horse the better,
-I must become a borrower of the night
-For a dark hour or twain.
-
- -MACBETH -
-Fail not our feast.
-
- -BANQUO -
-My lord, I will not.
-
- -MACBETH -
-We hear, our bloody cousins are bestow'd
-In England and in Ireland, not confessing
-Their cruel parricide, filling their hearers
-With strange invention: but of that to-morrow,
-When therewithal we shall have cause of state
-Craving us jointly. Hie you to horse: adieu,
-Till you return at night. Goes Fleance with you?
-
- -BANQUO -
-Ay, my good lord: our time does call upon 's.
-
- -MACBETH -
-I wish your horses swift and sure of foot;
-And so I do commend you to their backs. Farewell.
-

Exit BANQUO

-Let every man be master of his time
-Till seven at night: to make society
-The sweeter welcome, we will keep ourself
-Till supper-time alone: while then, God be with you!
-

Exeunt all but MACBETH, and an attendant

-Sirrah, a word with you: attend those men
-Our pleasure?
-
- -ATTENDANT -
-They are, my lord, without the palace gate.
-
- -MACBETH -
-Bring them before us.
-

Exit Attendant

-To be thus is nothing;
-But to be safely thus.--Our fears in Banquo
-Stick deep; and in his royalty of nature
-Reigns that which would be fear'd: 'tis much he dares;
-And, to that dauntless temper of his mind,
-He hath a wisdom that doth guide his valour
-To act in safety. There is none but he
-Whose being I do fear: and, under him,
-My Genius is rebuked; as, it is said,
-Mark Antony's was by Caesar. He chid the sisters
-When first they put the name of king upon me,
-And bade them speak to him: then prophet-like
-They hail'd him father to a line of kings:
-Upon my head they placed a fruitless crown,
-And put a barren sceptre in my gripe,
-Thence to be wrench'd with an unlineal hand,
-No son of mine succeeding. If 't be so,
-For Banquo's issue have I filed my mind;
-For them the gracious Duncan have I murder'd;
-Put rancours in the vessel of my peace
-Only for them; and mine eternal jewel
-Given to the common enemy of man,
-To make them kings, the seed of Banquo kings!
-Rather than so, come fate into the list.
-And champion me to the utterance! Who's there!
-

Re-enter Attendant, with two Murderers

-Now go to the door, and stay there till we call.
-

Exit Attendant

-Was it not yesterday we spoke together?
-
- -First Murderer -
-It was, so please your highness.
-
- -MACBETH -
-Well then, now
-Have you consider'd of my speeches? Know
-That it was he in the times past which held you
-So under fortune, which you thought had been
-Our innocent self: this I made good to you
-In our last conference, pass'd in probation with you,
-How you were borne in hand, how cross'd,
-the instruments,
-Who wrought with them, and all things else that might
-To half a soul and to a notion crazed
-Say 'Thus did Banquo.'
-
- -First Murderer -
-You made it known to us.
-
- -MACBETH -
-I did so, and went further, which is now
-Our point of second meeting. Do you find
-Your patience so predominant in your nature
-That you can let this go? Are you so gospell'd
-To pray for this good man and for his issue,
-Whose heavy hand hath bow'd you to the grave
-And beggar'd yours for ever?
-
- -First Murderer -
-We are men, my liege.
-
- -MACBETH -
-Ay, in the catalogue ye go for men;
-As hounds and greyhounds, mongrels, spaniels, curs,
-Shoughs, water-rugs and demi-wolves, are clept
-All by the name of dogs: the valued file
-Distinguishes the swift, the slow, the subtle,
-The housekeeper, the hunter, every one
-According to the gift which bounteous nature
-Hath in him closed; whereby he does receive
-Particular addition. from the bill
-That writes them all alike: and so of men.
-Now, if you have a station in the file,
-Not i' the worst rank of manhood, say 't;
-And I will put that business in your bosoms,
-Whose execution takes your enemy off,
-Grapples you to the heart and love of us,
-Who wear our health but sickly in his life,
-Which in his death were perfect.
-
- -Second Murderer -
-I am one, my liege,
-Whom the vile blows and buffets of the world
-Have so incensed that I am reckless what
-I do to spite the world.
-
- -First Murderer -
-And I another
-So weary with disasters, tugg'd with fortune,
-That I would set my lie on any chance,
-To mend it, or be rid on't.
-
- -MACBETH -
-Both of you
-Know Banquo was your enemy.
-
- -Both Murderers -
-True, my lord.
-
- -MACBETH -
-So is he mine; and in such bloody distance,
-That every minute of his being thrusts
-Against my near'st of life: and though I could
-With barefaced power sweep him from my sight
-And bid my will avouch it, yet I must not,
-For certain friends that are both his and mine,
-Whose loves I may not drop, but wail his fall
-Who I myself struck down; and thence it is,
-That I to your assistance do make love,
-Masking the business from the common eye
-For sundry weighty reasons.
-
- -Second Murderer -
-We shall, my lord,
-Perform what you command us.
-
- -First Murderer -
-Though our lives--
-
- -MACBETH -
-Your spirits shine through you. Within this hour at most
-I will advise you where to plant yourselves;
-Acquaint you with the perfect spy o' the time,
-The moment on't; for't must be done to-night,
-And something from the palace; always thought
-That I require a clearness: and with him--
-To leave no rubs nor botches in the work--
-Fleance his son, that keeps him company,
-Whose absence is no less material to me
-Than is his father's, must embrace the fate
-Of that dark hour. Resolve yourselves apart:
-I'll come to you anon.
-
- -Both Murderers -
-We are resolved, my lord.
-
- -MACBETH -
-I'll call upon you straight: abide within.
-

Exeunt Murderers

-It is concluded. Banquo, thy soul's flight,
-If it find heaven, must find it out to-night.
-

Exit

-
-

SCENE II. The palace.

-

-Enter LADY MACBETH and a Servant -
- -LADY MACBETH -
-Is Banquo gone from court?
-
- -Servant -
-Ay, madam, but returns again to-night.
-
- -LADY MACBETH -
-Say to the king, I would attend his leisure
-For a few words.
-
- -Servant -
- Madam, I will.
-

Exit

-
- -LADY MACBETH -
-Nought's had, all's spent,
-Where our desire is got without content:
-'Tis safer to be that which we destroy
-Than by destruction dwell in doubtful joy.
-

Enter MACBETH

-How now, my lord! why do you keep alone,
-Of sorriest fancies your companions making,
-Using those thoughts which should indeed have died
-With them they think on? Things without all remedy
-Should be without regard: what's done is done.
-
- -MACBETH -
-We have scotch'd the snake, not kill'd it:
-She'll close and be herself, whilst our poor malice
-Remains in danger of her former tooth.
-But let the frame of things disjoint, both the
-worlds suffer,
-Ere we will eat our meal in fear and sleep
-In the affliction of these terrible dreams
-That shake us nightly: better be with the dead,
-Whom we, to gain our peace, have sent to peace,
-Than on the torture of the mind to lie
-In restless ecstasy. Duncan is in his grave;
-After life's fitful fever he sleeps well;
-Treason has done his worst: nor steel, nor poison,
-Malice domestic, foreign levy, nothing,
-Can touch him further.
-
- -LADY MACBETH -
-Come on;
-Gentle my lord, sleek o'er your rugged looks;
-Be bright and jovial among your guests to-night.
-
- -MACBETH -
-So shall I, love; and so, I pray, be you:
-Let your remembrance apply to Banquo;
-Present him eminence, both with eye and tongue:
-Unsafe the while, that we
-Must lave our honours in these flattering streams,
-And make our faces vizards to our hearts,
-Disguising what they are.
-
- -LADY MACBETH -
-You must leave this.
-
- -MACBETH -
-O, full of scorpions is my mind, dear wife!
-Thou know'st that Banquo, and his Fleance, lives.
-
- -LADY MACBETH -
-But in them nature's copy's not eterne.
-
- -MACBETH -
-There's comfort yet; they are assailable;
-Then be thou jocund: ere the bat hath flown
-His cloister'd flight, ere to black Hecate's summons
-The shard-borne beetle with his drowsy hums
-Hath rung night's yawning peal, there shall be done
-A deed of dreadful note.
-
- -LADY MACBETH -
-What's to be done?
-
- -MACBETH -
-Be innocent of the knowledge, dearest chuck,
-Till thou applaud the deed. Come, seeling night,
-Scarf up the tender eye of pitiful day;
-And with thy bloody and invisible hand
-Cancel and tear to pieces that great bond
-Which keeps me pale! Light thickens; and the crow
-Makes wing to the rooky wood:
-Good things of day begin to droop and drowse;
-While night's black agents to their preys do rouse.
-Thou marvell'st at my words: but hold thee still;
-Things bad begun make strong themselves by ill.
-So, prithee, go with me.
-

Exeunt

-
-

SCENE III. A park near the palace.

-

-Enter three Murderers -
- -First Murderer -
-But who did bid thee join with us?
-
- -Third Murderer -
-Macbeth.
-
- -Second Murderer -
-He needs not our mistrust, since he delivers
-Our offices and what we have to do
-To the direction just.
-
- -First Murderer -
-Then stand with us.
-The west yet glimmers with some streaks of day:
-Now spurs the lated traveller apace
-To gain the timely inn; and near approaches
-The subject of our watch.
-
- -Third Murderer -
-Hark! I hear horses.
-
- -BANQUO -
-[Within] Give us a light there, ho!
-
- -Second Murderer -
-Then 'tis he: the rest
-That are within the note of expectation
-Already are i' the court.
-
- -First Murderer -
-His horses go about.
-
- -Third Murderer -
-Almost a mile: but he does usually,
-So all men do, from hence to the palace gate
-Make it their walk.
-
- -Second Murderer -
-A light, a light!
-

Enter BANQUO, and FLEANCE with a torch

-
- -Third Murderer -
-'Tis he.
-
- -First Murderer -
-Stand to't.
-
- -BANQUO -
-It will be rain to-night.
-
- -First Murderer -
-Let it come down.
-

They set upon BANQUO

-
- -BANQUO -
-O, treachery! Fly, good Fleance, fly, fly, fly!
-Thou mayst revenge. O slave!
-

Dies. FLEANCE escapes

-
- -Third Murderer -
-Who did strike out the light?
-
- -First Murderer -
-Wast not the way?
-
- -Third Murderer -
-There's but one down; the son is fled.
-
- -Second Murderer -
-We have lost
-Best half of our affair.
-
- -First Murderer -
-Well, let's away, and say how much is done.
-

Exeunt

-
-

SCENE IV. The same. Hall in the palace.

-

-A banquet prepared. Enter MACBETH, LADY MACBETH, ROSS, LENNOX, Lords, and Attendants -
- -MACBETH -
-You know your own degrees; sit down: at first
-And last the hearty welcome.
-
- -Lords -
-Thanks to your majesty.
-
- -MACBETH -
-Ourself will mingle with society,
-And play the humble host.
-Our hostess keeps her state, but in best time
-We will require her welcome.
-
- -LADY MACBETH -
-Pronounce it for me, sir, to all our friends;
-For my heart speaks they are welcome.
-

First Murderer appears at the door

-
- -MACBETH -
-See, they encounter thee with their hearts' thanks.
-Both sides are even: here I'll sit i' the midst:
-Be large in mirth; anon we'll drink a measure
-The table round.
-

Approaching the door

-There's blood on thy face.
-
- -First Murderer -
-'Tis Banquo's then.
-
- -MACBETH -
-'Tis better thee without than he within.
-Is he dispatch'd?
-
- -First Murderer -
-My lord, his throat is cut; that I did for him.
-
- -MACBETH -
-Thou art the best o' the cut-throats: yet he's good
-That did the like for Fleance: if thou didst it,
-Thou art the nonpareil.
-
- -First Murderer -
-Most royal sir,
-Fleance is 'scaped.
-
- -MACBETH -
-Then comes my fit again: I had else been perfect,
-Whole as the marble, founded as the rock,
-As broad and general as the casing air:
-But now I am cabin'd, cribb'd, confined, bound in
-To saucy doubts and fears. But Banquo's safe?
-
- -First Murderer -
-Ay, my good lord: safe in a ditch he bides,
-With twenty trenched gashes on his head;
-The least a death to nature.
-
- -MACBETH -
-Thanks for that:
-There the grown serpent lies; the worm that's fled
-Hath nature that in time will venom breed,
-No teeth for the present. Get thee gone: to-morrow
-We'll hear, ourselves, again.
-

Exit Murderer

-
- -LADY MACBETH -
-My royal lord,
-You do not give the cheer: the feast is sold
-That is not often vouch'd, while 'tis a-making,
-'Tis given with welcome: to feed were best at home;
-From thence the sauce to meat is ceremony;
-Meeting were bare without it.
-
- -MACBETH -
-Sweet remembrancer!
-Now, good digestion wait on appetite,
-And health on both!
-
- -LENNOX -
-May't please your highness sit.
-

The GHOST OF BANQUO enters, and sits in MACBETH's place

-
- -MACBETH -
-Here had we now our country's honour roof'd,
-Were the graced person of our Banquo present;
-Who may I rather challenge for unkindness
-Than pity for mischance!
-
- -ROSS -
-His absence, sir,
-Lays blame upon his promise. Please't your highness
-To grace us with your royal company.
-
- -MACBETH -
-The table's full.
-
- -LENNOX -
- Here is a place reserved, sir.
-
- -MACBETH -
-Where?
-
- -LENNOX -
-Here, my good lord. What is't that moves your highness?
-
- -MACBETH -
-Which of you have done this?
-
- -Lords -
-What, my good lord?
-
- -MACBETH -
-Thou canst not say I did it: never shake
-Thy gory locks at me.
-
- -ROSS -
-Gentlemen, rise: his highness is not well.
-
- -LADY MACBETH -
-Sit, worthy friends: my lord is often thus,
-And hath been from his youth: pray you, keep seat;
-The fit is momentary; upon a thought
-He will again be well: if much you note him,
-You shall offend him and extend his passion:
-Feed, and regard him not. Are you a man?
-
- -MACBETH -
-Ay, and a bold one, that dare look on that
-Which might appal the devil.
-
- -LADY MACBETH -
-O proper stuff!
-This is the very painting of your fear:
-This is the air-drawn dagger which, you said,
-Led you to Duncan. O, these flaws and starts,
-Impostors to true fear, would well become
-A woman's story at a winter's fire,
-Authorized by her grandam. Shame itself!
-Why do you make such faces? When all's done,
-You look but on a stool.
-
- -MACBETH -
-Prithee, see there! behold! look! lo!
-how say you?
-Why, what care I? If thou canst nod, speak too.
-If charnel-houses and our graves must send
-Those that we bury back, our monuments
-Shall be the maws of kites.
-

GHOST OF BANQUO vanishes

-
- -LADY MACBETH -
-What, quite unmann'd in folly?
-
- -MACBETH -
-If I stand here, I saw him.
-
- -LADY MACBETH -
-Fie, for shame!
-
- -MACBETH -
-Blood hath been shed ere now, i' the olden time,
-Ere human statute purged the gentle weal;
-Ay, and since too, murders have been perform'd
-Too terrible for the ear: the times have been,
-That, when the brains were out, the man would die,
-And there an end; but now they rise again,
-With twenty mortal murders on their crowns,
-And push us from our stools: this is more strange
-Than such a murder is.
-
- -LADY MACBETH -
-My worthy lord,
-Your noble friends do lack you.
-
- -MACBETH -
-I do forget.
-Do not muse at me, my most worthy friends,
-I have a strange infirmity, which is nothing
-To those that know me. Come, love and health to all;
-Then I'll sit down. Give me some wine; fill full.
-I drink to the general joy o' the whole table,
-And to our dear friend Banquo, whom we miss;
-Would he were here! to all, and him, we thirst,
-And all to all.
-
- -Lords -
- Our duties, and the pledge.
-

Re-enter GHOST OF BANQUO

-
- -MACBETH -
-Avaunt! and quit my sight! let the earth hide thee!
-Thy bones are marrowless, thy blood is cold;
-Thou hast no speculation in those eyes
-Which thou dost glare with!
-
- -LADY MACBETH -
-Think of this, good peers,
-But as a thing of custom: 'tis no other;
-Only it spoils the pleasure of the time.
-
- -MACBETH -
-What man dare, I dare:
-Approach thou like the rugged Russian bear,
-The arm'd rhinoceros, or the Hyrcan tiger;
-Take any shape but that, and my firm nerves
-Shall never tremble: or be alive again,
-And dare me to the desert with thy sword;
-If trembling I inhabit then, protest me
-The baby of a girl. Hence, horrible shadow!
-Unreal mockery, hence!
-

GHOST OF BANQUO vanishes

-Why, so: being gone,
-I am a man again. Pray you, sit still.
-
- -LADY MACBETH -
-You have displaced the mirth, broke the good meeting,
-With most admired disorder.
-
- -MACBETH -
-Can such things be,
-And overcome us like a summer's cloud,
-Without our special wonder? You make me strange
-Even to the disposition that I owe,
-When now I think you can behold such sights,
-And keep the natural ruby of your cheeks,
-When mine is blanched with fear.
-
- -ROSS -
-What sights, my lord?
-
- -LADY MACBETH -
-I pray you, speak not; he grows worse and worse;
-Question enrages him. At once, good night:
-Stand not upon the order of your going,
-But go at once.
-
- -LENNOX -
- Good night; and better health
-Attend his majesty!
-
- -LADY MACBETH -
-A kind good night to all!
-

Exeunt all but MACBETH and LADY MACBETH

-
- -MACBETH -
-It will have blood; they say, blood will have blood:
-Stones have been known to move and trees to speak;
-Augurs and understood relations have
-By magot-pies and choughs and rooks brought forth
-The secret'st man of blood. What is the night?
-
- -LADY MACBETH -
-Almost at odds with morning, which is which.
-
- -MACBETH -
-How say'st thou, that Macduff denies his person
-At our great bidding?
-
- -LADY MACBETH -
-Did you send to him, sir?
-
- -MACBETH -
-I hear it by the way; but I will send:
-There's not a one of them but in his house
-I keep a servant fee'd. I will to-morrow,
-And betimes I will, to the weird sisters:
-More shall they speak; for now I am bent to know,
-By the worst means, the worst. For mine own good,
-All causes shall give way: I am in blood
-Stepp'd in so far that, should I wade no more,
-Returning were as tedious as go o'er:
-Strange things I have in head, that will to hand;
-Which must be acted ere they may be scann'd.
-
- -LADY MACBETH -
-You lack the season of all natures, sleep.
-
- -MACBETH -
-Come, we'll to sleep. My strange and self-abuse
-Is the initiate fear that wants hard use:
-We are yet but young in deed.
-

Exeunt

-
-

SCENE V. A Heath.

-

-Thunder. Enter the three Witches meeting HECATE -
- -First Witch -
-Why, how now, Hecate! you look angerly.
-
- -HECATE -
-Have I not reason, beldams as you are,
-Saucy and overbold? How did you dare
-To trade and traffic with Macbeth
-In riddles and affairs of death;
-And I, the mistress of your charms,
-The close contriver of all harms,
-Was never call'd to bear my part,
-Or show the glory of our art?
-And, which is worse, all you have done
-Hath been but for a wayward son,
-Spiteful and wrathful, who, as others do,
-Loves for his own ends, not for you.
-But make amends now: get you gone,
-And at the pit of Acheron
-Meet me i' the morning: thither he
-Will come to know his destiny:
-Your vessels and your spells provide,
-Your charms and every thing beside.
-I am for the air; this night I'll spend
-Unto a dismal and a fatal end:
-Great business must be wrought ere noon:
-Upon the corner of the moon
-There hangs a vaporous drop profound;
-I'll catch it ere it come to ground:
-And that distill'd by magic sleights
-Shall raise such artificial sprites
-As by the strength of their illusion
-Shall draw him on to his confusion:
-He shall spurn fate, scorn death, and bear
-He hopes 'bove wisdom, grace and fear:
-And you all know, security
-Is mortals' chiefest enemy.
-

Music and a song within: 'Come away, come away,' & c

-Hark! I am call'd; my little spirit, see,
-Sits in a foggy cloud, and stays for me.
-

Exit

-
- -First Witch -
-Come, let's make haste; she'll soon be back again.
-

Exeunt

-
-

SCENE VI. Forres. The palace.

-

-Enter LENNOX and another Lord -
- -LENNOX -
-My former speeches have but hit your thoughts,
-Which can interpret further: only, I say,
-Things have been strangely borne. The
-gracious Duncan
-Was pitied of Macbeth: marry, he was dead:
-And the right-valiant Banquo walk'd too late;
-Whom, you may say, if't please you, Fleance kill'd,
-For Fleance fled: men must not walk too late.
-Who cannot want the thought how monstrous
-It was for Malcolm and for Donalbain
-To kill their gracious father? damned fact!
-How it did grieve Macbeth! did he not straight
-In pious rage the two delinquents tear,
-That were the slaves of drink and thralls of sleep?
-Was not that nobly done? Ay, and wisely too;
-For 'twould have anger'd any heart alive
-To hear the men deny't. So that, I say,
-He has borne all things well: and I do think
-That had he Duncan's sons under his key--
-As, an't please heaven, he shall not--they
-should find
-What 'twere to kill a father; so should Fleance.
-But, peace! for from broad words and 'cause he fail'd
-His presence at the tyrant's feast, I hear
-Macduff lives in disgrace: sir, can you tell
-Where he bestows himself?
-
- -Lord -
-The son of Duncan,
-From whom this tyrant holds the due of birth
-Lives in the English court, and is received
-Of the most pious Edward with such grace
-That the malevolence of fortune nothing
-Takes from his high respect: thither Macduff
-Is gone to pray the holy king, upon his aid
-To wake Northumberland and warlike Siward:
-That, by the help of these--with Him above
-To ratify the work--we may again
-Give to our tables meat, sleep to our nights,
-Free from our feasts and banquets bloody knives,
-Do faithful homage and receive free honours:
-All which we pine for now: and this report
-Hath so exasperate the king that he
-Prepares for some attempt of war.
-
- -LENNOX -
-Sent he to Macduff?
-
- -Lord -
-He did: and with an absolute 'Sir, not I,'
-The cloudy messenger turns me his back,
-And hums, as who should say 'You'll rue the time
-That clogs me with this answer.'
-
- -LENNOX -
-And that well might
-Advise him to a caution, to hold what distance
-His wisdom can provide. Some holy angel
-Fly to the court of England and unfold
-His message ere he come, that a swift blessing
-May soon return to this our suffering country
-Under a hand accursed!
-
- -Lord -
-I'll send my prayers with him.
-

Exeunt

-

-

ACT IV

-

SCENE I. A cavern. In the middle, a boiling cauldron.

-

-Thunder. Enter the three Witches -
- -First Witch -
-Thrice the brinded cat hath mew'd.
-
- -Second Witch -
-Thrice and once the hedge-pig whined.
-
- -Third Witch -
-Harpier cries 'Tis time, 'tis time.
-
- -First Witch -
-Round about the cauldron go;
-In the poison'd entrails throw.
-Toad, that under cold stone
-Days and nights has thirty-one
-Swelter'd venom sleeping got,
-Boil thou first i' the charmed pot.
-
- -ALL -
-Double, double toil and trouble;
-Fire burn, and cauldron bubble.
-
- -Second Witch -
-Fillet of a fenny snake,
-In the cauldron boil and bake;
-Eye of newt and toe of frog,
-Wool of bat and tongue of dog,
-Adder's fork and blind-worm's sting,
-Lizard's leg and owlet's wing,
-For a charm of powerful trouble,
-Like a hell-broth boil and bubble.
-
- -ALL -
-Double, double toil and trouble;
-Fire burn and cauldron bubble.
-
- -Third Witch -
-Scale of dragon, tooth of wolf,
-Witches' mummy, maw and gulf
-Of the ravin'd salt-sea shark,
-Root of hemlock digg'd i' the dark,
-Liver of blaspheming Jew,
-Gall of goat, and slips of yew
-Silver'd in the moon's eclipse,
-Nose of Turk and Tartar's lips,
-Finger of birth-strangled babe
-Ditch-deliver'd by a drab,
-Make the gruel thick and slab:
-Add thereto a tiger's chaudron,
-For the ingredients of our cauldron.
-
- -ALL -
-Double, double toil and trouble;
-Fire burn and cauldron bubble.
-
- -Second Witch -
-Cool it with a baboon's blood,
-Then the charm is firm and good.
-

Enter HECATE to the other three Witches

-
- -HECATE -
-O well done! I commend your pains;
-And every one shall share i' the gains;
-And now about the cauldron sing,
-Live elves and fairies in a ring,
-Enchanting all that you put in.
-

Music and a song: 'Black spirits,' & c

-

HECATE retires

-
- -Second Witch -
-By the pricking of my thumbs,
-Something wicked this way comes.
-Open, locks,
-Whoever knocks!
-

Enter MACBETH

-
- -MACBETH -
-How now, you secret, black, and midnight hags!
-What is't you do?
-
- -ALL -
- A deed without a name.
-
- -MACBETH -
-I conjure you, by that which you profess,
-Howe'er you come to know it, answer me:
-Though you untie the winds and let them fight
-Against the churches; though the yesty waves
-Confound and swallow navigation up;
-Though bladed corn be lodged and trees blown down;
-Though castles topple on their warders' heads;
-Though palaces and pyramids do slope
-Their heads to their foundations; though the treasure
-Of nature's germens tumble all together,
-Even till destruction sicken; answer me
-To what I ask you.
-
- -First Witch -
- Speak.
-
- -Second Witch -
-Demand.
-
- -Third Witch -
-We'll answer.
-
- -First Witch -
-Say, if thou'dst rather hear it from our mouths,
-Or from our masters?
-
- -MACBETH -
-Call 'em; let me see 'em.
-
- -First Witch -
-Pour in sow's blood, that hath eaten
-Her nine farrow; grease that's sweaten
-From the murderer's gibbet throw
-Into the flame.
-
- -ALL -
- Come, high or low;
-Thyself and office deftly show!
-

Thunder. First Apparition: an armed Head

-
- -MACBETH -
-Tell me, thou unknown power,--
-
- -First Witch -
-He knows thy thought:
-Hear his speech, but say thou nought.
-
- -First Apparition -
-Macbeth! Macbeth! Macbeth! beware Macduff;
-Beware the thane of Fife. Dismiss me. Enough.
-

Descends

-
- -MACBETH -
-Whate'er thou art, for thy good caution, thanks;
-Thou hast harp'd my fear aright: but one
-word more,--
-
- -First Witch -
-He will not be commanded: here's another,
-More potent than the first.
-

Thunder. Second Apparition: A bloody Child

-
- -Second Apparition -
-Macbeth! Macbeth! Macbeth!
-
- -MACBETH -
-Had I three ears, I'ld hear thee.
-
- -Second Apparition -
-Be bloody, bold, and resolute; laugh to scorn
-The power of man, for none of woman born
-Shall harm Macbeth.
-

Descends

-
- -MACBETH -
-Then live, Macduff: what need I fear of thee?
-But yet I'll make assurance double sure,
-And take a bond of fate: thou shalt not live;
-That I may tell pale-hearted fear it lies,
-And sleep in spite of thunder.
-

Thunder. Third Apparition: a Child crowned, with a tree in his hand

-What is this
-That rises like the issue of a king,
-And wears upon his baby-brow the round
-And top of sovereignty?
-
- -ALL -
-Listen, but speak not to't.
-
- -Third Apparition -
-Be lion-mettled, proud; and take no care
-Who chafes, who frets, or where conspirers are:
-Macbeth shall never vanquish'd be until
-Great Birnam wood to high Dunsinane hill
-Shall come against him.
-

Descends

-
- -MACBETH -
-That will never be
-Who can impress the forest, bid the tree
-Unfix his earth-bound root? Sweet bodements! good!
-Rebellion's head, rise never till the wood
-Of Birnam rise, and our high-placed Macbeth
-Shall live the lease of nature, pay his breath
-To time and mortal custom. Yet my heart
-Throbs to know one thing: tell me, if your art
-Can tell so much: shall Banquo's issue ever
-Reign in this kingdom?
-
- -ALL -
-Seek to know no more.
-
- -MACBETH -
-I will be satisfied: deny me this,
-And an eternal curse fall on you! Let me know.
-Why sinks that cauldron? and what noise is this?
-

Hautboys

-
- -First Witch -
-Show!
-
- -Second Witch -
-Show!
-
- -Third Witch -
-Show!
-
- -ALL -
-Show his eyes, and grieve his heart;
-Come like shadows, so depart!
-

A show of Eight Kings, the last with a glass in his hand; GHOST OF BANQUO following

-
- -MACBETH -
-Thou art too like the spirit of Banquo: down!
-Thy crown does sear mine eye-balls. And thy hair,
-Thou other gold-bound brow, is like the first.
-A third is like the former. Filthy hags!
-Why do you show me this? A fourth! Start, eyes!
-What, will the line stretch out to the crack of doom?
-Another yet! A seventh! I'll see no more:
-And yet the eighth appears, who bears a glass
-Which shows me many more; and some I see
-That two-fold balls and treble scepters carry:
-Horrible sight! Now, I see, 'tis true;
-For the blood-bolter'd Banquo smiles upon me,
-And points at them for his.
-

Apparitions vanish

-What, is this so?
-
- -First Witch -
-Ay, sir, all this is so: but why
-Stands Macbeth thus amazedly?
-Come, sisters, cheer we up his sprites,
-And show the best of our delights:
-I'll charm the air to give a sound,
-While you perform your antic round:
-That this great king may kindly say,
-Our duties did his welcome pay.
-

Music. The witches dance and then vanish, with HECATE

-
- -MACBETH -
-Where are they? Gone? Let this pernicious hour
-Stand aye accursed in the calendar!
-Come in, without there!
-

Enter LENNOX

-
- -LENNOX -
-What's your grace's will?
-
- -MACBETH -
-Saw you the weird sisters?
-
- -LENNOX -
-No, my lord.
-
- -MACBETH -
-Came they not by you?
-
- -LENNOX -
-No, indeed, my lord.
-
- -MACBETH -
-Infected be the air whereon they ride;
-And damn'd all those that trust them! I did hear
-The galloping of horse: who was't came by?
-
- -LENNOX -
-'Tis two or three, my lord, that bring you word
-Macduff is fled to England.
-
- -MACBETH -
-Fled to England!
-
- -LENNOX -
-Ay, my good lord.
-
- -MACBETH -
-Time, thou anticipatest my dread exploits:
-The flighty purpose never is o'ertook
-Unless the deed go with it; from this moment
-The very firstlings of my heart shall be
-The firstlings of my hand. And even now,
-To crown my thoughts with acts, be it thought and done:
-The castle of Macduff I will surprise;
-Seize upon Fife; give to the edge o' the sword
-His wife, his babes, and all unfortunate souls
-That trace him in his line. No boasting like a fool;
-This deed I'll do before this purpose cool.
-But no more sights!--Where are these gentlemen?
-Come, bring me where they are.
-

Exeunt

-
-

SCENE II. Fife. Macduff's castle.

-

-Enter LADY MACDUFF, her Son, and ROSS -
- -LADY MACDUFF -
-What had he done, to make him fly the land?
-
- -ROSS -
-You must have patience, madam.
-
- -LADY MACDUFF -
-He had none:
-His flight was madness: when our actions do not,
-Our fears do make us traitors.
-
- -ROSS -
-You know not
-Whether it was his wisdom or his fear.
-
- -LADY MACDUFF -
-Wisdom! to leave his wife, to leave his babes,
-His mansion and his titles in a place
-From whence himself does fly? He loves us not;
-He wants the natural touch: for the poor wren,
-The most diminutive of birds, will fight,
-Her young ones in her nest, against the owl.
-All is the fear and nothing is the love;
-As little is the wisdom, where the flight
-So runs against all reason.
-
- -ROSS -
-My dearest coz,
-I pray you, school yourself: but for your husband,
-He is noble, wise, judicious, and best knows
-The fits o' the season. I dare not speak
-much further;
-But cruel are the times, when we are traitors
-And do not know ourselves, when we hold rumour
-From what we fear, yet know not what we fear,
-But float upon a wild and violent sea
-Each way and move. I take my leave of you:
-Shall not be long but I'll be here again:
-Things at the worst will cease, or else climb upward
-To what they were before. My pretty cousin,
-Blessing upon you!
-
- -LADY MACDUFF -
-Father'd he is, and yet he's fatherless.
-
- -ROSS -
-I am so much a fool, should I stay longer,
-It would be my disgrace and your discomfort:
-I take my leave at once.
-

Exit

-
- -LADY MACDUFF -
-Sirrah, your father's dead;
-And what will you do now? How will you live?
-
- -Son -
-As birds do, mother.
-
- -LADY MACDUFF -
-What, with worms and flies?
-
- -Son -
-With what I get, I mean; and so do they.
-
- -LADY MACDUFF -
-Poor bird! thou'ldst never fear the net nor lime,
-The pitfall nor the gin.
-
- -Son -
-Why should I, mother? Poor birds they are not set for.
-My father is not dead, for all your saying.
-
- -LADY MACDUFF -
-Yes, he is dead; how wilt thou do for a father?
-
- -Son -
-Nay, how will you do for a husband?
-
- -LADY MACDUFF -
-Why, I can buy me twenty at any market.
-
- -Son -
-Then you'll buy 'em to sell again.
-
- -LADY MACDUFF -
-Thou speak'st with all thy wit: and yet, i' faith,
-With wit enough for thee.
-
- -Son -
-Was my father a traitor, mother?
-
- -LADY MACDUFF -
-Ay, that he was.
-
- -Son -
-What is a traitor?
-
- -LADY MACDUFF -
-Why, one that swears and lies.
-
- -Son -
-And be all traitors that do so?
-
- -LADY MACDUFF -
-Every one that does so is a traitor, and must be hanged.
-
- -Son -
-And must they all be hanged that swear and lie?
-
- -LADY MACDUFF -
-Every one.
-
- -Son -
-Who must hang them?
-
- -LADY MACDUFF -
-Why, the honest men.
-
- -Son -
-Then the liars and swearers are fools,
-for there are liars and swearers enow to beat
-the honest men and hang up them.
-
- -LADY MACDUFF -
-Now, God help thee, poor monkey!
-But how wilt thou do for a father?
-
- -Son -
-If he were dead, you'ld weep for
-him: if you would not, it were a good sign
-that I should quickly have a new father.
-
- -LADY MACDUFF -
-Poor prattler, how thou talk'st!
-

Enter a Messenger

-
- -Messenger -
-Bless you, fair dame! I am not to you known,
-Though in your state of honour I am perfect.
-I doubt some danger does approach you nearly:
-If you will take a homely man's advice,
-Be not found here; hence, with your little ones.
-To fright you thus, methinks, I am too savage;
-To do worse to you were fell cruelty,
-Which is too nigh your person. Heaven preserve you!
-I dare abide no longer.
-

Exit

-
- -LADY MACDUFF -
-Whither should I fly?
-I have done no harm. But I remember now
-I am in this earthly world; where to do harm
-Is often laudable, to do good sometime
-Accounted dangerous folly: why then, alas,
-Do I put up that womanly defence,
-To say I have done no harm?
-

Enter Murderers

-What are these faces?
-
- -First Murderer -
-Where is your husband?
-
- -LADY MACDUFF -
-I hope, in no place so unsanctified
-Where such as thou mayst find him.
-
- -First Murderer -
-He's a traitor.
-
- -Son -
-Thou liest, thou shag-hair'd villain!
-
- -First Murderer -
-What, you egg!
-

Stabbing him

-Young fry of treachery!
-
- -Son -
-He has kill'd me, mother:
-Run away, I pray you!
-

Dies

-

Exit LADY MACDUFF, crying 'Murder!' Exeunt Murderers, following her

-
-

SCENE III. England. Before the King's palace.

-

-Enter MALCOLM and MACDUFF -
- -MALCOLM -
-Let us seek out some desolate shade, and there
-Weep our sad bosoms empty.
-
- -MACDUFF -
-Let us rather
-Hold fast the mortal sword, and like good men
-Bestride our down-fall'n birthdom: each new morn
-New widows howl, new orphans cry, new sorrows
-Strike heaven on the face, that it resounds
-As if it felt with Scotland and yell'd out
-Like syllable of dolour.
-
- -MALCOLM -
-What I believe I'll wail,
-What know believe, and what I can redress,
-As I shall find the time to friend, I will.
-What you have spoke, it may be so perchance.
-This tyrant, whose sole name blisters our tongues,
-Was once thought honest: you have loved him well.
-He hath not touch'd you yet. I am young;
-but something
-You may deserve of him through me, and wisdom
-To offer up a weak poor innocent lamb
-To appease an angry god.
-
- -MACDUFF -
-I am not treacherous.
-
- -MALCOLM -
-But Macbeth is.
-A good and virtuous nature may recoil
-In an imperial charge. But I shall crave
-your pardon;
-That which you are my thoughts cannot transpose:
-Angels are bright still, though the brightest fell;
-Though all things foul would wear the brows of grace,
-Yet grace must still look so.
-
- -MACDUFF -
-I have lost my hopes.
-
- -MALCOLM -
-Perchance even there where I did find my doubts.
-Why in that rawness left you wife and child,
-Those precious motives, those strong knots of love,
-Without leave-taking? I pray you,
-Let not my jealousies be your dishonours,
-But mine own safeties. You may be rightly just,
-Whatever I shall think.
-
- -MACDUFF -
-Bleed, bleed, poor country!
-Great tyranny! lay thou thy basis sure,
-For goodness dare not cheque thee: wear thou
-thy wrongs;
-The title is affeer'd! Fare thee well, lord:
-I would not be the villain that thou think'st
-For the whole space that's in the tyrant's grasp,
-And the rich East to boot.
-
- -MALCOLM -
-Be not offended:
-I speak not as in absolute fear of you.
-I think our country sinks beneath the yoke;
-It weeps, it bleeds; and each new day a gash
-Is added to her wounds: I think withal
-There would be hands uplifted in my right;
-And here from gracious England have I offer
-Of goodly thousands: but, for all this,
-When I shall tread upon the tyrant's head,
-Or wear it on my sword, yet my poor country
-Shall have more vices than it had before,
-More suffer and more sundry ways than ever,
-By him that shall succeed.
-
- -MACDUFF -
-What should he be?
-
- -MALCOLM -
-It is myself I mean: in whom I know
-All the particulars of vice so grafted
-That, when they shall be open'd, black Macbeth
-Will seem as pure as snow, and the poor state
-Esteem him as a lamb, being compared
-With my confineless harms.
-
- -MACDUFF -
-Not in the legions
-Of horrid hell can come a devil more damn'd
-In evils to top Macbeth.
-
- -MALCOLM -
-I grant him bloody,
-Luxurious, avaricious, false, deceitful,
-Sudden, malicious, smacking of every sin
-That has a name: but there's no bottom, none,
-In my voluptuousness: your wives, your daughters,
-Your matrons and your maids, could not fill up
-The cistern of my lust, and my desire
-All continent impediments would o'erbear
-That did oppose my will: better Macbeth
-Than such an one to reign.
-
- -MACDUFF -
-Boundless intemperance
-In nature is a tyranny; it hath been
-The untimely emptying of the happy throne
-And fall of many kings. But fear not yet
-To take upon you what is yours: you may
-Convey your pleasures in a spacious plenty,
-And yet seem cold, the time you may so hoodwink.
-We have willing dames enough: there cannot be
-That vulture in you, to devour so many
-As will to greatness dedicate themselves,
-Finding it so inclined.
-
- -MALCOLM -
-With this there grows
-In my most ill-composed affection such
-A stanchless avarice that, were I king,
-I should cut off the nobles for their lands,
-Desire his jewels and this other's house:
-And my more-having would be as a sauce
-To make me hunger more; that I should forge
-Quarrels unjust against the good and loyal,
-Destroying them for wealth.
-
- -MACDUFF -
-This avarice
-Sticks deeper, grows with more pernicious root
-Than summer-seeming lust, and it hath been
-The sword of our slain kings: yet do not fear;
-Scotland hath foisons to fill up your will.
-Of your mere own: all these are portable,
-With other graces weigh'd.
-
- -MALCOLM -
-But I have none: the king-becoming graces,
-As justice, verity, temperance, stableness,
-Bounty, perseverance, mercy, lowliness,
-Devotion, patience, courage, fortitude,
-I have no relish of them, but abound
-In the division of each several crime,
-Acting it many ways. Nay, had I power, I should
-Pour the sweet milk of concord into hell,
-Uproar the universal peace, confound
-All unity on earth.
-
- -MACDUFF -
-O Scotland, Scotland!
-
- -MALCOLM -
-If such a one be fit to govern, speak:
-I am as I have spoken.
-
- -MACDUFF -
-Fit to govern!
-No, not to live. O nation miserable,
-With an untitled tyrant bloody-scepter'd,
-When shalt thou see thy wholesome days again,
-Since that the truest issue of thy throne
-By his own interdiction stands accursed,
-And does blaspheme his breed? Thy royal father
-Was a most sainted king: the queen that bore thee,
-Oftener upon her knees than on her feet,
-Died every day she lived. Fare thee well!
-These evils thou repeat'st upon thyself
-Have banish'd me from Scotland. O my breast,
-Thy hope ends here!
-
- -MALCOLM -
-Macduff, this noble passion,
-Child of integrity, hath from my soul
-Wiped the black scruples, reconciled my thoughts
-To thy good truth and honour. Devilish Macbeth
-By many of these trains hath sought to win me
-Into his power, and modest wisdom plucks me
-From over-credulous haste: but God above
-Deal between thee and me! for even now
-I put myself to thy direction, and
-Unspeak mine own detraction, here abjure
-The taints and blames I laid upon myself,
-For strangers to my nature. I am yet
-Unknown to woman, never was forsworn,
-Scarcely have coveted what was mine own,
-At no time broke my faith, would not betray
-The devil to his fellow and delight
-No less in truth than life: my first false speaking
-Was this upon myself: what I am truly,
-Is thine and my poor country's to command:
-Whither indeed, before thy here-approach,
-Old Siward, with ten thousand warlike men,
-Already at a point, was setting forth.
-Now we'll together; and the chance of goodness
-Be like our warranted quarrel! Why are you silent?
-
- -MACDUFF -
-Such welcome and unwelcome things at once
-'Tis hard to reconcile.
-

Enter a Doctor

-
- -MALCOLM -
-Well; more anon.--Comes the king forth, I pray you?
-
- -Doctor -
-Ay, sir; there are a crew of wretched souls
-That stay his cure: their malady convinces
-The great assay of art; but at his touch--
-Such sanctity hath heaven given his hand--
-They presently amend.
-
- -MALCOLM -
-I thank you, doctor.
-

Exit Doctor

-
- -MACDUFF -
-What's the disease he means?
-
- -MALCOLM -
-'Tis call'd the evil:
-A most miraculous work in this good king;
-Which often, since my here-remain in England,
-I have seen him do. How he solicits heaven,
-Himself best knows: but strangely-visited people,
-All swoln and ulcerous, pitiful to the eye,
-The mere despair of surgery, he cures,
-Hanging a golden stamp about their necks,
-Put on with holy prayers: and 'tis spoken,
-To the succeeding royalty he leaves
-The healing benediction. With this strange virtue,
-He hath a heavenly gift of prophecy,
-And sundry blessings hang about his throne,
-That speak him full of grace.
-

Enter ROSS

-
- -MACDUFF -
-See, who comes here?
-
- -MALCOLM -
-My countryman; but yet I know him not.
-
- -MACDUFF -
-My ever-gentle cousin, welcome hither.
-
- -MALCOLM -
-I know him now. Good God, betimes remove
-The means that makes us strangers!
-
- -ROSS -
-Sir, amen.
-
- -MACDUFF -
-Stands Scotland where it did?
-
- -ROSS -
-Alas, poor country!
-Almost afraid to know itself. It cannot
-Be call'd our mother, but our grave; where nothing,
-But who knows nothing, is once seen to smile;
-Where sighs and groans and shrieks that rend the air
-Are made, not mark'd; where violent sorrow seems
-A modern ecstasy; the dead man's knell
-Is there scarce ask'd for who; and good men's lives
-Expire before the flowers in their caps,
-Dying or ere they sicken.
-
- -MACDUFF -
-O, relation
-Too nice, and yet too true!
-
- -MALCOLM -
-What's the newest grief?
-
- -ROSS -
-That of an hour's age doth hiss the speaker:
-Each minute teems a new one.
-
- -MACDUFF -
-How does my wife?
-
- -ROSS -
-Why, well.
-
- -MACDUFF -
- And all my children?
-
- -ROSS -
-Well too.
-
- -MACDUFF -
-The tyrant has not batter'd at their peace?
-
- -ROSS -
-No; they were well at peace when I did leave 'em.
-
- -MACDUFF -
-But not a niggard of your speech: how goes't?
-
- -ROSS -
-When I came hither to transport the tidings,
-Which I have heavily borne, there ran a rumour
-Of many worthy fellows that were out;
-Which was to my belief witness'd the rather,
-For that I saw the tyrant's power a-foot:
-Now is the time of help; your eye in Scotland
-Would create soldiers, make our women fight,
-To doff their dire distresses.
-
- -MALCOLM -
-Be't their comfort
-We are coming thither: gracious England hath
-Lent us good Siward and ten thousand men;
-An older and a better soldier none
-That Christendom gives out.
-
- -ROSS -
-Would I could answer
-This comfort with the like! But I have words
-That would be howl'd out in the desert air,
-Where hearing should not latch them.
-
- -MACDUFF -
-What concern they?
-The general cause? or is it a fee-grief
-Due to some single breast?
-
- -ROSS -
-No mind that's honest
-But in it shares some woe; though the main part
-Pertains to you alone.
-
- -MACDUFF -
-If it be mine,
-Keep it not from me, quickly let me have it.
-
- -ROSS -
-Let not your ears despise my tongue for ever,
-Which shall possess them with the heaviest sound
-That ever yet they heard.
-
- -MACDUFF -
-Hum! I guess at it.
-
- -ROSS -
-Your castle is surprised; your wife and babes
-Savagely slaughter'd: to relate the manner,
-Were, on the quarry of these murder'd deer,
-To add the death of you.
-
- -MALCOLM -
-Merciful heaven!
-What, man! ne'er pull your hat upon your brows;
-Give sorrow words: the grief that does not speak
-Whispers the o'er-fraught heart and bids it break.
-
- -MACDUFF -
-My children too?
-
- -ROSS -
- Wife, children, servants, all
-That could be found.
-
- -MACDUFF -
-And I must be from thence!
-My wife kill'd too?
-
- -ROSS -
-I have said.
-
- -MALCOLM -
-Be comforted:
-Let's make us medicines of our great revenge,
-To cure this deadly grief.
-
- -MACDUFF -
-He has no children. All my pretty ones?
-Did you say all? O hell-kite! All?
-What, all my pretty chickens and their dam
-At one fell swoop?
-
- -MALCOLM -
-Dispute it like a man.
-
- -MACDUFF -
-I shall do so;
-But I must also feel it as a man:
-I cannot but remember such things were,
-That were most precious to me. Did heaven look on,
-And would not take their part? Sinful Macduff,
-They were all struck for thee! naught that I am,
-Not for their own demerits, but for mine,
-Fell slaughter on their souls. Heaven rest them now!
-
- -MALCOLM -
-Be this the whetstone of your sword: let grief
-Convert to anger; blunt not the heart, enrage it.
-
- -MACDUFF -
-O, I could play the woman with mine eyes
-And braggart with my tongue! But, gentle heavens,
-Cut short all intermission; front to front
-Bring thou this fiend of Scotland and myself;
-Within my sword's length set him; if he 'scape,
-Heaven forgive him too!
-
- -MALCOLM -
-This tune goes manly.
-Come, go we to the king; our power is ready;
-Our lack is nothing but our leave; Macbeth
-Is ripe for shaking, and the powers above
-Put on their instruments. Receive what cheer you may:
-The night is long that never finds the day.
-

Exeunt

-

-

ACT V

-

SCENE I. Dunsinane. Ante-room in the castle.

-

-Enter a Doctor of Physic and a Waiting-Gentlewoman -
- -Doctor -
-I have two nights watched with you, but can perceive
-no truth in your report. When was it she last walked?
-
- -Gentlewoman -
-Since his majesty went into the field, I have seen
-her rise from her bed, throw her night-gown upon
-her, unlock her closet, take forth paper, fold it,
-write upon't, read it, afterwards seal it, and again
-return to bed; yet all this while in a most fast sleep.
-
- -Doctor -
-A great perturbation in nature, to receive at once
-the benefit of sleep, and do the effects of
-watching! In this slumbery agitation, besides her
-walking and other actual performances, what, at any
-time, have you heard her say?
-
- -Gentlewoman -
-That, sir, which I will not report after her.
-
- -Doctor -
-You may to me: and 'tis most meet you should.
-
- -Gentlewoman -
-Neither to you nor any one; having no witness to
-confirm my speech.
-

Enter LADY MACBETH, with a taper

-Lo you, here she comes! This is her very guise;
-and, upon my life, fast asleep. Observe her; stand close.
-
- -Doctor -
-How came she by that light?
-
- -Gentlewoman -
-Why, it stood by her: she has light by her
-continually; 'tis her command.
-
- -Doctor -
-You see, her eyes are open.
-
- -Gentlewoman -
-Ay, but their sense is shut.
-
- -Doctor -
-What is it she does now? Look, how she rubs her hands.
-
- -Gentlewoman -
-It is an accustomed action with her, to seem thus
-washing her hands: I have known her continue in
-this a quarter of an hour.
-
- -LADY MACBETH -
-Yet here's a spot.
-
- -Doctor -
-Hark! she speaks: I will set down what comes from
-her, to satisfy my remembrance the more strongly.
-
- -LADY MACBETH -
-Out, damned spot! out, I say!--One: two: why,
-then, 'tis time to do't.--Hell is murky!--Fie, my
-lord, fie! a soldier, and afeard? What need we
-fear who knows it, when none can call our power to
-account?--Yet who would have thought the old man
-to have had so much blood in him.
-
- -Doctor -
-Do you mark that?
-
- -LADY MACBETH -
-The thane of Fife had a wife: where is she now?--
-What, will these hands ne'er be clean?--No more o'
-that, my lord, no more o' that: you mar all with
-this starting.
-
- -Doctor -
-Go to, go to; you have known what you should not.
-
- -Gentlewoman -
-She has spoke what she should not, I am sure of
-that: heaven knows what she has known.
-
- -LADY MACBETH -
-Here's the smell of the blood still: all the
-perfumes of Arabia will not sweeten this little
-hand. Oh, oh, oh!
-
- -Doctor -
-What a sigh is there! The heart is sorely charged.
-
- -Gentlewoman -
-I would not have such a heart in my bosom for the
-dignity of the whole body.
-
- -Doctor -
-Well, well, well,--
-
- -Gentlewoman -
-Pray God it be, sir.
-
- -Doctor -
-This disease is beyond my practise: yet I have known
-those which have walked in their sleep who have died
-holily in their beds.
-
- -LADY MACBETH -
-Wash your hands, put on your nightgown; look not so
-pale.--I tell you yet again, Banquo's buried; he
-cannot come out on's grave.
-
- -Doctor -
-Even so?
-
- -LADY MACBETH -
-To bed, to bed! there's knocking at the gate:
-come, come, come, come, give me your hand. What's
-done cannot be undone.--To bed, to bed, to bed!
-

Exit

-
- -Doctor -
-Will she go now to bed?
-
- -Gentlewoman -
-Directly.
-
- -Doctor -
-Foul whisperings are abroad: unnatural deeds
-Do breed unnatural troubles: infected minds
-To their deaf pillows will discharge their secrets:
-More needs she the divine than the physician.
-God, God forgive us all! Look after her;
-Remove from her the means of all annoyance,
-And still keep eyes upon her. So, good night:
-My mind she has mated, and amazed my sight.
-I think, but dare not speak.
-
- -Gentlewoman -
-Good night, good doctor.
-

Exeunt

-
-

SCENE II. The country near Dunsinane.

-

-Drum and colours. Enter MENTEITH, CAITHNESS, ANGUS, LENNOX, and Soldiers -
- -MENTEITH -
-The English power is near, led on by Malcolm,
-His uncle Siward and the good Macduff:
-Revenges burn in them; for their dear causes
-Would to the bleeding and the grim alarm
-Excite the mortified man.
-
- -ANGUS -
-Near Birnam wood
-Shall we well meet them; that way are they coming.
-
- -CAITHNESS -
-Who knows if Donalbain be with his brother?
-
- -LENNOX -
-For certain, sir, he is not: I have a file
-Of all the gentry: there is Siward's son,
-And many unrough youths that even now
-Protest their first of manhood.
-
- -MENTEITH -
-What does the tyrant?
-
- -CAITHNESS -
-Great Dunsinane he strongly fortifies:
-Some say he's mad; others that lesser hate him
-Do call it valiant fury: but, for certain,
-He cannot buckle his distemper'd cause
-Within the belt of rule.
-
- -ANGUS -
-Now does he feel
-His secret murders sticking on his hands;
-Now minutely revolts upbraid his faith-breach;
-Those he commands move only in command,
-Nothing in love: now does he feel his title
-Hang loose about him, like a giant's robe
-Upon a dwarfish thief.
-
- -MENTEITH -
-Who then shall blame
-His pester'd senses to recoil and start,
-When all that is within him does condemn
-Itself for being there?
-
- -CAITHNESS -
-Well, march we on,
-To give obedience where 'tis truly owed:
-Meet we the medicine of the sickly weal,
-And with him pour we in our country's purge
-Each drop of us.
-
- -LENNOX -
- Or so much as it needs,
-To dew the sovereign flower and drown the weeds.
-Make we our march towards Birnam.
-

Exeunt, marching

-
-

SCENE III. Dunsinane. A room in the castle.

-

-Enter MACBETH, Doctor, and Attendants -
- -MACBETH -
-Bring me no more reports; let them fly all:
-Till Birnam wood remove to Dunsinane,
-I cannot taint with fear. What's the boy Malcolm?
-Was he not born of woman? The spirits that know
-All mortal consequences have pronounced me thus:
-'Fear not, Macbeth; no man that's born of woman
-Shall e'er have power upon thee.' Then fly,
-false thanes,
-And mingle with the English epicures:
-The mind I sway by and the heart I bear
-Shall never sag with doubt nor shake with fear.
-

Enter a Servant

-The devil damn thee black, thou cream-faced loon!
-Where got'st thou that goose look?
-
- -Servant -
-There is ten thousand--
-
- -MACBETH -
-Geese, villain!
-
- -Servant -
-Soldiers, sir.
-
- -MACBETH -
-Go prick thy face, and over-red thy fear,
-Thou lily-liver'd boy. What soldiers, patch?
-Death of thy soul! those linen cheeks of thine
-Are counsellors to fear. What soldiers, whey-face?
-
- -Servant -
-The English force, so please you.
-
- -MACBETH -
-Take thy face hence.
-

Exit Servant

-Seyton!--I am sick at heart,
-When I behold--Seyton, I say!--This push
-Will cheer me ever, or disseat me now.
-I have lived long enough: my way of life
-Is fall'n into the sear, the yellow leaf;
-And that which should accompany old age,
-As honour, love, obedience, troops of friends,
-I must not look to have; but, in their stead,
-Curses, not loud but deep, mouth-honour, breath,
-Which the poor heart would fain deny, and dare not. Seyton!
-

Enter SEYTON

-
- -SEYTON -
-What is your gracious pleasure?
-
- -MACBETH -
-What news more?
-
- -SEYTON -
-All is confirm'd, my lord, which was reported.
-
- -MACBETH -
-I'll fight till from my bones my flesh be hack'd.
-Give me my armour.
-
- -SEYTON -
-'Tis not needed yet.
-
- -MACBETH -
-I'll put it on.
-Send out more horses; skirr the country round;
-Hang those that talk of fear. Give me mine armour.
-How does your patient, doctor?
-
- -Doctor -
-Not so sick, my lord,
-As she is troubled with thick coming fancies,
-That keep her from her rest.
-
- -MACBETH -
-Cure her of that.
-Canst thou not minister to a mind diseased,
-Pluck from the memory a rooted sorrow,
-Raze out the written troubles of the brain
-And with some sweet oblivious antidote
-Cleanse the stuff'd bosom of that perilous stuff
-Which weighs upon the heart?
-
- -Doctor -
-Therein the patient
-Must minister to himself.
-
- -MACBETH -
-Throw physic to the dogs; I'll none of it.
-Come, put mine armour on; give me my staff.
-Seyton, send out. Doctor, the thanes fly from me.
-Come, sir, dispatch. If thou couldst, doctor, cast
-The water of my land, find her disease,
-And purge it to a sound and pristine health,
-I would applaud thee to the very echo,
-That should applaud again.--Pull't off, I say.--
-What rhubarb, cyme, or what purgative drug,
-Would scour these English hence? Hear'st thou of them?
-
- -Doctor -
-Ay, my good lord; your royal preparation
-Makes us hear something.
-
- -MACBETH -
-Bring it after me.
-I will not be afraid of death and bane,
-Till Birnam forest come to Dunsinane.
-
- -Doctor -
-[Aside] Were I from Dunsinane away and clear,
-Profit again should hardly draw me here.
-

Exeunt

-
-

SCENE IV. Country near Birnam wood.

-

-Drum and colours. Enter MALCOLM, SIWARD and YOUNG SIWARD, MACDUFF, MENTEITH, CAITHNESS, ANGUS, LENNOX, ROSS, and Soldiers, marching -
- -MALCOLM -
-Cousins, I hope the days are near at hand
-That chambers will be safe.
-
- -MENTEITH -
-We doubt it nothing.
-
- -SIWARD -
-What wood is this before us?
-
- -MENTEITH -
-The wood of Birnam.
-
- -MALCOLM -
-Let every soldier hew him down a bough
-And bear't before him: thereby shall we shadow
-The numbers of our host and make discovery
-Err in report of us.
-
- -Soldiers -
-It shall be done.
-
- -SIWARD -
-We learn no other but the confident tyrant
-Keeps still in Dunsinane, and will endure
-Our setting down before 't.
-
- -MALCOLM -
-'Tis his main hope:
-For where there is advantage to be given,
-Both more and less have given him the revolt,
-And none serve with him but constrained things
-Whose hearts are absent too.
-
- -MACDUFF -
-Let our just censures
-Attend the true event, and put we on
-Industrious soldiership.
-
- -SIWARD -
-The time approaches
-That will with due decision make us know
-What we shall say we have and what we owe.
-Thoughts speculative their unsure hopes relate,
-But certain issue strokes must arbitrate:
-Towards which advance the war.
-

Exeunt, marching

-
-

SCENE V. Dunsinane. Within the castle.

-

-Enter MACBETH, SEYTON, and Soldiers, with drum and colours -
- -MACBETH -
-Hang out our banners on the outward walls;
-The cry is still 'They come:' our castle's strength
-Will laugh a siege to scorn: here let them lie
-Till famine and the ague eat them up:
-Were they not forced with those that should be ours,
-We might have met them dareful, beard to beard,
-And beat them backward home.
-

A cry of women within

-What is that noise?
-
- -SEYTON -
-It is the cry of women, my good lord.
-

Exit

-
- -MACBETH -
-I have almost forgot the taste of fears;
-The time has been, my senses would have cool'd
-To hear a night-shriek; and my fell of hair
-Would at a dismal treatise rouse and stir
-As life were in't: I have supp'd full with horrors;
-Direness, familiar to my slaughterous thoughts
-Cannot once start me.
-

Re-enter SEYTON

-Wherefore was that cry?
-
- -SEYTON -
-The queen, my lord, is dead.
-
- -MACBETH -
-She should have died hereafter;
-There would have been a time for such a word.
-To-morrow, and to-morrow, and to-morrow,
-Creeps in this petty pace from day to day
-To the last syllable of recorded time,
-And all our yesterdays have lighted fools
-The way to dusty death. Out, out, brief candle!
-Life's but a walking shadow, a poor player
-That struts and frets his hour upon the stage
-And then is heard no more: it is a tale
-Told by an idiot, full of sound and fury,
-Signifying nothing.
-

Enter a Messenger

-Thou comest to use thy tongue; thy story quickly.
-
- -Messenger -
-Gracious my lord,
-I should report that which I say I saw,
-But know not how to do it.
-
- -MACBETH -
-Well, say, sir.
-
- -Messenger -
-As I did stand my watch upon the hill,
-I look'd toward Birnam, and anon, methought,
-The wood began to move.
-
- -MACBETH -
-Liar and slave!
-
- -Messenger -
-Let me endure your wrath, if't be not so:
-Within this three mile may you see it coming;
-I say, a moving grove.
-
- -MACBETH -
-If thou speak'st false,
-Upon the next tree shalt thou hang alive,
-Till famine cling thee: if thy speech be sooth,
-I care not if thou dost for me as much.
-I pull in resolution, and begin
-To doubt the equivocation of the fiend
-That lies like truth: 'Fear not, till Birnam wood
-Do come to Dunsinane:' and now a wood
-Comes toward Dunsinane. Arm, arm, and out!
-If this which he avouches does appear,
-There is nor flying hence nor tarrying here.
-I gin to be aweary of the sun,
-And wish the estate o' the world were now undone.
-Ring the alarum-bell! Blow, wind! come, wrack!
-At least we'll die with harness on our back.
-

Exeunt

-
-

SCENE VI. Dunsinane. Before the castle.

-

-Drum and colours. Enter MALCOLM, SIWARD, MACDUFF, and their Army, with boughs -
- -MALCOLM -
-Now near enough: your leafy screens throw down.
-And show like those you are. You, worthy uncle,
-Shall, with my cousin, your right-noble son,
-Lead our first battle: worthy Macduff and we
-Shall take upon 's what else remains to do,
-According to our order.
-
- -SIWARD -
-Fare you well.
-Do we but find the tyrant's power to-night,
-Let us be beaten, if we cannot fight.
-
- -MACDUFF -
-Make all our trumpets speak; give them all breath,
-Those clamorous harbingers of blood and death.
-

Exeunt

-
-

SCENE VII. Another part of the field.

-

-Alarums. Enter MACBETH -
- -MACBETH -
-They have tied me to a stake; I cannot fly,
-But, bear-like, I must fight the course. What's he
-That was not born of woman? Such a one
-Am I to fear, or none.
-

Enter YOUNG SIWARD

-
- -YOUNG SIWARD -
-What is thy name?
-
- -MACBETH -
- Thou'lt be afraid to hear it.
-
- -YOUNG SIWARD -
-No; though thou call'st thyself a hotter name
-Than any is in hell.
-
- -MACBETH -
-My name's Macbeth.
-
- -YOUNG SIWARD -
-The devil himself could not pronounce a title
-More hateful to mine ear.
-
- -MACBETH -
-No, nor more fearful.
-
- -YOUNG SIWARD -
-Thou liest, abhorred tyrant; with my sword
-I'll prove the lie thou speak'st.
-

They fight and YOUNG SIWARD is slain

-
- -MACBETH -
-Thou wast born of woman
-But swords I smile at, weapons laugh to scorn,
-Brandish'd by man that's of a woman born.
-

Exit

-

Alarums. Enter MACDUFF

-
- -MACDUFF -
-That way the noise is. Tyrant, show thy face!
-If thou be'st slain and with no stroke of mine,
-My wife and children's ghosts will haunt me still.
-I cannot strike at wretched kerns, whose arms
-Are hired to bear their staves: either thou, Macbeth,
-Or else my sword with an unbatter'd edge
-I sheathe again undeeded. There thou shouldst be;
-By this great clatter, one of greatest note
-Seems bruited. Let me find him, fortune!
-And more I beg not.
-

Exit. Alarums

-

Enter MALCOLM and SIWARD

-
- -SIWARD -
-This way, my lord; the castle's gently render'd:
-The tyrant's people on both sides do fight;
-The noble thanes do bravely in the war;
-The day almost itself professes yours,
-And little is to do.
-
- -MALCOLM -
-We have met with foes
-That strike beside us.
-
- -SIWARD -
-Enter, sir, the castle.
-

Exeunt. Alarums

-
-

SCENE VIII. Another part of the field.

-

-Enter MACBETH -
- -MACBETH -
-Why should I play the Roman fool, and die
-On mine own sword? whiles I see lives, the gashes
-Do better upon them.
-

Enter MACDUFF

-
- -MACDUFF -
-Turn, hell-hound, turn!
-
- -MACBETH -
-Of all men else I have avoided thee:
-But get thee back; my soul is too much charged
-With blood of thine already.
-
- -MACDUFF -
-I have no words:
-My voice is in my sword: thou bloodier villain
-Than terms can give thee out!
-

They fight

-
- -MACBETH -
-Thou losest labour:
-As easy mayst thou the intrenchant air
-With thy keen sword impress as make me bleed:
-Let fall thy blade on vulnerable crests;
-I bear a charmed life, which must not yield,
-To one of woman born.
-
- -MACDUFF -
-Despair thy charm;
-And let the angel whom thou still hast served
-Tell thee, Macduff was from his mother's womb
-Untimely ripp'd.
-
- -MACBETH -
-Accursed be that tongue that tells me so,
-For it hath cow'd my better part of man!
-And be these juggling fiends no more believed,
-That palter with us in a double sense;
-That keep the word of promise to our ear,
-And break it to our hope. I'll not fight with thee.
-
- -MACDUFF -
-Then yield thee, coward,
-And live to be the show and gaze o' the time:
-We'll have thee, as our rarer monsters are,
-Painted on a pole, and underwrit,
-'Here may you see the tyrant.'
-
- -MACBETH -
-I will not yield,
-To kiss the ground before young Malcolm's feet,
-And to be baited with the rabble's curse.
-Though Birnam wood be come to Dunsinane,
-And thou opposed, being of no woman born,
-Yet I will try the last. Before my body
-I throw my warlike shield. Lay on, Macduff,
-And damn'd be him that first cries, 'Hold, enough!'
-

Exeunt, fighting. Alarums

-

Retreat. Flourish. Enter, with drum and colours, MALCOLM, SIWARD, ROSS, the other Thanes, and Soldiers

-
- -MALCOLM -
-I would the friends we miss were safe arrived.
-
- -SIWARD -
-Some must go off: and yet, by these I see,
-So great a day as this is cheaply bought.
-
- -MALCOLM -
-Macduff is missing, and your noble son.
-
- -ROSS -
-Your son, my lord, has paid a soldier's debt:
-He only lived but till he was a man;
-The which no sooner had his prowess confirm'd
-In the unshrinking station where he fought,
-But like a man he died.
-
- -SIWARD -
-Then he is dead?
-
- -ROSS -
-Ay, and brought off the field: your cause of sorrow
-Must not be measured by his worth, for then
-It hath no end.
-
- -SIWARD -
- Had he his hurts before?
-
- -ROSS -
-Ay, on the front.
-
- -SIWARD -
- Why then, God's soldier be he!
-Had I as many sons as I have hairs,
-I would not wish them to a fairer death:
-And so, his knell is knoll'd.
-
- -MALCOLM -
-He's worth more sorrow,
-And that I'll spend for him.
-
- -SIWARD -
-He's worth no more
-They say he parted well, and paid his score:
-And so, God be with him! Here comes newer comfort.
-

Re-enter MACDUFF, with MACBETH's head

-
- -MACDUFF -
-Hail, king! for so thou art: behold, where stands
-The usurper's cursed head: the time is free:
-I see thee compass'd with thy kingdom's pearl,
-That speak my salutation in their minds;
-Whose voices I desire aloud with mine:
-Hail, King of Scotland!
-
- -ALL -
-Hail, King of Scotland!
-

Flourish

-
- -MALCOLM -
-We shall not spend a large expense of time
-Before we reckon with your several loves,
-And make us even with you. My thanes and kinsmen,
-Henceforth be earls, the first that ever Scotland
-In such an honour named. What's more to do,
-Which would be planted newly with the time,
-As calling home our exiled friends abroad
-That fled the snares of watchful tyranny;
-Producing forth the cruel ministers
-Of this dead butcher and his fiend-like queen,
-Who, as 'tis thought, by self and violent hands
-Took off her life; this, and what needful else
-That calls upon us, by the grace of Grace,
-We will perform in measure, time and place:
-So, thanks to all at once and to each one,
-Whom we invite to see us crown'd at Scone.
-

Flourish. Exeunt

- - - diff --git a/test/ghostdriver-test/fixtures/common/map.png b/test/ghostdriver-test/fixtures/common/map.png deleted file mode 100644 index 763f562799..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/map.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/map_visibility.html b/test/ghostdriver-test/fixtures/common/map_visibility.html deleted file mode 100644 index 6cf5f763ea..0000000000 --- a/test/ghostdriver-test/fixtures/common/map_visibility.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Map test page - - -
- - diff --git a/test/ghostdriver-test/fixtures/common/markerTransparent.png b/test/ghostdriver-test/fixtures/common/markerTransparent.png deleted file mode 100644 index ed4e5e7f4d..0000000000 Binary files a/test/ghostdriver-test/fixtures/common/markerTransparent.png and /dev/null differ diff --git a/test/ghostdriver-test/fixtures/common/messages.html b/test/ghostdriver-test/fixtures/common/messages.html deleted file mode 100644 index 74f1a37f74..0000000000 --- a/test/ghostdriver-test/fixtures/common/messages.html +++ /dev/null @@ -1,15 +0,0 @@ - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/meta-redirect.html b/test/ghostdriver-test/fixtures/common/meta-redirect.html deleted file mode 100644 index 9d9c2f0cc9..0000000000 --- a/test/ghostdriver-test/fixtures/common/meta-redirect.html +++ /dev/null @@ -1,11 +0,0 @@ - - - Some test page - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/missedJsReference.html b/test/ghostdriver-test/fixtures/common/missedJsReference.html deleted file mode 100644 index 6167752765..0000000000 --- a/test/ghostdriver-test/fixtures/common/missedJsReference.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Example page - - -

This page contains a nested iframe. Execute some JS to locate a reference to an element in this - frame and return it. You should need to switch to that frame in order to use that element.

- - - diff --git a/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_1.html b/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_1.html deleted file mode 100644 index 4eff01acd6..0000000000 --- a/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_1.html +++ /dev/null @@ -1,21 +0,0 @@ - - -First Modal - - - - -

Modal dialog sample

- - - -lnk2 -
- -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_2.html b/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_2.html deleted file mode 100644 index cec3f3f14f..0000000000 --- a/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_2.html +++ /dev/null @@ -1,21 +0,0 @@ - - -Second Modal - - - - -

Modal dialog sample

- - - -lnk3 -
- -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_3.html b/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_3.html deleted file mode 100644 index 6c5eb7231e..0000000000 --- a/test/ghostdriver-test/fixtures/common/modal_dialogs/modal_3.html +++ /dev/null @@ -1,15 +0,0 @@ - - -Third Modal - - - - -

Modal dialog sample

- - -
- -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/modal_dialogs/modalindex.html b/test/ghostdriver-test/fixtures/common/modal_dialogs/modalindex.html deleted file mode 100644 index 0a1c4c9418..0000000000 --- a/test/ghostdriver-test/fixtures/common/modal_dialogs/modalindex.html +++ /dev/null @@ -1,21 +0,0 @@ - - -Main window - - - - -

Modal dialog sample

- - - -lnk1 -
- -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/mouseOver.html b/test/ghostdriver-test/fixtures/common/mouseOver.html deleted file mode 100644 index d4751bfdf7..0000000000 --- a/test/ghostdriver-test/fixtures/common/mouseOver.html +++ /dev/null @@ -1,17 +0,0 @@ - - -
-
-
- -
diff --git a/test/ghostdriver-test/fixtures/common/mousePositionTracker.html b/test/ghostdriver-test/fixtures/common/mousePositionTracker.html deleted file mode 100644 index 39a31cda4f..0000000000 --- a/test/ghostdriver-test/fixtures/common/mousePositionTracker.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - Div tracking mouse position. -
-
- Move mouse here. -
-

-0, 0 -

- - diff --git a/test/ghostdriver-test/fixtures/common/nestedElements.html b/test/ghostdriver-test/fixtures/common/nestedElements.html deleted file mode 100644 index cf00083cf3..0000000000 --- a/test/ghostdriver-test/fixtures/common/nestedElements.html +++ /dev/null @@ -1,155 +0,0 @@ - - -

outside

-

outside

-
-

inside

-
- - Here's a checkbox:
- - - -
- Here's a checkbox:
- - -
- -hello world - - - - - - -
- Here's a checkbox:
- -
- -
- Here's a checkbox:
- - -
- -hello world - - - - - - -
- Here's a checkbox:
- -
- -
- Here's a checkbox:
- - -
- -hello world - - - - - - -
- Here's a checkbox:
- -
- -
- Here's a checkbox:
- - -
- -hello world - - -Span with class of one -
- Find me - Also me - But not me -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/overflow-body.html b/test/ghostdriver-test/fixtures/common/overflow-body.html deleted file mode 100644 index 2d2264ce64..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow-body.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - The Visibility of Everyday Things - - - -

This image is copyright Simon Stewart and donated to the Selenium project for use in its test suites. -

-a nice beach - - - - - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_auto.html b/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_auto.html deleted file mode 100644 index cf8a647194..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_auto.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_hidden.html b/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_hidden.html deleted file mode 100644 index 96fd750a6b..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_hidden.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_scroll.html b/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_scroll.html deleted file mode 100644 index 6f1d90b6df..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_auto_y_scroll.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_auto.html b/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_auto.html deleted file mode 100644 index 24dd192830..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_auto.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_hidden.html b/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_hidden.html deleted file mode 100644 index cae566578f..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_hidden.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_scroll.html b/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_scroll.html deleted file mode 100644 index d4ffa3970f..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_hidden_y_scroll.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_auto.html b/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_auto.html deleted file mode 100644 index d425a2a8a5..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_auto.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_hidden.html b/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_hidden.html deleted file mode 100644 index 4a6ff595d3..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_hidden.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_scroll.html b/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_scroll.html deleted file mode 100644 index efa80742ad..0000000000 --- a/test/ghostdriver-test/fixtures/common/overflow/x_scroll_y_scroll.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - Page with overflow - - - -
- -
- Right clicked:
- Bottom clicked:
- Bottom-right clicked:
-
- - Click bottom -
- - diff --git a/test/ghostdriver-test/fixtures/common/pageWithOnBeforeUnloadMessage.html b/test/ghostdriver-test/fixtures/common/pageWithOnBeforeUnloadMessage.html deleted file mode 100644 index cb59707ed3..0000000000 --- a/test/ghostdriver-test/fixtures/common/pageWithOnBeforeUnloadMessage.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Page with OnBeforeUnload handler - - -

Page with onbeforeunload event handler. Click here to navigate to another page.

- - diff --git a/test/ghostdriver-test/fixtures/common/pageWithOnLoad.html b/test/ghostdriver-test/fixtures/common/pageWithOnLoad.html deleted file mode 100644 index 2c644ff959..0000000000 --- a/test/ghostdriver-test/fixtures/common/pageWithOnLoad.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -

Page with onload event handler

- - diff --git a/test/ghostdriver-test/fixtures/common/pageWithOnUnload.html b/test/ghostdriver-test/fixtures/common/pageWithOnUnload.html deleted file mode 100644 index 6070341e2f..0000000000 --- a/test/ghostdriver-test/fixtures/common/pageWithOnUnload.html +++ /dev/null @@ -1,6 +0,0 @@ - - - -

Page with onunload event handler

- - diff --git a/test/ghostdriver-test/fixtures/common/plain.txt b/test/ghostdriver-test/fixtures/common/plain.txt deleted file mode 100644 index 8318c86b35..0000000000 --- a/test/ghostdriver-test/fixtures/common/plain.txt +++ /dev/null @@ -1 +0,0 @@ -Test \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/proxy/page1.html b/test/ghostdriver-test/fixtures/common/proxy/page1.html deleted file mode 100644 index 1810f1cdfd..0000000000 --- a/test/ghostdriver-test/fixtures/common/proxy/page1.html +++ /dev/null @@ -1,20 +0,0 @@ - - - -Page 1 -

The next query param must be the URL for the next page to -link to. - diff --git a/test/ghostdriver-test/fixtures/common/proxy/page2.html b/test/ghostdriver-test/fixtures/common/proxy/page2.html deleted file mode 100644 index d826f1742b..0000000000 --- a/test/ghostdriver-test/fixtures/common/proxy/page2.html +++ /dev/null @@ -1,24 +0,0 @@ - - - -Page 2 -This page is a middle man for referrer tests. -This page will include a link to a "next" page if the next query -parameter, or the document.referrer is set. -

- diff --git a/test/ghostdriver-test/fixtures/common/proxy/page3.html b/test/ghostdriver-test/fixtures/common/proxy/page3.html deleted file mode 100644 index 27048f7294..0000000000 --- a/test/ghostdriver-test/fixtures/common/proxy/page3.html +++ /dev/null @@ -1,5 +0,0 @@ - - - -Page 3 -

diff --git a/test/ghostdriver-test/fixtures/common/readOnlyPage.html b/test/ghostdriver-test/fixtures/common/readOnlyPage.html deleted file mode 100644 index b3f0012b9e..0000000000 --- a/test/ghostdriver-test/fixtures/common/readOnlyPage.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - -

This is a contentEditable area
- - - diff --git a/test/ghostdriver-test/fixtures/common/rectangles.html b/test/ghostdriver-test/fixtures/common/rectangles.html deleted file mode 100644 index 8ba2339849..0000000000 --- a/test/ghostdriver-test/fixtures/common/rectangles.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - Rectangles - - - -
r1
-
r2
-
r3
- - diff --git a/test/ghostdriver-test/fixtures/common/resultPage.html b/test/ghostdriver-test/fixtures/common/resultPage.html deleted file mode 100644 index 94f3e246e0..0000000000 --- a/test/ghostdriver-test/fixtures/common/resultPage.html +++ /dev/null @@ -1,25 +0,0 @@ - - - We Arrive Here - - - -

Success!

- -
-

List of stuff

-
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
-
-
-

Almost empty

-
- - - - - diff --git a/test/ghostdriver-test/fixtures/common/rich_text.html b/test/ghostdriver-test/fixtures/common/rich_text.html deleted file mode 100644 index 8c9a073678..0000000000 --- a/test/ghostdriver-test/fixtures/common/rich_text.html +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - -
-
-
- - - - - -
-
IFRAME
- -
-
frame.contentWindow.document.designMode: on
frame.contentWindow.document.body.contentEditable: false
-
-
DIV
-
-
-
-
div.ownerDocument.designMode: off
div.ownerDocument.body.contentEditable: false
div.contentEditable: true
-
-
- -
-
- - - - - - - - - - - - - - - - - - -
type:[]
tagName:[]
id:[]
keyIdentifier:[]
keyLocation:[]
keyCode:[]
charCode:[]
which:[]
isTrusted:[]
---------------------
Modifiers
alt:[]
ctrl:[]
shift:[]
meta:[]
-
- - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/safari/frames_benchmark.html b/test/ghostdriver-test/fixtures/common/safari/frames_benchmark.html deleted file mode 100644 index 8a05925561..0000000000 --- a/test/ghostdriver-test/fixtures/common/safari/frames_benchmark.html +++ /dev/null @@ -1,31 +0,0 @@ - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen.css b/test/ghostdriver-test/fixtures/common/screen/screen.css deleted file mode 100644 index 815261850c..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen.css +++ /dev/null @@ -1,19 +0,0 @@ -* { - margin: 0; -} -html, body, #output { - width: 100%; - height: 100%; -} -table { - border: 0px; - border-collapse: collapse; - border-spacing: 0px; - display: table; -} -table td { - padding: 0px; -} -.cell { - color: black; -} diff --git a/test/ghostdriver-test/fixtures/common/screen/screen.html b/test/ghostdriver-test/fixtures/common/screen/screen.html deleted file mode 100644 index 166665da3d..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen.html +++ /dev/null @@ -1,72 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen.js b/test/ghostdriver-test/fixtures/common/screen/screen.js deleted file mode 100644 index 1d1685980f..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen.js +++ /dev/null @@ -1,7 +0,0 @@ -function toColor(num) { - num >>>= 0; - var b = num & 0xFF, - g = (num & 0xFF00) >>> 8, - r = (num & 0xFF0000) >>> 16; - return "rgb(" + [r, g, b].join(",") + ")"; -} \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_frame1.html b/test/ghostdriver-test/fixtures/common/screen/screen_frame1.html deleted file mode 100644 index d50c21dbf8..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_frame1.html +++ /dev/null @@ -1,72 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_frame2.html b/test/ghostdriver-test/fixtures/common/screen/screen_frame2.html deleted file mode 100644 index b66cd700ed..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_frame2.html +++ /dev/null @@ -1,72 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_frames.html b/test/ghostdriver-test/fixtures/common/screen/screen_frames.html deleted file mode 100644 index 46852dcf57..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_frames.html +++ /dev/null @@ -1,11 +0,0 @@ - - - screen test - - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_iframes.html b/test/ghostdriver-test/fixtures/common/screen/screen_iframes.html deleted file mode 100644 index ae3ea1e24b..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_iframes.html +++ /dev/null @@ -1,12 +0,0 @@ - - -Screen test - - -
- - - -
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_too_long.html b/test/ghostdriver-test/fixtures/common/screen/screen_too_long.html deleted file mode 100644 index 4d00f0270d..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_too_long.html +++ /dev/null @@ -1,68 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_x_long.html b/test/ghostdriver-test/fixtures/common/screen/screen_x_long.html deleted file mode 100644 index 1a6a1002fc..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_x_long.html +++ /dev/null @@ -1,72 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_x_too_long.html b/test/ghostdriver-test/fixtures/common/screen/screen_x_too_long.html deleted file mode 100644 index 3fee005d59..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_x_too_long.html +++ /dev/null @@ -1,72 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_y_long.html b/test/ghostdriver-test/fixtures/common/screen/screen_y_long.html deleted file mode 100644 index 31733e073f..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_y_long.html +++ /dev/null @@ -1,72 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/screen/screen_y_too_long.html b/test/ghostdriver-test/fixtures/common/screen/screen_y_too_long.html deleted file mode 100644 index dbef9361a4..0000000000 --- a/test/ghostdriver-test/fixtures/common/screen/screen_y_too_long.html +++ /dev/null @@ -1,72 +0,0 @@ - - -screen test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/scroll.html b/test/ghostdriver-test/fixtures/common/scroll.html deleted file mode 100644 index cd5214f15e..0000000000 --- a/test/ghostdriver-test/fixtures/common/scroll.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - -
-
    -
  • line1
  • -
  • line2
  • -
  • line3
  • -
  • line4
  • -
  • line5
  • -
  • line6
  • -
  • line7
  • -
  • line8
  • -
  • line9
  • -
-
-Clicked: -
- - diff --git a/test/ghostdriver-test/fixtures/common/scroll2.html b/test/ghostdriver-test/fixtures/common/scroll2.html deleted file mode 100644 index 0ea66d378c..0000000000 --- a/test/ghostdriver-test/fixtures/common/scroll2.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - -
    -
  • -
  • -
  • Text
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
- - diff --git a/test/ghostdriver-test/fixtures/common/scroll3.html b/test/ghostdriver-test/fixtures/common/scroll3.html deleted file mode 100644 index 1aa1709292..0000000000 --- a/test/ghostdriver-test/fixtures/common/scroll3.html +++ /dev/null @@ -1,8 +0,0 @@ - - -



























































































































































- -



- -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 -
























































































































































\ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/scroll4.html b/test/ghostdriver-test/fixtures/common/scroll4.html deleted file mode 100644 index 652a778eb7..0000000000 --- a/test/ghostdriver-test/fixtures/common/scroll4.html +++ /dev/null @@ -1,7 +0,0 @@ - - -


































































































- -


































































































- - diff --git a/test/ghostdriver-test/fixtures/common/scroll5.html b/test/ghostdriver-test/fixtures/common/scroll5.html deleted file mode 100644 index b345a8c3f7..0000000000 --- a/test/ghostdriver-test/fixtures/common/scroll5.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - -
-
-
-
-
-Clicked: -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_height_above_200.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_height_above_200.html deleted file mode 100644 index 3eb3bf47d5..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_height_above_200.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Child frame - - -

This is a scrolling frame test

-
- - - - - - - - - - - - - -
First row
Second row
Third row
Fourth row
-
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_height_above_2000.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_height_above_2000.html deleted file mode 100644 index 61ffe85da5..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_height_above_2000.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - Child frame - - -

This is a tall frame test

-
- - - - - - - - - - - - - -
First row
Second row
Third row
Fourth row
-
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_nested_scrolling_frame.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_nested_scrolling_frame.html deleted file mode 100644 index 1530138699..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_nested_scrolling_frame.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Welcome Page - - -
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html deleted file mode 100644 index 5781aeb9fa..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Welcome Page - - -
Placeholder
-
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_small_height.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_small_height.html deleted file mode 100644 index 047de0f183..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/frame_with_small_height.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Child frame - - -

This is a non-scrolling frame test

- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_double_overflow_auto.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_double_overflow_auto.html deleted file mode 100644 index 01b7c3058f..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_double_overflow_auto.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Page with overflow: auto - - - -
Placeholder
-
- Click me! -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_frame_out_of_view.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_frame_out_of_view.html deleted file mode 100644 index c536e41d73..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_frame_out_of_view.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Welcome Page - - -
Placeholder
-
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_nested_scrolling_frames.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_nested_scrolling_frames.html deleted file mode 100644 index e5b76022bb..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_nested_scrolling_frames.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Welcome Page - - -
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_nested_scrolling_frames_out_of_view.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_nested_scrolling_frames_out_of_view.html deleted file mode 100644 index f79f7c8486..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_nested_scrolling_frames_out_of_view.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Welcome Page - - -
Placeholder
-
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_non_scrolling_frame.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_non_scrolling_frame.html deleted file mode 100644 index 0a493fa5d0..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_non_scrolling_frame.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Welcome Page - - -
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_scrolling_frame.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_scrolling_frame.html deleted file mode 100644 index cb5d53a44b..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_scrolling_frame.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Welcome Page - - -
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_scrolling_frame_out_of_view.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_scrolling_frame_out_of_view.html deleted file mode 100644 index 5df1115c24..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_scrolling_frame_out_of_view.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Welcome Page - - -
Placeholder
-
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_tall_frame.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_tall_frame.html deleted file mode 100644 index b7cfaf5a3a..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_tall_frame.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - Welcome Page - - -
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_y_overflow_auto.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_y_overflow_auto.html deleted file mode 100644 index b5716e7312..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/page_with_y_overflow_auto.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Page with overflow: auto - - -
-
Placeholder
-
- Click me! -
-
- - diff --git a/test/ghostdriver-test/fixtures/common/scrolling_tests/target_page.html b/test/ghostdriver-test/fixtures/common/scrolling_tests/target_page.html deleted file mode 100644 index 0457a822f6..0000000000 --- a/test/ghostdriver-test/fixtures/common/scrolling_tests/target_page.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -Clicked Successfully! - - -

Clicked Successfully!

- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/selectPage.html b/test/ghostdriver-test/fixtures/common/selectPage.html deleted file mode 100644 index 1c785cede8..0000000000 --- a/test/ghostdriver-test/fixtures/common/selectPage.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - -Multiple Selection test page - - - - - - - - - - - - - - - diff --git a/test/ghostdriver-test/fixtures/common/selectableItems.html b/test/ghostdriver-test/fixtures/common/selectableItems.html deleted file mode 100644 index 190b2ada7c..0000000000 --- a/test/ghostdriver-test/fixtures/common/selectableItems.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - jQuery UI Selectable - Default functionality - - - - - - - - -
- -
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
  5. Item 3
  6. -
  7. Item 4
  8. -
  9. Item 5
  10. -
  11. Item 6
  12. -
  13. Item 7
  14. -
- -
- -
- -

Enable a DOM element (or group of elements) to be selectable. Draw a box with your cursor to select items. Hold down the Ctrl key to make multiple non-adjacent selections.

- - - -
-

no info

-
- - -
- - diff --git a/test/ghostdriver-test/fixtures/common/send_keys_visibility.html b/test/ghostdriver-test/fixtures/common/send_keys_visibility.html deleted file mode 100644 index 366cbe2364..0000000000 --- a/test/ghostdriver-test/fixtures/common/send_keys_visibility.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - An element that disappears on click - - - -
- - - - -
-
-

Log:

-

- - - diff --git a/test/ghostdriver-test/fixtures/common/sessionCookie.html b/test/ghostdriver-test/fixtures/common/sessionCookie.html deleted file mode 100644 index 0ada24ed3c..0000000000 --- a/test/ghostdriver-test/fixtures/common/sessionCookie.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - diff --git a/test/ghostdriver-test/fixtures/common/sessionCookieDest.html b/test/ghostdriver-test/fixtures/common/sessionCookieDest.html deleted file mode 100644 index f5e2ef2e4c..0000000000 --- a/test/ghostdriver-test/fixtures/common/sessionCookieDest.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Session cookie destination - - - -This is the cookie destination page. - - diff --git a/test/ghostdriver-test/fixtures/common/simple.xml b/test/ghostdriver-test/fixtures/common/simple.xml deleted file mode 100644 index 01f4c87ccd..0000000000 --- a/test/ghostdriver-test/fixtures/common/simple.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - baz - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/simpleTest.html b/test/ghostdriver-test/fixtures/common/simpleTest.html deleted file mode 100644 index 49bbc26932..0000000000 --- a/test/ghostdriver-test/fixtures/common/simpleTest.html +++ /dev/null @@ -1,97 +0,0 @@ - - - Hello WebDriver - - -

Heading

- -

A single line of text

- -
-

A div containing

- More than one line of text
- -
and block level elements
-
- -An inline element - -

This line has lots - - of spaces. -

- -

This line has a non-breaking space

- -

This line has a   non-breaking space and spaces

- -

These lines  
  have leading and trailing NBSPs  

- -

This line has text within elements that are meant to be displayed - inline

- -
-

before pre

-
   This section has a preformatted
-    text block    
-  split in four lines
-         
-

after pre

-
- -

Some text

Some more text

- -
Cheese

Some text

Some more text

and also

Brie
- -
Hello, world
- -
- -
- -
-

- - -

-
- - - - - -
Top level
-
-
Nested
-
- - - - - -
beforeSpace afterSpace
- - - - - -a link to an icon - -{a="b", c=1, d=true} -{a="\\b\\\"'\'"} - -            ​‌‍  ⁠ test            ​‌‍  ⁠  - - - diff --git a/test/ghostdriver-test/fixtures/common/slowLoadingAlert.html b/test/ghostdriver-test/fixtures/common/slowLoadingAlert.html deleted file mode 100644 index a6216e3752..0000000000 --- a/test/ghostdriver-test/fixtures/common/slowLoadingAlert.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -slowLoadingAlert - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/slowLoadingResourcePage.html b/test/ghostdriver-test/fixtures/common/slowLoadingResourcePage.html deleted file mode 100644 index e05f9546d9..0000000000 --- a/test/ghostdriver-test/fixtures/common/slowLoadingResourcePage.html +++ /dev/null @@ -1,12 +0,0 @@ - - - This page loads something slowly - - -

Simulate the situation where a web-bug or analytics script takes waaay - too long to respond. Normally these things are loaded in an iframe, which is - what we're doing here.

- - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/slow_loading_iframes.html b/test/ghostdriver-test/fixtures/common/slow_loading_iframes.html deleted file mode 100644 index d007248e2f..0000000000 --- a/test/ghostdriver-test/fixtures/common/slow_loading_iframes.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Page with slow loading iFrames - - - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/styledPage.html b/test/ghostdriver-test/fixtures/common/styledPage.html deleted file mode 100644 index 30810f0913..0000000000 --- a/test/ghostdriver-test/fixtures/common/styledPage.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - Styled Page - - - - -
- -
- - -
- -
- -
Content
- - - - - - diff --git a/test/ghostdriver-test/fixtures/common/svgPiechart.xhtml b/test/ghostdriver-test/fixtures/common/svgPiechart.xhtml deleted file mode 100644 index bf060fdeda..0000000000 --- a/test/ghostdriver-test/fixtures/common/svgPiechart.xhtml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Pie Chart Test - - - -
- Some text for the chart. -
-
Nothing.
-
- - - - - Test Chart - - - Apple - - Orange - - Banana - - Orange - - - - - - - - Example RotateScale - Rotate and scale transforms - - - - - - - - - - - - - - ABC (rotate) - - - - - - - - - - - - ABC (scale) - - - - -
WOrange
-
-
WOrange
- - diff --git a/test/ghostdriver-test/fixtures/common/svgTest.svg b/test/ghostdriver-test/fixtures/common/svgTest.svg deleted file mode 100644 index c6cc28390d..0000000000 --- a/test/ghostdriver-test/fixtures/common/svgTest.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/test/ghostdriver-test/fixtures/common/tables.html b/test/ghostdriver-test/fixtures/common/tables.html deleted file mode 100644 index a2bc957b88..0000000000 --- a/test/ghostdriver-test/fixtures/common/tables.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - Here be tables - - - - - - - - - -
HelloWorld(Cheese!)
- - - - - -
some text -
some more text
-
- - - - - - - - - -
Heading
Data 1Data 2
- - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/transformable.xml b/test/ghostdriver-test/fixtures/common/transformable.xml deleted file mode 100644 index 0b7e7fd584..0000000000 --- a/test/ghostdriver-test/fixtures/common/transformable.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - ]> - - -

Click the button.

- - Go to another page - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/transformable.xsl b/test/ghostdriver-test/fixtures/common/transformable.xsl deleted file mode 100644 index 53db9fded9..0000000000 --- a/test/ghostdriver-test/fixtures/common/transformable.xsl +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - -
\ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/underscore.html b/test/ghostdriver-test/fixtures/common/underscore.html deleted file mode 100644 index 904a4441fb..0000000000 --- a/test/ghostdriver-test/fixtures/common/underscore.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/unicode_ltr.html b/test/ghostdriver-test/fixtures/common/unicode_ltr.html deleted file mode 100644 index 245acc74ec..0000000000 --- a/test/ghostdriver-test/fixtures/common/unicode_ltr.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -
‎Some notes‎
- - diff --git a/test/ghostdriver-test/fixtures/common/upload-multiple.html b/test/ghostdriver-test/fixtures/common/upload-multiple.html deleted file mode 100644 index d1805f131d..0000000000 --- a/test/ghostdriver-test/fixtures/common/upload-multiple.html +++ /dev/null @@ -1,39 +0,0 @@ - -Upload Form - -
-
- Enter a file to upload: -
-
-
- - -
diff --git a/test/ghostdriver-test/fixtures/common/upload.html b/test/ghostdriver-test/fixtures/common/upload.html deleted file mode 100644 index aca398ab74..0000000000 --- a/test/ghostdriver-test/fixtures/common/upload.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - Upload Form - - - -
-
- Enter a file to upload: -
-
-
- - -
- - diff --git a/test/ghostdriver-test/fixtures/common/userDefinedProperty.html b/test/ghostdriver-test/fixtures/common/userDefinedProperty.html deleted file mode 100644 index 2453e6921b..0000000000 --- a/test/ghostdriver-test/fixtures/common/userDefinedProperty.html +++ /dev/null @@ -1,8 +0,0 @@ - - -
- - - diff --git a/test/ghostdriver-test/fixtures/common/veryLargeCanvas.html b/test/ghostdriver-test/fixtures/common/veryLargeCanvas.html deleted file mode 100644 index 54a2aba46e..0000000000 --- a/test/ghostdriver-test/fixtures/common/veryLargeCanvas.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - Rectangles - - - - -
-
First Target
-
Second Target
-
Third Target
-
Fourth Target
-
Not a Target
-
Not a Target
- - diff --git a/test/ghostdriver-test/fixtures/common/visibility-css.html b/test/ghostdriver-test/fixtures/common/visibility-css.html deleted file mode 100644 index 80cc649ce8..0000000000 --- a/test/ghostdriver-test/fixtures/common/visibility-css.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - -Visibility test via CSS - -
-

Hello world. I like cheese.

-
- - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/win32frameset.html b/test/ghostdriver-test/fixtures/common/win32frameset.html deleted file mode 100644 index 108b80f8c2..0000000000 --- a/test/ghostdriver-test/fixtures/common/win32frameset.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/common/window_switching_tests/page_with_frame.html b/test/ghostdriver-test/fixtures/common/window_switching_tests/page_with_frame.html deleted file mode 100644 index b94733b5cf..0000000000 --- a/test/ghostdriver-test/fixtures/common/window_switching_tests/page_with_frame.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Test page for WindowSwitchingTest.testShouldFocusOnTheTopMostFrameAfterSwitchingToAWindow - - -

Open new window

-
- -
- - diff --git a/test/ghostdriver-test/fixtures/common/window_switching_tests/simple_page.html b/test/ghostdriver-test/fixtures/common/window_switching_tests/simple_page.html deleted file mode 100644 index 52c163cbf8..0000000000 --- a/test/ghostdriver-test/fixtures/common/window_switching_tests/simple_page.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Simple Page - - -
Simple page with simple test.
- - diff --git a/test/ghostdriver-test/fixtures/common/xhtmlFormPage.xhtml b/test/ghostdriver-test/fixtures/common/xhtmlFormPage.xhtml deleted file mode 100644 index aca53d3439..0000000000 --- a/test/ghostdriver-test/fixtures/common/xhtmlFormPage.xhtml +++ /dev/null @@ -1,17 +0,0 @@ - - - - XHTML - - - -
- - -
- -

Here is some content that should not be in the previous p tag - - - diff --git a/test/ghostdriver-test/fixtures/common/xhtmlTest.html b/test/ghostdriver-test/fixtures/common/xhtmlTest.html deleted file mode 100644 index d2f3a5da84..0000000000 --- a/test/ghostdriver-test/fixtures/common/xhtmlTest.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - XHTML Test Page - - -

- - - -
-

XHTML Might Be The Future

- -

If you'd like to go elsewhere then click me.

- -

Alternatively, this goes to the same place.

- -
- -
- - This link has the same text as another link: click me. -
- -
Another div starts here.

-

An H2 title

-

Some more text

-
- -
- Foo -
    - -
- -
-
-
- - -
-
-
- - I have width -
-
-
-
- - -

-

-
Link=equalssign - -

Spaced out

- - -
first_div
-
second_div
- first_span - second_span -
- -
I'm a parent -
I'm a child
-
- -
Woo woo
- - diff --git a/test/ghostdriver-test/fixtures/right_frame/0.html b/test/ghostdriver-test/fixtures/right_frame/0.html deleted file mode 100644 index e6fa019ac4..0000000000 --- a/test/ghostdriver-test/fixtures/right_frame/0.html +++ /dev/null @@ -1,38911 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/right_frame/1.html b/test/ghostdriver-test/fixtures/right_frame/1.html deleted file mode 100644 index 39b65dd997..0000000000 --- a/test/ghostdriver-test/fixtures/right_frame/1.html +++ /dev/null @@ -1,51 +0,0 @@ - -WYSIWYG Editor Input Template - - - - - - - - - - - - -
  • foo.
  • bar
\ No newline at end of file diff --git a/test/ghostdriver-test/fixtures/right_frame/outside.html b/test/ghostdriver-test/fixtures/right_frame/outside.html deleted file mode 100644 index b240224d4f..0000000000 --- a/test/ghostdriver-test/fixtures/right_frame/outside.html +++ /dev/null @@ -1,414 +0,0 @@ - - - Editing testDotAtEndDoesNotDelete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
-
-
-
-
- -
- -
-
-
-
-
-
-
-
- -
- - -
-
-
-
- - - - -
- -
-
- -
- - - - -
- -
-
-
 
 
- - - - - - - - - - - - - - - -
-
-
-
- -
- - -
- - - - -
-
- - - -
-
-
-

Document information

-

- -

XWiki Syntax Help

Help on the XWiki Syntax

-
- - -
-
-
-
-
-
This wiki is licensed under a Creative Commons 2.0 license
-
XWiki Enterprise 5.1-SNAPSHOT - Documentation
-
-
- -
-
diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/1 b/test/ghostdriver-test/fixtures/testcase-issue_240/1 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/2 b/test/ghostdriver-test/fixtures/testcase-issue_240/2 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/3 b/test/ghostdriver-test/fixtures/testcase-issue_240/3 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/4 b/test/ghostdriver-test/fixtures/testcase-issue_240/4 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/5 b/test/ghostdriver-test/fixtures/testcase-issue_240/5 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/6 b/test/ghostdriver-test/fixtures/testcase-issue_240/6 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/test.html b/test/ghostdriver-test/fixtures/testcase-issue_240/test.html deleted file mode 100644 index e5ebdb7254..0000000000 --- a/test/ghostdriver-test/fixtures/testcase-issue_240/test.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - test - - - - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - - - - - diff --git a/test/ghostdriver-test/fixtures/testcase-issue_240/wb.rb b/test/ghostdriver-test/fixtures/testcase-issue_240/wb.rb deleted file mode 100644 index d51106a344..0000000000 --- a/test/ghostdriver-test/fixtures/testcase-issue_240/wb.rb +++ /dev/null @@ -1,62 +0,0 @@ -require 'json' -require 'shellwords' - -def c (method, url, data) - ret = `curl -s -X #{method} http://localhost:10000/#{url} --data-binary #{data.to_json.shellescape}` - return JSON.parse ret rescue ret -end - -def g (url, data={}) - c "GET", url, data -end - -def o (url, data) - c "POST", url, data -end - -def a (session, action, data = {}) - o "session/#{session}/#{action}", data -end - -def exec (session, js) - a(session, "execute", { script: "return #{js}", args: [] })["value"] -end - -def css (session, selector) - a(session, "elements", { using: 'css selector', value: selector })["value"].map { |x| x["ELEMENT"] } -end - -def click (session, element) - a(session, "element/#{element}/click") -end - -session_data = { - desiredCapabilities: { - browserName: "phantomjs", - platform: "ANY", - javascriptEnabled: true, - cssSelectorsEnabled: true, - takesScreenshot: true, - nativeEvents: false, - rotatable: false - } -} - -sessions = g("sessions", {})["value"] -if sessions.empty? - o("session", session_data) - sleep 0.5 -end -session = g("sessions", {})["value"][0]["id"] - -puts "Got session: #{session}" -a session, "url", { url: "http://localhost:8000/test.html" } -print "Going to do it now..." - - -css(session, "a").each do |i| - click session, i - # puts "Clicked on #{i}" -end - -puts exec session, "results" diff --git a/test/ghostdriver-test/java/build.gradle b/test/ghostdriver-test/java/build.gradle deleted file mode 100644 index a7ac4ec9f8..0000000000 --- a/test/ghostdriver-test/java/build.gradle +++ /dev/null @@ -1,86 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -apply plugin: "java" -apply plugin: "idea" -apply plugin: "eclipse" - -task wrapper(type: Wrapper) { - gradleVersion = "1.12" - jarFile = "gradle/gradle-wrapper.jar" -} - -repositories { - mavenCentral() -} - -ext.commonsFileUploadVersion = "1.3" -ext.seleniumVersion = "3.0.0" -ext.jettyVersion = "6.1.21" -ext.jsr305Version = "2.0.1" -ext.browsermobProxyClientVersion = "0.1.3" -ext.phantomjsdriverVersion = "2.0.0" - -configurations { - // introduces a transitive dependency on selenium 2.53 - // cyclic dependency on selenium-java - all*.exclude group: 'com.codeborne', module: 'phantomjsdriver' - - // not included in selenium 3.+ - all*.exclude group: 'org.seleniumhq.selenium', module: 'selenium-htmlunit-driver' -} - -dependencies { - // Test Dependencies - testCompile "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" - testCompile "org.seleniumhq.selenium:selenium-edge-driver:$seleniumVersion" - testCompile "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" - testCompile "org.seleniumhq.selenium:selenium-ie-driver:$seleniumVersion" - testCompile "org.seleniumhq.selenium:selenium-opera-driver:$seleniumVersion" - testCompile "org.seleniumhq.selenium:selenium-safari-driver:$seleniumVersion" - testCompile "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - testCompile "com.google.code.findbugs:jsr305:$jsr305Version" - testCompile "org.mortbay.jetty:jetty:$jettyVersion" - testCompile "commons-fileupload:commons-fileupload:$commonsFileUploadVersion" - testCompile "com.github.detro:browsermob-proxy-client:$browsermobProxyClientVersion" - - // Library under test (PhantomJS Driver, aka "PhantomJS WebDriver Java Binding") - testCompile files("../../binding/java/jars/phantomjsdriver-${phantomjsdriverVersion}.jar") -} - -tasks.withType(JavaExec) { - classpath = configurations.compile + sourceSets.test.output - args project.hasProperty("args") ? project.args.split("\\s") : [] -} - -test { - maxParallelForks = 3 - - afterTest { descriptor, result -> - logger.quiet(result.toString() + " for " + descriptor + " in " + descriptor.getParent()) - } -} diff --git a/test/ghostdriver-test/java/gradle/gradle-wrapper.jar b/test/ghostdriver-test/java/gradle/gradle-wrapper.jar deleted file mode 100644 index 5838598129..0000000000 Binary files a/test/ghostdriver-test/java/gradle/gradle-wrapper.jar and /dev/null differ diff --git a/test/ghostdriver-test/java/gradle/gradle-wrapper.properties b/test/ghostdriver-test/java/gradle/gradle-wrapper.properties deleted file mode 100644 index 7f0be4694a..0000000000 --- a/test/ghostdriver-test/java/gradle/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Wed May 07 22:46:29 BST 2014 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip diff --git a/test/ghostdriver-test/java/gradlew b/test/ghostdriver-test/java/gradlew deleted file mode 100755 index 9e810c47c1..0000000000 --- a/test/ghostdriver-test/java/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/test/ghostdriver-test/java/gradlew.bat b/test/ghostdriver-test/java/gradlew.bat deleted file mode 100644 index 661508d9b3..0000000000 --- a/test/ghostdriver-test/java/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/test/ghostdriver-test/java/settings.gradle b/test/ghostdriver-test/java/settings.gradle deleted file mode 100644 index 4fd8a728e5..0000000000 --- a/test/ghostdriver-test/java/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "ghostdriver-test" diff --git a/test/ghostdriver-test/java/src/test/java/BlacklistWhitelistTest.java b/test/ghostdriver-test/java/src/test/java/BlacklistWhitelistTest.java deleted file mode 100644 index 5132399183..0000000000 --- a/test/ghostdriver-test/java/src/test/java/BlacklistWhitelistTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2017, Jason Gowan -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.openqa.selenium.WebDriver; - -import java.util.Arrays; - -public class BlacklistWhitelistTest extends BaseTest { - @BeforeClass - public static void setBlacklistWhitelistCapabilities() { - sCaps.setCapability( - "phantomjs.page.blacklist", - Arrays.asList("png$") - ); - sCaps.setCapability( - "phantomjs.page.whitelist", - Arrays.asList("^https:..github.com", "^https:..assets-cdn.github.com") - ); - } - - @Test - public void testBlacklistWhitelistCapabilities() { - WebDriver d = getDriver(); - - d.get("https://github.com"); - // need some way to verify - } - -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/AuthBasicTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/AuthBasicTest.java deleted file mode 100644 index dda124141f..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/AuthBasicTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2017, Jason Gowan -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.phantomjs.PhantomJSDriverService; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebDriverException; -import org.junit.BeforeClass; - -import ghostdriver.server.HttpRequestCallback; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class AuthBasicTest extends BaseTestWithServer { - - // credentials for testing, no one would ever use these - private final static String userName = "admin"; - private final static String password = "admin"; - - @BeforeClass - public static void setCustomHeaders() { - sCaps.setCapability( - "phantomjs.page.customHeaders.Accept-Encoding", - "gzip, deflate" - ); - } - - @Override - public void prepareDriver() throws Exception { - sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_PAGE_SETTINGS_PREFIX + "userName", userName); - sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_PAGE_SETTINGS_PREFIX + "password", password); - - super.prepareDriver(); - } - - @Test - public void simpleBasicAuthShouldWork() { - // Get Driver Instance - WebDriver driver = getDriver(); - - // wrong password - driver.get(String.format("http://httpbin.org/basic-auth/%s/Wrong%s", userName, password)); - assertTrue(!driver.getPageSource().contains("authenticated")); - - // we should be authorized - driver.get(String.format("http://httpbin.org/basic-auth/%s/%s", userName, password)); - assertTrue(driver.getPageSource().contains("authenticated")); - } - - // we should be able to interact with pages that have content security policies - // @Ignore - @Test - public void canSendKeysAndClickOnPageWithCSP() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.addHeader("Content-Security-Policy", "default-src 'self'; script-src 'self';"); - res.getOutputStream().println( - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - ""); - } - }); - - // Get Driver Instance - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - WebElement element = d.findElement(By.id("username")); - element.sendKeys("jesg"); - element.click(); - try { - ((JavascriptExecutor) d).executeScript("1+1"); - fail("we should not be able to eval javascript on csp page"); - } catch (WebDriverException e) {} - } - -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/BaseTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/BaseTest.java deleted file mode 100644 index 2f885a500b..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/BaseTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.firefox.FirefoxDriver; -import org.openqa.selenium.phantomjs.PhantomJSDriver; -import org.openqa.selenium.phantomjs.PhantomJSDriverService; -import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.remote.RemoteWebDriver; - -import java.io.FileReader; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Properties; - -/** - * Tests base class. - * Takes care of initialising the Remote WebDriver - */ -public abstract class BaseTest { - private WebDriver mDriver = null; - private boolean mAutoQuitDriver = true; - - private static final String CONFIG_FILE = "../config.ini"; - private static final String DRIVER_FIREFOX = "firefox"; - private static final String DRIVER_CHROME = "chrome"; - private static final String DRIVER_PHANTOMJS = "phantomjs"; - - protected static Properties sConfig; - protected static DesiredCapabilities sCaps; - - private static boolean isUrl(String urlString) { - try { - new URL(urlString); - return true; - } catch (MalformedURLException mue) { - return false; - } - } - - @BeforeClass - public static void configure() throws IOException { - // Read config file - sConfig = new Properties(); - sConfig.load(new FileReader(CONFIG_FILE)); - - // Prepare capabilities - sCaps = new DesiredCapabilities(); - sCaps.setJavascriptEnabled(true); - sCaps.setCapability("takesScreenshot", false); - - String driver = sConfig.getProperty("driver", DRIVER_PHANTOMJS); - - // Fetch PhantomJS-specific configuration parameters - if (driver.equals(DRIVER_PHANTOMJS)) { - // "phantomjs_exec_path" - if (sConfig.getProperty("phantomjs_exec_path") != null) { - sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, sConfig.getProperty("phantomjs_exec_path")); - } else { - throw new IOException(String.format("Property '%s' not set!", PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY)); - } - // "phantomjs_driver_path" - if (sConfig.getProperty("phantomjs_driver_path") != null) { - System.out.println("Test will use an external GhostDriver"); - sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY, sConfig.getProperty("phantomjs_driver_path")); - } else { - System.out.println("Test will use PhantomJS internal GhostDriver"); - } - } - - // Disable "web-security", enable all possible "ssl-protocols" and "ignore-ssl-errors" for PhantomJSDriver -// sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[] { -// "--web-security=false", -// "--ssl-protocol=any", -// "--ignore-ssl-errors=true" -// }); - ArrayList cliArgsCap = new ArrayList(); - cliArgsCap.add("--web-security=false"); - cliArgsCap.add("--ssl-protocol=any"); - cliArgsCap.add("--ignore-ssl-errors=true"); - sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, cliArgsCap); - - // Control LogLevel for GhostDriver, via CLI arguments - sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_CLI_ARGS, new String[] { - "--logLevel=" + (sConfig.getProperty("phantomjs_driver_loglevel") != null ? sConfig.getProperty("phantomjs_driver_loglevel") : "INFO") - }); - } - - @Before - public void prepareDriver() throws Exception { - // Which driver to use? (default "phantomjs") - String driver = sConfig.getProperty("driver", DRIVER_PHANTOMJS); - - // Start appropriate Driver - if (isUrl(driver)) { - sCaps.setBrowserName("phantomjs"); - mDriver = new RemoteWebDriver(new URL(driver), sCaps); - } else if (driver.equals(DRIVER_FIREFOX)) { - mDriver = new FirefoxDriver(sCaps); - } else if (driver.equals(DRIVER_CHROME)) { - mDriver = new ChromeDriver(sCaps); - } else if (driver.equals(DRIVER_PHANTOMJS)) { - mDriver = new PhantomJSDriver(sCaps); - } - } - - protected WebDriver getDriver() { - return mDriver; - } - - protected void disableAutoQuitDriver() { - mAutoQuitDriver = false; - } - - protected void enableAutoQuitDriver() { - mAutoQuitDriver = true; - } - - protected boolean isAutoQuitDriverEnabled() { - return mAutoQuitDriver; - } - - @After - public void quitDriver() { - if (mAutoQuitDriver && mDriver != null) { - mDriver.quit(); - mDriver = null; - } - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/BaseTestWithServer.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/BaseTestWithServer.java deleted file mode 100644 index dd45f271c6..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/BaseTestWithServer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.CallbackHttpServer; -import org.junit.After; -import org.junit.Before; - -abstract public class BaseTestWithServer extends BaseTest { - protected CallbackHttpServer server; - - @Before - public void startServer() throws Exception { - server = new CallbackHttpServer(); - server.start(); - } - - @After - public void stopServer() throws Exception { - server.stop(); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/CookieTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/CookieTest.java deleted file mode 100644 index e212908641..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/CookieTest.java +++ /dev/null @@ -1,342 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.EmptyPageHttpRequestCallback; -import ghostdriver.server.HttpRequestCallback; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.Cookie; -import org.openqa.selenium.InvalidCookieDomainException; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebDriver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Date; - -import static org.junit.Assert.*; - -public class CookieTest extends BaseTestWithServer { - private WebDriver driver; - - private final static HttpRequestCallback COOKIE_SETTING_CALLBACK = new EmptyPageHttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - super.call(req, res); - javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie("test", "test"); - cookie.setDomain(".localhost"); - cookie.setMaxAge(360); - - res.addCookie(cookie); - - cookie = new javax.servlet.http.Cookie("test2", "test2"); - cookie.setDomain(".localhost"); - res.addCookie(cookie); - } - }; - - private final static HttpRequestCallback EMPTY_CALLBACK = new EmptyPageHttpRequestCallback(); - - @Before - public void setup() { - driver = getDriver(); - } - - @After - public void cleanUp() { - driver.manage().deleteAllCookies(); - } - - private void goToPage(String path) { - driver.get(server.getBaseUrl() + path); - } - - private void goToPage() { - goToPage(""); - } - - private Cookie[] getCookies() { - return driver.manage().getCookies().toArray(new Cookie[]{}); - } - - @Test - public void gettingAllCookies() { - server.setHttpHandler("GET", COOKIE_SETTING_CALLBACK); - goToPage(); - Cookie[] cookies = getCookies(); - - assertEquals(2, cookies.length); - - Cookie cookie = driver.manage().getCookieNamed("test"); - assertEquals("test", cookie.getName()); - assertEquals("test", cookie.getValue()); - assertEquals(".localhost", cookie.getDomain()); - assertEquals("/", cookie.getPath()); - assertTrue(cookie.getExpiry() != null); - assertEquals(false, cookie.isSecure()); - - Cookie cookie2 = driver.manage().getCookieNamed("test2"); - assertEquals("test2", cookie2.getName()); - assertEquals("test2", cookie2.getValue()); - assertEquals(".localhost", cookie2.getDomain()); - assertEquals("/", cookie2.getPath()); - assertEquals(false, cookie2.isSecure()); - assertTrue(cookie2.getExpiry() == null); - } - - @Test - public void gettingAllCookiesOnANonCookieSettingPage() { - server.setHttpHandler("GET", EMPTY_CALLBACK); - goToPage(); - assertEquals(0, getCookies().length); - } - - @Test - public void deletingAllCookies() { - server.setHttpHandler("GET", COOKIE_SETTING_CALLBACK); - goToPage(); - driver.manage().deleteAllCookies(); - assertEquals(0, getCookies().length); - } - - @Test - public void deletingOneCookie() { - server.setHttpHandler("GET", COOKIE_SETTING_CALLBACK); - goToPage(); - - driver.manage().deleteCookieNamed("test"); - - Cookie[] cookies = getCookies(); - - assertEquals(1, cookies.length); - assertEquals("test2", cookies[0].getName()); - } - - @Test - public void addingACookie() { - server.setHttpHandler("GET", EMPTY_CALLBACK); - goToPage(); - - driver.manage().addCookie(new Cookie("newCookie", "newValue", ".localhost", "/", null, false, false)); - - Cookie[] cookies = getCookies(); - assertEquals(1, cookies.length); - assertEquals("newCookie", cookies[0].getName()); - assertEquals("newValue", cookies[0].getValue()); - assertEquals(".localhost", cookies[0].getDomain()); - assertEquals("/", cookies[0].getPath()); - assertEquals(false, cookies[0].isSecure()); - assertEquals(false, cookies[0].isHttpOnly()); - } - - @Test - public void modifyingACookie() { - server.setHttpHandler("GET", COOKIE_SETTING_CALLBACK); - goToPage(); - - driver.manage().addCookie(new Cookie("test", "newValue", "localhost", "/", null, false)); - - Cookie[] cookies = getCookies(); - assertEquals(2, cookies.length); - assertEquals("test", cookies[1].getName()); - assertEquals("newValue", cookies[1].getValue()); - assertEquals(".localhost", cookies[1].getDomain()); - assertEquals("/", cookies[1].getPath()); - assertEquals(false, cookies[1].isSecure()); - - assertEquals("test2", cookies[0].getName()); - assertEquals("test2", cookies[0].getValue()); - assertEquals(".localhost", cookies[0].getDomain()); - assertEquals("/", cookies[0].getPath()); - assertEquals(false, cookies[0].isSecure()); - } - - @Test - public void shouldRetainCookieInfo() { - server.setHttpHandler("GET", EMPTY_CALLBACK); - goToPage(); - - // Added cookie (in a sub-path - allowed) - Cookie addedCookie = - new Cookie.Builder("fish", "cod") - .expiresOn(new Date(System.currentTimeMillis() + 100 * 1000)) //< now + 100sec - .path("/404") - .domain("localhost") - .build(); - driver.manage().addCookie(addedCookie); - - // Search cookie on the root-path and fail to find it - Cookie retrieved = driver.manage().getCookieNamed("fish"); - assertNull(retrieved); - - // Go to the "/404" sub-path (to find the cookie) - goToPage("404"); - retrieved = driver.manage().getCookieNamed("fish"); - assertNotNull(retrieved); - // Check that it all matches - assertEquals(addedCookie.getName(), retrieved.getName()); - assertEquals(addedCookie.getValue(), retrieved.getValue()); - assertEquals(addedCookie.getExpiry(), retrieved.getExpiry()); - assertEquals(addedCookie.isSecure(), retrieved.isSecure()); - assertEquals(addedCookie.getPath(), retrieved.getPath()); - assertTrue(retrieved.getDomain().contains(addedCookie.getDomain())); - } - - @Test(expected = InvalidCookieDomainException.class) - public void shouldNotAllowToCreateCookieOnDifferentDomain() { - goToPage(); - - // Added cookie (in a sub-path) - Cookie addedCookie = new Cookie.Builder("fish", "cod") - .expiresOn(new Date(System.currentTimeMillis() + 100 * 1000)) //< now + 100sec - .path("/404") - .domain("github.com") - .build(); - driver.manage().addCookie(addedCookie); - } - - @Test - public void shouldAllowToDeleteCookiesEvenIfNotSet() { - WebDriver d = getDriver(); - d.get("https://github.com/"); - - // Clear all cookies - assertTrue(d.manage().getCookies().size() > 0); - d.manage().deleteAllCookies(); - assertEquals(d.manage().getCookies().size(), 0); - - // All cookies deleted, call deleteAllCookies again. Should be a no-op. - d.manage().deleteAllCookies(); - d.manage().deleteCookieNamed("non_existing_cookie"); - assertEquals(d.manage().getCookies().size(), 0); - } - - @Test - public void shouldAllowToSetCookieThatIsAlreadyExpired() { - WebDriver d = getDriver(); - d.get("https://github.com/"); - - // Clear all cookies - assertTrue(d.manage().getCookies().size() > 0); - d.manage().deleteAllCookies(); - assertEquals(d.manage().getCookies().size(), 0); - - // Added cookie that expires in the past - Cookie addedCookie = new Cookie.Builder("expired", "yes") - .expiresOn(new Date(System.currentTimeMillis() - 1000)) //< now - 1 second - .build(); - d.manage().addCookie(addedCookie); - - Cookie cookie = d.manage().getCookieNamed("expired"); - assertNull(cookie); - } - - @Test(expected = Exception.class) - public void shouldThrowExceptionIfAddingCookieBeforeLoadingAnyUrl() { - // NOTE: At the time of writing, this test doesn't pass with FirefoxDriver. - // ChromeDriver is fine instead. - String xval = "123456789101112"; //< detro: I buy you a beer if you guess what am I quoting here - WebDriver d = getDriver(); - - // Set cookie, without opening any page: should throw an exception - d.manage().addCookie(new Cookie("x", xval)); - } - - @Test - public void shouldBeAbleToCreateCookieViaJavascriptOnGoogle() { - String ckey = "cookiekey"; - String cval = "cookieval"; - - WebDriver d = getDriver(); - d.get("http://www.google.com"); - JavascriptExecutor js = (JavascriptExecutor) d; - - // Of course, no cookie yet(!) - Cookie c = d.manage().getCookieNamed(ckey); - assertNull(c); - - // Attempt to create cookie on multiple Google domains - js.executeScript("javascript:(" + - "function() {" + - " cook = document.cookie;" + - " begin = cook.indexOf('"+ckey+"=');" + - " var val;" + - " if (begin !== -1) {" + - " var end = cook.indexOf(\";\",begin);" + - " if (end === -1)" + - " end=cook.length;" + - " val=cook.substring(begin+11,end);" + - " }" + - " val = ['"+cval+"'];" + - " if (val) {" + - " var d=Array('com','co.jp','ca','fr','de','co.uk','it','es','com.br');" + - " for (var i = 0; i < d.length; i++) {" + - " document.cookie = '"+ckey+"='+val+';path=/;domain=.google.'+d[i]+'; ';" + - " }" + - " }" + - "})();"); - c = d.manage().getCookieNamed(ckey); - assertNotNull(c); - assertEquals(cval, c.getValue()); - - // Set cookie as empty - js.executeScript("javascript:(" + - "function() {" + - " var d = Array('com','co.jp','ca','fr','de','co.uk','it','cn','es','com.br');" + - " for(var i = 0; i < d.length; i++) {" + - " document.cookie='"+ckey+"=;path=/;domain=.google.'+d[i]+'; ';" + - " }" + - "})();"); - c = d.manage().getCookieNamed(ckey); - assertNotNull(c); - assertEquals("", c.getValue()); - } - - @Test - public void addingACookieWithDefaults() { - server.setHttpHandler("GET", EMPTY_CALLBACK); - goToPage(); - long startTime = new Date().getTime(); - - driver.manage().addCookie(new Cookie("newCookie", "newValue")); - - Cookie[] cookies = getCookies(); - assertEquals(1, cookies.length); - assertEquals("newCookie", cookies[0].getName()); - assertEquals("newValue", cookies[0].getValue()); - assertEquals(".localhost", cookies[0].getDomain()); - assertEquals("/", cookies[0].getPath()); - assertEquals(false, cookies[0].isSecure()); - assertEquals(false, cookies[0].isHttpOnly()); - // expiry > 19 years in the future - assertTrue(startTime + 599184000000L <= cookies[0].getExpiry().getTime()); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/CustomHeadersTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/CustomHeadersTest.java deleted file mode 100644 index 2162605a2d..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/CustomHeadersTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2016, Jason Gowan -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.phantomjs.PhantomJSDriverService; -import org.openqa.selenium.By; - -import ghostdriver.server.HttpRequestCallback; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertEquals; - -public class CustomHeadersTest extends BaseTestWithServer { - - private static final String CUSTOM_HEADER_NAME = "My-Custom-Header"; - private static final String CUSTOM_HEADER = "my value"; - - @BeforeClass - public static void setCustomHeaders() { - sCaps.setCapability( - "phantomjs.page.customHeaders.Accept-Encoding", - "gzip, deflate" - ); - sCaps.setCapability( - "phantomjs.page.customHeaders."+CUSTOM_HEADER_NAME, - CUSTOM_HEADER - ); - } - - // regression test for detro/ghostdriver#489 - @Test - public void testAcceptEncodingHeader() { - WebDriver d = getDriver(); - d.get("https://cn.bing.com"); - assertFalse(d.getTitle().isEmpty()); - } - - @Test - public void testCustomHeaders() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println( - "\n" + - "\n" + - "\n" + - "\n" + - "
\n" + - "\n" + - ""); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - String actualCustomHeader = d.findElement(By.name(CUSTOM_HEADER_NAME)).getAttribute("value"); - assertEquals(CUSTOM_HEADER, actualCustomHeader); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/DirectFileUploadTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/DirectFileUploadTest.java deleted file mode 100644 index 3400000163..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/DirectFileUploadTest.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.io.IOUtils; -import org.junit.Test; -import org.junit.Ignore; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; -import org.openqa.selenium.phantomjs.PhantomJSDriver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.util.List; - -@Ignore -public class DirectFileUploadTest extends BaseTestWithServer { - private static final String LOREM_IPSUM_TEXT = "lorem ipsum dolor sit amet"; - private static final String FILE_HTML = "
" + LOREM_IPSUM_TEXT + "
"; - - @Test - public void checkFileUploadCompletes() throws IOException { - WebDriver d = getDriver(); - if (!(d instanceof PhantomJSDriver)) { - // Skip this test if not using PhantomJS. - // The command under test is only available when using PhantomJS - return; - } - PhantomJSDriver phantom = (PhantomJSDriver)d; - - String buttonId = "upload"; - - // Create the test file for uploading - File testFile = File.createTempFile("webdriver", "tmp"); - testFile.deleteOnExit(); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - new FileOutputStream(testFile.getAbsolutePath()), "utf-8")); - writer.write(FILE_HTML); - writer.close(); - - server.setHttpHandler("POST", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - if (ServletFileUpload.isMultipartContent(req) && req.getPathInfo().endsWith("/upload")) { - // Create a factory for disk-based file items - DiskFileItemFactory factory = new DiskFileItemFactory(1024, new File(System.getProperty("java.io.tmpdir"))); - - // Create a new file upload handler - ServletFileUpload upload = new ServletFileUpload(factory); - - // Parse the request - List items; - try { - items = upload.parseRequest(req); - } catch (FileUploadException fue) { - throw new IOException(fue); - } - - res.setHeader("Content-Type", "text/html; charset=UTF-8"); - InputStream is = items.get(0).getInputStream(); - OutputStream os = res.getOutputStream(); - IOUtils.copy(is, os); - - os.write("".getBytes()); - - IOUtils.closeQuietly(is); - IOUtils.closeQuietly(os); - return; - } - - res.sendError(400); - } - }); - - // Upload the temp file - phantom.get(server.getBaseUrl() + "/common/upload.html"); - - phantom.executePhantomJS("var page = this; page.uploadFile('input#"+ buttonId +"', '"+ testFile.getAbsolutePath() +"');"); - - phantom.findElement(By.id("go")).submit(); - - // Uploading files across a network may take a while, even if they're really small. - // Wait for the loading label to disappear. - WebDriverWait wait = new WebDriverWait(phantom, 10); - wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label"))); - - phantom.switchTo().frame("upload_target"); - - wait = new WebDriverWait(phantom, 5); - wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), LOREM_IPSUM_TEXT)); - - // Navigate after file upload to verify callbacks are properly released. - phantom.get("http://www.google.com/"); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/DriverBasicTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/DriverBasicTest.java deleted file mode 100644 index 9f9dc787bc..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/DriverBasicTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.WebDriver; - -public class DriverBasicTest extends BaseTest { - @Test - public void useDriverButDontQuit() { - WebDriver d = getDriver(); - disableAutoQuitDriver(); - - d.get("http://www.google.com/"); - d.quit(); - } - -// @Test -// public void shouldSurviveExecutingManyTimesTheSameCommand() { -// WebDriver d = getDriver(); -// d.get("http://www.google.com"); -// for (int j = 0; j < 100; j++) { -// try { -// d.findElement(By.linkText(org.apache.commons.lang3.RandomStringUtils.randomAlphabetic(4))).isDisplayed(); -// } catch (NoSuchElementException nsee) { -// // swallow exceptions: we don't care about the result -// } -// } -// } -// -// @Test -// public void shouldSurviveExecutingManyTimesTheSameTest() throws Exception { -// for (int i = 0; i < 100; ++i) { -// prepareDriver(); -// shouldSurviveExecutingManyTimesTheSameCommand(); -// quitDriver(); -// } -// } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementFindingTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementFindingTest.java deleted file mode 100644 index 5d86ba4531..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementFindingTest.java +++ /dev/null @@ -1,261 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.openqa.selenium.*; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.*; - -public class ElementFindingTest extends BaseTestWithServer { - @Test - public void findChildElement() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("
" + - "" + - "" + - "
"); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - WebElement parent = d.findElement(By.id("y-masthead")); - - assertNotNull(parent.findElement(By.name("t"))); - } - - @Test - public void findChildElements() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("
" + - "" + - "" + - "
"); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - WebElement parent = d.findElement(By.id("y-masthead")); - - List children = parent.findElements(By.tagName("input")); - assertEquals(2, children.size()); - } - - @Test - public void findMultipleElements() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("
" + - "" + - "" + - "" + - "
"); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - assertEquals(3, d.findElements(By.tagName("input")).size()); - } - - @Test - public void findNoElementsMeetingCriteria() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - List els = d.findElements(By.name("noElementWithThisName")); - - assertEquals(0, els.size()); - } - - @Test - public void findNoChildElementsMeetingCriteria() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement parent = d.findElement(By.name("q")); - - List children = parent.findElements(By.tagName("input")); - - assertEquals(0, children.size()); - } - - @Test - public void findActiveElement() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement inputField = d.findElement(By.cssSelector("input[name='q']")); - WebElement active = d.switchTo().activeElement(); - - assertEquals(inputField.getTagName(), active.getTagName()); - assertEquals(inputField.getLocation(), active.getLocation()); - assertEquals(inputField.hashCode(), active.hashCode()); - assertEquals(inputField.getText(), active.getText()); - assertTrue(inputField.equals(active)); - } - - @Test(expected = NoSuchElementException.class) - public void failToFindNonExistentElement() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement inputField = d.findElement(By.cssSelector("input[name='idontexist']")); - } - - @Test(expected = InvalidSelectorException.class) - public void failFindElementForInvalidXPathLocator() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement inputField = d.findElement(By.xpath("this][isnot][valid")); - } - - @Test(expected = InvalidSelectorException.class) - public void failFindElementsForInvalidXPathLocator() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - List inputField = d.findElements(By.xpath("this][isnot][valid")); - } - - @Test - public void findElementWithImplicitWait() { - WebDriver d = getDriver(); - - d.get("about:blank"); - String injectLink = "document.body.innerHTML = \"add\""; - ((JavascriptExecutor)d).executeScript(injectLink); - WebElement add = d.findElement(By.id("add")); - - // DO NOT WAIT when looking for an element - d.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); - - // Add element - add.click(); - // Check element is not there yet - try { - d.findElement(By.id("testing1")); - throw new RuntimeException("expected NoSuchElementException"); - } catch (NoSuchElementException nse) { /* nothing to do */ } - - // DO WAIT 1 SECOND before giving up while looking for an element - d.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS); - // Add element - add.click(); - // Check element is there - assertNotNull(d.findElement(By.id("testing2"))); - - // DO WAIT 0.5 SECONDS before giving up while looking for an element - d.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS); - // Add element - add.click(); - - // Check element is not there yet - try { - d.findElement(By.id("testing3")); - throw new RuntimeException("expected NoSuchElementException"); - } catch (NoSuchElementException nse) { /* nothing to do */ } - } - - @Test - public void findElementsWithImplicitWait() { - WebDriver d = getDriver(); - - d.get("about:blank"); - String injectLink = "document.body.innerHTML = \"add\""; - ((JavascriptExecutor)d).executeScript(injectLink); - WebElement add = d.findElement(By.id("add")); - - // DO NOT WAIT while looking for an element - d.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); - // Add element - add.click(); - // Check element is not there yet - assertEquals(0, d.findElements(By.id("testing1")).size()); - - // DO WAIT 3 SEC when looking for an element - d.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); - // Add element - add.click(); - // Check element is there - assert(d.findElements(By.tagName("span")).size() >= 1 && d.findElements(By.tagName("span")).size() <= 2); - } - - @Test - public void findElementViaXpathLocator() { - // Define HTTP response for test - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - ServletOutputStream out = res.getOutputStream(); - out.println("" + - "" + - ""); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - WebElement loginButton = d.findElement(By.xpath("//button[contains(@class, 'login')]")); - assertNotNull(loginButton); - assertTrue(loginButton.getText().toLowerCase().contains("login")); - assertEquals("button", loginButton.getTagName().toLowerCase()); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementJQueryEventsTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementJQueryEventsTest.java deleted file mode 100644 index 0beb061a2e..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementJQueryEventsTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; -import org.openqa.selenium.By; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebDriver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Arrays; - -import static org.junit.Assert.assertTrue; - -@RunWith(value = Parameterized.class) -public class ElementJQueryEventsTest extends BaseTestWithServer { - - @Parameters(name = "jQuery Version: {0}") - public static Iterable data() { - return Arrays.asList(new Object[][]{ - {"2.0.3"}, {"2.0.2"}, {"2.0.1"}, {"2.0.0"}, - {"1.10.2"}, {"1.10.1"}, {"1.10.0"}, - {"1.9.1"}, {"1.9.0"}, - {"1.8.3"}, {"1.8.2"}, {"1.8.1"}, {"1.8.0"}, - {"1.7.2"}, //{"1.7.1"}, {"1.7.0"}, - {"1.6.4"}, //{"1.6.3"}, {"1.6.2"}, {"1.6.1"}, {"1.6.0"}, - {"1.5.2"}, //{"1.5.1"}, {"1.5.0"}, - {"1.4.4"}, //{"1.4.3"}, {"1.4.2"}, {"1.4.1"}, {"1.4.0"}, - {"1.3.2"}, //{"1.3.1"}, {"1.3.0"}, - {"1.2.6"}, //{"1.2.3"} - }); - } - - private String mJqueryVersion; - - public ElementJQueryEventsTest(String jQueryVersion) { - mJqueryVersion = jQueryVersion; - } - - @Test - public void shouldBeAbleToClickAndEventsBubbleUpUsingJquery() { - final String buttonId = "clickme"; - - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println( - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - " click me\n" + - "\n" + - ""); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - // Click on the link inside the page - d.findElement(By.id(buttonId)).click(); - - // Check element was clicked as expected - assertTrue((Boolean)((JavascriptExecutor)d).executeScript("return clicked;")); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementMethodsTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementMethodsTest.java deleted file mode 100644 index 29938e7d6e..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementMethodsTest.java +++ /dev/null @@ -1,222 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class ElementMethodsTest extends BaseTestWithServer { - @Test - public void checkDisplayedOnGoogleSearchBox() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement el = d.findElement(By.cssSelector("input[name*='q']")); - - assertTrue(el.isDisplayed()); - - el = d.findElement(By.cssSelector("input[type='hidden']")); - - assertFalse(el.isDisplayed()); - } - - @Test - public void checkEnabledOnGoogleSearchBox() { - // TODO: Find a sample site that has hidden elements and use it to - // verify behavior of enabled and disabled elements. - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement el = d.findElement(By.cssSelector("input[name*='q']")); - - assertTrue(el.isEnabled()); - } - - @Test - public void checkClickOnAHREFCausesPageLoad() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement link = d.findElement(By.cssSelector("a[href*=\"/intl/en/ads/\"]")); - link.click(); - - assertTrue(d.getTitle().contains("Ads")); - } - - @Test - public void checkClickOnINPUTSUBMITCausesPageLoad() { - WebDriver d = getDriver(); - - d.get("http://www.duckduckgo.com"); - WebElement textInput = d.findElement(By.cssSelector("#search_form_input_homepage")); - WebElement submitInput = d.findElement(By.cssSelector("#search_button_homepage")); - - - assertFalse(d.getTitle().contains("clicking")); - textInput.click(); - assertFalse(d.getTitle().contains("clicking")); - textInput.sendKeys("clicking"); - assertFalse(d.getTitle().contains("clicking")); - - submitInput.click(); - assertTrue(d.getTitle().contains("clicking")); - } - - @Test - public void SubmittingFormShouldFireOnSubmitForThatForm() { - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/javascriptPage.html"); - - WebElement formElement = d.findElement(By.id("submitListeningForm")); - formElement.submit(); - - WebDriverWait wait = new WebDriverWait(d, 30); - wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("result"), "form-onsubmit")); - - WebElement result = d.findElement(By.id("result")); - String text = result.getText(); - boolean conditionMet = text.contains("form-onsubmit"); - - assertTrue(conditionMet); - } - - @Test - public void shouldWaitForOnClickCallbackToFinishBeforeContinuing() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("\n" + - " Click Here"); - } - }); - - WebDriver d = getDriver(); - - d.get(server.getBaseUrl()); - d.findElement(By.xpath("html/body/a")).click(); - - assertTrue(d.getTitle().toLowerCase().contains("google")); - } - - @Test - public void shouldNotHandleCasesWhenAsyncJavascriptInitiatesAPageLoadFarInTheFuture() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("\n" + - " Click Here"); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - // Initiate timer that will finish with loading Google in the window - d.findElement(By.xpath("html/body/a")).click(); - - // "google.com" hasn't loaded yet at this stage - assertFalse(d.getTitle().toLowerCase().contains("google")); - } - - @Test - public void shouldHandleCasesWhereJavascriptCodeInitiatesPageLoadsThatFail() throws InterruptedException { - final String crazyUrl = "http://abcdefghilmnopqrstuvz.zvutsr"; - - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("\n" + - " Click Here"); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - // Click on the link to kickstart the javascript that will attempt to load a page that is supposed to fail - d.findElement(By.xpath("html/body/a")).click(); - - // The crazy URL should have not been loaded - assertTrue(!d.getCurrentUrl().equals(crazyUrl)); - } - - - @Test - public void shouldUsePageTimeoutToWaitForPageLoadOnInput() throws InterruptedException { - WebDriver d = getDriver(); - String inputString = "clicking"; - - d.get("http://www.duckduckgo.com"); - WebElement textInput = d.findElement(By.cssSelector("#search_form_input_homepage")); - - assertFalse(d.getTitle().contains(inputString)); - textInput.click(); - assertFalse(d.getTitle().contains(inputString)); - - // This input will ALSO submit the search form, causing a Page Load - textInput.sendKeys(inputString + "\n"); - - assertTrue(d.getTitle().contains(inputString)); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementQueryingTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementQueryingTest.java deleted file mode 100644 index b9cb151982..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/ElementQueryingTest.java +++ /dev/null @@ -1,148 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.openqa.selenium.*; -import org.openqa.selenium.internal.Locatable; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class ElementQueryingTest extends BaseTestWithServer { - @Test - public void checkAttributesOnGoogleSearchBox() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - WebElement el = d.findElement(By.cssSelector("input[name*='q']")); - - assertTrue(el.getAttribute("name").toLowerCase().contains("q")); - assertTrue(el.getAttribute("type").toLowerCase().contains("text")); - assertTrue(el.getAttribute("style").length() > 0); - assertTrue(el.getAttribute("type").length() > 0); - } - - @Test - public void checkLocationAndSizeOfBingSearchBox() { - WebDriver d = getDriver(); - d.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS); - - d.get("http://www.bing.com"); - WebElement searchBox = d.findElement(By.cssSelector("input[name*='q']")); - - assertTrue(searchBox.getCssValue("color").contains("rgb(0, 0, 0)") || searchBox.getCssValue("color").contains("rgba(0, 0, 0, 1)")); - assertEquals("", searchBox.getAttribute("value")); - assertEquals("input", searchBox.getTagName()); - assertEquals(true, searchBox.isEnabled()); - assertEquals(true, searchBox.isDisplayed()); - assertTrue(searchBox.getLocation().getX() >= 200); - assertTrue(searchBox.getLocation().getY() >= 100); - assertTrue(searchBox.getSize().getWidth() >= 350); - assertTrue(searchBox.getSize().getHeight() >= 20); - } - - @Test - public void scrollElementIntoView() { - WebDriver d = getDriver(); - - d.get("https://developer.mozilla.org/en/CSS/Attribute_selectors"); - WebElement aboutGoogleLink = d.findElement(By.partialLinkText("About MDN")); - Point locationBeforeScroll = aboutGoogleLink.getLocation(); - Point locationAfterScroll = ((Locatable) aboutGoogleLink).getCoordinates().inViewPort(); - - assertTrue(locationBeforeScroll.x >= locationAfterScroll.x); - assertTrue(locationBeforeScroll.y >= locationAfterScroll.y); - } - - @Test - public void getTextFromDifferentLocationsOfDOMTree() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("" + - "
\n" + - " \n" + - " \n" + - "

The Title of The Item

\n" + - "
\n" + - "
\n" + - "
\n" + - " (Loads of other stuff)\n" + - "
\n" + - "
" + - ""); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - assertEquals("The Title of The Item\n(Loads of other stuff)", d.findElement(By.className("item")).getText()); - assertEquals("The Title of The Item", d.findElement(By.className("item")).findElement(By.tagName("h1")).getText()); - assertEquals("The Title of The Item", d.findElement(By.className("item")).findElement(By.tagName("a")).getText()); - assertEquals("The Title of The Item", d.findElement(By.className("item")).findElement(By.className("item-title")).getText()); - } - - @Test(expected = InvalidElementStateException.class) - public void throwExceptionWhenInteractingWithInvisibleElement() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("" + - "" + - " \n" + - " test\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " " + - ""); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - WebElement visibleInput = d.findElement(By.id("visible")); - WebElement invisibleInput = d.findElement(By.id("invisible")); - - String textToType = "text to type"; - visibleInput.sendKeys(textToType); - assertEquals(textToType, visibleInput.getAttribute("value")); - - invisibleInput.sendKeys(textToType); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/FileUploadTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/FileUploadTest.java deleted file mode 100644 index 654212a19b..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/FileUploadTest.java +++ /dev/null @@ -1,266 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.apache.commons.fileupload.FileItem; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.disk.DiskFileItemFactory; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.io.IOUtils; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; -import org.openqa.selenium.WebDriverException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; - -public class FileUploadTest extends BaseTestWithServer { - private static final String LOREM_IPSUM_TEXT = "lorem ipsum dolor sit amet"; - private static final String FILE_HTML = "
" + LOREM_IPSUM_TEXT + "
"; - private static final String FILE_HTML2 = "
Hello
"; - - @Test - public void checkFileUploadCompletes() throws IOException { - WebDriver d = getDriver(); - - // Create the test file for uploading - File testFile = File.createTempFile("webdriver", "tmp"); - testFile.deleteOnExit(); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - new FileOutputStream(testFile.getAbsolutePath()), "utf-8")); - writer.write(FILE_HTML); - writer.close(); - - server.setHttpHandler("POST", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - if (ServletFileUpload.isMultipartContent(req) && req.getPathInfo().endsWith("/upload")) { - // Create a factory for disk-based file items - DiskFileItemFactory factory = new DiskFileItemFactory(1024, new File(System.getProperty("java.io.tmpdir"))); - - // Create a new file upload handler - ServletFileUpload upload = new ServletFileUpload(factory); - - // Parse the request - List items; - try { - items = upload.parseRequest(req); - } catch (FileUploadException fue) { - throw new IOException(fue); - } - - res.setHeader("Content-Type", "text/html; charset=UTF-8"); - InputStream is = items.get(0).getInputStream(); - OutputStream os = res.getOutputStream(); - IOUtils.copy(is, os); - - os.write("".getBytes()); - - IOUtils.closeQuietly(is); - IOUtils.closeQuietly(os); - return; - } - - res.sendError(400); - } - }); - - // Upload the temp file - d.get(server.getBaseUrl() + "/common/upload.html"); - d.findElement(By.id("upload")).sendKeys(testFile.getAbsolutePath()); - d.findElement(By.id("go")).submit(); - - // Uploading files across a network may take a while, even if they're really small. - // Wait for the loading label to disappear. - WebDriverWait wait = new WebDriverWait(d, 10); - wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label"))); - - d.switchTo().frame("upload_target"); - - wait = new WebDriverWait(d, 5); - wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), LOREM_IPSUM_TEXT)); - - // Navigate after file upload to verify callbacks are properly released. - d.get("http://www.google.com/"); - } - - @Test - public void checkFileUploadFailsIfFileDoesNotExist() throws InterruptedException { - WebDriver d = getDriver(); - - // Trying to upload a file that doesn't exist - d.get(server.getBaseUrl() + "/common/upload.html"); - d.findElement(By.id("upload")).sendKeys("file_that_does_not_exist.fake"); - d.findElement(By.id("go")).submit(); - - // Uploading files across a network may take a while, even if they're really small. - // Wait for a while and make sure the "upload_label" is still there: means that the file was not uploaded - Thread.sleep(1000); - assertTrue(d.findElement(By.id("upload_label")).isDisplayed()); - } - - @Test - public void checkUploadingTheSameFileMultipleTimes() throws IOException { - WebDriver d = getDriver(); - - File file = File.createTempFile("test", "txt"); - file.deleteOnExit(); - - d.get(server.getBaseUrl() + "/common/formPage.html"); - WebElement uploadElement = d.findElement(By.id("upload")); - uploadElement.sendKeys(file.getAbsolutePath()); - uploadElement.submit(); - - d.get(server.getBaseUrl() + "/common/formPage.html"); - uploadElement = d.findElement(By.id("upload")); - uploadElement.sendKeys(file.getAbsolutePath()); - uploadElement.submit(); - } - - @Test - public void checkOnChangeEventIsFiredOnFileUpload() throws IOException { - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/formPage.html"); - WebElement uploadElement = d.findElement(By.id("upload")); - WebElement result = d.findElement(By.id("fileResults")); - assertEquals("", result.getText()); - - File file = File.createTempFile("test", "txt"); - file.deleteOnExit(); - - uploadElement.sendKeys(file.getAbsolutePath()); - // Shift focus to something else because send key doesn't make the focus leave - d.findElement(By.id("id-name1")).click(); - - assertEquals("changed", result.getText()); - } - - @Test - public void checkMultipleFileUploadCompletes() throws IOException { - WebDriver d = getDriver(); - - // Create the test file for uploading - File testFile = File.createTempFile("webdriver", "tmp"); - testFile.deleteOnExit(); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - new FileOutputStream(testFile.getAbsolutePath()), "utf-8")); - writer.write(FILE_HTML); - writer.close(); - - // Create the test file for uploading - File testFile2 = File.createTempFile("webdriver", "tmp"); - testFile2.deleteOnExit(); - writer = new BufferedWriter(new OutputStreamWriter( - new FileOutputStream(testFile2.getAbsolutePath()), "utf-8")); - writer.write(FILE_HTML2); - writer.close(); - - server.setHttpHandler("POST", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - if (ServletFileUpload.isMultipartContent(req) && req.getPathInfo().endsWith("/uploadmult")) { - // Create a factory for disk-based file items - DiskFileItemFactory factory = new DiskFileItemFactory(1024, new File(System.getProperty("java.io.tmpdir"))); - - // Create a new file upload handler - ServletFileUpload upload = new ServletFileUpload(factory); - - // Parse the request - List items; - try { - items = upload.parseRequest(req); - } catch (FileUploadException fue) { - throw new IOException(fue); - } - - res.setHeader("Content-Type", "text/html; charset=UTF-8"); - InputStream is = items.get(0).getInputStream(); - OutputStream os = res.getOutputStream(); - IOUtils.copy(is, os); - is = items.get(1).getInputStream(); - IOUtils.copy(is, os); - - os.write("".getBytes()); - - IOUtils.closeQuietly(is); - IOUtils.closeQuietly(os); - return; - } - - res.sendError(400); - } - }); - - // Upload the temp file - d.get(server.getBaseUrl() + "/common/upload-multiple.html"); - d.findElement(By.id("upload")).sendKeys(testFile.getAbsolutePath()+"\n"+testFile2.getAbsolutePath()); - d.findElement(By.id("go")).submit(); - - // Uploading files across a network may take a while, even if they're really small. - // Wait for the loading label to disappear. - WebDriverWait wait = new WebDriverWait(d, 10); - wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label"))); - - d.switchTo().frame("upload_target"); - - wait = new WebDriverWait(d, 5); - wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), LOREM_IPSUM_TEXT)); - wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), "Hello")); - - // Navigate after file upload to verify callbacks are properly released. - d.get("http://www.google.com/"); - } - - @Test - public void checkMultipleFileUploadFailsIfFileDoesNotExist() throws InterruptedException { - WebDriver d = getDriver(); - - // Trying to upload a file that doesn't exist - d.get(server.getBaseUrl() + "/common/upload-multiple.html"); - d.findElement(By.id("upload")).sendKeys("file_that_does_not_exist.fake"); - d.findElement(By.id("go")).submit(); - - // Uploading files across a network may take a while, even if they're really small. - // Wait for a while and make sure the "upload_label" is still there: means that the file was not uploaded - Thread.sleep(1000); - assertTrue(d.findElement(By.id("upload_label")).isDisplayed()); - } - -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/FrameSwitchingTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/FrameSwitchingTest.java deleted file mode 100644 index 7810a68dc3..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/FrameSwitchingTest.java +++ /dev/null @@ -1,492 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import com.google.common.base.Predicate; -import ghostdriver.server.GetFixtureHttpRequestCallback; -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.openqa.selenium.*; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; - -import javax.annotation.Nullable; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -import static org.junit.Assert.*; - -public class FrameSwitchingTest extends BaseTestWithServer { - - private String getCurrentFrameName(WebDriver driver) { - return (String)((JavascriptExecutor) driver).executeScript("return window.frameElement ? " + - "window.frameElement.name : " + - "'__MAIN_FRAME__';"); - } - - private boolean isAtTopWindow(WebDriver driver) { - return (Boolean)((JavascriptExecutor) driver).executeScript("return window == window.top"); - } - - @Test - public void switchToFrameByNumber() { - WebDriver d = getDriver(); - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - d.switchTo().frame(0); - assertEquals("packageFrame", getCurrentFrameName(d)); - d.switchTo().defaultContent(); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - d.switchTo().frame(0); - assertEquals("packageFrame", getCurrentFrameName(d)); - } - - @Test - public void switchToFrameByName() { - WebDriver d = getDriver(); - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - d.switchTo().frame("packageFrame"); - assertEquals("packageFrame", getCurrentFrameName(d)); - d.switchTo().defaultContent(); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - d.switchTo().frame("packageFrame"); - assertEquals("packageFrame", getCurrentFrameName(d)); - } - - @Test - public void switchToFrameByElement() { - WebDriver d = getDriver(); - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - d.switchTo().frame(d.findElement(By.name("packageFrame"))); - assertEquals("packageFrame", getCurrentFrameName(d)); - d.switchTo().defaultContent(); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - d.switchTo().frame(d.findElement(By.name("packageFrame"))); - assertEquals("packageFrame", getCurrentFrameName(d)); - } - - @Test(expected = NoSuchFrameException.class) - public void failToSwitchToFrameByName() throws Exception { - WebDriver d = getDriver(); - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - d.switchTo().frame("unavailable frame"); - } - - @Test(expected = NoSuchElementException.class) - public void shouldBeAbleToClickInAFrame() throws InterruptedException { - WebDriver d = getDriver(); - - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - - d.switchTo().frame("classFrame"); - assertEquals("classFrame", getCurrentFrameName(d)); - - // This should cause a reload in the frame "classFrame" - d.findElement(By.linkText("HttpClient")).click(); - - // Wait for new content to load in the frame. - WebDriverWait wait = new WebDriverWait(d, 10); - wait.until(ExpectedConditions.titleContains("HttpClient")); - - // Frame should still be "classFrame" - assertEquals("classFrame", getCurrentFrameName(d)); - - // Check if a link "clearCookies()" is there where expected - assertEquals("clearCookies", d.findElement(By.linkText("clearCookies")).getText()); - - // Make sure it was really frame "classFrame" which was replaced: - // 1. move to the other frame "packageFrame" - d.switchTo().defaultContent().switchTo().frame("packageFrame"); - assertEquals("packageFrame", getCurrentFrameName(d)); - // 2. the link "clearCookies()" shouldn't be there anymore - d.findElement(By.linkText("clearCookies")); - } - - @Test(expected = NoSuchElementException.class) - public void shouldBeAbleToClickInAFrameAfterRunningJavaScript() throws InterruptedException { - WebDriver d = getDriver(); - - // Navigate to page and ensure we are on the Main Frame - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - assertTrue(isAtTopWindow(d)); - d.switchTo().defaultContent(); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - assertTrue(isAtTopWindow(d)); - - // Switch to a child frame - d.switchTo().frame("classFrame"); - assertEquals("classFrame", getCurrentFrameName(d)); - assertFalse(isAtTopWindow(d)); - - // Renavigate to the page, and check we are back on the Main Frame - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - assertTrue(isAtTopWindow(d)); - // Switch to a child frame - d.switchTo().frame("classFrame"); - assertEquals("classFrame", getCurrentFrameName(d)); - assertFalse(isAtTopWindow(d)); - - // This should cause a reload in the frame "classFrame" - d.findElement(By.linkText("HttpClient")).click(); - - // Wait for new content to load in the frame. - WebDriverWait wait = new WebDriverWait(d, 10); - wait.until(ExpectedConditions.titleContains("HttpClient")); - - // Frame should still be "classFrame" - assertEquals("classFrame", getCurrentFrameName(d)); - - // Check if a link "clearCookies()" is there where expected - assertEquals("clearCookies", d.findElement(By.linkText("clearCookies")).getText()); - - // Make sure it was really frame "classFrame" which was replaced: - // 1. move to the other frame "packageFrame" - d.switchTo().defaultContent().switchTo().frame("packageFrame"); - assertEquals("packageFrame", getCurrentFrameName(d)); - // 2. the link "clearCookies()" shouldn't be there anymore - d.findElement(By.linkText("clearCookies")); - } - - @Test - public void titleShouldReturnWindowTitle() { - WebDriver d = getDriver(); - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - assertEquals("__MAIN_FRAME__", getCurrentFrameName(d)); - String topLevelTitle = d.getTitle(); - d.switchTo().frame("packageFrame"); - assertEquals("packageFrame", getCurrentFrameName(d)); - assertEquals(topLevelTitle, d.getTitle()); - d.switchTo().defaultContent(); - assertEquals(topLevelTitle, d.getTitle()); - } - - @Test - public void pageSourceShouldReturnSourceOfFocusedFrame() throws InterruptedException { - WebDriver d = getDriver(); - d.get("http://docs.wpm.neustar.biz/testscript-api/index.html"); - - // Compare source before and after the frame switch - String pageSource = d.getPageSource(); - d.switchTo().frame("classFrame"); - String framePageSource = d.getPageSource(); - assertFalse(pageSource.equals(framePageSource)); - - assertTrue("Page source was: " + framePageSource, framePageSource.contains("Interface Summary")); - } - - @Test - public void shouldSwitchBackToMainFrameIfLinkInFrameCausesTopFrameReload() throws Exception { - WebDriver d = getDriver(); - String expectedTitle = "Unique title"; - - class SpecialHttpRequestCallback extends GetFixtureHttpRequestCallback { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - if (req.getPathInfo().matches("^.*page/\\d+$")) { - int lastIndex = req.getPathInfo().lastIndexOf('/'); - String pageNumber = - (lastIndex == -1 ? "Unknown" : req.getPathInfo().substring(lastIndex + 1)); - String resBody = String.format("Page%s" + - "Page number %s" + - "

top" + - "", - pageNumber, pageNumber); - - res.getOutputStream().println(resBody); - } else { - super.call(req, res); - } - } - } - - server.setHttpHandler("GET", new SpecialHttpRequestCallback()); - - d.get(server.getBaseUrl() + "/common/frameset.html"); - assertEquals(expectedTitle, d.getTitle()); - - d.switchTo().frame(0); - d.findElement(By.linkText("top")).click(); - - // Wait for new content to load in the frame. - expectedTitle = "XHTML Test Page"; - WebDriverWait wait = new WebDriverWait(d, 10); - wait.until(ExpectedConditions.titleIs(expectedTitle)); - assertEquals(expectedTitle, d.getTitle()); - - WebElement element = d.findElement(By.id("amazing")); - assertNotNull(element); - } - - @Test - public void shouldSwitchBetweenNestedFrames() { - // Define HTTP response for test - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - String pathInfo = req.getPathInfo(); - ServletOutputStream out = res.getOutputStream(); - - // NOTE: the following pages are cut&paste from "Watir" test specs. - // @see https://github.com/watir/watirspec/tree/master/html/nested_frame.html - if (pathInfo.endsWith("nested_frame_1.html")) { - // nested frame 1 - out.println("frame 1"); - } else if (pathInfo.endsWith("nested_frame_2.html")) { - // nested frame 2 - out.println("\n" + - "\n" + - " \n" + - " \n" + - " \n" + - ""); - } else if (pathInfo.endsWith("nested_frame_3.html")) { - // nested frame 3, nested inside frame 2 - out.println("\n" + - "\n" + - " \n" + - " this link should consume the page\n" + - " \n" + - ""); - } else if (pathInfo.endsWith("definition_lists.html")) { - // definition lists - out.println("\n" + - " \n" + - " definition_lists\n" + - " \n" + - ""); - } else { - // main page - out.println("\n" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - ""); - } - } - }); - - // Launch Driver against the above defined server - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - // Switch to frame "#two" - d.switchTo().frame("two"); - // Switch further down into frame "#three" - d.switchTo().frame("three"); - // Click on the link in frame "#three" - d.findElement(By.id("four")).click(); - - // Expect page to have loaded and title to be set correctly - new WebDriverWait(d, 5).until(ExpectedConditions.titleIs("definition_lists")); - } - - @Test - public void shouldSwitchBetweenNestedFramesPickedViaWebElement() { - // Define HTTP response for test - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - String pathInfo = req.getPathInfo(); - ServletOutputStream out = res.getOutputStream(); - - // NOTE: the following pages are cut&paste from "Watir" test specs. - // @see https://github.com/watir/watirspec/tree/master/html/nested_frame.html - if (pathInfo.endsWith("nested_frame_1.html")) { - // nested frame 1 - out.println("frame 1"); - } else if (pathInfo.endsWith("nested_frame_2.html")) { - // nested frame 2 - out.println("\n" + - "\n" + - " \n" + - " \n" + - " \n" + - ""); - } else if (pathInfo.endsWith("nested_frame_3.html")) { - // nested frame 3, nested inside frame 2 - out.println("\n" + - "\n" + - " \n" + - " this link should consume the page\n" + - " \n" + - ""); - } else if (pathInfo.endsWith("definition_lists.html")) { - // definition lists - out.println("\n" + - " \n" + - " definition_lists\n" + - " \n" + - ""); - } else { - // main page - out.println("\n" + - "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - ""); - } - } - }); - - // Launch Driver against the above defined server - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - // Switch to frame "#two" - d.switchTo().frame(d.findElement(By.id("two"))); - // Switch further down into frame "#three" - d.switchTo().frame(d.findElement(By.id("three"))); - // Click on the link in frame "#three" - d.findElement(By.id("four")).click(); - - // Expect page to have loaded and title to be set correctly - new WebDriverWait(d, 5).until(ExpectedConditions.titleIs("definition_lists")); - } - - @Test - public void shouldBeAbleToSwitchToIFrameThatHasNoNameNorId() { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("" + - "" + - " " + - "" + - ""); - } - }); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - WebElement el = d.findElement(By.tagName("iframe")); - d.switchTo().frame(el); - } - - @Test(expected = TimeoutException.class) - public void shouldTimeoutWhileChangingIframeSource() { - final String iFrameId = "iframeId"; - - // Define HTTP response for test - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - String pathInfo = req.getPathInfo(); - ServletOutputStream out = res.getOutputStream(); - - if (pathInfo.endsWith("iframe_content.html")) { - // nested frame 1 - out.println("iframe content"); - } else { - // main page - out.println("\n" + - "\n" + - " \n" + - " \n" + - "\n" + - ""); - } - } - }); - - // Launch Driver against the above defined server - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - // Switch to iframe - d.switchTo().frame(iFrameId); - assertEquals(0, d.findElements(By.id(iFrameId)).size()); - assertFalse(d.getPageSource().toLowerCase().contains("iframe content")); - - new WebDriverWait(d, 5).until(new Predicate() { - @Override - public boolean apply(@Nullable WebDriver driver) { - assertEquals(0, driver.findElements(By.id(iFrameId)).size()); - return (Boolean) ((JavascriptExecutor) driver).executeScript("return false;"); - } - }); - } - - @Test - public void shouldSwitchToTheRightFrame() { - WebDriver d = getDriver(); - - // Load "outside.html" and check it's the right one - d.get(server.getBaseUrl() + "right_frame/outside.html"); - assertTrue(d.getPageSource().contains("Editing testDotAtEndDoesNotDelete")); - assertEquals(2, d.findElements(By.tagName("iframe")).size()); - - // Find the iframe with class "gwt-RichTextArea" - WebElement iframeRichTextArea = d.findElement(By.className("gwt-RichTextArea")); - - // Switch to the iframe via WebElement and check it's the right one - d.switchTo().frame(iframeRichTextArea); - assertEquals(0, d.findElements(By.tagName("title")).size()); - assertFalse(d.getPageSource().contains("Editing testDotAtEndDoesNotDelete")); - assertEquals(0, d.findElements(By.tagName("iframe")).size()); - - // Switch back to the main frame and check it's the right one - d.switchTo().defaultContent(); - assertEquals(2, d.findElements(By.tagName("iframe")).size()); - - // Switch again to the iframe, this time via it's "frame number" (i.e. 0 to n) - d.switchTo().frame(0); - assertEquals(0, d.findElements(By.tagName("title")).size()); - assertFalse(d.getPageSource().contains("Editing testDotAtEndDoesNotDelete")); - assertEquals(0, d.findElements(By.tagName("iframe")).size()); - - // Switch back to the main frame and check it's the right one - d.switchTo().defaultContent(); - assertEquals(2, d.findElements(By.tagName("iframe")).size()); - - // Switch to the second frame via it's "frame number" - d.switchTo().frame(1); - assertEquals(1, d.findElements(By.tagName("title")).size()); - assertEquals(0, d.findElements(By.tagName("iframe")).size()); - assertTrue(d.getPageSource().contains("WYSIWYG Editor Input Template")); - - // Switch again to the main frame - d.switchTo().defaultContent(); - assertEquals(2, d.findElements(By.tagName("iframe")).size()); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/GoogleSearchTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/GoogleSearchTest.java deleted file mode 100644 index 5d0f12ecd8..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/GoogleSearchTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.ui.WebDriverWait; -import org.openqa.selenium.support.ui.ExpectedConditions; - -import static org.junit.Assert.assertTrue; - -public class GoogleSearchTest extends BaseTest { - @Test - public void searchForCheese() { - String strToSearchFor = "Cheese!"; - WebDriver d = getDriver(); - - // Load Google.com - d.get(" http://www.google.com"); - // Locate the Search field on the Google page - WebElement element = d.findElement(By.name("q")); - // Type Cheese - element.sendKeys(strToSearchFor); - // Submit form - element.submit(); - - new WebDriverWait(d, 5).until(ExpectedConditions.titleIs("Cheese! - Google Search")); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/IsolatedSessionTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/IsolatedSessionTest.java deleted file mode 100644 index 0fd63362df..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/IsolatedSessionTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Before; -import org.junit.Test; -import org.openqa.selenium.Cookie; -import org.openqa.selenium.WebDriver; - -import java.util.Set; - -import static org.junit.Assert.assertFalse; - -public class IsolatedSessionTest extends BaseTest { - // New Session Cookies will be stored in here - private String url = "http://httpbin.org/cookies/set"; - private Set firstSessionCookies; - private Set secondSessionCookies; - - @Before - public void createSession() throws Exception { - disableAutoQuitDriver(); - - // Create first Driver, and grab it's cookies - WebDriver d = getDriver(); - d.get(url + "?session1=value1"); - // Grab set of session cookies - firstSessionCookies = d.manage().getCookies(); - // Manually quit the current Driver and create a new one - d.quit(); - - // Create second Driver, and grab it's cookies - prepareDriver(); - d = getDriver(); - d.get(url + "?session2=value2"); - // Grab set of session cookies - secondSessionCookies = d.manage().getCookies(); - // Manually quit the current Driver and create a new one - d.quit(); - } - - @Test - public void shouldCreateASeparateSessionWithEveryNewDriverInstance() { - // No cookie of the new Session can be found in the cookies of the old Session - for (Cookie c : firstSessionCookies) { - assertFalse(secondSessionCookies.contains(c)); - } - // No cookie of the old Session can be found in the cookies of the new Session - for (Cookie c : secondSessionCookies) { - assertFalse(firstSessionCookies.contains(c)); - } - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/LogTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/LogTest.java deleted file mode 100644 index bd74feddac..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/LogTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.logging.LogEntries; -import org.openqa.selenium.logging.LogEntry; -import org.openqa.selenium.logging.LogType; -import org.openqa.selenium.logging.LoggingPreferences; -import org.openqa.selenium.remote.CapabilityType; -import java.util.logging.Level; -import org.junit.BeforeClass; - -import java.util.Set; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class LogTest extends BaseTestWithServer { - - @BeforeClass - public static void setCustomHeaders() { - LoggingPreferences logPrefs = new LoggingPreferences(); - logPrefs.enable(LogType.BROWSER, Level.ALL); - logPrefs.enable("har", Level.ALL); - sCaps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs); - } - - @Test - public void shouldReturnListOfAvailableLogs() { - WebDriver d = getDriver(); - Set logTypes = d.manage().logs().getAvailableLogTypes(); - - if (d.getClass().getSimpleName().equals("PhantomJSDriver")) { - // GhostDriver only has 3 log types... - assertEquals(3, logTypes.size()); - // ... and "har" is one of them - assertTrue(logTypes.contains("har")); - } else { - assertTrue(logTypes.size() >= 2); - } - assertTrue(logTypes.contains("client")); - assertTrue(logTypes.contains("browser")); - - } - - @Test - public void shouldReturnLogTypeBrowser() { - WebDriver d = getDriver(); - d.get(server.getBaseUrl() + "/common/errors.html"); - // Throw 3 errors that are logged in the Browser's console - WebElement throwErrorButton = d.findElement(By.cssSelector("input[type='button']")); - throwErrorButton.click(); - throwErrorButton.click(); - throwErrorButton.click(); - - // Retrieve and count the errors - LogEntries logEntries = d.manage().logs().get("browser"); - assertEquals(3, logEntries.getAll().size()); - - for (LogEntry logEntry : logEntries) { - System.out.println(logEntry); - } - - // Clears logs - logEntries = d.manage().logs().get("browser"); - assertEquals(0, logEntries.getAll().size()); - } - - @Test - public void shouldReturnLogTypeHar() { - WebDriver d = getDriver(); - d.get(server.getBaseUrl() + "/common/iframes.html"); - - LogEntries logEntries = d.manage().logs().get("har"); - for (LogEntry logEntry : logEntries) { - System.out.println(logEntry); - } - - String firstRequestMessage = logEntries.getAll().get(0).getMessage(); - String secondRequestMessage = d.manage().logs().get("har").getAll().get(0).getMessage(); - assertTrue(secondRequestMessage.length() < firstRequestMessage.length()); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/MouseCommandsTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/MouseCommandsTest.java deleted file mode 100644 index 14d8b51042..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/MouseCommandsTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class MouseCommandsTest extends BaseTestWithServer { - @Test - public void move() { - WebDriver d = getDriver(); - Actions actionBuilder = new Actions(d); - - d.get("http://www.duckduckgo.com"); - - // Move mouse by x,y - actionBuilder.moveByOffset(100, 100).build().perform(); - // Move mouse on a given element - actionBuilder.moveToElement(d.findElement(By.id("logo_homepage_link"))).build().perform(); - // Move mouse on a given element, by x,y relative coordinates - actionBuilder.moveToElement(d.findElement(By.id("logo_homepage_link")), 50, 50).build().perform(); - } - - @Test - public void clickAndRightClick() { - WebDriver d = getDriver(); - Actions actionBuilder = new Actions(d); - - d.get("http://www.duckduckgo.com"); - - // Left click - actionBuilder.click().build().perform(); - // Right click - actionBuilder.contextClick(null).build().perform(); - // Right click on the logo (it will cause a "/moveto" before clicking - actionBuilder.contextClick(d.findElement(By.id("logo_homepage_link"))).build().perform(); - } - - @Test - public void doubleClick() { - WebDriver d = getDriver(); - Actions actionBuilder = new Actions(d); - - d.get("http://www.duckduckgo.com"); - - // Double click - actionBuilder.doubleClick().build().perform(); - // Double click on the logo - actionBuilder.doubleClick(d.findElement(By.id("logo_homepage_link"))).build().perform(); - } - - @Test - public void clickAndHold() { - WebDriver d = getDriver(); - Actions actionBuilder = new Actions(d); - - d.get("http://www.duckduckgo.com"); - - // Hold, then release - actionBuilder.clickAndHold().build().perform(); - actionBuilder.release(); - // Hold on the logo, then release - actionBuilder.clickAndHold(d.findElement(By.id("logo_homepage_link"))).build().perform(); - actionBuilder.release(); - } - - @Test - public void handleClickWhenOnClickInlineCodeFails() { - // Define HTTP response for test - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("" + - "" + - "\n" + - "" + - "" + - "\n" + - "Click me" + - "" + - ""); - } - }); - - // Navigate to local server - WebDriver d = getDriver(); - d.navigate().to(server.getBaseUrl()); - - WebElement el = d.findElement(By.linkText("Click me")); - el.click(); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/NavigationTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/NavigationTest.java deleted file mode 100644 index c0f9f170f5..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/NavigationTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.phantomjs.PhantomJSDriverService; - -import static org.junit.Assert.assertTrue; - -public class NavigationTest extends BaseTest { - @BeforeClass - public static void setUserAgentForPhantomJSDriver() { - // Setting a generic Chrome UA to bypass some UA spoofing - sCaps.setCapability( - PhantomJSDriverService.PHANTOMJS_PAGE_SETTINGS_PREFIX + "userAgent", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11" - ); - } - - @Test - public void navigateAroundMDN() { - WebDriver d = getDriver(); - - d.get("https://developer.mozilla.org/en-US/"); - assertTrue(d.getTitle().toLowerCase().contains("Mozilla".toLowerCase())); - d.navigate().to("https://developer.mozilla.org/en/HTML/HTML5"); - assertTrue(d.getTitle().toLowerCase().contains("HTML5".toLowerCase())); - d.navigate().refresh(); - assertTrue(d.getTitle().toLowerCase().contains("HTML5".toLowerCase())); - d.navigate().back(); - assertTrue(d.getTitle().toLowerCase().contains("Mozilla".toLowerCase())); - d.navigate().forward(); - assertTrue(d.getTitle().toLowerCase().contains("HTML5".toLowerCase())); - } - - @Test - public void navigateBackWithNoHistory() throws Exception { - // Fresh Driver (every test gets one) - WebDriver d = getDriver(); - - // Navigate back and forward: should be a no-op, given we haven't loaded anything yet - d.navigate().back(); - d.navigate().forward(); - - // Make sure explicit navigation still works. - d.get("http://google.com"); - } - - @Test - public void navigateToGoogleAdwords() { - WebDriver d = getDriver(); - d.get("http://adwords.google.com"); - assertTrue(d.getCurrentUrl().contains("google.com")); - } - - @Test - public void navigateToNameJet() { - // NOTE: This passes only when the User Agent is NOT PhantomJS {@see setUserAgentForPhantomJSDriver} - // method above. - WebDriver d = getDriver(); - d.navigate().to("http://www.namejet.com/"); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/PhantomJSCommandTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/PhantomJSCommandTest.java deleted file mode 100755 index a9ebbc4161..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/PhantomJSCommandTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.phantomjs.PhantomJSDriver; - -import static junit.framework.TestCase.assertEquals; - -public class PhantomJSCommandTest extends BaseTest { - @Test - public void executePhantomJS() { - WebDriver d = getDriver(); - if (!(d instanceof PhantomJSDriver)) { - // Skip this test if not using PhantomJS. - // The command under test is only available when using PhantomJS - return; - } - - PhantomJSDriver phantom = (PhantomJSDriver)d; - - // Do we get results back? - Object result = phantom.executePhantomJS("return 1 + 1"); - assertEquals(new Long(2), (Long)result); - - // Can we read arguments? - result = phantom.executePhantomJS("return arguments[0] + arguments[0]", new Long(1)); - assertEquals(new Long(2), (Long)result); - - // Can we override some browser JavaScript functions in the page context? - result = phantom.executePhantomJS("var page = this;" + - "page.onInitialized = function () { " + - "page.evaluate(function () { " + - "Math.random = function() { return 42 / 100 } " + - "})" + - "}"); - - phantom.get("http://ariya.github.com/js/random/"); - - WebElement numbers = phantom.findElement(By.id("numbers")); - boolean foundAtLeastOne = false; - for(String number : numbers.getText().split(" ")) { - foundAtLeastOne = true; - assertEquals("42", number); - } - assert(foundAtLeastOne); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/RuntimeProxySetupTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/RuntimeProxySetupTest.java deleted file mode 100644 index 599f56ac8e..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/RuntimeProxySetupTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -Copyright (c) 2014, Artem Koshelev -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import com.github.detro.browsermobproxyclient.BMPCLocalLauncher; -import com.github.detro.browsermobproxyclient.BMPCProxy; -import com.github.detro.browsermobproxyclient.manager.BMPCLocalManager; -import com.google.gson.JsonObject; -import org.junit.*; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.remote.CapabilityType; - -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -@RunWith(Parameterized.class) -public class RuntimeProxySetupTest extends BaseTestWithServer { - private static BMPCLocalManager localProxyManager; - private BMPCProxy proxy; - private URL url; - - @Parameterized.Parameters(name = "URL requested through Proxy: {0}") - public static Collection data() throws Exception { - List requestedUrls = new ArrayList(); - requestedUrls.add(new URL[]{new URL("http://www.google.com/")}); - requestedUrls.add(new URL[]{new URL("http://ivandemarino.me/ghostdriver/")}); - return requestedUrls; - } - - public RuntimeProxySetupTest(URL url) { - this.url = url; - } - - @BeforeClass - public static void startProxyManager() { - localProxyManager = BMPCLocalLauncher.launchOnRandomPort(); - } - - @Before - public void createProxy() throws Exception { - proxy = localProxyManager.createProxy(); - sCaps.setCapability(CapabilityType.PROXY, proxy.asSeleniumProxy()); - prepareDriver(); - } - - @Test - public void requestsProcessedByProxy() { - proxy.newHar(url.toString()); - - WebDriver driver = getDriver(); - driver.navigate().to(url); - - JsonObject har = proxy.har(); - assertNotNull(har); - String firstUrlLoaded = har.getAsJsonObject("log") - .getAsJsonArray("entries").get(0).getAsJsonObject() - .getAsJsonObject("request") - .getAsJsonPrimitive("url").getAsString(); - assertEquals(url.toString(), firstUrlLoaded); - } - - @After - public void closeProxy() { - proxy.close(); - } - - @AfterClass - public static void stopProxyManager() throws Exception { - localProxyManager.closeAll(); - localProxyManager.stop(); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/ScriptExecutionTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/ScriptExecutionTest.java deleted file mode 100644 index 8a2046c753..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/ScriptExecutionTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Ignore; -import org.junit.Test; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.*; - -public class ScriptExecutionTest extends BaseTest { - @Test - public void findGoogleInputFieldInjectingJavascript() { - WebDriver d = getDriver(); - d.get("http://www.google.com"); - WebElement e = (WebElement)((JavascriptExecutor) d).executeScript( - "return document.querySelector(\"[name='\"+arguments[0]+\"']\");", - "q"); - assertNotNull(e); - assertEquals("input", e.getTagName().toLowerCase()); - } - - @Test - public void setTimeoutAsynchronously() { - WebDriver d = getDriver(); - d.get("http://www.google.com"); - String res = (String)((JavascriptExecutor) d).executeAsyncScript( - "window.setTimeout(arguments[arguments.length - 1], arguments[0], 'done');", - 1000); - assertEquals("done", res); - } - - @Test - public void shouldBeAbleToPassMultipleArgumentsToAsyncScripts() { - WebDriver d = getDriver(); - d.manage().timeouts().setScriptTimeout(0, TimeUnit.MILLISECONDS); - d.get("http://www.google.com/"); - Number result = (Number) ((JavascriptExecutor) d).executeAsyncScript( - "arguments[arguments.length - 1](arguments[0] + arguments[1]);", - 1, - 2); - assertEquals(3, result.intValue()); - - // Verify that a future navigation does not cause the driver to have problems. - d.get("http://www.google.com/"); - } - - @Test - public void shouldBeAbleToExecuteMultipleAsyncScriptsSequentially() { - WebDriver d = getDriver(); - d.manage().timeouts().setScriptTimeout(0, TimeUnit.MILLISECONDS); - d.get("http://www.google.com/"); - Number numericResult = (Number) ((JavascriptExecutor) d).executeAsyncScript( - "arguments[arguments.length - 1](123);"); - assertEquals(123, numericResult.intValue()); - String stringResult = (String) ((JavascriptExecutor) d).executeAsyncScript( - "arguments[arguments.length - 1]('abc');"); - assertEquals("abc", stringResult); - } - - @Ignore("Known issue #140 - see https://github.com/detro/ghostdriver/issues/140)") - @Test - public void shouldBeAbleToExecuteMultipleAsyncScriptsSequentiallyWithNavigation() { - // NOTE: This test is supposed to fail! - // It's a reminder that there is some internal issue in PhantomJS still to address. - - WebDriver d = getDriver(); - d.manage().timeouts().setScriptTimeout(0, TimeUnit.MILLISECONDS); - - d.get("http://www.google.com/"); - Number numericResult = (Number) ((JavascriptExecutor) d).executeAsyncScript( - "arguments[arguments.length - 1](123);"); - assertEquals(123, numericResult.intValue()); - - d.get("http://www.google.com/"); - String stringResult = (String) ((JavascriptExecutor) d).executeAsyncScript( - "arguments[arguments.length - 1]('abc');"); - assertEquals("abc", stringResult); - - // Verify that a future navigation does not cause the driver to have problems. - d.get("http://www.google.com/"); - } - - @Ignore("Known issue #140 - see https://github.com/detro/ghostdriver/issues/140)") - @Test - public void executeAsyncScriptMultipleTimesWithoutCrashing() { - // NOTE: This test is supposed to fail! - // It's a reminder that there is some internal issue in PhantomJS still to address. - - WebDriver d = getDriver(); - - String hello = null; - try { - hello = URLEncoder.encode("

hello

", "UTF-8"); - } catch (UnsupportedEncodingException uee) { - fail(); - } - - for (int i = 1; i < 5; ++i) { - d.get("data:text/html;content-type=utf-8,"+hello); - String h = (String)((JavascriptExecutor) d).executeAsyncScript("arguments[arguments.length - 1]('hello')"); - assertEquals("hello", h); - } - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/SessionBasicTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/SessionBasicTest.java deleted file mode 100644 index e78aa135a0..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/SessionBasicTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.NoSuchWindowException; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.NoSuchSessionException; - -import java.net.MalformedURLException; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -public class SessionBasicTest extends BaseTest { - - @Test(expected = NoSuchSessionException.class) - public void quitShouldTerminatePhantomJSProcess() throws MalformedURLException { - // Get Driver Instance - WebDriver d = getDriver(); - d.navigate().to("about:blank"); - - // Quit the driver, that will cause the process to close - d.quit(); - - // Throws "SessionNotFoundException", because no process is actually left to respond - d.getWindowHandle(); - } - - @Test(expected = NoSuchWindowException.class) - public void closeShouldNotTerminatePhantomJSProcess() throws MalformedURLException { - // By default, 1 window is created when Driver is launched - WebDriver d = getDriver(); - assertEquals(1, d.getWindowHandles().size()); - - // Check the number of windows - d.navigate().to("about:blank"); - assertEquals(1, d.getWindowHandles().size()); - - // Create a new window - ((JavascriptExecutor) d).executeScript("window.open('http://www.google.com','google');"); - assertEquals(2, d.getWindowHandles().size()); - - // Close 1 window and check that 1 is left - d.close(); - assertEquals(1, d.getWindowHandles().size()); - - // Switch to that window - d.switchTo().window("google"); - assertNotNull(d.getWindowHandle()); - - // Close the remaining window and check now there are no windows available - d.close(); - assertEquals(0, d.getWindowHandles().size()); - - // This should throw a "NoSuchWindowException": the Driver is still running, but no Session/Window are left - d.getWindowHandle(); - } - -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/TimeoutSettingTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/TimeoutSettingTest.java deleted file mode 100644 index e65f90e0a2..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/TimeoutSettingTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.WebDriver; - -import java.util.concurrent.TimeUnit; - -public class TimeoutSettingTest extends BaseTest { - @Test - public void navigateAroundMDN() { - WebDriver d = getDriver(); - d.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); - d.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS); - d.manage().timeouts().setScriptTimeout(5, TimeUnit.SECONDS); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/UnhandledAlertAcceptTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/UnhandledAlertAcceptTest.java deleted file mode 100644 index c0fbd27cb9..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/UnhandledAlertAcceptTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2017, Jason Gowan -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.phantomjs.PhantomJSDriverService; -import org.openqa.selenium.support.ui.WebDriverWait; -import org.openqa.selenium.support.ui.ExpectedConditions; - -public class UnhandledAlertAcceptTest extends BaseTestWithServer { - - - @Override - public void prepareDriver() throws Exception { - sCaps.setCapability("unhandledPromptBehavior", "accept"); - - super.prepareDriver(); - } - - @Test - public void canHandleAlert() { - // Get Driver Instance - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/alerts.html"); - d.findElement(By.id("alert2")).click(); - - new WebDriverWait(d, 5).until(ExpectedConditions.presenceOfElementLocated(By.id("cheese-child"))); - } - - @Test - public void canHandleConfirm() { - // Get Driver Instance - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/alerts.html"); - WebElement elem = d.findElement(By.id("confirm2")); - elem.click(); - - new WebDriverWait(d, 5).until(ExpectedConditions.attributeToBe(elem, "value", "true")); - } - - @Test - public void canHandlePrompt() { - // Get Driver Instance - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/alerts.html"); - WebElement elem = d.findElement(By.id("prompt2")); - elem.click(); - - new WebDriverWait(d, 5).until(ExpectedConditions.attributeToBe(elem, "value", "default value")); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/UnhandledAlertDismissTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/UnhandledAlertDismissTest.java deleted file mode 100644 index 1a4f0f7463..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/UnhandledAlertDismissTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2017, Jason Gowan -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.phantomjs.PhantomJSDriverService; -import org.openqa.selenium.support.ui.WebDriverWait; -import org.openqa.selenium.support.ui.ExpectedConditions; - -public class UnhandledAlertDismissTest extends BaseTestWithServer { - - - @Override - public void prepareDriver() throws Exception { - sCaps.setCapability("unhandledPromptBehavior", "dismiss"); - - super.prepareDriver(); - } - - @Test - public void canHandleAlert() { - // Get Driver Instance - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/alerts.html"); - d.findElement(By.id("alert2")).click(); - - new WebDriverWait(d, 5).until(ExpectedConditions.presenceOfElementLocated(By.id("cheese-child"))); - } - - @Test - public void canHandleConfirm() { - // Get Driver Instance - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/alerts.html"); - WebElement elem = d.findElement(By.id("confirm2")); - elem.click(); - - new WebDriverWait(d, 5).until(ExpectedConditions.attributeToBe(elem, "value", "false")); - } - - @Test - public void canHandlePrompt() { - // Get Driver Instance - WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/alerts.html"); - WebElement elem = d.findElement(By.id("prompt2")); - elem.click(); - - new WebDriverWait(d, 5).until(ExpectedConditions.attributeToBe(elem, "value", "default value")); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/VisibilityTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/VisibilityTest.java deleted file mode 100644 index 404b320fef..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/VisibilityTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.openqa.selenium.*; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.WebDriverWait; -import java.io.*; -// import org.apache.commons.fileupload.FileItem; -// import org.apache.commons.fileupload.FileUploadException; -// import org.apache.commons.fileupload.disk.DiskFileItemFactory; -// import org.apache.commons.io.IOUtils; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import static org.junit.Assert.*; - -public class VisibilityTest extends BaseTestWithServer { - - @Test - public void testShouldNotBeAbleToTypeToAnElementThatIsNotDisplayed() { - - WebDriver d = getDriver(); - d.get(server.getBaseUrl() + "/common/send_keys_visibility.html"); - - WebElement elem = d.findElement(By.id("unclickable")); - - try { - elem.sendKeys("this is not visible"); - fail("You should not be able to send keyboard input to an invisible element"); - } catch (InvalidElementStateException e) { - } - - assertFalse(elem.getAttribute("value").equals("this is not visible")); - assertTrue(d.findElement(By.id("log")).getText().trim().equals("Log:")); - } - - @Test - public void testShouldNotBeAbleToTypeToAFileInputElementThatIsNotDisplayed() throws IOException { - - // Create the test file for uploading - File testFile = File.createTempFile("webdriver", "tmp"); - testFile.deleteOnExit(); - BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( - new FileOutputStream(testFile.getAbsolutePath()), "utf-8")); - writer.write("Hello"); - writer.close(); - - WebDriver d = getDriver(); - d.get(server.getBaseUrl() + "/common/send_keys_visibility.html"); - - WebElement elem = d.findElement(By.id("unclickable_file")); - - try { - elem.sendKeys(testFile.getAbsolutePath()); - fail("You should not be able to send keyboard input to an invisible element"); - } catch (ElementNotVisibleException e) { - } - - assertFalse(elem.getAttribute("value").equals(testFile.getAbsolutePath())); - assertTrue(d.findElement(By.id("log")).getText().trim().equals("Log:")); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowHandlesTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowHandlesTest.java deleted file mode 100644 index 2e3d26fb77..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowHandlesTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import ghostdriver.server.HttpRequestCallback; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Set; - -import static org.junit.Assert.*; - -public class WindowHandlesTest extends BaseTestWithServer { - @Test - public void enumerateWindowHandles() { - WebDriver d = getDriver(); - - // Didn't open any page yet: no Window Handles yet - Set whandles = d.getWindowHandles(); - assertEquals(whandles.size(), 1); - - // Open Google and count the Window Handles: there should be at least 1 - d.get("http://www.google.com"); - whandles = d.getWindowHandles(); - assertEquals(whandles.size(), 1); - } - - @Test - public void enumerateWindowHandle() { - WebDriver d = getDriver(); - - // Didn't open any page yet: no Window Handles yet - String whandle = d.getWindowHandle(); - assertFalse(whandle.isEmpty()); - } - - @Test - public void openPopupAndGetCurrentUrl() throws InterruptedException { - server.setHttpHandler("GET", new HttpRequestCallback() { - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println("" + - "" + - "\n" + - "\n" + - " \n" + - " Link to popup" + - " \n" + - ""); - } - }); - - // Load page - WebDriver d = getDriver(); - d.get(server.getBaseUrl()); - - // Click on link that will cause popup to be created - d.findElement(By.xpath("//a")).click(); - // Switch to new popup - String popupHandle = (String)d.getWindowHandles().toArray()[1]; - d.switchTo().window(popupHandle); - - assertTrue(d.getTitle().contains("Japan")); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowSizingAndPositioningTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowSizingAndPositioningTest.java deleted file mode 100644 index 887bd24974..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowSizingAndPositioningTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.Dimension; -import org.openqa.selenium.Point; -import org.openqa.selenium.WebDriver; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class WindowSizingAndPositioningTest extends BaseTest { - @Test - public void manipulateWindowSize() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - assertTrue(d.manage().window().getSize().width > 100); - assertTrue(d.manage().window().getSize().height > 100); - - d.manage().window().setSize(new Dimension(1024, 768)); - assertEquals(d.manage().window().getSize().width, 1024); - assertEquals(d.manage().window().getSize().height, 768); - } - - @Test - public void manipulateWindowPosition() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - assertTrue(d.manage().window().getPosition().x >= 0); - assertTrue(d.manage().window().getPosition().y >= 0); - - d.manage().window().setPosition(new Point(0, 0)); - assertTrue(d.manage().window().getPosition().x == 0); - assertTrue(d.manage().window().getPosition().y == 0); - } - - @Test - public void manipulateWindowMaximize() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - - Dimension sizeBefore = d.manage().window().getSize(); - d.manage().window().maximize(); - Dimension sizeAfter = d.manage().window().getSize(); - - assertTrue(sizeBefore.width <= sizeAfter.width); - assertTrue(sizeBefore.height <= sizeAfter.height); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowSwitchingTest.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowSwitchingTest.java deleted file mode 100644 index 070d4556cc..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/WindowSwitchingTest.java +++ /dev/null @@ -1,220 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver; - -import com.google.common.base.Function; -import org.junit.Test; -import org.openqa.selenium.*; -import org.openqa.selenium.support.ui.WebDriverWait; - -import javax.annotation.Nullable; - -import static org.junit.Assert.*; - -public class WindowSwitchingTest extends BaseTestWithServer { - @Test - public void switchBetween3WindowsThenDeleteSecondOne() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - String googleWH = d.getWindowHandle(); - assertEquals(d.getWindowHandles().size(), 1); - - // Open a new window and make sure the window handle is different - ((JavascriptExecutor) d).executeScript("window.open('http://www.yahoo.com', 'yahoo')"); - assertEquals(d.getWindowHandles().size(), 2); - String yahooWH = (String) d.getWindowHandles().toArray()[1]; - assertTrue(!yahooWH.equals(googleWH)); - - // Switch to the yahoo window and check that the current window handle has changed - d.switchTo().window(yahooWH); - assertEquals(d.getWindowHandle(), yahooWH); - - // Open a new window and make sure the window handle is different - ((JavascriptExecutor) d).executeScript("window.open('http://www.bing.com', 'bing')"); - assertEquals(d.getWindowHandles().size(), 3); - String bingWH = (String) d.getWindowHandles().toArray()[2]; - assertTrue(!bingWH.equals(googleWH)); - assertTrue(!bingWH.equals(yahooWH)); - - // Close yahoo window - d.close(); - - // Switch to google window and notice that only google and bing are left - d.switchTo().window(googleWH); - assertEquals(d.getWindowHandles().size(), 2); - assertTrue(d.getWindowHandles().contains(googleWH)); - assertTrue(d.getWindowHandles().contains(bingWH)); - } - - @Test(expected = NoSuchWindowException.class) - public void switchBetween3WindowsThenDeleteFirstOne() { - WebDriver d = getDriver(); - - d.get("http://www.google.com"); - String googleWH = d.getWindowHandle(); - assertEquals(d.getWindowHandles().size(), 1); - - // Open a new window and make sure the window handle is different - ((JavascriptExecutor) d).executeScript("window.open('http://www.yahoo.com', 'yahoo')"); - assertEquals(d.getWindowHandles().size(), 2); - String yahooWH = (String) d.getWindowHandles().toArray()[1]; - assertTrue(!yahooWH.equals(googleWH)); - - // Switch to the yahoo window and check that the current window handle has changed - d.switchTo().window(yahooWH); - assertEquals(d.getWindowHandle(), yahooWH); - - // Open a new window and make sure the window handle is different - ((JavascriptExecutor) d).executeScript("window.open('http://www.bing.com', 'bing')"); - assertEquals(d.getWindowHandles().size(), 3); - String bingWH = (String) d.getWindowHandles().toArray()[2]; - assertTrue(!bingWH.equals(googleWH)); - assertTrue(!bingWH.equals(yahooWH)); - - // Switch to google window and close it - d.switchTo().window(googleWH); - d.close(); - - // Notice that yahoo and bing are the only left - assertEquals(d.getWindowHandles().size(), 2); - assertTrue(d.getWindowHandles().contains(yahooWH)); - assertTrue(d.getWindowHandles().contains(bingWH)); - - // Try getting the title of the, now closed, google window and cause an Exception - d.getTitle(); - } - - @Test - public void switchToSameWindowViaHandle() { - WebDriver d = getDriver(); - d.navigate().to(server.getBaseUrl() + "/common/frameset.html"); - - // Get handle of the main html page - String windowHandle = d.getWindowHandle(); - - // Verify that the element can be retrieved from the main page: - WebElement e = d.findElement(By.tagName("frameset")); - assertNotNull(e); - - // Switch to the frame. - d.switchTo().frame(0); - e = null; - try { - e = d.findElement(By.tagName("frameset")); - } catch (NoSuchElementException ex) { - // swallow the exception - } - assertNull(e); - - // Switch back to the main page using the original window handle: - d.switchTo().window(windowHandle); - - // This then throws an element not found exception.. the main page was not selected. - e = d.findElement(By.tagName("frameset")); - assertNotNull(e); - } - - @Test - public void shouldBeAbleToClickALinkThatClosesAWindow() throws Exception { - final WebDriver d = getDriver(); - d.get(server.getBaseUrl() + "/common/javascriptPage.html"); - - String handle = d.getWindowHandle(); - d.findElement(By.id("new_window")).click(); - - // Wait until we can switch to the new window - WebDriverWait waiter = new WebDriverWait(d, 10); - waiter.until(new Function() { - @Override - public Object apply(@Nullable WebDriver input) { - try { - d.switchTo().window("close_me"); - return true; - } catch (Exception e) { - return false; - } - } - }); - assertEquals(0, d.findElements(By.id("new_window")).size()); - - // Click on the "close" link. - // NOTE : This will cause the window currently in focus to close - d.findElement(By.id("close")).click(); - - d.switchTo().window(handle); - assertNotNull(d.findElement(By.id("new_window"))); - - // NOTE: If we haven't seen an exception or hung the test has passed - } - - @Test - public void shouldNotBeAbleToSwitchBackToInitialWindowUsingEmptyWindowNameParameter() { - final WebDriver d = getDriver(); - - d.get(server.getBaseUrl() + "/common/xhtmlTest.html"); - - // Store the first window handle - String initialWindowHandle = d.getWindowHandle(); - - // Ensure we are where we think we are, then click on "windowOne" to open another window - assertEquals(1, d.findElements(By.name("windowOne")).size()); - d.findElement(By.name("windowOne")).click(); - - // Wait until we can switch to the new window - WebDriverWait waiter = new WebDriverWait(d, 10); - waiter.until(new Function() { - @Override - public Object apply(@Nullable WebDriver input) { - try { - d.switchTo().window("result"); - return true; - } catch (Exception e) { - return false; - } - } - }); - // Check we are on the new window - assertEquals(1, d.findElements(By.id("greeting")).size()); - - // Switch to the first screen that has "window.name = ''". Usually, the first window of the Session. - d.switchTo().window(""); - // Close the window - d.close(); - - try { - // This second call to switch to window with empty string should fail. - // NOTE: I can't use "@Test(expected..." because the first call might throw the same exception - // and we won't be able to distinguish. - d.switchTo().window(""); - fail(); - } catch (NoSuchWindowException nswe) { - // If we are here, all is happening as expected - } - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/WrongErrorMappingThroughSeleniumServer.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/WrongErrorMappingThroughSeleniumServer.java deleted file mode 100644 index c73a5e22f5..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/WrongErrorMappingThroughSeleniumServer.java +++ /dev/null @@ -1,31 +0,0 @@ -package ghostdriver; - -import org.junit.Test; -import org.openqa.selenium.*; - -public class WrongErrorMappingThroughSeleniumServer extends BaseTest { - - @Test(expected = NoSuchElementException.class) - public void shouldThrowNoSuchElementException() { - WebDriver driver = getDriver(); - - String google = "http://www.google.com/ncr"; - driver.get(google); - driver.findElement(By.name("q")); - driver.findElement(By.name("nonameexists")); - } - - @Test(expected = StaleElementReferenceException.class) - public void shouldThrowStaleElementReference() { - WebDriver driver = getDriver(); - - String google = "http://www.google.com/ncr"; - driver.get(google); - WebElement queryInput = driver.findElement(By.name("q")); - - String bbc = "http://www.bbc.co.uk/"; - driver.get(bbc); - queryInput.getAttribute("outerHTML"); - } - -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/CallbackHttpServer.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/server/CallbackHttpServer.java deleted file mode 100644 index b6385728dc..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/CallbackHttpServer.java +++ /dev/null @@ -1,79 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver.server; - -import org.mortbay.jetty.Server; -import org.mortbay.jetty.servlet.Context; -import org.mortbay.jetty.servlet.ServletHolder; - -import java.util.HashMap; -import java.util.Map; - -import static java.lang.String.format; - -public class CallbackHttpServer { - - protected Server server; - protected final Map httpReqCallbacks = new HashMap(); - - public CallbackHttpServer() { - // Default HTTP GET request callback: returns files in "test/fixture" - setHttpHandler("GET", new GetFixtureHttpRequestCallback()); - } - - public HttpRequestCallback getHttpHandler(String httpMethod) { - return httpReqCallbacks.get(httpMethod.toUpperCase()); - } - - public void setHttpHandler(String httpMethod, HttpRequestCallback getHandler) { - httpReqCallbacks.put(httpMethod.toUpperCase(), getHandler); - } - - public void start() throws Exception { - server = new Server(0); - Context context = new Context(server, "/"); - addServlets(context); - server.start(); - } - - public void stop() throws Exception { - server.stop(); - } - - protected void addServlets(Context context) { - context.addServlet(new ServletHolder(new CallbackServlet(this)), "/*"); - } - - public int getPort() { - return server.getConnectors()[0].getLocalPort(); - } - - public String getBaseUrl() { - return format("http://localhost:%d/", getPort()); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/CallbackServlet.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/server/CallbackServlet.java deleted file mode 100644 index c533bb4840..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/CallbackServlet.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver.server; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class CallbackServlet extends HttpServlet { - private CallbackHttpServer server; - - CallbackServlet(CallbackHttpServer server) { - this.server = server; - } - - protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - if (server.getHttpHandler("GET") != null) { - server.getHttpHandler("GET").call(req, res); - } else { - super.doGet(req, res); - } - } - - protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - if (server.getHttpHandler("POST") != null) { - server.getHttpHandler("POST").call(req, res); - } else { - super.doPost(req, res); - } - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/EmptyPageHttpRequestCallback.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/server/EmptyPageHttpRequestCallback.java deleted file mode 100644 index dfedc655a8..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/EmptyPageHttpRequestCallback.java +++ /dev/null @@ -1,40 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver.server; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class EmptyPageHttpRequestCallback implements HttpRequestCallback { - - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.getOutputStream().println(""); - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/GetFixtureHttpRequestCallback.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/server/GetFixtureHttpRequestCallback.java deleted file mode 100644 index a21240e025..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/GetFixtureHttpRequestCallback.java +++ /dev/null @@ -1,91 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver.server; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.nio.file.NoSuchFileException; -import java.nio.file.Path; -import java.util.logging.Logger; - -public class GetFixtureHttpRequestCallback implements HttpRequestCallback { - - private static final Logger LOG = Logger.getLogger(GetFixtureHttpRequestCallback.class.getName()); - - private static final String FIXTURE_PATH = "../fixtures"; - - @Override - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException { - // Construct path to the file - Path filePath = FileSystems.getDefault().getPath(FIXTURE_PATH, req.getPathInfo()); - - // If the file exists - if (filePath.toFile().exists()) { - try { - // Set Content Type - res.setContentType(filePathToMimeType(filePath.toString())); - // Read and write to response - Files.copy(filePath, res.getOutputStream()); - - return; - } catch (NoSuchFileException nsfe) { - LOG.warning(nsfe.getClass().getName()); - } catch (IOException ioe) { - LOG.warning(ioe.getClass().getName()); - } catch (RuntimeException re) { - LOG.warning(re.getClass().getName()); - } - } - - LOG.warning("Fixture NOT FOUND: "+filePath); - res.sendError(404); //< Not Found - } - - private static String filePathToMimeType(String filePath) { - if (filePath.endsWith(".js")) { - return "application/javascript"; - } - if (filePath.endsWith(".json")) { - return "text/json"; - } - if (filePath.endsWith(".png")) { - return "image/png"; - } - if (filePath.endsWith(".jpg")) { - return "image/jpg"; - } - if (filePath.endsWith(".gif")) { - return "image/gif"; - } - - return "text/html"; - } -} diff --git a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/HttpRequestCallback.java b/test/ghostdriver-test/java/src/test/java/ghostdriver/server/HttpRequestCallback.java deleted file mode 100644 index c26bb519f2..0000000000 --- a/test/ghostdriver-test/java/src/test/java/ghostdriver/server/HttpRequestCallback.java +++ /dev/null @@ -1,36 +0,0 @@ -/* -This file is part of the GhostDriver by Ivan De Marino . - -Copyright (c) 2012-2014, Ivan De Marino -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -package ghostdriver.server; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public interface HttpRequestCallback { - public void call(HttpServletRequest req, HttpServletResponse res) throws IOException; -} diff --git a/test/run-tests-ghostdriver.sh b/test/run-tests-ghostdriver.sh deleted file mode 100755 index 8b4a937a36..0000000000 --- a/test/run-tests-ghostdriver.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# Go to GhostDriver (Java) Tests -pushd ./test/ghostdriver-test/java - -# Ensure Gradle Wrapper is executable -chmod +x ./gradlew - -# Run tests -./gradlew test -q -# Grab exit status -TEST_EXIT_STATUS=$? - -# Return to starting directory -popd - -exit $TEST_EXIT_STATUS