'use strict';

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

exports.default = pluginContext => data => {
  var _pluginContext$record = pluginContext.recordDataHelpers;
  const deepGet = _pluginContext$record.deepGet,
        getPart = _pluginContext$record.getPart;


  if (!data) {
    return '';
  }

  const common = getPart(data, 'collectionobjects_common');

  if (!common) {
    return '';
  }

  const objectNumber = common.get('objectNumber');
  const title = deepGet(common, ['titleGroupList', 'titleGroup', 0, 'title']);

  return [objectNumber, title].filter(part => !!part).join(' – ');
};