"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _reactIntlNext = require("react-intl-next");
var _messages = require("../../../../messages");
var _intlUtils = require("../../../../utils/intl-utils");
var _unresolvedView = _interopRequireDefault(require("../unresolved-view"));
var _notFoundSvg = require("./not-found-svg");
var _excluded = ["context", "accessContext", "testId"];
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var NotFoundView = function NotFoundView(_ref) {
  var context = _ref.context,
    accessContext = _ref.accessContext,
    _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'embed-card-not-found-view' : _ref$testId,
    unresolvedViewProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var _ref2 = context !== null && context !== void 0 ? context : {},
    icon = _ref2.icon,
    image = _ref2.image,
    _ref2$text = _ref2.text,
    text = _ref2$text === void 0 ? '' : _ref2$text;
  var _ref3 = accessContext !== null && accessContext !== void 0 ? accessContext : {},
    titleMessageKey = _ref3.titleMessageKey,
    descriptiveMessageKey = _ref3.descriptiveMessageKey;
  var values = (0, _react.useMemo)(function () {
    return {
      product: text
    };
  }, [text]);
  return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, unresolvedViewProps, {
    icon: icon,
    image: image !== null && image !== void 0 ? image : /*#__PURE__*/_react.default.createElement(_notFoundSvg.NotFoundSVG, null),
    testId: testId,
    text: text,
    title: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, (0, _intlUtils.toMessage)(_messages.messages.not_found_title, titleMessageKey), {
      values: values
    })),
    description: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, (0, _intlUtils.toMessage)(_messages.messages.not_found_description, descriptiveMessageKey), {
      values: values
    }))
  }));
};
var _default = exports.default = NotFoundView;