import { Memo as a, ForwardRef as i } from "react-is";
const c = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
function s(e) {
  const t = `${e}`.match(c);
  return t && t[1] || "";
}
function f(e, t = "") {
  return e.displayName || e.name || s(e) || t;
}
function u(e, t, r) {
  const n = f(t);
  return e.displayName || (n !== "" ? `${r}(${n})` : r);
}
function y(e) {
  if (e != null) {
    if (typeof e == "string")
      return e;
    if (typeof e == "function")
      return f(e, "Component");
    if (typeof e == "object")
      switch (e.$$typeof) {
        case i:
          return u(e, e.render, "ForwardRef");
        case a:
          return u(e, e.type, "memo");
        default:
          return;
      }
  }
}
export {
  y as default,
  s as getFunctionName
};
