+
    ~jd                        ^ 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
 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I-H.t. Rt/].P`                  ! R4      t1]! 4       t]Pe                  R4       ]Pg                  R4       ]Pg                  R4       ]Pg                  ],! ]/RRR7      4       ]Pg                  4        ]Pg                  R4       ]4! ]Pk                  ]14      4      t6]Pg                  ]64       ]Pg                  4        ]Pg                  R4       ]Pg                  ]14       ]Pg                  R 4       R!# R!# )"    )IntEnum)	lru_cache)filterfalse)
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RenderResultc                   Z    ] 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__BELLCARRIAGE_RETURNHOMECLEARSHOW_CURSORHIDE_CURSORENABLE_ALT_SCREENDISABLE_ALT_SCREEN	CURSOR_UPCURSOR_DOWNCURSOR_FORWARDCURSOR_BACKWARDCURSOR_MOVE_TO_COLUMNCURSOR_MOVE_TOERASE_IN_LINESET_WINDOW_TITLE__static_attributes__r       a/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/rich/segment.pyr   r       sY    NDODEKKIKNONMr5   r   c                     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]]! R54      V 3R lR l4       4       tV 3R lR l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]R9V 3R lR ll4       t]V 3R lR l4       t]V 3R lR  l4       t]R:V 3R! lR" ll4       t]R7V 3R# lR$ ll4       t]R7V 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]V 3R- lR. l4       t]V 3R/ lR0 l4       t ]V 3R1 lR2 l4       t!V 3R3 lt"R4t#V t$R# );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)format__classdict__s   "r6   __annotate__Segment.__annotate__O   s     0 0S 0r5   c                6    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   &   r6   cell_lengthSegment.cell_lengthN   s     !%gq/$/r5   c                    < V ^8  d   QhRS[ /# r:   )r   )r>   r?   s   "r6   r@   rA   X   s      v r5   c              #     "   V P                   x  V P                  f!   V P                  e   V P                  x  R # R # V P                  x  V P                  x  R # 5iN)rD   rF   stylerC   s   &r6   __rich_repr__Segment.__rich_repr__X   sG     ii<<zz%jj  & **,,s   AAc                    < V ^8  d   QhRS[ /# r:   bool)r>   r?   s   "r6   r@   rA   a   s      $ r5   c                ,    \        V P                  4      # )z#Check if the segment contains text.)rR   rD   rM   s   &r6   __bool__Segment.__bool__a   s    DIIr5   c                    < V ^8  d   QhRS[ /# r:   rQ   )r>   r?   s   "r6   r@   rA   f   s     ( (D (r5   c                    V P                   RJ# )z,Check if the segment contains control codes.N)rF   rM   s   &r6   
is_controlSegment.is_controle   s     ||4''r5   c                8   < V ^8  d   QhRRRS[ RS[R,          /# )r;   segmentr8   cutr<   r8   r8   r=   r   )r>   r?   s   "r6   r@   rA   l   s(     - -9 -3 -5AU;V -r5   c                f   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 )r8   rG   r   r=   lenr   )clsr[   r\   rD   rL   rF   _SegmentrG   	cell_sizeposbeforecell_posout_bys   &&&          r6   _split_cellsSegment._split_cellsj   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r5   c                4   < V ^8  d   QhRS[ RS[R,          /# )r;   r\   r<   r]   r^   )r>   r?   s   "r6   r@   rA      s!     , ,s ,u-A'B ,r5   c                    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.
r`   N)r   rc   r8   rk   )rC   r\   rD   rL   rF   s   &&   r6   split_cellsSegment.split_cells   s}      $Waxx!$''c$iWR888Tc
E3T
E3 
   ++r5   c                   < V ^8  d   QhRR/# )r;   r<   r8   r   )r>   r?   s   "r6   r@   rA      s      Y r5   c                    V ! R4      # )zMake a new line segment.
r   )rd   s   &r6   lineSegment.line   s     4yr5   c          	      n   < V ^8  d   QhRS[ R,          RS[S[,          RS[S[,          RS[ R,          /# )r;   segmentsr8   rL   
post_styler<   )r	   r   r   )r>   r?   s   "r6   r@   rA      sE     & &9%& & UO	&
 
)	&r5   c                |   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   \   <"   T F!  w  rpS! Y'       d   R MS! V4      V4      x  K#  	  R # 5irK   r   ).0rD   rE   rF   applyrd   s   &   r6   	<genexpr>&Segment.apply_style.<locals>.<genexpr>   s1      -<)D' D'$uV}gFF-<s   ),c              3   t   <"   T F-  w  rpS! TV'       d   R MV'       d
   VS,           MSV4      x  K/  	  R # 5irK   r   )r{   rD   rE   rF   rd   rx   s   &   r6   r}   r~      sG       .=)D'  # 5;fz1  .=s   88)__add__)rd   rw   rL   rx   result_segmentsr|   s   f&&f @r6   apply_styleSegment.apply_style   sC    & #MME-<O  .=O r5   c                H   < V ^8  d   QhRS[ R,          RS[RS[ R,          /# )r;   rw   r8   rX   r<   )r	   rR   )r>   r?   s   "r6   r@   rA      s4     @ @	*@8<@	)	@r5   c                f    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.

rF   )filterr   r   )rd   rw   rX   s   &&&r6   filter_controlSegment.filter_control   s+     *Y/::z)4h??r5   c                R   < V ^8  d   QhRS[ R,          RS[ S[R,          ,          /# r;   rw   r8   r<   )r	   r
   )r>   r?   s   "r6   r@   rA      s)      8I#6 8DO;T r5   c              #  \  "   . 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.
rs   NappendrD   rF   	partition
rd   rw   rt   r   r[   rD   rL   __textnew_lines
   &&        r6   split_linesSegment.split_lines   s      !Gw||#GOOO!(Q,0NN4,@)ETs501x"
!!%  w   J s   6B,B,/B,:)B,$B,c                h   < V ^8  d   QhRS[ R,          RS[ S[S[R,          S[3,          ,          /# r   )r	   r   r
   rR   )r>   r?   s   "r6   r@   rA     s5        	* 	%Y-.	/ r5   c              #  d  "   . pVP                   pV F  pRVP                  9   dl   VP                  '       gZ   Vw  rVpV'       dK   VP                  R4      w  rpV'       d   V! V ! W4      4       V	'       g   K<  VR3x  . pVP                   pKR  K  V! V4       K  	  V'       d	   VR3x  R# R# 5i)a
  Split a sequence of segments in to a list of lines and a boolean to indicate if there was a new line.

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

Yields:
    Iterable[List[Segment]]: Iterable of segment lists, one per line.
rs   TFNr   r   s
   &&        r6   split_lines_terminatorSegment.split_lines_terminator  s      !Gw||#GOOO!(Q,0NN4,@)ETs501x#Tl*!!%  w   - s   6B0B0/B0:+B0&
B0c                z   < V ^8  d   QhRS[ R,          RS[RS[S[,          RS[RS[RS[ S[R,          ,          /# )r;   rw   r8   lengthrL   padinclude_new_linesr<   )r	   r=   r   r   rR   r
   )r>   r?   s   "r6   r@   rA   3  sa     ,I ,I9%,I ,I 	,I
 ,I  ,I 
$y/	",Ir5   c              #    "   . 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.
rs   )rL   r   N)r   adjust_line_lengthrD   rF   r   clear)rd   rw   r   rL   r   r   rt   r   r   new_line_segmentr[   rD   segment_styler   r   r   cropped_lines   &&&&&&           r6   split_and_crop_linesSegment.split_and_crop_lines2  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                d   < V ^8  d   QhRS[ R,          RS[RS[S[,          RS[RS[ R,          /# )r;   rt   r8   r   rL   r   r<   r
   r=   r   r   rR   )r>   r?   s   "r6   r@   rA   b  sI     * *9o* * 	*
 * 
i*r5   c                   \        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   8   "   T F  qP                   x  K  	  R # 5irK   )rG   )r{   r[   s   & r6   r}   -Segment.adjust_line_length.<locals>.<genexpr>t  s     BT'--Ts   ra   NNN)sumr   rG   rF   r   )rd   rt   r   rL   r   line_lengthr   r   r[   segment_lengthrD   r   r   s   &&&&&        r6   r   Segment.adjust_line_lengtha  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r5   c                4   < V ^8  d   QhRS[ R,          RS[/# )r;   rt   r8   r<   )r
   r=   )r>   r?   s   "r6   r@   rA     s#     
T 
T4	? 
Ts 
Tr5   c                :   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   L   <"   T F  w  rq3'       d   K  S! V4      x  K  	  R # 5irK   r   )r{   rD   rL   rF   	_cell_lens   &   r6   r}   *Segment.get_line_length.<locals>.<genexpr>  s      St';tG7?9T??ts   $$)r   r   )rd   rt   r   s   &&@r6   get_line_lengthSegment.get_line_length  s     	StSSSr5   c                Z   < V ^8  d   QhRS[ S[ R,          ,          RS[S[S[3,          /# )r;   linesr8   r<   )r
   r   r=   )r>   r?   s   "r6   r@   rA     s,     ' 'd4	?3 'c3h 'r5   c                t   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   4   <"   T F  pS! V4      x  K  	  R # 5irK   r   )r{   rt   r   s   & r6   r}   $Segment.get_shape.<locals>.<genexpr>  s     @%$--%s   )r   maxrc   )rd   r   	max_widthr   s   && @r6   	get_shapeSegment.get_shape  s3     --DIC@%@@q	3u:&&r5   c                   < V ^8  d   QhRS[ S[ R,          ,          RS[RS[S[,          RS[S[,          RS[RS[ S[ R,          ,          /# )r;   r   r8   widthheightrL   	new_linesr<   r   )r>   r?   s   "r6   r@   rA     sa     ! !DO$! ! 	!
 ! ! 
d9o	!r5   c           	     h   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.
        ra   rs   N)rL   r   )rc   r   extend)rd   r   r   r   rL   r   _heightblankr   shaped_linesrt   s   &&&&&&     r6   	set_shape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;   rd   r8   r   r   r   rL   r   r<   r   r
   r=   r   rR   )r>   r?   s   "r6   r@   rA     e      )_DO$  	
   
d9o	r5   c                    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.
        r   Nra   rs   rc   rd   r   r   r   rL   r   extra_linesr   s   &&&&&&  r6   	align_topSegment.align_top  sd    * s5z)8Ogv2;C%K$&.S5[RWAX	K//r5   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   r   )r>   r?   s   "r6   r@   rA     r   r5   c                    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.
        r   Nra   rs   r   r   s   &&&&&&  r6   align_bottomSegment.align_bottom  sf    * s5z)8Ogv2;C%K$&.S5[RWAX	K'%/r5   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   r   )r>   r?   s   "r6   r@   rA     se      )_DO$  	
   
d9o	r5   c                   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.
        r   Nra   rs   r   )
rd   r   r   r   rL   r   r   r   	top_linesbottom_liness
   &&&&&&    r6   align_middleSegment.align_middle  s    * s5z)8Ogv2;C%K$&.S5[RWAX1$	".	I%-%	L0HHr5   c                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r	   )r>   r?   s   "r6   r@   rA   '  s%       3 8K r5   c              #  L  "   \        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nextStopIterationr8   rL   rF   rD   )rd   rw   iter_segmentslast_segmentre   r[   s   &&    r6   simplifySegment.simplify&  s      X	.L $G!!W]]27???' %%4l6H6H  #"& %   		s.   B$B 7B$A B$B!B$ B!!B$c                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r   )r>   r?   s   "r6   r@   rA   B  s)     L L8I#6 L8I;N Lr5   c              #     "   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)rF   rL   update_link)rd   rw   r[   rD   rL   _controls   &&    r6   strip_linksSegment.strip_linksA  sN       G'--"7(/%X$5 1 1$ 7dKK  s   AAc                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r   )r>   r?   s   "r6   r@   rA   S  s%     
+ 
+HY$7 
+HY<O 
+r5   c              #  >   "   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   )rd   rw   rD   rE   rF   s   &&   r6   strip_stylesSegment.strip_stylesR  s%      &.!D'dD'** &.s   c                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r   )r>   r?   s   "r6   r@   rA   `  s%     / /HY$7 /HY<O /r5   c              #     "   / 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)getwithout_color)rd   rw   cacherD   rL   rF   colorless_styles   &&     r6   remove_colorSegment.remove_color_  s`      %'$, D"'))E"2"*&+&9&9O#2%L$99$g.. %-s   AAc                h   < V ^8  d   QhRS[ R,          RS[ S[,          RS[ S[R,          ,          /# )r;   rw   r8   cutsr<   )r	   r=   r
   )r>   r?   s   "r6   r@   rA   v  s<     B B	*B2:3-B	$y/	"Br5   c              #    "   . 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.
Nrb   )r   r   r   r   copyr   ro   )rd   rw   r   split_segmentsadd_segment	iter_cutsr\   rg   segments_clearsegments_copyr   r[   rD   rE   rF   end_posrh   s   &&&              r6   divideSegment.divideu  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                n   < V ^8  d   Qh/ S[ ;R&   S[S[,          ;R&   S[S[S[,          ,          ;R&   # )r;   rD   rL   rF   )strr   r   r   ControlCode)r>   r?   s   "r6   r@   rA   <   s9      I  E?!   h{+,3! r5   r   i @  )NNF)NTT)NT)NNF)%r   r    r!   r"   r#   rL   rF   propertyrG   rN   rT   rX   classmethodr   rk   ro   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  __annotate_func__r4   __classdictcell__r?   s   @r6   r8   r8   <   s$    
 "E/3G0 0   ( ( y-  -^, ,4   & & &P @ @ @$  8    < ,I ,I ,I\ * * *X 
T 
T ' ' ! ! !F   8   8   <  4 L L  
+ 
+ / /* B Bu  r5   r8   c                   L   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                :   < V ^8  d   QhRS[ S[,          RS[RR/# )r;   rw   r   r<   N)r	   r8   rR   )r>   r?   s   "r6   r@   Segments.__annotate__  s(     # #'!2 #t #PT #r5   c                2    \        V4      V n        W n        R # rK   )listrw   r   )rC   rw   r   s   &&&r6   __init__Segments.__init__  s    X"r5   c                &   < V ^8  d   QhRRRRRR/# r;   consoler   optionsr   r<   r   r   )r>   r?   s   "r6   r@   r    s%     	% 	% 	%+;	%		%r5   c              #     "   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rK   )r   r8   rt   rw   )rC   r  r  rt   r[   s   &&&  r6   __rich_console__Segments.__rich_console__  sB      >>><<>D==
 ) }}$$s   AAAA)r   rw   Nr	  )	r   r    r!   r"   r#   r  r  r4   r  r  s   @r6   r  r    s     # #	% 	%r5   r  c                   H   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                J   < V ^8  d   QhRS[ S[S[,          ,          RS[RR/# )r;   r   r   r<   N)r	   r
   r8   rR   )r>   r?   s   "r6   r@   SegmentLines.__annotate__  s,     	# 	#htG}5 	#$ 	#SW 	#r5   c                2    \        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  r   r   )rC   r   r   s   &&&r6   r  SegmentLines.__init__  s     %[
"r5   c                &   < V ^8  d   QhRRRRRR/# r  r   )r>   r?   s   "r6   r@   r!    s%     
  
  
 +;
 	
 r5   c              #     "   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rK   )r   r8   rt   r   )rC   r  r  r   rt   s   &&&  r6   r  SegmentLines.__rich_console__  sV      >>>||~H

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

 #    s!   ;A/A+"A/ A-!A/-A/)r   r   Nr	  )r   r    r!   r"   r  r  r4   r  r  s   @r6   r  r    s     	# 	#
  
 r5   r  __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:
pythonT)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)7enumr   	functoolsr   	itertoolsr   operatorr   typingr   r   r	   r
   r   r   r   r   r   r   cellsr   r   r   r   r   reprr   r   rL   r   r  r   r   r   r   r=   r  r  r8   r  r  r   rich.consolerich.syntaxr(  	rich.textr)  codefrom_markuprD   ruleprintr  render	fragmentsr   r5   r6   <module>r<     s     !     $ >>' * 	+	+uS#X
&'	+sC
 " {	j {	 {	|% %2   2 z$"D
 <=DiGLL MMg MM45MM&xd;<MMOMM] W^^D)*IMM)MMOMMVWMM$MM^; r5   