"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.fireSmartLinkEvent = exports.context = exports.TrackQuickActionType = exports.TrackQuickActionFailureReason = exports.SmartLinkEvents = exports.ANALYTICS_CHANNEL = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
var context = exports.context = {
  componentName: 'smart-cards',
  packageName: "@atlaskit/smart-card" || '',
  packageVersion: "45.11.2" || ''
};
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
  return TrackQuickActionType;
}({});
var TrackQuickActionFailureReason = exports.TrackQuickActionFailureReason = /*#__PURE__*/function (TrackQuickActionFailureReason) {
  TrackQuickActionFailureReason["PermissionError"] = "PermissionError";
  TrackQuickActionFailureReason["ValidationError"] = "ValidationError";
  TrackQuickActionFailureReason["UnknownError"] = "UnknownError";
  return TrackQuickActionFailureReason;
}({});
var SmartLinkEvents = exports.SmartLinkEvents = /*#__PURE__*/function () {
  function SmartLinkEvents() {
    (0, _classCallCheck2.default)(this, SmartLinkEvents);
  }
  return (0, _createClass2.default)(SmartLinkEvents, [{
    key: "insertSmartLink",
    value: function insertSmartLink(url, type, createAnalyticsEvent) {
      fireSmartLinkEvent({
        action: 'inserted',
        actionSubject: 'smartLink',
        eventType: 'track',
        attributes: {
          type: type
        },
        nonPrivacySafeAttributes: {
          domainName: url
        }
      }, createAnalyticsEvent);
    }
  }]);
}();
var fireSmartLinkEvent = exports.fireSmartLinkEvent = function fireSmartLinkEvent(payload, createAnalyticsEvent) {
  if (createAnalyticsEvent) {
    createAnalyticsEvent(payload).fire(ANALYTICS_CHANNEL);
  }
};