"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojInputPassword = exports.OjInputPassword = void 0;
const __1 = require("../../");
const OjInputPassword_1 = require("./OjInputPassword");
Object.defineProperty(exports, "OjInputPassword", { enumerable: true, get: function () { return OjInputPassword_1.OjInputPassword; } });
/**
 * Retrieve an instance of [OjInputPassword](../classes/elements.OjInputPassword.html).
 * @example
 * ```javascript
 * import { ojInputPassword } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojInputPassword(driver, By.id('my-oj-input-password'));
 * ```
 * @param driver A WebDriver/WebElement instance from where the element will be
 * searched. If WebDriver is passed, the element will be searched globally in the
 * document. If WebElement is passed, the search will be relative to this element.
 * @param by The locator with which to find the element
 */
async function ojInputPassword(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjInputPassword
    if (!(webEl instanceof OjInputPassword_1.OjInputPassword)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjInputPassword') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojInputPassword(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjInputPassword_1.OjInputPassword.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojInputPassword = ojInputPassword;
(0, __1.register)('oj-input-password', OjInputPassword_1.OjInputPassword);
//# sourceMappingURL=index.js.map