File: //proc/1233/root/usr/lib/python3/dist-packages/pip/_vendor/rich/__pycache__/emoji.cpython-310.pyc
o
@%Ne� � @ s@ d dl Z d dlmZmZmZ ddlmZ ddlmZ ddl m
Z
ddlmZ ddl
m
Z
e jd kr8d d
lmZ nd d
lmZ erJddlmZmZmZ ed ZG d
d� de�ZG dd� de�Zedkr�d dl Z d dlmZ d dlmZ edd�Zedd� ee�� �D �dd�Ze� e� e!e j"�dkr�e�#e j"d � dS dS dS )� N)�
TYPE_CHECKING�Optional�Union� )�JupyterMixin)�Segment)�Style)�EMOJI��_emoji_replace)� � )�Literal)�Console�ConsoleOptions�RenderResult)�emoji�textc @ s e Zd ZdZdS )�NoEmojizNo emoji by that name.N)�__name__�
__module__�__qualname__�__doc__� r r �8/usr/lib/python3/dist-packages/pip/_vendor/rich/emoji.pyr s r c @ s� e Zd Zg d�Zddd�Z ddedeeef d ee d
dfdd�Z
ed
ed
efdd��Zd
efdd�Z
d
efdd�Z
ddd�ZdS )�Emoji)�name�style�_char�variantu ︎u ️)r r �noneNr r r �returnc C sf || _ || _|| _zt| | _W n ty td|����w |dur1| j| j�|d�7 _dS dS )z�A single emoji character.
Args:
name (str): Name of emoji.
style (Union[str, Style], optional): Optional style. Defaults to None.
Raises:
NoEmoji: If the emoji doesn't exist.
zNo emoji called N� ) r r r r r �KeyErrorr �VARIANTS�get)�selfr r r r r r �__init__ s ��zEmoji.__init__r c C s t |�S )z�Replace emoji markup with corresponding unicode characters.
Args:
text (str): A string with emojis codes, e.g. "Hello :smiley:!"
Returns:
str: A string with emoji codes replaces with actual emoji.
r
)�clsr r r r �replace9 s
z
Emoji.replacec C s d| j �d�S )Nz<emoji �>)r �r&