def resolve_annotations(
    raw_annotations: Mapping[str, type[Any]], module_name: str | None
) -> dict[str, type[Any]]:
    """Partially taken from typing.get_type_hints.

    Resolve string or ForwardRef annotations into type objects if possible.

    Args:
        raw_annotations: The raw annotations to resolve.
        module_name: The name of the module.

    Returns:
        The resolved annotations.
    """
    module = sys.modules.get(module_name, None) if module_name is not None else None

    base_globals: dict[str, Any] | None = (
        module.__dict__ if module is not None else None
    )

    annotations = {}
    for name, value in raw_annotations.items():
        if isinstance(value, str):
            if sys.version_info == (3, 10, 0):
                value = ForwardRef(value, is_argument=False)
            else:
                value = ForwardRef(value, is_argument=False, is_class=True)
        try:
            if sys.version_info >= (3, 13):
                value = _eval_type(value, base_globals, None, type_params=())
            else:
                value = _eval_type(value, base_globals, None)
        except NameError:
            # this is ok, it can be fixed with update_forward_refs
            pass
        annotations[name] = value
    return annotations
Partially taken from typing.get_type_hints.

    Resolve string or ForwardRef annotations into type objects if possible.

    Args:
        raw_annotations: The raw annotations to resolve.
        module_name: The name of the module.

    Returns:
        The resolved annotations.
    
reflex/utils/types.py