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