"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.default = getComponent;

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")), _amosJsplumb = require("amos-jsplumb"), _CustomNode = _interopRequireDefault(require("./CustomNode")), _GiotNode = _interopRequireDefault(require("./GiotNode")), _fireNode = _interopRequireDefault(require("./fireNode"));

function ownKeys(e, t) {
  var r = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    t && (o = o.filter((function(t) {
      return Object.getOwnPropertyDescriptor(e, t).enumerable;
    }))), r.push.apply(r, o);
  }
  return r;
}

function _objectSpread(e) {
  for (var t = 1; t < arguments.length; t++) {
    var r = null != arguments[t] ? arguments[t] : {};
    t % 2 ? ownKeys(Object(r), !0).forEach((function(t) {
      (0, _defineProperty2.default)(e, t, r[t]);
    })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ownKeys(Object(r)).forEach((function(t) {
      Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
    }));
  }
  return e;
}

var DefaultNode = _amosJsplumb.PlumbEleNode.DefaultNode, typeToComponentMap = _objectSpread({
  custom: _CustomNode.default,
  giot: _GiotNode.default
}, _fireNode.default);

function getComponent(e) {
  return typeToComponentMap[e] ? typeToComponentMap[e] : DefaultNode;
}