'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 _relRelationsCommon, _Object$assign, _citationTermGroup, _citationTermGroupLis, _citationRecordTypes, _citationPublicationI, _citationPublicationI2, _citationAgentInfoGro, _citationAgentInfoGro2, _citationResourceIden, _citationResourceIden2, _citationRelatedTerms, _citationRelatedTerms2, _ns2Citations_common;

  var _pluginContext$inputC = pluginContext.inputComponents,
      AutocompleteInput = _pluginContext$inputC.AutocompleteInput,
      CompoundInput = _pluginContext$inputC.CompoundInput,
      HierarchyInput = _pluginContext$inputC.HierarchyInput,
      OptionPickerInput = _pluginContext$inputC.OptionPickerInput,
      TextInput = _pluginContext$inputC.TextInput,
      TermPickerInput = _pluginContext$inputC.TermPickerInput,
      CheckboxInput = _pluginContext$inputC.CheckboxInput,
      StructuredDateInput = _pluginContext$inputC.StructuredDateInput;
  var config = pluginContext.configHelpers.configKey;
  var extensions = pluginContext.config.extensions;


  return {
    document: Object.assign((_Object$assign = {}, _defineProperty(_Object$assign, config, {
      view: {
        type: CompoundInput,
        props: {
          defaultChildSubpath: 'ns2:citations_common'
        }
      }
    }), _defineProperty(_Object$assign, 'rel:relations-common-list', (_relRelationsCommon = {}, _defineProperty(_relRelationsCommon, config, {
      service: {
        ns: 'http://collectionspace.org/services/relation'
      }
    }), _defineProperty(_relRelationsCommon, 'relation-list-item', _defineProperty({}, config, {
      view: {
        type: HierarchyInput,
        props: {
          messages: (0, _reactIntl.defineMessages)({
            parent: {
              'id': 'hierarchyInput.citation.parent',
              'defaultMessage': 'Broader citation'
            },
            children: {
              'id': 'hierarchyInput.citation.children',
              'defaultMessage': 'Narrower citations'
            },
            siblings: {
              'id': 'hierarchyInput.citation.siblings',
              'defaultMessage': 'Adjacent citations'
            }
          })
        }
      }
    })), _relRelationsCommon)), _Object$assign), extensions.core.fields, {
      'ns2:citations_common': (_ns2Citations_common = {}, _defineProperty(_ns2Citations_common, config, {
        service: {
          ns: 'http://collectionspace.org/services/citation'
        }
      }), _defineProperty(_ns2Citations_common, 'csid', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Citations_common, 'inAuthority', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Citations_common, 'refName', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Citations_common, 'shortIdentifier', _defineProperty({}, config, {
        cloneable: false
      })), _defineProperty(_ns2Citations_common, 'citationTermGroupList', (_citationTermGroupLis = {}, _defineProperty(_citationTermGroupLis, config, {
        messages: (0, _reactIntl.defineMessages)({
          required: {
            'id': 'field.citations_common.citationTermGroupList.required',
            'defaultMessage': 'At least one term display name is required. Please enter a value.'
          }
        }),
        required: true,
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationTermGroupLis, 'citationTermGroup', (_citationTermGroup = {}, _defineProperty(_citationTermGroup, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.citationTermGroup.name',
            'defaultMessage': 'Term'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationTermGroup, 'termDisplayName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termDisplayName.name',
            'defaultMessage': 'Display name'
          }
        }),
        required: true,
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termName', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termName.name',
            'defaultMessage': 'Name'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termType', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termType.name',
            'defaultMessage': 'Type'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'citationtermtype'
          }
        }
      })), _defineProperty(_citationTermGroup, 'termFlag', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termFlag.name',
            'defaultMessage': 'Flag'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'citationtermflag'
          }
        }
      })), _defineProperty(_citationTermGroup, 'termStatus', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termStatus.name',
            'defaultMessage': 'Status'
          }
        }),
        view: {
          type: OptionPickerInput,
          props: {
            source: 'citationTermStatuses'
          }
        }
      })), _defineProperty(_citationTermGroup, 'termQualifier', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termQualifier.name',
            'defaultMessage': 'Qualifier'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termLanguage', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termLanguage.name',
            'defaultMessage': 'Language'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'languages'
          }
        }
      })), _defineProperty(_citationTermGroup, 'termPrefForLang', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termPrefForLang.name',
            'defaultMessage': 'Preferred for lang'
          }
        }),
        view: {
          type: CheckboxInput
        }
      })), _defineProperty(_citationTermGroup, 'termSource', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termSource.name',
            'defaultMessage': 'Name'
          },
          fullName: {
            'id': 'field.citations_common.termSource.fullName',
            'defaultMessage': 'Source name'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'citation/local,citation/shared,citation/worldcat'
          }
        }
      })), _defineProperty(_citationTermGroup, 'termSourceDetail', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termSourceDetail.name',
            'defaultMessage': 'Detail'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termSourceID', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termSourceID.name',
            'defaultMessage': 'ID'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termSourceNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termSourceNote.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termFullCitation', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termFullCitation.name',
            'defaultMessage': 'Full citation'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termTitle', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termTitle.name',
            'defaultMessage': 'Title'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termSubTitle', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termSubTitle.name',
            'defaultMessage': 'Subtitle'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termSectionTitle', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termSectionTitle.name',
            'defaultMessage': 'Section title'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termVolume', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termVolume.name',
            'defaultMessage': 'Volume'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationTermGroup, 'termIssue', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.termIssue.name',
            'defaultMessage': 'Issue'
          }
        }),
        view: {
          type: TextInput
        }
      })), _citationTermGroup)), _citationTermGroupLis)), _defineProperty(_ns2Citations_common, 'citationRecordTypes', (_citationRecordTypes = {}, _defineProperty(_citationRecordTypes, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationRecordTypes, 'citationRecordType', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.citationRecordType.name',
            'defaultMessage': 'Type'
          }
        }),
        repeating: true,
        view: {
          type: TermPickerInput,
          props: {
            source: 'citationtermtype'
          }
        }
      })), _citationRecordTypes)), _defineProperty(_ns2Citations_common, 'citationPublicationInfoGroupList', (_citationPublicationI2 = {}, _defineProperty(_citationPublicationI2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationPublicationI2, 'citationPublicationInfoGroup', (_citationPublicationI = {}, _defineProperty(_citationPublicationI, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.citationPublicationInfoGroup.name',
            'defaultMessage': 'Publication'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_citationPublicationI, 'publisher', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.publisher.name',
            'defaultMessage': 'Publisher'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'organization/local'
          }
        }
      })), _defineProperty(_citationPublicationI, 'publicationPlace', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.publicationPlace.name',
            'defaultMessage': 'Place'
          },
          fullName: {
            'id': 'field.citations_common.publicationPlace.fullName',
            'defaultMessage': 'Publication place'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'place/local,place/tgn'
          }
        }
      })), _defineProperty(_citationPublicationI, 'publicationDate', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.publicationDate.name',
            'defaultMessage': 'Date'
          }
        }),
        view: {
          type: StructuredDateInput
        }
      })), _defineProperty(_citationPublicationI, 'edition', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.edition.name',
            'defaultMessage': 'Edition'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationPublicationI, 'pages', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.pages.name',
            'defaultMessage': 'Page(s)'
          }
        }),
        view: {
          type: TextInput
        }
      })), _citationPublicationI)), _citationPublicationI2)), _defineProperty(_ns2Citations_common, 'citationAgentInfoGroupList', (_citationAgentInfoGro2 = {}, _defineProperty(_citationAgentInfoGro2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationAgentInfoGro2, 'citationAgentInfoGroup', (_citationAgentInfoGro = {}, _defineProperty(_citationAgentInfoGro, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.citationAgentInfoGroup.name',
            'defaultMessage': 'Agent'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_citationAgentInfoGro, 'agent', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.agent.name',
            'defaultMessage': 'Name'
          },
          fullName: {
            'id': 'field.citations_common.agent.fullName',
            'defaultMessage': 'Agent name'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'person/local,person/ulan,organization/local'
          }
        }
      })), _defineProperty(_citationAgentInfoGro, 'role', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.role.name',
            'defaultMessage': 'Role'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'agentinfotype'
          }
        }
      })), _defineProperty(_citationAgentInfoGro, 'note', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.note.name',
            'defaultMessage': 'Note'
          }
        }),
        view: {
          type: TextInput
        }
      })), _citationAgentInfoGro)), _citationAgentInfoGro2)), _defineProperty(_ns2Citations_common, 'citationNote', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.citationNote.name',
            'defaultMessage': 'Citation note'
          }
        }),
        view: {
          type: TextInput,
          props: {
            multiline: true
          }
        }
      })), _defineProperty(_ns2Citations_common, 'citationResourceIdentGroupList', (_citationResourceIden2 = {}, _defineProperty(_citationResourceIden2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationResourceIden2, 'citationResourceIdentGroup', (_citationResourceIden = {}, _defineProperty(_citationResourceIden, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.citationResourceIdentGroup.name',
            'defaultMessage': 'Resource identifier'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_citationResourceIden, 'resourceIdent', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.resourceIdent.name',
            'defaultMessage': 'Identifier'
          }
        }),
        view: {
          type: TextInput
        }
      })), _defineProperty(_citationResourceIden, 'type', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.type.name',
            'defaultMessage': 'Type'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'resourceidtype'
          }
        }
      })), _defineProperty(_citationResourceIden, 'captureDate', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.captureDate.name',
            'defaultMessage': 'Capture date'
          }
        }),
        view: {
          type: StructuredDateInput
        }
      })), _citationResourceIden)), _citationResourceIden2)), _defineProperty(_ns2Citations_common, 'citationRelatedTermsGroupList', (_citationRelatedTerms2 = {}, _defineProperty(_citationRelatedTerms2, config, {
        view: {
          type: CompoundInput
        }
      }), _defineProperty(_citationRelatedTerms2, 'citationRelatedTermsGroup', (_citationRelatedTerms = {}, _defineProperty(_citationRelatedTerms, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.citationRelatedTermsGroup.name',
            'defaultMessage': 'Related term'
          }
        }),
        repeating: true,
        view: {
          type: CompoundInput,
          props: {
            tabular: true
          }
        }
      }), _defineProperty(_citationRelatedTerms, 'relatedTerm', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.relatedTerm.name',
            'defaultMessage': 'Term'
          },
          fullName: {
            'id': 'field.citations_common.relatedTerm.fullName',
            'defaultMessage': 'Related term'
          }
        }),
        view: {
          type: AutocompleteInput,
          props: {
            source: 'concept/associated,concept/activity,concept/material'
          }
        }
      })), _defineProperty(_citationRelatedTerms, 'relationType', _defineProperty({}, config, {
        messages: (0, _reactIntl.defineMessages)({
          name: {
            'id': 'field.citations_common.relationType.name',
            'defaultMessage': 'Type'
          }
        }),
        view: {
          type: TermPickerInput,
          props: {
            source: 'relationtypetype'
          }
        }
      })), _citationRelatedTerms)), _citationRelatedTerms2)), _ns2Citations_common)
    })
  };
};