import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
export default (function (changeLog) {
  var humanReadableChangeLog = [];

  var _iterator = _createForOfIteratorHelper(changeLog),
      _step;

  try {
    for (_iterator.s(); !(_step = _iterator.n()).done;) {
      var _step$value = _step.value,
          userName = _step$value.userName,
          op = _step$value.op,
          path = _step$value.path;

      if (path.startsWith("/interface")) {
        humanReadableChangeLog.push({
          type: "warning",
          message: "".concat(userName, " changed the project settings")
        });
      } else if (path.startsWith("/taskOutput")) {
        var sampleMatch = path.match(/\/samples\/([^/]+)/);
        humanReadableChangeLog.push({
          type: "info",
          message: "".concat(userName, " changed sample ").concat(sampleMatch[1])
        });
      } else {
        humanReadableChangeLog.push({
          message: "".concat(userName, " did a ").concat(op, " at ").concat(path),
          type: "info"
        });
      }
    }
  } catch (err) {
    _iterator.e(err);
  } finally {
    _iterator.f();
  }

  return humanReadableChangeLog;
});