HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //snap/certbot/5057/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/align.cpython-312.pyc
�

�F�hT(���ddlmZddlmZmZmZmZddlmZddl	m
Z
ddlmZddl
mZddlmZerdd	lmZmZmZmZed
ZedZGd�d
e
�ZGd�de
�Zedk(r�ddlmZmZddlmZddlm Z e�Z!e�Ze eejEe!d��ejGe!d��ejIe!d���ddd
��Z%ejMejGe%ddejN���yy)�)�chain)�
TYPE_CHECKING�Iterable�Optional�Literal�)�	Constrain)�JupyterMixin)�Measurement)�Segment)�	StyleType)�Console�ConsoleOptions�RenderableType�RenderResult��left�center�right��top�middle�bottomc��eZdZdZ		dddddd�dddedeed	eed
edee	dee	d
dfd�Z
d
efd�Ze
	dddddd�dddeed	eed
edee	dee	d
dfd��Ze
	dddddd�dddeed	eed
edee	dee	d
dfd��Ze
	dddddd�dddeed	eed
edee	dee	d
dfd��Z						dd�Zddddd
efd�Zy)�AlignaAlign a renderable by adding spaces if necessary.

    Args:
        renderable (RenderableType): A console renderable.
        align (AlignMethod): One of "left", "center", or "right""
        style (StyleType, optional): An optional style to apply to the background.
        vertical (Optional[VerticalAlignMethod], optional): Optional vertical align, one of "top", "middle", or "bottom". Defaults to None.
        pad (bool, optional): Pad the right with spaces. Defaults to True.
        width (int, optional): Restrict contents to given width, or None to use default width. Defaults to None.
        height (int, optional): Set height of align renderable, or None to fit to contents. Defaults to None.

    Raises:
        ValueError: if ``align`` is not one of the expected values.
    NT)�vertical�pad�width�height�
renderabler�align�stylerrrr�returnc��|dvrtd|�d���|�|dvrtd|�d���||_||_||_||_||_||_||_y)NrzDinvalid value for align, expected "left", "center", or "right" (not �)rzGinvalid value for vertical, expected "top", "middle", or "bottom" (not )�
ValueErrorr r!r"rrrr)�selfr r!r"rrrrs        ��/build/snapcraft-certbot-c9aaebe726f8beb59a0eb2d8e1671bc4/parts/certbot/install/lib/python3.12/site-packages/pip/_vendor/rich/align.py�__init__zAlign.__init__!s����3�3��V�W\�V_�_`�a��
���H�4O�$O��Y�Zb�Ye�ef�g��
�%�����
���
� ��
������
����c�<�d|j�d|j�d�S)NzAlign(z, r%)r r!�r's r(�__repr__zAlign.__repr__<s ������*�"�T�Z�Z�N�!�<�<r*c	� �||d|||||��S)zAlign a renderable to the left.r�r"rrrr���clsr r"rrrrs       r(rz
Align.left?s&����������
�	
r*c	� �||d|||||��S)z!Align a renderable to the center.rr/r0r1s       r(rzAlign.centerUs&����������
�	
r*c	� �||d|||||��S)z Align a renderable to the right.rr/r0r1s       r(rzAlign.rightks&����������
�	
r*�consoler�optionsrc	#�D���
����K��j�|j�j|��j}|j	t�j�j�|nt|�j��|jd���}ttj|���tj��\}}tj�||��tj��|j|z
��j �|j#�j �nd�dt$tf������fd�}�j&r*td�jxs|jz�d���n
td��
dt(dt$tf�
fd�}�j*xs|j*}�j,r�|���j,d	k(r||z
}	t/|�||	��}
nb�j,d
k(r/||z
dz}||z
|z
}	t/||�|�||	��}
n$||z
}t/||�|��}
n|�}
�j r1|j#�j ��tj0|
��}
|
Ed{���y7��w)N)r6�rr#c3���K��dkr�D]}|Ed{�������y�dk(r9�jrtd�z�	�nd}�D]}|Ed{���|r|������y�dk(rV�dz}td|z�	�}�jrtd�|z
z�	�nd}�D]}|r|��|Ed{���|r|������y�dk(r)td�z�	�}�D]}|��|Ed{�������yy7��7��7�D7��w)Nrr� r�r)rr)
�linerr�	pad_rightr!�excess_space�lines�new_liner'r"s
    ������r(�generate_segmentsz1Align.__rich_console__.<locals>.generate_segments�s9������q� �!�#�D�#�O�O�"�N�#��&��<@�H�H�g�c�L�0�%�8�$��!�#�D�#�O�O��!�	�"�N�	#��(�"�#�q�(���c�D�j�%�0��CG�8�8�G�C�<�$�#6�7��?�QU��"�#�D��!�	�#�O�O� �'��"�N�
#��'�!��c�L�0�%�8��!�#�D��I�#�O�O�"�N�#�"�7$��$��$��$�sF�C/�C'�7C/�C)�AC/�&C+�'3C/�C-�
C/�)C/�+C/�-C/r:�
�countc3�B�K�|dkDrt|�D]}����yy�w)Nr��range)rC�_�
blank_lines  �r(�blank_linesz+Align.__rich_console__.<locals>.blank_lines�s,������q�y��u��%�A�$�$�%��s�rrr;)r!�measurer �maximum�renderr	r�min�update�listr�split_lines�	get_shape�	set_shaper<�	max_widthr"�	get_stylerr�intrrr�apply_style)r'r5r6r�renderedrrArI�vertical_height�bottom_space�
iter_segments�	top_spacer!rHr>r?r@r"s`           @@@@@@r(�__rich_console__zAlign.__rich_console__�sL������
�
����������A�I�I���>�>�����$�*�*�*<��#�e�T�Z�Z�BX�
�
�N�N�$�N�'�	
���W�(�(��2�3���)�)�%�0�
��v��!�!�%���7���<�<�>���(�(�5�0��15���1G��!�!�$�*�*�-�T��%	#�8�G�#4�%	#�%	#�R�x�x�
�s�d�j�j�=�G�,=�,=�>�?�r�B�E�J����	�	%�s�	%�x��'8�	%�
�+�+�7������=�=�_�8��}�}��%�.��7�� %�&7�&9�;�|�;T� U�
����(�*�,�v�5�!�;�	�.��:�V�C�� %��	�*�%�'���-�!�
�,�f�4�	� %�k�)�&<�>O�>Q� R�
�-�/�M��:�:��%�%�d�j�j�1�E�#�/�/�
�u�E�M� � � �s�JJ �J�J c�H�tj|||j�}|S�N�r�getr �r'r5r6�measurements    r(�__rich_measure__zAlign.__rich_measure__�� ��"�o�o�g�w����H���r*)rNr^�r5rr6rr#r)�__name__�
__module__�__qualname__�__doc__�AlignMethodrr
�VerticalAlignMethod�boolrUr)�strr-�classmethodrrrr\rrcr0r*r(rrs\��
�$$�%)�	�37��#� $��$�����	�"�	��.�/�
�����}����
��
��6=�#�=��&*�
�
37��#� $�
�$�
��	�"�
�
�.�/�
��

���}�
���
�
�
�
��
�*�&*�
�
37��#� $�
�$�
��	�"�
�
�.�/�
��

���}�
���
�
�
�
��
�*�&*�
�
37��#� $�
�$�
��	�"�
�
�.�/�
��

���}�
���
�
�
�
��
�*Z!� �Z!�+;�Z!�	�Z!�x� ��+;��	�r*rc�b�eZdZdZ	ddddeeddfd�Zdefd�Z						dd
�Z	d	d
ddde
fd�Zy)�VerticalCenteraTVertically aligns a renderable.

    Warn:
        This class is deprecated and may be removed in a future version. Use Align class with
        `vertical="middle"`.

    Args:
        renderable (RenderableType): A renderable object.
        style (StyleType, optional): An optional style to apply to the background. Defaults to None.
    Nr rr"r#c� �||_||_yr^)r r")r'r r"s   r(r)zVerticalCenter.__init__�s��
%�����
r*c�"�d|j�d�S)NzVerticalCenter(r%)r r,s r(r-zVerticalCenter.__repr__�s�� ���� 3�1�5�5r*r5rr6rc#���
K�|j�|j|j�nd}|j|j|j	d��d��}tj|�\}}tj��
|jxs|jj}|t|�z
dz}||z
t|�z
}	td|z�|��dtdtt
f��
fd�}
|d	kDr|
|�Ed{���|D]}|Ed{����
���|	d	kDr|
|	�Ed{���yy7�07�#7�
�w)
Nr8F)rr;r:rCr#c3�>�K�t|�D]
}�������y�wr^rE)rCrGrHr@s  ��r(rIz4VerticalCenter.__rich_console__.<locals>.blank_lines	s%������5�\�
�� � ���
�s�r)
r"rT�render_linesr rNrrQr<r�size�lenrUr)r'r5r6r"r?r�_heightrr[rYrIr<rHr@s            @@r(r\zVerticalCenter.__rich_console__�s:�����26���1G��!�!�$�*�*�-�T���$�$��O�O�W�^�^�4�^�8�e�%�
��!�*�*�5�1���w��<�<�>�����6�7�<�<�#6�#6���c�%�j�(�Q�.�	��	�)�C��J�6����e��}�u�5�
�	�s�	�x��'8�	�
�q�=�"�9�-�-�-��	�D��O�O��N�	��!��"�<�0�0�0��	
.����
1�s6�DD?�D9�	D?�D;�D?�2D=�3D?�;D?�=D?c�H�tj|||j�}|Sr^r_ras    r(rczVerticalCenter.__rich_measure__rdr*r^re)rfrgrhrirr
r)rmr-r\rrcr0r*r(rprp�sx��	�&*��$���	�"��
�	�6�#�6�1� �1�+;�1�	�1�6� ��+;��	�r*rp�__main__)r�Group)�ReprHighlighter)�Panelzalign='left'zalign='center'z
align='right'�<zon dark_blue)rr"�titlerzon red)rr"rN)(�	itertoolsr�typingrrrr�	constrainr	�jupyterr
rJr�segmentrr"r
r5rrrrrjrkrrprf�pip._vendor.rich.consoler{�pip._vendor.rich.highlighterr|�pip._vendor.rich.panelr}�highlighterrrr�panel�printrr0r*r(�<module>r�s����=�=� �!� ����N�N��/�0���7�8��P�L�P�f6�\�6�r�z��7�<�,�!�#�K��i�G��
��J�J�{�>�2�3��L�L��%5�6�7��K�K��O�4�5�	
�
���	
�E��M�M�
���U�X�X�g�n�n��U��'r*