
    q"hL                    r   S SK Jr  S SKrS SKJr  SSKJr  SSKJrJ	r	  \R                  " S5      rSS jrSSS	 jjr\S
:X  au  SSKJr  \" SS9r\R#                  S5        \" \	" SS5      5        \" SS9r\R%                  5         \R#                  S5        \R%                  5         \R#                  S5        gg)    )annotationsN)Iterable   )	loop_last)cell_len
chop_cellsz	\s*\S+\s*c              #     #    Sn[         R                  X5      nUbD  UR                  5       u  p4UR                  S5      nX4U4v   [         R                  X5      nUb  MC  gg7f)zYields each word from the text as a tuple
containing (start_index, end_index, word). A "word" in this context may
include the actual word and any whitespace to the right.
r   N)re_wordmatchspangroup)textposition
word_matchstartendwords         H/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/rich/_wrap.pywordsr      s_     
 Ht.J

 __&
"$]]4-
	 
 s   AA" A"c                   / nUR                   nSn[        n[        U 5       H  u  pxn	U" U	R                  5       5      n
X-
  nX:  nU(       a  XV" U	5      -  nM7  X:  am  U(       aM  [	        XS9n[        U5       H3  u  pU(       a  U" U5        U(       a
  U" U5      nM%  U[        U5      -  nM5     M  U(       a  U" U5        U" U	5      nM  U(       d  M  U(       d  M  U" U5        U" U	5      nM     U$ )ax  Given a string of text, and a width (measured in cells), return a list
of cell offsets which the string should be split at in order for it to fit
within the given width.

Args:
    text: The text to examine.
    width: The available cell width.
    fold: If True, words longer than `width` will be folded onto a new line.

Returns:
    A list of indices to break the line at.
r   width)appendr   r   rstripr   r   len)r   r   foldbreak_positionsr   cell_offset	_cell_lenr   _endr   word_lengthremaining_spaceword_fits_remaining_spacefolded_wordlastlines                   r   divide_liner'      s     "$O##FKI"4[T.-$3$B!$9T?*K " ",T"?K&/&<
 "5M*3D/K!SY.E '= u"+D/K u'oA )D     __main__)Console
   r   z@12345 abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWXYZ 12345abcdefghijklmnopqrstuvwxyz   uR   TextualはPythonの高速アプリケーション開発フレームワークですu4   アプリケーションは1670万色を使用でき)r   strreturnzIterable[tuple[int, int, str]])T)r   r.   r   intr   boolr/   z	list[int])
__future__r   retypingr   _loopr   cellsr   r   compiler
   r   r'   __name__consoler*   printrule r(   r   <module>r=      s    " 	   '
**\
".4n z BGMMTU	*12
67BGLLNMMfgLLNMMHI r(   