import { _ as _extends } from '../extends-C4cduGrv.js';
import { _ as _objectWithoutProperties } from '../objectWithoutProperties-TXwlfNxG.js';
import React__default from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import PropTypes from 'prop-types';
import { icons } from './icons.js';
import './library.js';
import '@fortawesome/fontawesome-svg-core';
import '@fortawesome/free-solid-svg-icons';
import '@fortawesome/free-brands-svg-icons';

var _excluded = ["name"];
var lookupSocialIcon = function lookupSocialIcon(icon) {
  return icons.find(function (i) {
    return i.iconName === icon;
  });
};
var FontAwesomeNameFallbacks = [{
  old: "external-link",
  "new": "arrow-up-right-from-square"
}, {
  old: "shoping-cart",
  "new": "cart-shopping"
}, {
  old: "telegram-plane",
  "new": "telegram"
}, {
  old: "snapchat-ghost",
  "new": "snapchat"
}];

var SocialIcon = function SocialIcon(_ref) {
  var name = _ref.name,
      props = _objectWithoutProperties(_ref, _excluded);

  var iconName;

  if (name && typeof name == "string") {
    var oldName = FontAwesomeNameFallbacks.find(function (f) {
      return f.old === name;
    });

    if (oldName) {
      iconName = lookupSocialIcon(oldName["new"]);
    } else {
      iconName = lookupSocialIcon(name);
    }
  }

  return /*#__PURE__*/React__default.createElement(FontAwesomeIcon, _extends({
    icon: iconName
  }, props));
};

SocialIcon.propTypes = {
  name: PropTypes.oneOfType([PropTypes.object, PropTypes.string])
};

export { SocialIcon as default, lookupSocialIcon };
