/*
Attempts a require and instantiation from a given string.
function requireFromString(src, args) {
  if (!src) {
    return undefined;
  }
  /*eslint-disable camelcase, no-undef*/
  /* webpack bug: https://github.com/webpack/webpack/issues/5939 */
  /* we should probably use guards like below, but we will skip them now due to the bug above*/
  // const load =
  //   typeof __non_webpack_require__ === 'function'
  //     ? __non_webpack_require__
  //     : require;
  try {
    const mod = __non_webpack_require__(src);
    /*eslint-enable camelcase, no-undef*/

    if (args && Array.isArray(args) && typeof mod === 'function') {
      return mod(...args);
    }

    if (typeof mod === 'function') {
      return mod();
    }

    return mod;
  } catch (err) {
    /*eslint-disable no-console*/
    console.warn(`Failed to import ${src}`);
    /*eslint-enable no-console*/
  }

  return undefined;
}