+
     h`  c                   s   ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
HtHtHtHtHtHtHtHtHtHt ^RIHtHtHtHtHt ^RIHtHt ^R	IHt ]'       d   ^R
I H!t!H"t"H#t# ]! R4      t$ ! R R]4      t%]]]%,          ]]%]]&]'3,          3,          ]]%]&]&3,          3,          t(]! 4        ! R R]4      4       t) ! R R4      t* ! R R4      t+],R8X  Ed	   ^ RI-H!t! ^ RI.H/t/ ^ RI0H1t1 Rt2]1Pf                  ! R4      t4]!! 4       t ] Pk                  R4       ] Pm                  R4       ] Pm                  R4       ] Pm                  ]/! ]2RRR7      4       ] Pm                  4        ] Pm                  R 4       ]7! ] Pq                  ]44      4      t9] Pm                  ]94       ] Pm                  4        ] Pm                  R!4       ] Pm                  ]44       ] Pm                  R"4       R## R## )$i    )IntEnum)	lru_cache)filterfalse)	getLogger)
attrgetter)
TYPE_CHECKINGDictIterableList
NamedTupleOptionalSequenceTupleTypeUnion)_is_single_cell_widthscached_cell_lencell_lenget_character_cell_sizeset_cell_size)Result	rich_repr)Style)ConsoleConsoleOptionsRenderResultZrichc                   sZ    ] tR t^#tRt^t^t^t^t^t	^t
^t^t^	t^
t^t^t^t^t^t^tRtR# )ControlTypezDNon-printable control codes which typically translate to ANSI codes. N)__name__
__module____qualname____firstlineno____doc__ZBELLZCARRIAGE_RETURNZHOMEZCLEARZSHOW_CURSORZHIDE_CURSORZENABLE_ALT_SCREENZDISABLE_ALT_SCREENZ	CURSOR_UPZCURSOR_DOWNZCURSOR_FORWARDZCURSOR_BACKWARDZCURSOR_MOVE_TO_COLUMNZCURSOR_MOVE_TOZERASE_IN_LINEZSET_WINDOW_TITLE__static_attributes__r       =/usr/lib/python3.14/site-packages/pip/_vendor/rich/segment.pyr   r   #   sY    NDODEKKIKNONMr"   r   c                   s  a  ] tR t^?t o RtRtRt]V 3R lR l4       tV 3R lR lt	V 3R lR lt
]V 3R	 lR
 l4       t]]! R34      V 3R lR l4       4       tV 3R lR lt]V 3R lR l4       t]R4V 3R lR ll4       t]R5V 3R lR ll4       t]V 3R lR l4       t]R6V 3R lR ll4       t]R7V 3R lR ll4       t]V 3R lR l4       t]V 3R lR l4       t]R8V 3R lR  ll4       t]R5V 3R! lR" ll4       t]R5V 3R# lR$ ll4       t]R5V 3R% lR& ll4       t]V 3R' lR( l4       t]V 3R) lR* l4       t]V 3R+ lR, l4       t]V 3R- lR. l4       t]V 3R/ lR0 l4       t V 3R1 lt!R2t"V t#R# )9Segmenta  A piece of text with associated style. Segments are produced by the Console render process and
are ultimately converted in to strings to be written to the terminal.

Args:
    text (str): A piece of text.
    style (:class:`~rich.style.Style`, optional): An optional style to apply to the text.
    control (Tuple[ControlCode], optional): Optional sequence of control codes.

Attributes:
    cell_length (int): The cell length of this Segment.
Nc                    < V ^8  d   QhRS[ /#    return)intZformat__classdict__   "r#   __annotate__Segment.__annotate__R   s     0 0S 0r"   c                s6    V w  rpV'       d   ^ # \        V4      # )zbThe number of terminal cells required to display self.text.

Returns:
    int: A number of cells.
)r   )selftext_stylecontrols   &   r#   cell_lengthZSegment.cell_lengthQ   s     !%gq/$/r"   c                r%   r&   )r   r*   r,   r#   r-   r.   [   s      v r"   c              #  s   "   V P                   x  V P                  f!   V P                  e   V P                  x  R # R # V P                  x  V P                  x  R # 5iN)r0   r2   styler/      &r#   __rich_repr__ZSegment.__rich_repr__[   sG     ii<<zz%jj  & **,,s   AAc                r%   r&   boolr*   r,   r#   r-   r.   d   s      $ r"   c                s,    \        V P                  4      # )z#Check if the segment contains text.)r:   r0   r6   r7   r#   __bool__ZSegment.__bool__d   s    DIIr"   c                r%   r&   r9   r*   r,   r#   r-   r.   i   s     ( (D (r"   c                s    V P                   RJ# )z,Check if the segment contains control codes.N)r2   r6   r7   r#   
is_controlZSegment.is_controlh   s     ||4''r"   c                s8   < V ^8  d   QhRRRS[ RS[R,          /# )r'   segmentr$   cutr(   r$   r$   r)   r   r*   r,   r#   r-   r.   o   s(     - -9 -3 -5AU;V -r"   c                sf   Vw  r4p\         pVP                  pW'8  d   W! RWE4      3# \        p\        W',          \	        V4      ,          4      p	 VRV	 p
\        V
4      pW,
          pV'       g   V! WV4      V! W9R WE4      3# VR8X  d@   V! W9,          4      ^8X  d-   V! VRV	 R,           WE4      V! RW9^,           R ,           WE4      3# V^8X  dG   V! W9^,
          ,          4      ^8X  d-   V! VRV	^,
           R,           WE4      V! RW9R ,           WE4      3# W8  d   V	^,          p	K  V	^,          p	K  )a  Split a segment in to two at a given cell position.

Note that splitting a double-width character, may result in that character turning
into two spaces.

Args:
    segment (Segment): A segment to split.
    cut (int): A cell position to cut on.

Returns:
    A tuple of two segments.
 N )r$   r3   r   r)   lenr   )clsr=   r>   r0   r5   r2   _Segmentr3   Z	cell_sizeposbeforeZcell_posZout_bys   &&&          r#   _split_cellsZSegment._split_cellsm   sL     'W))HR888+	3$D	12$3ZF'H^FVG4T$Z8  |	$) 4 9T$3Z#-u>S4a	?2EC  |	$Qw- 8A =T)C!G_s2ECS4:-u>  ~qqr"   c                s4   < V ^8  d   QhRS[ RS[R,          /# )r'   r>   r(   r?   r@   r*   r,   r#   r-   r.      s!     , ,s ,u-A'B ,r"   c                s    V w  r#pV^ 8  g   Q h\        V4      '       d<   V\        V4      8  d   V \        RW44      3# \        VRV W44      \        W!R W44      3# V P                  W4      # )a@  Split segment in to two segments at the specified column.

If the cut point falls in the middle of a 2-cell wide character then it is replaced
by two spaces, to preserve the display width of the parent segment.

Args:
    cut (int): Offset within the segment to cut.

Returns:
    Tuple[Segment, Segment]: Two segments.
rA   N)r   rD   r$   rI   )r/   r>   r0   r5   r2      &&   r#   split_cellsZSegment.split_cells   s}      $Waxx!$''c$iWR888Tc
E3T
E3 
   ++r"   c                s   < V ^8  d   QhRR/# )r'   r(   r$   r   r*   r,   r#   r-   r.      s      Y r"   c                s    V ! R4      # )zMake a new line segment.
r   )rE   r7   r#   lineZSegment.line   s     4yr"   c          	      sn   < V ^8  d   QhRS[ R,          RS[S[,          RS[S[,          RS[ R,          /# )r'   segmentsr$   r5   
post_styler(   )r   r
   r   r*   r,   r#   r-   r.      sE     & &9%& & UO	&
 
)	&r"   c                s|   a aa TpV'       d   VP                   oVV 3R lV 4       pS'       d   V V3R lV 4       pV# )a  Apply style(s) to an iterable of segments.

Returns an iterable of segments where the style is replaced by ``style + segment.style + post_style``.

Args:
    segments (Iterable[Segment]): Segments to process.
    style (Style, optional): Base style. Defaults to None.
    post_style (Style, optional): Style to apply on top of segment style. Defaults to None.

Returns:
    Iterable[Segments]: A new iterable of segments (possibly the same iterable).
c              3   s\   <"   T F!  w  rpS! Y'       d   R MS! V4      V4      x  K#  	  R # 5ir4   r   ).0r0   r1   r2   applyrE      &   r#   	<genexpr>&Segment.apply_style.<locals>.<genexpr>   s1      -<)D' D'$uV}gFF-<s   ),c              3   st   <"   T F-  w  rpS! TV'       d   R MV'       d
   VS,           MSV4      x  K/  	  R # 5ir4   r   )rP   r0   r1   r2   rE   rO   rR   r#   rS   rT      sG       .=)D'  # 5;fz1  .=s   88)Z__add__)rE   rN   r5   rO   Zresult_segmentsrQ   s   f&&f @r#   apply_styleZSegment.apply_style   sC    & #MME-<O  .=O r"   c                sH   < V ^8  d   QhRS[ R,          RS[RS[ R,          /# )r'   rN   r$   r<   r(   )r   r:   r*   r,   r#   r-   r.      s4     @ @	*@8<@	)	@r"   c                sf    V'       d   \        \        R4      V4      # \        \        R4      V4      # )a  Filter segments by ``is_control`` attribute.

Args:
    segments (Iterable[Segment]): An iterable of Segment instances.
    is_control (bool, optional): is_control flag to match in search.

Returns:
    Iterable[Segment]: And iterable of Segment instances.

r2   )Zfilterr   r   )rE   rN   r<      &&&r#   filter_controlZSegment.filter_control   s+     *Y/::z)4h??r"   c                sR   < V ^8  d   QhRS[ R,          RS[ S[R,          ,          /# r'   rN   r$   r(   )r   r   r*   r,   r#   r-   r.      s)      8I#6 8DO;T r"   c              #  s\  "   . pVP                   pV F  pRVP                  9   dj   VP                  '       gX   Vw  rVpV'       dI   VP                  R4      w  rpV'       d   V! V ! W4      4       V	'       g   K<  Vx  . pVP                   pKP  K}  V! V4       K  	  V'       d   Vx  R# R# 5i)zSplit a sequence of segments in to a list of lines.

Args:
    segments (Iterable[Segment]): Segments potentially containing line feeds.

Yields:
    Iterable[List[Segment]]: Iterable of segment lists, one per line.
rL   N)appendr0   r2   	partition)
rE   rN   rM   rY   r=   r0   r5   __textnew_lines
   &&        r#   split_linesZSegment.split_lines   s      !Gw||#GOOO!(Q,0NN4,@)ETs501x"
!!%  w   J s   6B,B,/B,:)B,$B,c                sz   < V ^8  d   QhRS[ R,          RS[RS[S[,          RS[RS[RS[ S[R,          ,          /# )r'   rN   r$   lengthr5   padinclude_new_linesr(   )r   r)   r
   r   r:   r   r*   r,   r#   r-   r.     sa     ,I ,I9%,I ,I 	,I
 ,I  ,I 
$y/	",Ir"   c              #  s  "   . pVP                   pV P                  pV ! R4      p	V F  p
RV
P                  9   d   V
P                  '       g}   V
w  rpV'       dn   VP	                  R4      w  rpV'       d   V! V ! W4      4       V'       g   K<  V! WbW4R7      pV'       d   VP                  V	4       Vx  VP                  4        Ku  K  V! V
4       K  	  V'       d   V! WbW4R7      x  R# R# 5i)a  Split segments in to lines, and crop lines greater than a given length.

Args:
    segments (Iterable[Segment]): An iterable of segments, probably
        generated from console.render.
    length (int): Desired line length.
    style (Style, optional): Style to use for any padding.
    pad (bool): Enable padding of lines that are less than `length`.

Returns:
    Iterable[List[Segment]]: An iterable of lines of segments.
rL   )r5   r`   N)rY   adjust_line_lengthr0   r2   rZ   clear)rE   rN   r_   r5   r`   ra   rM   rY   rb   Znew_line_segmentr=   r0   segment_styler[   r\   r]   Zcropped_lines   &&&&&&           r#   split_and_crop_linesZSegment.split_and_crop_lines  s     * ! 33t9Gw||#GOOO)0&Q,0NN4,@)ETs589x'9 ( -(//0@A**

  w!  " $THH s   A
C-C-/C-AC-C-c                sd   < V ^8  d   QhRS[ R,          RS[RS[S[,          RS[RS[ R,          /# )r'   rM   r$   r_   r5   r`   r(   r   r)   r
   r   r:   r*   r,   r#   r-   r.   F  sI     * *9o* * 	*
 * 
i*r"   c                s   \        R V 4       4      pWR8  d4   V'       d    W! RW%,
          ,          V4      .,           pV# VR,          p V# WR8  d   . pVP                  p^ pV Ff  pVP                  p	WY,           V8  g   VP                  '       d   V! V4       WY,          pK@  Vw  rp\	        WV,
          4      p
V! V ! W4      4        V# 	   V# VR,          pV# )a  Adjust a line to a given width (cropping or padding as required).

Args:
    segments (Iterable[Segment]): A list of segments in a single line.
    length (int): The desired width of the line.
    style (Style, optional): The style of padding if used (space on the end). Defaults to None.
    pad (bool, optional): Pad lines with spaces if they are shorter than `length`. Defaults to True.

Returns:
    List[Segment]: A line of segments with the desired length.
c              3   s8   "   T F  qP                   x  K  	  R # 5ir4   )r3   )rP   r=   s   & r#   rS   Z-Segment.adjust_line_length.<locals>.<genexpr>X  s     BT'--Ts   rB   NNN)sumrY   r3   r2   r   )rE   rM   r_   r5   r`   Zline_lengthr]   rY   r=   Zsegment_lengthr0   rd   r[   s   &&&&&        r#   rb   ZSegment.adjust_line_lengthE  s    & BTBB 3sf.B'CU#K"LL& #  7" ! !H__FK!(!4!4/&8GOOO7O1K-4*D(/CDD3t34     AwHr"   c                s4   < V ^8  d   QhRS[ R,          RS[/# )r'   rM   r$   r(   )r   r)   r*   r,   r#   r-   r.   s  s#     
T 
T4	? 
Ts 
Tr"   c                s:   a \         o\        V3R lV 4       4      # )zGet the length of list of segments.

Args:
    line (List[Segment]): A line encoded as a list of Segments (assumes no '\\n' characters),

Returns:
    int: The length of the line.
c              3   sL   <"   T F  w  rq3'       d   K  S! V4      x  K  	  R # 5ir4   r   )rP   r0   r5   r2   	_cell_lens   &   r#   rS   Z*Segment.get_line_length.<locals>.<genexpr>}  s      St';tG7?9T??ts   $$)r   rh   )rE   rM   ri   s   &&@r#   get_line_lengthZSegment.get_line_lengthr  s     	StSSSr"   c                sZ   < V ^8  d   QhRS[ S[ R,          ,          RS[S[S[3,          /# )r'   linesr$   r(   )r   r   r)   r*   r,   r#   r-   r.     s,     ' 'd4	?3 'c3h 'r"   c                st   a V P                   oV'       d   \        V3R lV 4       4      M^ pV\        V4      3# )zGet the shape (enclosing rectangle) of a list of lines.

Args:
    lines (List[List[Segment]]): A list of lines (no '\\n' characters).

Returns:
    Tuple[int, int]: Width and height in characters.
c              3   s4   <"   T F  pS! V4      x  K  	  R # 5ir4   r   )rP   rM   rj   s   & r#   rS   Z$Segment.get_shape.<locals>.<genexpr>  s     @%$--%s   )rj   ZmaxrD   )rE   rk   Z	max_widthrj   s   && @r#   	get_shapeZSegment.get_shape  s3     --DIC@%@@q	3u:&&r"   c                s   < V ^8  d   QhRS[ S[ R,          ,          RS[RS[S[,          RS[S[,          RS[RS[ S[ R,          ,          /# )r'   rk   r$   widthheightr5   	new_linesr(   rf   r*   r,   r#   r-   r.     sa     ! !DO$! ! 	!
 ! ! 
d9o	!r"   c           	     sh   T;'       g    \        V4      pV'       d   V ! RV,          R,           V4      .MV ! RV,          V4      .pV P                  pVRV p	V U
u. uF  q! WVR7      NK  	  up
V	R&   \        V	4      V8  d*   V	P                  V.V\        V	4      ,
          ,          4       V	# u up
i )a  Set the shape of a list of lines (enclosing rectangle).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style, optional): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        rB   rL   N)r5   rg   )rD   rb   Zextend)rE   rk   rm   rn   r5   ro   Z_heightblankrb   Zshaped_linesrM   s   &&&&&&     r#   	set_shapeZSegment.set_shape  s    * &&CJ 1:Sut#U+,C%KQV@W?X 	 !33XgEJ
EJTt%8U
Q |w&7S5F+F GH
s   B/c                   < V ^8  d   QhRS[ R,          RS[S[R,          ,          RS[RS[RS[RS[RS[S[R,          ,          /# 	r'   rE   r$   rk   rm   rn   r5   ro   r(   r   r   r)   r   r:   r*   r,   r#   r-   r.     e      )_DO$  	
   
d9o	r"   c                s    V\        V4      ,
          pV'       g
   VR,          # VRV pV'       d   V ! RV,          R,           V4      MV ! RV,          V4      pW..V,          ,           pV# )a  Aligns lines to top (adds extra lines to bottom as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        rg   NrB   rL   rD   rE   rk   rm   rn   r5   ro   extra_linesrp      &&&&&&  r#   	align_topZSegment.align_top  sd    * s5z)8Ogv2;C%K$&.S5[RWAX	K//r"   c                rr   rs   rt   r*   r,   r#   r-   r.     ru   r"   c                s    V\        V4      ,
          pV'       g
   VR,          # VRV pV'       d   V ! RV,          R,           V4      MV ! RV,          V4      pV..V,          V,           pV# )a  Aligns render to bottom (adds extra lines above as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added. Defaults to None.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        rg   NrB   rL   rv   rw   ry   r#   align_bottomZSegment.align_bottom  sf    * s5z)8Ogv2;C%K$&.S5[RWAX	K'%/r"   c                rr   rs   rt   r*   r,   r#   r-   r.     se      )_DO$  	
   
d9o	r"   c                s   V\        V4      ,
          pV'       g
   VR,          # VRV pV'       d   V ! RV,          R,           V4      MV ! RV,          V4      pV^,          pWh,
          p	V..V,          V,           V..V	,          ,           pV# )a  Aligns lines to middle (adds extra lines to above and below as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        rg   NrB   rL   rv   )
rE   rk   rm   rn   r5   ro   rx   rp   Z	top_linesZbottom_liness
   &&&&&&    r#   align_middleZSegment.align_middle  s    * s5z)8Ogv2;C%K$&.S5[RWAX1$	".	I%-%	L0HHr"   c                B   < V ^8  d   QhRS[ R,          RS[ R,          /# rX   r   r*   r,   r#   r-   r.     s%       3 8K r"   c              #  sL  "   \        V4      p \        V4      p\        pT Ff  pTP                  TP                  8X  dC   TP
                  '       g1   T! TP                  TP                  ,           TP                  4      pK`  Tx  TpKh  	  Tx  R#   \         d     R# i ; i5i)a  Simplify an iterable of segments by combining contiguous segments with the same style.

Args:
    segments (Iterable[Segment]): An iterable of segments.

Returns:
    Iterable[Segment]: A possibly smaller iterable of segments that will render the same way.
N)iternextZStopIterationr$   r5   r2   r0   )rE   rN   Ziter_segmentsZlast_segmentrF   r=      &&    r#   simplifyZSegment.simplify
  s      X	.L $G!!W]]27???' %%4l6H6H  #"& %   		s.   B$B 7B$A B$B!B$ B!!B$c                r}   rX   r~   r*   r,   r#   r-   r.   &  s)     L L8I#6 L8I;N Lr"   c              #  s   "   V FQ  pVP                   '       g   VP                  f   Vx  K)  Vw  r4pT ! Y4'       d   VP                  R4      MR4      x  KS  	  R# 5i)zRemove all links from an iterable of styles.

Args:
    segments (Iterable[Segment]): An iterable segments.

Yields:
    Segment: Segments with link removed.
N)r2   r5   Zupdate_link)rE   rN   r=   r0   r5   Z_controlr   r#   strip_linksZSegment.strip_links%  sN       G'--"7(/%X$5 1 1$ 7dKK  s   AAc                r}   rX   r~   r*   r,   r#   r-   r.   7  s%     
+ 
+HY$7 
+HY<O 
+r"   c              #  s>   "   V F  w  r#pV ! VRV4      x  K  	  R# 5i)zRemove all styles from an iterable of segments.

Args:
    segments (Iterable[Segment]): An iterable segments.

Yields:
    Segment: Segments with styles replace with None
Nr   )rE   rN   r0   r1   r2   rJ   r#   strip_stylesZSegment.strip_styles6  s%      &.!D'dD'** &.s   c                r}   rX   r~   r*   r,   r#   r-   r.   D  s%     / /HY$7 /HY<O /r"   c              #  s   "   / pV FL  w  r4pV'       d3   VP                  V4      pVf   VP                  pWbV&   V ! W6V4      x  K@  V ! VRV4      x  KN  	  R# 5i)zRemove all color from an iterable of segments.

Args:
    segments (Iterable[Segment]): An iterable segments.

Yields:
    Segment: Segments with colorless style.
N)ZgetZwithout_color)rE   rN   Zcacher0   r5   r2   Zcolorless_styles   &&     r#   remove_colorZSegment.remove_colorC  s`      %'$, D"'))E"2"*&+&9&9O#2%L$99$g.. %-s   AAc                sh   < V ^8  d   QhRS[ R,          RS[ S[,          RS[ S[R,          ,          /# )r'   rN   r$   cutsr(   )r   r)   r   r*   r,   r#   r-   r.   Z  s<     B B	*B2:3-B	$y/	"Br"   c              #  s  "   . pVP                   p\        V4      p \        VR4      pVR8X  d   R# V^ 8w  d   M. x  K$  ^ pVP                  pVP                  p	\
        p
V F  pVw  rpV'       g   K  V'       d   TMWz! V4      ,           pW8  d   V! V4       TpK<  W8X  dD   V! V4       V	! 4       x  V! 4        Tp\        VR4      pVR8X  d   V'       d
   V	! 4       x   R# K  VP                  Wg,
          4      w  ppVw  rpV! V4       V	! 4       x  V! 4        Tp\        VR4      pVR8X  g   K  V'       d
   V	! 4       x   R# 	  V	! 4       x  R# 5i)zDivides an iterable of segments in to portions.

Args:
    cuts (Iterable[int]): Cell positions where to divide.

Yields:
    [Iterable[List[Segment]]]: An iterable of Segments in List.
NrC   )rY   r   r   rc   Zcopyr   rK   )rE   rN   r   Zsplit_segmentsZadd_segmentZ	iter_cutsr>   rG   Zsegments_clearZsegments_copyri   r=   r0   r1   r2   Zend_posrH   s   &&&              r#   divideZSegment.divideY  sV     +-$++J	y"%CbyaxH'--&++#	G$+!D'$!(#cIdO.C=(!C>('/)"$!Cy"-Cby)"//1 '.&9&9#)&DOFG,3)D'''/)"$C9b)"9%+o-G  J os&   A-E4E<AEAE5E=Ec                sn   < V ^8  d   Qh/ S[ ;R&   S[S[,          ;R&   S[S[S[,          ,          ;R&   # )r'   r0   r5   r2   )strr
   r   r   ControlCoder*   r,   r#   r-   r.   ?   s9      I  E?!   h{+,3! r"   r   i @  )NNF)NTT)NT)NNF)$r   r   r   r   r    r5   r2   Zpropertyr3   r8   r;   r<   Zclassmethodr   rI   rK   rM   rU   rW   r^   re   rb   rj   rl   rq   rz   r{   r|   r   r   r   r   r   Z__annotate_func__r!   __classdictcell__r+      @r#   r$   r$   ?   s    
 "E/3G0 0   ( ( y-  -^, ,4   & & &P @ @ @$  8 ,I ,I ,I\ * * *X 
T 
T ' ' ! ! !F   8   8   <  4 L L  
+ 
+ / /* B Bw  r"   r$   c                   sL   a  ] tR tRt o RtR	V 3R lR lltV 3R lR ltRtV tR# )
Segmentsi  a)  A simple renderable to render an iterable of segments. This class may be useful if
you want to print segments outside of a __rich_console__ method.

Args:
    segments (Iterable[Segment]): An iterable of segments.
    new_lines (bool, optional): Add new lines between segments. Defaults to False.
c                s:   < V ^8  d   QhRS[ S[,          RS[RR/# )r'   rN   ro   r(   N)r   r$   r:   r*   r,   r#   r-   Segments.__annotate__  s(     # #'!2 #t #PT #r"   c                s2    \        V4      V n        W n        R # r4   )listrN   ro   )r/   rN   ro   rV   r#   __init__ZSegments.__init__  s    X"r"   c                &   < V ^8  d   QhRRRRRR/# r'   consoler   optionsr   r(   r   r   r*   r,   r#   r-   r     s%     	% 	% 	%+;	%		%r"   c              #  s   "   V P                   '       d2   \        P                  4       pV P                   F  pVx  Vx  K  	  R # V P                   R j  xL
  R #  L5ir4   )ro   r$   rM   rN   )r/   r   r   rM   r=      &&&  r#   __rich_console__ZSegments.__rich_console__  sB      >>><<>D==
 ) }}$$s   AAAA)ro   rN   Nr   )	r   r   r   r   r    r   r   r!   r   r   r   r#   r   r     s     # #	% 	%r"   r   c                   sH   a  ] tR tRt o RV 3R lR lltV 3R lR ltRtV tR# )	SegmentLinesi  c                sJ   < V ^8  d   QhRS[ S[S[,          ,          RS[RR/# )r'   rk   ro   r(   N)r   r   r$   r:   r*   r,   r#   r-   SegmentLines.__annotate__  s,     	# 	#htG}5 	#$ 	#SW 	#r"   c                s2    \        V4      V n        W n        R# )a  A simple renderable containing a number of lines of segments. May be used as an intermediate
in rendering process.

Args:
    lines (Iterable[List[Segment]]): Lists of segments forming lines.
    new_lines (bool, optional): Insert new lines after each line. Defaults to False.
N)r   rk   ro   )r/   rk   ro   rV   r#   r   ZSegmentLines.__init__  s     %[
"r"   c                r   r   r   r*   r,   r#   r-   r     s%     
  
  
 +;
 	
 r"   c              #  s   "   V P                   '       d8   \        P                  4       pV P                   F  pT R j  xL
  Vx  K  	  R # V P                   F  pT R j  xL
  K  	  R #  L- L5ir4   )ro   r$   rM   rk   )r/   r   r   r]   rM   r   r#   r   ZSegmentLines.__rich_console__  sV      >>>||~H

 # 

 #    s!   ;A/A+"A/ A-!A/-A/)rk   ro   Nr   )r   r   r   r   r   r   r!   r   r   r   r#   r   r     s     	# 	#
  
 r"   r   Z__main__)r   )Syntax)Textzfrom rich.console import Console
console = Console()
text = Text.from_markup("Hello, [bold magenta]World[/]!")
console.print(text)zHello, [bold magenta]World[/]!zrich.Segmentz]A Segment is the last step in the Rich render process before generating text with ANSI codes.z
Consider the following code:
ZpythonT)Zline_numberszRWhen you call [b]print()[/b], Rich [i]renders[/i] the object in to the following:
zAThe Segments are then processed to produce the following output:
zS
You will only need to know this if you are implementing your own Rich renderables.N):Zenumr    Z	functoolsr   Z	itertoolsr   Zloggingr   Zoperatorr   Ztypingr   r   r   r   r	   r
   r   r   r   r   Zcellsr   r   r   r   r   Zreprr   r   r5   r   r   r   r   r   Zlogr   r)   r   r   r$   r   r   r   Zpip._vendor.rich.consoleZpip._vendor.rich.syntaxr   Zpip._vendor.rich.textr   ZcodeZfrom_markupr0   ZruleZprintr   ZrenderZ	fragmentsr   r"   r#   <module>r      s     !      $ >>' * 	+	+uS#X
&'	+sC
 " \	j \	 \	~% %2   2 z0.*D
 <=DiGLL MMg MM45MM&xd;<MMOMM] W^^D)*IMM)MMOMMVWMM$MM^; r"   