"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ojSelectMany = exports.OjSelectMany = void 0;
const __1 = require("../../");
const OjSelectMany_1 = require("./OjSelectMany");
Object.defineProperty(exports, "OjSelectMany", { enumerable: true, get: function () { return OjSelectMany_1.OjSelectMany; } });
/**
 * Retrieve an instance of [OjSelectMany](../classes/elements.OjSelectMany.html).
 * @example
 * ```javascript
 * import { ojSelectMany } from '@oracle/oraclejet-webdriver/elements';
 * const el = await ojSelectMany(driver, By.id('my-oj-select-many'));
 * ```
 * @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 ojSelectMany(driver, by) {
    const webEl = await driver.findElement(by);
    // Check that the element is of type OjSelectMany
    if (!(webEl instanceof OjSelectMany_1.OjSelectMany)) {
        const tagName = await webEl.getTagName();
        let supplemental = '';
        if (webEl.constructor.name === 'OjSelectMany') {
            supplemental = 'You likely have multiple installations of this package.';
        }
        throw Error(`ojSelectMany(${by}) created ${webEl.constructor.name} for <${tagName}>, but expected ${OjSelectMany_1.OjSelectMany.name}. ${supplemental}`);
    }
    return webEl;
}
exports.ojSelectMany = ojSelectMany;
(0, __1.register)('oj-select-many', OjSelectMany_1.OjSelectMany);
//# sourceMappingURL=index.js.map