/* main.tsx generated by @compiled/babel-plugin v0.39.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AutomationModalEmptyState = void 0;
require("./main.compiled.css");
var React = _interopRequireWildcard(require("react"));
var _runtime = require("@compiled/react/runtime");
var _reactIntl = require("react-intl");
var _analyticsNext = require("@atlaskit/analytics-next");
var _link = _interopRequireDefault(require("@atlaskit/link"));
var _compiled = require("@atlaskit/primitives/compiled");
var _menuContext = require("../../menu-context");
var _emptyIcon = _interopRequireDefault(require("./empty-icon"));
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 styles = {
  emptyState: "_19bv1ejb _u5f31ejb _19pk1jfw",
  image: "_19pk1b66 _otyr1ejb _1bsb1lit _4t3iplmo",
  description: "_1bsb1gwv _y3gn1h6o"
};
var i18n = (0, _reactIntl.defineMessages)({
  defaultEmptyStateAdminDesc: {
    id: 'automation-menu.modal.empty.automations.admin.description',
    defaultMessage: 'Use the manual trigger to populate a menu of selections that anyone, or people you specify, can apply as one-click automations.',
    description: 'A description shown in the automation menu when the rule list is empty for an admin.'
  },
  defaultEmptyStateDesc: {
    id: 'automation-menu.modal.empty.automations.user.description',
    defaultMessage: 'Admins haven’t configured any manually triggered automations yet.',
    description: 'A description shown in the automation menu when the rule list is empty for a user.'
  },
  learnMoreLink: {
    id: 'automation-menu.empty-state.learn-more.link',
    defaultMessage: 'Learn more about the manual trigger',
    description: 'The text of a link that takes a user to the documentation for manually triggered rules in Automation for Confluence.'
  },
  emptyAutomationListImageAlt: {
    id: 'automation-menu.empty-state.image.alt',
    defaultMessage: 'Empty automation list icon',
    description: 'Alternative text for the image that renders when the automation list is empty.'
  }
});
var AutomationModalEmptyState = exports.AutomationModalEmptyState = function AutomationModalEmptyState() {
  var _useIntl = (0, _reactIntl.useIntl)(),
    formatMessage = _useIntl.formatMessage;
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
    createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
  var _useAutomationMenu = (0, _menuContext.useAutomationMenu)(),
    canManageAutomation = _useAutomationMenu.canManageAutomation,
    analyticsSource = _useAutomationMenu.analyticsSource,
    emptyStateDescription = _useAutomationMenu.emptyStateDescription,
    emptyStateAdminDescription = _useAutomationMenu.emptyStateAdminDescription;
  var emptyStateDesc = emptyStateDescription !== null && emptyStateDescription !== void 0 ? emptyStateDescription : /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, i18n.defaultEmptyStateDesc);
  var adminEmptyStateDesc = emptyStateAdminDescription !== null && emptyStateAdminDescription !== void 0 ? emptyStateAdminDescription : /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, i18n.defaultEmptyStateAdminDesc);
  var displayedEmptyStateDesc = canManageAutomation ? adminEmptyStateDesc : emptyStateDesc;
  return /*#__PURE__*/React.createElement(_compiled.Stack, {
    xcss: styles.emptyState,
    alignInline: "center",
    alignBlock: "center",
    grow: "fill"
  }, /*#__PURE__*/React.createElement(_compiled.Box, {
    xcss: styles.image
  }, /*#__PURE__*/React.createElement(_emptyIcon.default, {
    alt: formatMessage(i18n.emptyAutomationListImageAlt)
  })), /*#__PURE__*/React.createElement(_compiled.Box, {
    xcss: styles.description
  }, displayedEmptyStateDesc, canManageAutomation && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_link.default, {
    href: "https://www.atlassian.com/platform/automation",
    target: "_blank",
    onClick: function onClick() {
      createAnalyticsEvent({
        type: 'sendUIEvent',
        data: {
          action: 'clicked',
          actionSubject: 'link',
          actionSubjectId: 'learnMore',
          source: analyticsSource
        }
      }).fire();
    }
  }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, i18n.learnMoreLink)))));
};