import { R as ReferenceField } from './index-ef734a5e.js';
import { B as BaseField } from './BaseField-461b6d0c.js';
import { S as SingleChoiceField, M as MultipleChoiceField } from './index-0e8b9ea2.js';
import { S as SubFormField, a as SectionHeaderField, R as RangeField, N as NumberField } from './index-c3eacf05.js';
import { T as TextField } from './index-336ef773.js';
import { D as DateField } from './date-ce777316.js';

function generateFieldModelFromRawData(fieldData) {
  if (!fieldData) {
    return undefined;
  }
  switch (fieldData.type) {
    case DateField.type:
      return Object.assign(Object.create(DateField.prototype), fieldData);
    case MultipleChoiceField.type:
      return Object.assign(Object.create(MultipleChoiceField.prototype), fieldData);
    case NumberField.type:
      return Object.assign(Object.create(NumberField.prototype), fieldData);
    case RangeField.type:
      return Object.assign(Object.create(RangeField.prototype), fieldData);
    case SectionHeaderField.type:
      return Object.assign(Object.create(SectionHeaderField.prototype), fieldData);
    case SingleChoiceField.type:
      return Object.assign(Object.create(SingleChoiceField.prototype), fieldData);
    case SubFormField.type:
      return Object.assign(Object.create(SubFormField.prototype), fieldData);
    case TextField.type:
      return Object.assign(Object.create(TextField.prototype), fieldData);
    case ReferenceField.type:
      return Object.assign(Object.create(ReferenceField.prototype), fieldData);
    default:
      return Object.assign(Object.create(BaseField.prototype), fieldData);
  }
}

export { generateFieldModelFromRawData as g };
