function minErr(module, ErrorConstructor) {
  ErrorConstructor = ErrorConstructor || Error;

  var url = 'https://errors.angularjs.org/1.7.5/';
  var regex = url.replace('.', '\\.') + '[\\s\\S]*';
  var errRegExp = new RegExp(regex, 'g');

  return function() {
    var code = arguments[0],
      template = arguments[1],
      message = '[' + (module ? module + ':' : '') + code + '] ',
      templateArgs = sliceArgs(arguments, 2).map(function(arg) {
        return toDebugString(arg, minErrConfig.objectMaxDepth);
      }),
      paramPrefix, i;

    // A minErr message has two parts: the message itself and the url that contains the
    // encoded message.
    // The message's parameters can contain other error messages which also include error urls.
    // To prevent the messages from getting too long, we strip the error urls from the parameters.

    message += template.replace(/\{\d+\}/g, function(match) {
      var index = +match.slice(1, -1);

      if (index < templateArgs.length) {
        return templateArgs[index].replace(errRegExp, '');
      }

      return match;
    });

    message += '\n' + url + (module ? module + '/' : '') + code;

    if (minErrConfig.urlErrorParamsEnabled) {
      for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
        message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]);
      }
    }

    return new ErrorConstructor(message);
  };
}
@ngdoc method
@name $animate#move
@kind function
@description Inserts (moves) the element into its new position in the DOM either after
  the `after` element (if provided) or as the first child within the `parent` element
  and then triggers an animation. A promise is returned that will be resolved
  during the next digest once the animation has completed.

@param {DOMElement} element the element which will be moved into the new DOM position
@param {DOMElement} parent the parent element which will append the element as
  a child (so long as the after element is not present)
@param {DOMElement=} after the sibling element after which the element will be appended
@param {object=} options an optional collection of options/styles that will be applied to the element.
  The object can have the following properties:

  - **addClass** - `{string}` - space-separated CSS classes to add to element
  - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
  - **removeClass** - `{string}` - space-separated CSS classes to remove from element
  - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`

@return {Runner} the animation runner