// Generated by CoffeeScript 2.3.2
(function() {
  var ConfigNode, DefaultView, augmentHit, merge;

  ({ConfigNode} = require("@l.degener/irma-config"));

  ({augmentHit} = require("../response-parser-support"));

  merge = require("../shallow-merge");

  module.exports = DefaultView = class DefaultView extends ConfigNode {
    transform(searchRequest, settings) {
      return this.render(searchRequest, settings);
    }

    apply(searchRequest, settings) {
      return this.render(searchRequest, settings);
    }

    render(searchRequest, settings) {
      return function(searchResult) {
        return {
          data: merge(searchResult, {
            hits: searchResult.hits.map(augmentHit(searchRequest, settings))
          })
        };
      };
    }

  };

}).call(this);
