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