'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _reactIntl = require('react-intl');

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

exports.default = function (pluginContext) {
  var _conservationStatusGr, _conservationStatusGr2, _conservators, _otherPartyGroup, _otherPartyGroupList, _examinationGroup, _examinationGroupList, _destAnalysisGroup, _destAnalysisGroupLis, _ns2Conservation_com;

  var _pluginContext$inputC = pluginContext.inputComponents,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput,
      CheckboxInput = _pluginContext$inputC.CheckboxInput,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      DateInput = _pluginContext$inputC.DateInput,
      IDGeneratorInput = _pluginContext$inputC.IDGeneratorInput,
      TermPickerInput = _pluginContext$inputC.TermPickerInput,
      TextInput = _pluginContext$inputC.TextInput;
  var config = pluginContext.configHelpers.configKey;
  var DATA_TYPE_DATE = pluginContext.dataTypes.DATA_TYPE_DATE;
  var extensions = pluginContext.config.extensions;


  return {
    document: Object.assign(_defineProperty({}, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:conservation_common'
        }
      }
    }), extensions.core.fields, {
      'ns2:conservation_common': (_ns2Conservation_com = {}, _defineProperty(_ns2Conservation_com, config, {
        service: {
          ns: 'http://collectionspace.org/services/conservation'
        }
      }), _defineProperty(_ns2Conservation_com, 'conservationNumber', _defineProperty({}, config, {
        cloneable: false,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.conservationNumber.name',
            'defaultMessage': 'Reference number'
          }
        }),
        required: true,
        searchView: {
          type: TextInput
        },
        view: {
          type: IDGeneratorInput,
          props: {
            idGeneratorName: 'conservation'
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'conservationStatusGroupList', (_conservationStatusGr2 = {}, _defineProperty(_conservationStatusGr2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conservationStatusGr2, 'conservationStatusGroup', (_conservationStatusGr = {}, _defineProperty(_conservationStatusGr, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.conservationStatusGroup.name',
            'defaultMessage': 'Procedural status'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_conservationStatusGr, 'status', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.status.name',
            'defaultMessage': 'Status'
          },
          fullName: {
            'id': 'field.conservation_common.status.fullName',
            'defaultMessage': 'Procedural status'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'conservationstatus'
          }
        }
      })), _defineProperty(_conservationStatusGr, 'statusDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.statusDate.name',
            'defaultMessage': 'Date'
          },
          fullName: {
            'id': 'field.conservation_common.statusDate.fullName',
            'defaultMessage': 'Procedural status date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _conservationStatusGr)), _conservationStatusGr2)), _defineProperty(_ns2Conservation_com, 'treatmentPurpose', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.treatmentPurpose.name',
            'defaultMessage': 'Treatment purpose'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'treatmentpurpose'
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'conservators', (_conservators = {}, _defineProperty(_conservators, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_conservators, 'conservator', _defineProperty({}, config, {
        repeating: true,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.conservator.name',
            'defaultMessage': 'Conservator'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared'
          }
        }
      })), _conservators)), _defineProperty(_ns2Conservation_com, 'otherPartyGroupList', (_otherPartyGroupList = {}, _defineProperty(_otherPartyGroupList, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_otherPartyGroupList, 'otherPartyGroup', (_otherPartyGroup = {}, _defineProperty(_otherPartyGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.otherPartyGroup.name',
            'defaultMessage': 'Other treatment party'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_otherPartyGroup, 'otherParty', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.otherParty.name',
            'defaultMessage': 'Name'
          },
          fullName: {
            'id': 'field.conservation_common.otherParty.fullName',
            'defaultMessage': 'Other treatment party name'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared'
          }
        }
      })), _defineProperty(_otherPartyGroup, 'otherPartyRole', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.otherPartyRole.name',
            'defaultMessage': 'Role'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'otherpartyrole'
          }
        }
      })), _defineProperty(_otherPartyGroup, 'otherPartyNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.otherPartyNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _otherPartyGroup)), _otherPartyGroupList)), _defineProperty(_ns2Conservation_com, 'examinationGroupList', (_examinationGroupList = {}, _defineProperty(_examinationGroupList, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_examinationGroupList, 'examinationGroup', (_examinationGroup = {}, _defineProperty(_examinationGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.examinationGroup.name',
            'defaultMessage': 'Examination'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_examinationGroup, 'examinationStaff', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.examinationStaff.name',
            'defaultMessage': 'Exam staff'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared'
          }
        }
      })), _defineProperty(_examinationGroup, 'examinationPhase', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.examinationPhase.name',
            'defaultMessage': 'Phase of treatment'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'examinationphase'
          }
        }
      })), _defineProperty(_examinationGroup, 'examinationDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.examinationDate.name',
            'defaultMessage': 'Date'
          },
          fullName: {
            'id': 'field.conservation_common.examinationDate.fullName',
            'defaultMessage': 'Examination date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_examinationGroup, 'examinationNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.examinationNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _examinationGroup)), _examinationGroupList)), _defineProperty(_ns2Conservation_com, 'fabricationNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.fabricationNote.name',
            'defaultMessage': 'Fabrication note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'proposedTreatment', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.proposedTreatment.name',
            'defaultMessage': 'Proposed treatment'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'approvedBy', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.approvedBy.name',
            'defaultMessage': 'Approved by'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared'
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'approvedDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.approvedDate.name',
            'defaultMessage': 'Approval date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Conservation_com, 'treatmentStartDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.treatmentStartDate.name',
            'defaultMessage': 'Treatment start date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Conservation_com, 'treatmentEndDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.treatmentEndDate.name',
            'defaultMessage': 'Treatment end date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Conservation_com, 'treatmentSummary', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.treatmentSummary.name',
            'defaultMessage': 'Treatment summary'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'researcher', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.researcher.name',
            'defaultMessage': 'Researcher'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared'
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'proposedAnalysis', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.proposedAnalysis.name',
            'defaultMessage': 'Proposed analysis'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'proposedAnalysisDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.proposedAnalysisDate.name',
            'defaultMessage': 'Proposal date'
          },
          fullName: {
            'id': 'field.conservation_common.proposedAnalysisDate.fullName',
            'defaultMessage': 'Analysis proposal date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Conservation_com, 'destAnalysisGroupList', (_destAnalysisGroupLis = {}, _defineProperty(_destAnalysisGroupLis, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_destAnalysisGroupLis, 'destAnalysisGroup', (_destAnalysisGroup = {}, _defineProperty(_destAnalysisGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.destAnalysisGroup.name',
            'defaultMessage': 'Destructive analysis'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_destAnalysisGroup, 'destAnalysisApprovedDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.destAnalysisApprovedDate.name',
            'defaultMessage': 'Approval date'
          },
          fullName: {
            'id': 'field.conservation_common.destAnalysisApprovedDate.fullName',
            'defaultMessage': 'Destructive analysis approval date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_destAnalysisGroup, 'destAnalysisApprovalNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.destAnalysisApprovalNote.name',
            'defaultMessage': 'Approval note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_destAnalysisGroup, 'sampleBy', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.sampleBy.name',
            'defaultMessage': 'Sample taken by'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared'
          }
        }
      })), _defineProperty(_destAnalysisGroup, 'sampleDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.sampleDate.name',
            'defaultMessage': 'Sample date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_destAnalysisGroup, 'sampleDescription', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.sampleDescription.name',
            'defaultMessage': 'Sample description'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_destAnalysisGroup, 'sampleReturned', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.sampleReturned.name',
            'defaultMessage': 'Sample returned'
          }
        }),
        view: {
          type: CheckboxInput
        }
      })), _defineProperty(_destAnalysisGroup, 'sampleReturnedLocation', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.sampleReturnedLocation.name',
            'defaultMessage': 'Sample returned location'
          }
        }),
        view: {
          type: TextInput
        }
      })), _destAnalysisGroup)), _destAnalysisGroupLis)), _defineProperty(_ns2Conservation_com, 'analysisMethod', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.analysisMethod.name',
            'defaultMessage': 'Analytical methodology'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Conservation_com, 'analysisResults', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.conservation_common.analysisResults.name',
            'defaultMessage': 'Analytical result'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _ns2Conservation_com)
    })
  };
};