function getInstanceName(instance) {
  var _a, _b, _c;

  const name = getComponentTypeName(instance.type || {});
  if (name) return name;
  if (isAppRoot(instance)) return 'Root';

  for (const key in (_b = (_a = instance.parent) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.components) {
    if (instance.parent.type.components[key] === instance.type) return saveComponentName(instance, key);
  }

  for (const key in (_c = instance.appContext) === null || _c === void 0 ? void 0 : _c.components) {
    if (instance.appContext.components[key] === instance.type) return saveComponentName(instance, key);
  }

  return 'Anonymous Component';
}
Get the appropriate display name for an instance.

@param {Vue} instance
@return {String}