'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.propsForBankEntryUnauthorizedEdit = exports.propsForStimulusBankEntryEditPrompt = exports.propsForItemBankEntryEditPrompt = exports.propsForBankEntryEditPrompt = exports.propsForBankEntryVersioningWrapper = exports.propsForStimulusVersioningWrapper = exports.propsForItemVersioningWrapper = undefined;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _partial = require('lodash/partial');

var _partial2 = _interopRequireDefault(_partial);

var _Text = require('@instructure/ui-elements/lib/components/Text');

var _Text2 = _interopRequireDefault(_Text);

var _formatMessage = require('../format-message');

var _formatMessage2 = _interopRequireDefault(_formatMessage);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var immutableItemDescription = _react2.default.createElement(
  _Text2.default,
  null,
  _react2.default.createElement(
    'b',
    null,
    '\u0642\u0627\u0645 \u0628\u0639\u0636 \u0627\u0644\u0637\u0644\u0627\u0628 \u0628\u0627\u0644\u0641\u0639\u0644 \u0628\u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A \u0644\u0647\u0630\u0647 \u0627\u0644\u0639\u0646\u0635\u0631!'
  ),
  '\xA0',
  '\u064A\u0645\u0643\u0646\u0643 \u062A\u0637\u0628\u064A\u0642 \u062A\u062D\u0631\u064A\u0631\u0627\u062A\u0643 \u0639\u0644\u0649 \u0646\u0633\u062E\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0635\u0631 \u0648\u0627\u0644\u062A\u064A \u0644\u0646 \u064A\u0631\u0627\u0647\u0627 \u0633\u0648\u0649 \u0627\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u0630\u064A \u0644\u0645 \u064A\u062E\u0636\u0639\u0648\u0627 \u0644\u0644\u062A\u0642\u064A\u064A\u0645 .'
);

var itemCopyDescription = _react2.default.createElement(
  _Text2.default,
  null,
  _react2.default.createElement(
    'b',
    null,
    '\u062A\u062D\u0631\u064A\u0631 \u0646\u0633\u062E\u0629.'
  ),
  '\xA0',
  '\u0633\u062A\u0628\u062F\u0648 \u0625\u062D\u0635\u0627\u0626\u064A\u0627\u062A \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0646\u0633\u062E\u0629 \u0627\u0644\u062C\u062F\u064A\u062F\u0629 \u0645\u0646\u0641\u0635\u0644\u0629 \u0639\u0646 \u0627\u0644\u0625\u0635\u062F\u0627\u0631 \u0627\u0644\u0633\u0627\u0628\u0642 \u0644\u0647\u0630\u0627 \u0627\u0644\u0633\u0624\u0627\u0644.'
);

var immutableStimulusDescription = _react2.default.createElement(
  _Text2.default,
  null,
  _react2.default.createElement(
    'b',
    null,
    '\u0642\u0627\u0645 \u0628\u0639\u0636 \u0627\u0644\u0637\u0644\u0627\u0628 \u0628\u0627\u0644\u0641\u0639\u0644 \u0628\u0625\u0631\u0633\u0627\u0644 \u0625\u062C\u0627\u0628\u0627\u062A \u0644\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0641\u0632!'
  ),
  '\xA0',
  '\u064A\u0645\u0643\u0646\u0643 \u062A\u0637\u0628\u064A\u0642 \u062A\u062D\u0631\u064A\u0631\u0627\u062A\u0643 \u0639\u0644\u0649 \u0646\u0633\u062E\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u0641\u0632 \u0648\u0627\u0644\u062A\u064A \u0644\u0646 \u064A\u0631\u0627\u0647\u0627 \u0633\u0648\u0649 \u0627\u0644\u0637\u0644\u0627\u0628 \u0627\u0644\u0630\u064A \u0644\u0645 \u064A\u062E\u0636\u0639\u0648\u0627 \u0644\u0644\u062A\u0642\u064A\u064A\u0645 . \u0633\u064A\u062A\u0645 \u0646\u0633\u062E \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u0631\u0641\u0642\u0629 \u0623\u064A\u0636\u064B\u0627.'
);

var stimulusCopyDescription = _react2.default.createElement(
  _Text2.default,
  null,
  _react2.default.createElement(
    'b',
    null,
    '\u062A\u062D\u0631\u064A\u0631 \u0646\u0633\u062E\u0629.'
  ),
  '\xA0',
  '\u0633\u062A\u0628\u062F\u0648 \u0625\u062D\u0635\u0627\u0626\u064A\u0627\u062A \u0627\u0644\u0645\u062D\u0641\u0632\u0627\u062A \u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0646\u0633\u062E\u0629 \u0627\u0644\u062C\u062F\u064A\u062F\u0629 \u0645\u0646\u0641\u0635\u0644\u0629 \u0639\u0646 \u0627\u0644\u0625\u0635\u062F\u0627\u0631 \u0627\u0644\u0633\u0627\u0628\u0642.'
);

var itemBankEntryEditDescription = _react2.default.createElement(
  _Text2.default,
  null,
  _react2.default.createElement(
    'b',
    null,
    '\u0627\u0644\u0639\u0646\u0635\u0631 \u0627\u0644\u0645\u062E\u0632\u0651\u0646 \u0641\u064A \u0627\u0644\u0628\u0646\u0643.'
  ),
  '\xA0',
  '\u064A\u0645\u0643\u0646 \u062A\u063A\u064A\u064A\u0631 \u0628\u0639\u0636 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A \u0648\u0642\u064A\u0645\u0629 \u0627\u0644\u0646\u0642\u0627\u0637 \u0647\u0646\u0627 \u0648\u0644\u0643\u0646 \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0645 \u0627\u0644\u062A\u062D\u0631\u064A\u0631 \u062F\u0627\u062E\u0644 \u0627\u0644\u0628\u0646\u0643.'
);

var stimulusBankEntryEditDescription = _react2.default.createElement(
  _Text2.default,
  { 'data-automation': 'sdk-editInBanks-warning' },
  _react2.default.createElement(
    'b',
    null,
    '\u0627\u0644\u0645\u062D\u0641\u0632 \u0627\u0644\u0645\u062E\u0632\u0651\u0646 \u0641\u064A \u0627\u0644\u0628\u0646\u0643.'
  ),
  '\xA0',
  '\u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0645 \u062A\u062D\u0631\u064A\u0631 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u0641\u0632 \u062F\u0627\u062E\u0644 \u0627\u0644\u0628\u0646\u0643.'
);

var bankEntryUnauthorizedEditDescription = _react2.default.createElement(
  _Text2.default,
  null,
  _react2.default.createElement(
    'b',
    null,
    '\u0627\u0644\u0639\u0646\u0635\u0631 \u0627\u0644\u0645\u062E\u0632\u0651\u0646 \u0641\u064A \u0627\u0644\u0628\u0646\u0643.'
  ),
  '\xA0',
  '\u063A\u064A\u0631 \u0645\u0633\u0645\u0648\u062D \u0644\u0643 \u0628\u062A\u062D\u0631\u064A\u0631 \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0635\u0631.'
);

var archivedBankEntryDescription = _react2.default.createElement(
  _Text2.default,
  null,
  '\u062A\u0645 \u062D\u0630\u0641 \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0635\u0631 \u0645\u0646 \u0628\u0646\u0643 \u0627\u0644\u0639\u0646\u0627\u0635\u0631. \u0644\u0646 \u064A\u0632\u0627\u0644 \u0628\u0645\u0642\u062F\u0648\u0631 \u0627\u0644\u0637\u0644\u0627\u0628 \u0631\u0624\u064A\u062A\u0647 \u0641\u064A \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0627\u062A \u0627\u0644\u0645\u0633\u062A\u0642\u0628\u0644\u064A\u0629. \u0644\u0644\u062A\u062D\u0631\u064A\u0631\u060C \u0627\u0635\u0646\u0639 \u0646\u0633\u062E\u0629 \u0645\u0646 \u0627\u0644\u0639\u0646\u0635\u0631.'
);

var propsForVersioningWrapper = function propsForVersioningWrapper(copyDescription, immutableDescription, isImmutable, shouldClone, setShouldClone, switchOffEditing, isEditing) {
  var alertType = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'warning';

  var defaultProps = {
    disableChildren: false,
    showAlert: false
  };
  if (!isEditing) return { showAlert: false };
  if (isImmutable && shouldClone) {
    Object.assign(defaultProps, {
      description: copyDescription,
      hideActions: true,
      showAlert: true
    });
  } else if (isImmutable) {
    Object.assign(defaultProps, {
      alertType: alertType,
      cancelActionCallback: switchOffEditing,
      defaultActionCallback: (0, _partial2.default)(setShouldClone, true),
      defaultActionText: '\u062A\u062D\u0631\u064A\u0631 \u0646\u0633\u062E\u0629',
      description: immutableDescription,
      disableChildren: true,
      showAlert: true
    });
  }
  return defaultProps;
};

var propsForItemVersioningWrapper = exports.propsForItemVersioningWrapper = function propsForItemVersioningWrapper() {
  for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  return propsForVersioningWrapper.apply(undefined, [itemCopyDescription, immutableItemDescription].concat(args));
};

var propsForStimulusVersioningWrapper = exports.propsForStimulusVersioningWrapper = function propsForStimulusVersioningWrapper() {
  for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    args[_key2] = arguments[_key2];
  }

  return propsForVersioningWrapper.apply(undefined, [stimulusCopyDescription, immutableStimulusDescription].concat(args));
};

var propsForBankEntryVersioningWrapper = exports.propsForBankEntryVersioningWrapper = function propsForBankEntryVersioningWrapper() {
  for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
    args[_key3] = arguments[_key3];
  }

  return propsForVersioningWrapper.apply(undefined, [itemCopyDescription, archivedBankEntryDescription].concat(args));
};

var propsForBankEntryEditPrompt = exports.propsForBankEntryEditPrompt = function propsForBankEntryEditPrompt(isEditing, switchOffEditing, defaultActionCallback, description) {
  if (!isEditing) return { showAlert: false };
  return {
    cancelActionCallback: switchOffEditing,
    disableChildren: true,
    description: description,
    defaultActionCallback: defaultActionCallback,
    defaultActionText: '\u0627\u0644\u062A\u062D\u0631\u064A\u0631 \u0641\u064A \u0627\u0644\u0628\u0646\u0643',
    showAlert: true
  };
};

var propsForItemBankEntryEditPrompt = exports.propsForItemBankEntryEditPrompt = function propsForItemBankEntryEditPrompt() {
  for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
    args[_key4] = arguments[_key4];
  }

  return propsForBankEntryEditPrompt.apply(undefined, args.concat([itemBankEntryEditDescription]));
};

var propsForStimulusBankEntryEditPrompt = exports.propsForStimulusBankEntryEditPrompt = function propsForStimulusBankEntryEditPrompt() {
  for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
    args[_key5] = arguments[_key5];
  }

  return propsForBankEntryEditPrompt.apply(undefined, args.concat([stimulusBankEntryEditDescription]));
};

var propsForBankEntryUnauthorizedEdit = exports.propsForBankEntryUnauthorizedEdit = function propsForBankEntryUnauthorizedEdit(isEditing) {
  if (!isEditing) return { showAlert: false };
  return {
    alertType: 'warning',
    disableChildren: true,
    description: bankEntryUnauthorizedEditDescription,
    hideActions: true,
    showAlert: true
  };
};