"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.messageBoxMarketerialLayoutUniDriverFactory = void 0;
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _unidriver = require("../utils/test-utils/unidriver");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var messageBoxMarketerialLayoutUniDriverFactory = base => {
  var getPrimaryButtonBase = () => base.$('[data-hook="primary-button"]');
  var getPrimaryButtonNodeBase = () => base.$('[data-hook="primary-button-node"]');
  var getSecondaryButtonBase = () => base.$('[data-hook="secondary-button"]');
  var getCloseButtonBase = () => base.$('[data-hook="close-button"]');
  var getMessageBoxTitleBase = () => base.$('[data-hook="message-box-title"]');
  var getHeaderImageBase = () => base.$('[data-hook="header-image"]');
  return _objectSpread(_objectSpread({}, (0, _unidriver.baseUniDriverFactory)(base)), {}, {
    getPrimaryButtonText: () => getPrimaryButtonBase().text(),
    getPrimaryButton: function () {
      var _getPrimaryButton = (0, _asyncToGenerator2.default)(function* () {
        return (yield getPrimaryButtonBase().exists()) ? getPrimaryButtonBase() : null;
      });
      function getPrimaryButton() {
        return _getPrimaryButton.apply(this, arguments);
      }
      return getPrimaryButton;
    }(),
    getPrimaryButtonNode: function () {
      var _getPrimaryButtonNode = (0, _asyncToGenerator2.default)(function* () {
        return (yield getPrimaryButtonNodeBase().exists()) ? getPrimaryButtonNodeBase() : null;
      });
      function getPrimaryButtonNode() {
        return _getPrimaryButtonNode.apply(this, arguments);
      }
      return getPrimaryButtonNode;
    }(),
    getSecondaryButtonText: () => getSecondaryButtonBase().text(),
    getSecondaryButton: function () {
      var _getSecondaryButton = (0, _asyncToGenerator2.default)(function* () {
        return (yield getSecondaryButtonBase().exists()) ? getSecondaryButtonBase() : null;
      });
      function getSecondaryButton() {
        return _getSecondaryButton.apply(this, arguments);
      }
      return getSecondaryButton;
    }(),
    getHeaderCloseButton: function () {
      var _getHeaderCloseButton = (0, _asyncToGenerator2.default)(function* () {
        return (yield getCloseButtonBase().exists()) ? getCloseButtonBase() : null;
      });
      function getHeaderCloseButton() {
        return _getHeaderCloseButton.apply(this, arguments);
      }
      return getHeaderCloseButton;
    }(),
    clickOnPrimaryButton: () => getPrimaryButtonBase().click(),
    clickOnSecondaryButton: () => getSecondaryButtonBase().click(),
    closeMessageBox: () => getCloseButtonBase().click(),
    getTitle: () => getMessageBoxTitleBase().text(),
    getContentBySelector: function () {
      var _getContentBySelector = (0, _asyncToGenerator2.default)(function* (selector) {
        return (yield base.$(selector).exists()) ? base.$(selector) : null;
      });
      function getContentBySelector(_x) {
        return _getContentBySelector.apply(this, arguments);
      }
      return getContentBySelector;
    }(),
    getImageSrc: () => getHeaderImageBase().attr('src')
  });
};
exports.messageBoxMarketerialLayoutUniDriverFactory = messageBoxMarketerialLayoutUniDriverFactory;
//# sourceMappingURL=MessageBoxMarketerialLayout.uni.driver.js.map