HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/__pycache__/cells.cpython-310.pyc
o

��h
�@sUddlmZddlmZddlmZddlmZgd�Zde	d<e
d	d
�eD��ZejZ
de	d<ed
�d,dd��Zefd-dd�Zed
d�d.dd��Zd/dd�Zd0d!d"�Zed#kr�eed$��ed%d&�D]Zee�qded'dd(�D]Zeed%e�d)�ed*e�qqd+Sd+S)1�)�annotations)�	lru_cache)�Callable�)�CELL_WIDTHS))� �~)��)�i�)ipi�)i%i�%)i(i�(zlist[tuple[int, int]]�_SINGLE_CELL_UNICODE_RANGEScCs.g|]\}}ttt||d��D]}|�qqS)r)�map�chr�range)�.0�_start�_end�	character�r�A/usr/local/lib/python3.10/dist-packages/pip/_vendor/rich/cells.py�
<listcomp>s���rzCallable[[str], bool]�_is_single_cell_widthsi�text�str�return�intcCst|�rt|�Sttt|��S)a/Get the number of cells required to display text.

    This method always caches, which may use up a lot of memory. It is recommended to use
    `cell_len` over this method.

    Args:
        text (str): Text to display.

    Returns:
        int: Get the number of cells required to display text.
    )r�len�sumr
�get_character_cell_size)rrrr�cached_cell_len!s
r�	_cell_len�Callable[[str], int]cCs2t|�dkr
||�St|�rt|�Sttt|��S)z�Get the number of cells required to display text.

    Args:
        text (str): Text to display.

    Returns:
        int: Get the number of cells required to display text.
    i)rrrr
r)rr rrr�cell_len3s
	r")�maxsizerc	Cs�t|�}t}d}t|�d}||d}	||\}}}||kr%|d}n||kr.|d}n|dkr4dS|S||kr=	dS||d}q)z�Get the cell size of a character.

    Args:
        character (str): A single character.

    Returns:
        int: Number of cells (0, 1 or 2) occupied by that character.
    rr�T���)�ordrr)	r�	codepoint�_table�lower_bound�upper_bound�index�start�end�widthrrrrCs"


��r�totalc	Cs�t|�rt|�}||kr|d||S|d|�S|dkr dSt|�}||kr*|S||kr6|d||Sd}t|�}	||d}|d|d�}t|�}||dkret|d�dkre|dd�dS||krk|S||krr|}n|}q=)	z?Set the length of a string to fit within given number of cells.� Nr�Tr$rr%)rrr")	rr/�size�	cell_sizer,r-�pos�before�
before_lenrrr�
set_cell_size`s4�r7r.�	list[str]c
Csxt}gg}|j}|dj}d}|D]#}||�}|||k}	|	r,||g�|dj}|}q||�||7}qdd�|D�S)ahSplit text into lines such that each line fits within the available (cell) width.

    Args:
        text: The text to fold such that it fits in the given width.
        width: The width available (number of cells).

    Returns:
        A list of strings such that each string in the list has cell width
        less than or equal to the available width.
    r%rcSsg|]}d�|��qS)r1)�join)r�linerrrr�szchop_cells.<locals>.<listcomp>)r�append)
rr.�_get_character_cell_size�lines�append_new_line�append_to_last_line�total_widthr�
cell_width�char_doesnt_fitrrr�
chop_cells�s



rC�__main__u😽u]这是对亚洲语言支持的测试。面对模棱两可的想法,拒绝猜测的诱惑。��Pr%�|�xN)rrrr)rrr r!rr)rrrr)rrr/rrr)rrr.rrr8)�
__future__r�	functoolsr�typingr�_cell_widthsrr�__annotations__�	frozenset�
_SINGLE_CELLS�
issupersetrrr"rr7rC�__name__�printr:r�nrrrr�<module>s6
��


#%
�