import { renderToString } from 'react-dom/server';
import styled, { ServerStyleSheet } from 'styled-components';
import React$1 from 'react';

function _taggedTemplateLiteral(e, t) {
  return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
    raw: {
      value: Object.freeze(t)
    }
  }));
}

var _templateObject$9, _templateObject2$4;
var Section = styled.div(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n  max-width: 700px;\n  margin: 0 auto 18px;\n\n  h2 {\n    margin: 0;\n    padding: 0;\n    margin-bottom: 3px;\n    font-weight: 600;\n  }\n\n  hr {\n    margin: 0;\n    padding: 0;\n    margin-top: 7px;\n    margin-bottom: 3px;\n  }\n"])));
var Container$2 = styled.div(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral(["\n  margin: 0 8px;\n"])));
var SectionComponent = function SectionComponent(_ref) {
  var children = _ref.children,
    title = _ref.title;
  return /*#__PURE__*/React.createElement(Section, null, title && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h2", null, title), /*#__PURE__*/React.createElement("hr", null)), /*#__PURE__*/React.createElement(Container$2, null, children));
};

var _templateObject$8;
var ListContainer = styled.ul(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n  padding-left: 20px;\n  line-height: 16px;\n  li::before {\n    content: '\u2022';\n    display: inline-block;\n    width: 1em;\n    margin-left: -1em;\n    line-height: 10px;\n  }\n"])));
var List$1 = function List(_ref) {
  var items = _ref.items;
  if (!items) {
    return null;
  }
  return /*#__PURE__*/React.createElement(ListContainer, null, items.map(function (item) {
    return /*#__PURE__*/React.createElement("li", {
      key: item
    }, item);
  }));
};

var _templateObject$7;
var Text = styled.div(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n  font-style: italic;\n  font-size: 1.4rem;\n"])));
var DateComponent = function DateComponent(_ref) {
  var date = _ref.date;
  if (!date) {
    return /*#__PURE__*/React.createElement(Text, null, "Present");
  }
  var fullDate = new Date(date);
  var options = {
    year: 'numeric',
    month: 'long'
  };
  var formattedDate = fullDate.toLocaleDateString('en-US', options);
  return /*#__PURE__*/React.createElement(Text, null, formattedDate !== null && formattedDate !== void 0 ? formattedDate : 'Present');
};

var _templateObject$6;
var Range = styled.div(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n  display: flex;\n  font-style: italic;\n  font-size: 13px;\n"])));
var DateRange = function DateRange(_ref) {
  var startDate = _ref.startDate,
    endDate = _ref.endDate;
  return /*#__PURE__*/React.createElement(Range, null, /*#__PURE__*/React.createElement(DateComponent, {
    date: startDate
  }), "\xA0\u2014\xA0", /*#__PURE__*/React.createElement(DateComponent, {
    date: endDate
  }));
};

var _templateObject$5, _templateObject2$3, _templateObject3$2, _templateObject4, _templateObject5;
var Meta = styled.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteral(["\n  display: flex;\n  justify-content: space-between;\n  margin-bottom: 2px;\n"])));
var Title$1 = styled.div(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n  font-weight: 600;\n  font-size: 1.45rem;\n  margin-bottom: 3px;\n"])));
var SubTitle = styled.div(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n  font-style: italic;\n  font-size: 1.4rem;\n  margin-bottom: 3px;\n"])));
var Container$1 = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n  margin-bottom: 10px;\n"])));
var Summary$1 = styled.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n  margin-bottom: 5px;\n"])));
var Experience = function Experience(_ref) {
  var title = _ref.title,
    date = _ref.date,
    startDate = _ref.startDate,
    endDate = _ref.endDate,
    subTitle = _ref.subTitle,
    summary = _ref.summary,
    highlights = _ref.highlights;
  return /*#__PURE__*/React.createElement(Container$1, null, /*#__PURE__*/React.createElement(Meta, null, /*#__PURE__*/React.createElement(Title$1, null, title), /*#__PURE__*/React.createElement("div", {
    className: "secondary"
  }, date ? /*#__PURE__*/React.createElement(DateComponent, {
    date: date
  }) : /*#__PURE__*/React.createElement(DateRange, {
    startDate: startDate,
    endDate: endDate
  }))), subTitle && /*#__PURE__*/React.createElement(SubTitle, null, subTitle), /*#__PURE__*/React.createElement("div", {
    className: "secondary"
  }, summary && /*#__PURE__*/React.createElement(Summary$1, null, summary), /*#__PURE__*/React.createElement(List$1, {
    items: highlights
  })));
};

var Work$1 = function Work(_ref) {
  var projects = _ref.projects;
  if (!projects) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Projects"
  }, projects.map(function (w, key) {
    return /*#__PURE__*/React.createElement(Experience, {
      title: w.name,
      startDate: w.startDate,
      endDate: w.endDate,
      summary: w.description,
      highlights: w.highlights,
      key: key
    });
  })));
};

var DefaultContext = {
  color: undefined,
  size: undefined,
  className: undefined,
  style: undefined,
  attr: undefined
};
var IconContext = React$1.createContext && /*#__PURE__*/React$1.createContext(DefaultContext);

var _excluded = ["attr", "size", "title"];
function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};
  var target = _objectWithoutPropertiesLoose(source, excluded);
  var key, i;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;
  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }
  return target;
}
function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}
function ownKeys(e, r) {
  var t = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    r && (o = o.filter(function (r) {
      return Object.getOwnPropertyDescriptor(e, r).enumerable;
    })), t.push.apply(t, o);
  }
  return t;
}
function _objectSpread(e) {
  for (var r = 1; r < arguments.length; r++) {
    var t = null != arguments[r] ? arguments[r] : {};
    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
      _defineProperty(e, r, t[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
    });
  }
  return e;
}
function _defineProperty(obj, key, value) {
  key = _toPropertyKey(key);
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey(arg) {
  var key = _toPrimitive(arg, "string");
  return typeof key === "symbol" ? key : String(key);
}
function _toPrimitive(input, hint) {
  if (typeof input !== "object" || input === null) return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== undefined) {
    var res = prim.call(input, hint || "default");
    if (typeof res !== "object") return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function Tree2Element(tree) {
  return tree && tree.map((node, i) => /*#__PURE__*/React$1.createElement(node.tag, _objectSpread({
    key: i
  }, node.attr), Tree2Element(node.child)));
}
function GenIcon(data) {
  // eslint-disable-next-line react/display-name
  return props => /*#__PURE__*/React$1.createElement(IconBase, _extends({
    attr: _objectSpread({}, data.attr)
  }, props), Tree2Element(data.child));
}
function IconBase(props) {
  var elem = conf => {
    var {
        attr,
        size,
        title
      } = props,
      svgProps = _objectWithoutProperties(props, _excluded);
    var computedSize = size || conf.size || "1em";
    var className;
    if (conf.className) className = conf.className;
    if (props.className) className = (className ? className + " " : "") + props.className;
    return /*#__PURE__*/React$1.createElement("svg", _extends({
      stroke: "currentColor",
      fill: "currentColor",
      strokeWidth: "0"
    }, conf.attr, attr, svgProps, {
      className: className,
      style: _objectSpread(_objectSpread({
        color: props.color || conf.color
      }, conf.style), props.style),
      height: computedSize,
      width: computedSize,
      xmlns: "http://www.w3.org/2000/svg"
    }), title && /*#__PURE__*/React$1.createElement("title", null, title), props.children);
  };
  return IconContext !== undefined ? /*#__PURE__*/React$1.createElement(IconContext.Consumer, null, conf => elem(conf)) : elem(DefaultContext);
}

// THIS FILE IS AUTO GENERATED
function FaGithub(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 496 512"},"child":[{"tag":"path","attr":{"d":"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},"child":[]}]})(props);}function FaLinkedin(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 448 512"},"child":[{"tag":"path","attr":{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"},"child":[]}]})(props);}function FaTwitter(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"},"child":[]}]})(props);}function FaEnvelope(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"},"child":[]}]})(props);}function FaLink(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"},"child":[]}]})(props);}function FaMapPin(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 288 512"},"child":[{"tag":"path","attr":{"d":"M112 316.94v156.69l22.02 33.02c4.75 7.12 15.22 7.12 19.97 0L176 473.63V316.94c-10.39 1.92-21.06 3.06-32 3.06s-21.61-1.14-32-3.06zM144 0C64.47 0 0 64.47 0 144s64.47 144 144 144 144-64.47 144-144S223.53 0 144 0zm0 76c-37.5 0-68 30.5-68 68 0 6.62-5.38 12-12 12s-12-5.38-12-12c0-50.73 41.28-92 92-92 6.62 0 12 5.38 12 12s-5.38 12-12 12z"},"child":[]}]})(props);}function FaPhoneAlt(props){return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z"},"child":[]}]})(props);}

var _templateObject$4, _templateObject2$2, _templateObject3$1;
var Title = styled.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteral(["\n  font-size: 3rem;\n  text-align: center;\n  margin-top: 20px;\n  margin-bottom: 20px;\n"])));
var BasicInfo = styled.div(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteral(["\n  display: flex;\n  gap: 10px 20px;\n  justify-content: center;\n  flex-wrap: wrap;\n"])));
var Info = styled.div(_templateObject3$1 || (_templateObject3$1 = _taggedTemplateLiteral(["\n  display: flex;\n  align-items: center;\n  font-size: 1.5rem;\n  svg {\n    color: #000;\n    margin-right: 5px;\n    width: 10px;\n  }\n\n  a {\n    color: inherit;\n    text-decoration: none;\n    &:hover {\n      color: #000;\n    }\n  }\n"])));
var HeroComponent = function HeroComponent(_ref) {
  var basics = _ref.basics;
  var name = basics.name,
    url = basics.url,
    location = basics.location,
    profiles = basics.profiles,
    phone = basics.phone,
    email = basics.email;
  var linkedin = profiles.find(function (_ref2) {
    var network = _ref2.network;
    return network === 'linkedin';
  });
  var github = profiles.find(function (_ref3) {
    var network = _ref3.network;
    return network === 'github';
  });
  var twitter = profiles.find(function (_ref4) {
    var network = _ref4.network;
    return network === 'twitter';
  });
  return /*#__PURE__*/React.createElement(SectionComponent, null, /*#__PURE__*/React.createElement(Title, null, name), /*#__PURE__*/React.createElement("div", {
    className: "secondary"
  }, /*#__PURE__*/React.createElement(BasicInfo, null, location && /*#__PURE__*/React.createElement(Info, null, /*#__PURE__*/React.createElement(FaMapPin, null), location.city, ", ", location.countryCode), email && /*#__PURE__*/React.createElement(Info, null, /*#__PURE__*/React.createElement(FaEnvelope, null), email), phone && /*#__PURE__*/React.createElement(Info, null, /*#__PURE__*/React.createElement(FaPhoneAlt, null), phone), url && /*#__PURE__*/React.createElement(Info, null, /*#__PURE__*/React.createElement(FaLink, null), /*#__PURE__*/React.createElement("a", {
    href: "{url}"
  }, url)), linkedin && /*#__PURE__*/React.createElement(Info, null, /*#__PURE__*/React.createElement(FaLinkedin, null), /*#__PURE__*/React.createElement("a", {
    href: "https://linkedin.com/".concat(linkedin.username)
  }, linkedin.username)), github && /*#__PURE__*/React.createElement(Info, null, /*#__PURE__*/React.createElement(FaGithub, null), /*#__PURE__*/React.createElement("a", {
    href: "https://github.com/".concat(github.username)
  }, github.username)), twitter && /*#__PURE__*/React.createElement(Info, null, /*#__PURE__*/React.createElement(FaTwitter, null), /*#__PURE__*/React.createElement("a", {
    href: "https://twitter.com/".concat(twitter.username)
  }, twitter.username)))));
};

var _templateObject$3;
var Summary = styled.p(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral([""])));
var SummaryComponent = function SummaryComponent(_ref) {
  var basics = _ref.basics;
  var summary = basics.summary;
  return /*#__PURE__*/React.createElement(SectionComponent, null, /*#__PURE__*/React.createElement("div", {
    className: "secondary"
  }, /*#__PURE__*/React.createElement(Summary, null, summary)));
};

var Education = function Education(_ref) {
  var education = _ref.education;
  if (!education) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Education"
  }, education.map(function (e, key) {
    var subTitle = e.area ? "".concat(e.studyType, " in ").concat(e.area) : e.studyType;
    if (e.score) {
      subTitle = "".concat(subTitle, " (").concat(e.score, ")");
    }
    return /*#__PURE__*/React.createElement(Experience, {
      title: e.institution,
      subTitle: subTitle,
      startDate: e.startDate,
      endDate: e.endDate,
      highlights: e.courses,
      key: key
    });
  })));
};

var Work = function Work(_ref) {
  var work = _ref.work;
  if (!work) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Experience"
  }, work.map(function (w, key) {
    return /*#__PURE__*/React.createElement(Experience, {
      title: w.position,
      subTitle: w.name,
      startDate: w.startDate,
      endDate: w.endDate,
      summary: w.summary,
      highlights: w.highlights,
      key: key
    });
  })));
};

var Certificates = function Certificates(_ref) {
  var certificates = _ref.certificates;
  if (!certificates) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Certificates"
  }, certificates.map(function (c, key) {
    return /*#__PURE__*/React.createElement(Experience, {
      title: c.name,
      subTitle: c.issuer,
      date: c.date,
      key: key
    });
  })));
};

var Publications = function Publications(_ref) {
  var publications = _ref.publications;
  if (!publications) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Publications"
  }, publications.map(function (p, key) {
    return /*#__PURE__*/React.createElement(Experience, {
      title: p.name,
      subTitle: p.publisher,
      date: p.releaseDate,
      summary: p.summary,
      key: key
    });
  })));
};

var Awards = function Awards(_ref) {
  var awards = _ref.awards;
  if (!awards) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Awards"
  }, awards.map(function (a, key) {
    return /*#__PURE__*/React.createElement(Experience, {
      title: a.title,
      subTitle: a.awarder,
      date: a.date,
      summary: a.summary,
      key: key
    });
  })));
};

var _templateObject$2, _templateObject2$1, _templateObject3;
var Name$1 = styled.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n  font-weight: 600;\n  font-size: 1.4rem;\n"])));
var List = styled.div(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n  font-size: 1.4rem;\n  margin-left: 5px;\n"])));
var Container = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n  margin-bottom: 5px;\n  display: flex;\n  align-items: baseline;\n"])));
var OneLineList = function OneLineList(_ref) {
  var name = _ref.name,
    items = _ref.items;
  return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Name$1, null, name, ":"), /*#__PURE__*/React.createElement(List, null, /*#__PURE__*/React.createElement("div", {
    "class": "secondary"
  }, items.join(', '))));
};

var Skills = function Skills(_ref) {
  var skills = _ref.skills;
  if (!skills) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Skills"
  }, skills.map(function (w, key) {
    return /*#__PURE__*/React.createElement(OneLineList, {
      key: key,
      name: w.name,
      items: w.keywords
    });
  })));
};

var Interests = function Interests(_ref) {
  var interests = _ref.interests;
  // check if interests is null, empty, empty string or empty array

  if (!interests) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Interests"
  }, interests.map(function (w, key) {
    return /*#__PURE__*/React.createElement(OneLineList, {
      key: key,
      name: w.name,
      items: w.keywords
    });
  })));
};

var Languages = function Languages(_ref) {
  var languages = _ref.languages;
  if (!languages) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "Languages"
  }, languages.map(function (l, key) {
    return /*#__PURE__*/React.createElement(OneLineList, {
      key: key,
      name: l.language,
      items: [l.fluency]
    });
  })));
};

var _templateObject$1, _templateObject2;
var Name = styled.div(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n  font-weight: 600;\n  font-size: 1.4rem;\n  margin-bottom: 5px;\n"])));
var Reference = styled.p(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([""])));
var References = function References(_ref) {
  var references = _ref.references;
  if (!references) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionComponent, {
    title: "References"
  }, references.map(function (r, key) {
    return /*#__PURE__*/React.createElement("div", {
      key: key,
      style: {
        marginBottom: '15px'
      }
    }, /*#__PURE__*/React.createElement(Name, null, r.name), /*#__PURE__*/React.createElement(Reference, null, r.reference));
  })));
};

var _templateObject;
var Layout = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n  max-width: 660px;\n  margin: 0 auto;\n  line-height: calc(1ex / 0.32);\n  margin-bottom: 40px;\n"])));
var Resume = function Resume(_ref) {
  var resume = _ref.resume;
  return /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(HeroComponent, {
    basics: resume.basics
  }), /*#__PURE__*/React.createElement(SummaryComponent, {
    basics: resume.basics
  }), /*#__PURE__*/React.createElement(Education, {
    education: resume.education
  }), /*#__PURE__*/React.createElement(Work, {
    work: resume.work
  }), /*#__PURE__*/React.createElement(Work$1, {
    projects: resume.projects
  }), /*#__PURE__*/React.createElement(Certificates, {
    certificates: resume.certificates
  }), /*#__PURE__*/React.createElement(Publications, {
    publications: resume.publications
  }), /*#__PURE__*/React.createElement(Awards, {
    awards: resume.awards
  }), /*#__PURE__*/React.createElement(Languages, {
    languages: resume.languages
  }), /*#__PURE__*/React.createElement(Skills, {
    skills: resume.skills
  }), /*#__PURE__*/React.createElement(Interests, {
    interests: resume.interests
  }), /*#__PURE__*/React.createElement(References, {
    references: resume.references
  }));
};

var render = function render(resume) {
  var sheet = new ServerStyleSheet();
  var html = renderToString(sheet.collectStyles( /*#__PURE__*/React.createElement(Resume, {
    resume: resume
  })));
  var styles = sheet.getStyleTags();
  return "<!DOCTYPE html><head>\n  <title>".concat(resume.basics.name, " - Resume</title>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n  <style>\n    @font-face {\n      font-family: LatinModern;\n      font-style: normal;\n      font-weight: normal;\n      src: url(\"/fonts/lmroman10-regular.otf\") format(\"opentype\");\n    }\n\n    @font-face {\n      font-family: LatinModern;\n      font-weight: bold;\n      src: url(\"/fonts/lmroman10-bold.otf\") format(\"opentype\");\n    }\n\n    @font-face {\n      font-family: LatinModern;\n      font-style: italic;\n      src: url(\"/fonts/lmroman10-italic.otf\") format(\"opentype\");\n    }\n\n     @font-face {\n      font-family: LatinModernSans;\n      font-style: normal;\n      font-weight: normal;\n      src: url(\"/fonts/lmsans10-regular.otf\") format(\"opentype\");\n    }\n\n    @font-face {\n      font-family: LatinModernSans;\n      font-weight: bold;\n      src: url(\"/fonts/lmsans10-bold.otf\") format(\"opentype\");\n    }\n\n    @font-face {\n      font-family: LatinModernSans;\n      font-style: italic;\n      src: url(\"/fonts/lmsans10-italic.otf\") format(\"opentype\");\n    }\n\n    html {\n      font-family:LatinModern, \"Courier New\", monospace;\n      background: #fff;\n      font-size: 10px;\n    }\n\n    h2 {\n      font-size: 1.65rem;\n    }\n\n    p {\n      padding: 0;\n      margin: 0;\n    }\n\n    p, li {\n      font-size: 1.4rem;\n      line-height: 1.5rem;\n    }\n\n    .secondary {\n      color: #111;\n    }\n\n    a {\n      text-decoration: none;\n    }\n\n    ul {\n      list-style: none;\n      margin: 0;\n      padding: 0;\n    }\n\n    *,\n    *::before,\n    *::after {\n      box-sizing: border-box;\n    }\n\n\n\n  </style>\n  ").concat(styles, "</head><body>").concat(html, "</body></html>");
};

export { Resume, render };
//# sourceMappingURL=index.mjs.map
