'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 _exitMethods, _deacApprovalGroup, _deacApprovalGroupLis, _ns2Objectexit_commo;

  var _pluginContext$inputC = pluginContext.inputComponents,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      DateInput = _pluginContext$inputC.DateInput,
      OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
      TextInput = _pluginContext$inputC.TextInput,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput,
      IDGeneratorInput = _pluginContext$inputC.IDGeneratorInput,
      TermPickerInput = _pluginContext$inputC.TermPickerInput,
      StructuredDateInput = _pluginContext$inputC.StructuredDateInput;
  var config = pluginContext.configHelpers.configKey;
  var _pluginContext$dataTy = pluginContext.dataTypes,
      DATA_TYPE_DATE = _pluginContext$dataTy.DATA_TYPE_DATE,
      DATA_TYPE_FLOAT = _pluginContext$dataTy.DATA_TYPE_FLOAT,
      DATA_TYPE_INT = _pluginContext$dataTy.DATA_TYPE_INT;
  var extensions = pluginContext.config.extensions;


  return {
    document: Object.assign(_defineProperty({}, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:objectexit_common'
        }
      }
    }), extensions.core.fields, {
      'ns2:objectexit_common': (_ns2Objectexit_commo = {}, _defineProperty(_ns2Objectexit_commo, config, {
        service: {
          ns: 'http://collectionspace.org/services/objectexit'
        }
      }), _defineProperty(_ns2Objectexit_commo, 'exitNumber', _defineProperty({}, config, {
        cloneable: false,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.exitNumber.name',
            'defaultMessage': 'Exit number'
          }
        }),
        required: true,
        searchView: {
          type: TextInput
        },
        view: {
          type: IDGeneratorInput,
          props: {
            idGeneratorName: 'objectexit'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'currentOwner', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.currentOwner.name',
            'defaultMessage': 'Current owner'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'depositor', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.depositor.name',
            'defaultMessage': 'Depositor'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'exitDateGroup', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.exitDateGroup.name',
            'defaultMessage': 'Exit date'
          }
        }),
        view: {
          type: StructuredDateInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'exitMethods', (_exitMethods = {}, _defineProperty(_exitMethods, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_exitMethods, 'exitMethod', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.exitMethod.name',
            'defaultMessage': 'Exit method'
          }
        }),
        repeating: true,
        view: {
          type: OptionPickerInput,
          props: {
            source: 'exitMethods'
          }
        }
      })), _exitMethods)), _defineProperty(_ns2Objectexit_commo, 'exitQuantity', _defineProperty({}, config, {
        dataType: DATA_TYPE_INT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.exitQuantity.name',
            'defaultMessage': 'Exit quantity'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'exitNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.exitNote.name',
            'defaultMessage': 'Exit note'
          }
        }),
        searchView: {
          type: TextInput
        },
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'exitReason', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.exitReason.name',
            'defaultMessage': 'Exit reason'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'exitReasons'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'packingNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.packingNote.name',
            'defaultMessage': 'Packing note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalNewObjectNumber', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalNewObjectNumber.name',
            'defaultMessage': 'Disposal new object number'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'deacApprovalGroupList', (_deacApprovalGroupLis = {}, _defineProperty(_deacApprovalGroupLis, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_deacApprovalGroupLis, 'deacApprovalGroup', (_deacApprovalGroup = {}, _defineProperty(_deacApprovalGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.deacApprovalGroupList.name',
            'defaultMessage': 'Deaccession approval'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_deacApprovalGroup, 'deaccessionApprovalGroup', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.deaccessionApprovalGroup.name',
            'defaultMessage': 'Group'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'deaccessionapprovalgroup'
          }
        }
      })), _defineProperty(_deacApprovalGroup, 'deaccessionApprovalStatus', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.deaccessionApprovalStatus.name',
            'defaultMessage': 'Status'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'deaccessionapprovalstatus'
          }
        }
      })), _defineProperty(_deacApprovalGroup, 'deaccessionApprovalDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.deaccessionApprovalDate.name',
            'defaultMessage': 'Date'
          },
          fullName: {
            'id': 'field.objectexit_common.deaccessionApprovalDate.fullName',
            'defaultMessage': 'Deaccession approval status date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _deacApprovalGroup)), _deacApprovalGroupLis)), _defineProperty(_ns2Objectexit_commo, 'deaccessionAuthorizer', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.deaccessionAuthorizer.name',
            'defaultMessage': 'Deaccession authorizer'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'authorizationDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.authorizationDate.name',
            'defaultMessage': 'Authorization date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'deaccessionDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.deaccessionDate.name',
            'defaultMessage': 'Deaccession date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalDate', _defineProperty({}, config, {
        dataType: DATA_TYPE_DATE,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalDate.name',
            'defaultMessage': 'Disposal date'
          }
        }),
        view: {
          type: DateInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalMethod', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalMethod.name',
            'defaultMessage': 'Disposal method'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'disposalmethod'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalReason', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalReason.name',
            'defaultMessage': 'Disposal reason'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalProvisos', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalProvisos.name',
            'defaultMessage': 'Disposal provisos'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalProposedRecipient', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalProposedRecipient.name',
            'defaultMessage': 'Disposal proposed recipient'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalRecipient', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalRecipient.name',
            'defaultMessage': 'Disposal recipient'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/shared,organization/local,organization/shared'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalNote.name',
            'defaultMessage': 'Disposal note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'disposalValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.disposalValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.objectexit_common.disposalValue.fullName',
            'defaultMessage': 'Disposal value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_ns2Objectexit_commo, 'groupDisposalCurrency', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.groupDisposalCurrency.name',
            'defaultMessage': 'Currency'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'currency'
          }
        }
      })), _defineProperty(_ns2Objectexit_commo, 'groupDisposalValue', _defineProperty({}, config, {
        dataType: DATA_TYPE_FLOAT,
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.objectexit_common.groupDisposalValue.name',
            'defaultMessage': 'Value'
          },
          fullName: {
            'id': 'field.objectexit_common.groupDisposalValue.fullName',
            'defaultMessage': 'Group disposal value'
          }
        }),
        view: {
          type: TextInput
        }
      })), _ns2Objectexit_commo)
    })
  };
};