"use strict";

exports.__esModule = true;
exports.inputTypes = exports.default = exports.createInput = void 0;
var _react = _interopRequireDefault(require("react"));
var _index = require("./index");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
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 _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cannot destructure " + t); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var inputTypes = exports.inputTypes = {
  inputBase: "inputBase",
  checkbox: "checkbox",
  checkboxGroup: "checkboxGroup",
  radio: "radio",
  select: "select",
  standaloneRadio: "standaloneRadio",
  switch: "switch"
};
var propsClasses = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, inputTypes.inputBase, _index.InputBaseProps), inputTypes.checkbox, _index.CheckboxProps), inputTypes.checkboxGroup, _index.CheckboxGroupProps), inputTypes.radio, _index.RadioProps), inputTypes.select, _index.SelectProps), inputTypes.standaloneRadio, _index.StandaloneRadioProps), inputTypes.switch, _index.SwitchProps);
var inputComponents = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, inputTypes.inputBase, _index.InputBase), inputTypes.checkbox, _index.Checkbox), inputTypes.checkboxGroup, _index.CheckboxGroup), inputTypes.radio, _index.Radio), inputTypes.select, _index.Select), inputTypes.standaloneRadio, _index.StandaloneRadio), inputTypes.switch, _index.Switch);
var propsPropertyName = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, inputTypes.inputBase, "inputProps"), inputTypes.checkbox, "checkboxProps"), inputTypes.checkboxGroup, "checkboxGroupProps"), inputTypes.radio, "radioProps"), inputTypes.select, "selectProps"), inputTypes.standaloneRadio, "radioProps"), inputTypes.switch, "switchProps");
var createInput = exports.createInput = function createInput(inputType, _ref) {
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
  var typePropsInstance = new propsClasses[inputType]();
  var propKeys = Object.keys(props);
  var otherProps = {};
  propKeys.forEach(function (propKey) {
    var _propsClasses$inputTy;
    if (propsClasses[inputType].propNames[propKey] != null) {
      typePropsInstance.set(propKey, props[propKey]);
    } else if (((_propsClasses$inputTy = propsClasses[inputType].ruleNames) == null ? void 0 : _propsClasses$inputTy[propKey]) != null) {
      typePropsInstance.setStyle(propKey, props[propKey]);
    } else {
      otherProps[propKey] = props[propKey];
    }
  });
  return _react.default.createElement(inputComponents[inputType], _objectSpread(_defineProperty({}, propsPropertyName[inputType], typePropsInstance), otherProps));
};
var _default = createInput;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(inputTypes, "inputTypes", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsClasses, "propsClasses", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(inputComponents, "inputComponents", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsPropertyName, "propsPropertyName", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(createInput, "createInput", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(inputTypes, "inputTypes", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsClasses, "propsClasses", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(inputComponents, "inputComponents", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(propsPropertyName, "propsPropertyName", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(createInput, "createInput", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/MaterialUI/Inputs/createInput.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();