
    ^hC	                        S SK Jr  S SKJrJrJrJrJrJr  S SK	J
r
  \(       a  S SKJr  S/r\" S\
S9r " S S	\\   5      rSS
 jrg)    )annotations)TYPE_CHECKINGIterableListTypeVarcastoverload)OneStyleAndTextTuple)SupportsIndexexplode_text_fragments_T)boundc                     ^  \ rS rSrSrSrSS jrSU 4S jjrSS jr\	SS j5       r
\	SS j5       r
      SU 4S	 jjr
S
rU =r$ )_ExplodedList   z
Wrapper around a list, that marks it as 'exploded'.

As soon as items are added or the list is extended, the new items are
automatically exploded as well.
Tc                (    U R                  U/5        g N)extend)selfitems     U/home/james-whalen/.local/lib/python3.13/site-packages/prompt_toolkit/layout/utils.pyappend_ExplodedList.append   s    TF    c                6   > [         TU ]  [        U5      5        g r   )superr   r   )r   lst	__class__s     r   r   _ExplodedList.extend   s    -c23r   c                    [         er   )NotImplementedError)r   indexr   s      r   insert_ExplodedList.insert!   s    !!r   c                    g r    r   r"   values      r   __setitem___ExplodedList.__setitem__&   s    DGr   c                    g r   r&   r'   s      r   r)   r*   )   s    FIr   c                   > [        U[        5      (       d  UR                  5       n[        X3S-   5      n[        U[        5      (       a  [	        SU/5      n[
        TU ]  U[        U5      5        g)zT
Ensure that when `(style_str, 'long string')` is set, the string will be
exploded.
   zList[_T]N)
isinstanceslice	__index__tupler   r   r)   r   )r   r"   r(   	int_indexr   s       r   r)   r*   ,   s\     %'')I)]3EeU##eW-EE#9%#@Ar   r&   )r   r   returnNone)r   Iterable[_T]r3   r4   )r"   r   r   r   r3   r4   )r"   r   r(   r   r3   r4   )r"   r/   r(   r5   r3   r4   )r"   zSupportsIndex | slicer(   z_T | Iterable[_T]r3   r4   )__name__
__module____qualname____firstlineno____doc__explodedr   r   r#   r	   r)   __static_attributes____classcell__)r   s   @r   r   r      sc     H4"
 G GI IB*B3DB	B Br   r   c                    [        U [        5      (       a  U $ / nU  H#  tp#nU H  nUR                  X%/UQ75        M     M%     [        U5      $ )a  
Turn a list of (style_str, text) tuples into another list where each string is
exactly one character.

It should be fine to call this function several times. Calling this on a
list that is already exploded, is a null operation.

:param fragments: List of (style, text) tuples.
)r.   r   r   )	fragmentsresultstylestringrestcs         r   r   r   <   sV     )]++F )AMM5+d+,  !*   r   N)r?   r5   r3   z_ExplodedList[_T])
__future__r   typingr   r   r   r   r   r	   "prompt_toolkit.formatted_text.baser
   typing_extensionsr   __all__r   r   r   r&   r   r   <module>rJ      sJ    " I I C/  T-.(BDH (BV!r   