"use strict";

exports.__esModule = true;
exports.circularProgressBarCoreDriverFactory = void 0;
var circularProgressBarCoreDriverFactory = _ref => {
  var {
    element
  } = _ref;
  var getElement = dataHook => element == null ? void 0 : element.querySelector("[data-hook=\"".concat(dataHook, "\"]"));
  var getValue = () => {
    var _getElement;
    return !element ? null : (_getElement = getElement('progress-indicator')) == null ? void 0 : _getElement.innerHTML;
  };
  var getByLabelText = () => {
    var _getElement2;
    return !element ? null : (_getElement2 = getElement('label')) == null ? void 0 : _getElement2.innerHTML;
  };
  var driver = {
    exists: () => !!element,
    isSuccessIconDisplayed: () => !!getElement('success-icon'),
    isErrorIconDisplayed: () => !!getElement('error-icon'),
    getLabelTextContent: () => getByLabelText(),
    isLabelDisplayed: () => !!getElement('label'),
    isPercentagesProgressDisplayed: () => !!getElement('progress-indicator'),
    getValue: function (_getValue) {
      function getValue() {
        return _getValue.apply(this, arguments);
      }
      getValue.toString = function () {
        return _getValue.toString();
      };
      return getValue;
    }(() => getValue()),
    isCompleted: () => getValue() === '100',
    isSingleElementRendered: dataHook => (element == null ? void 0 : element.querySelectorAll("[data-hook=\"".concat(dataHook, "\"]")).length) === 1
  };
  return driver;
};
exports.circularProgressBarCoreDriverFactory = circularProgressBarCoreDriverFactory;
//# sourceMappingURL=CircularProgressBarCore.driver.js.map