+
    Ri!                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	H
t
HtHtHtHtHt ^ RIHt . R+OtR]P$                  9   t]! R	R
R7      t ! R R]],          4      t ! R R]
R,          4      t ! R R]]]3,          4      t]! 4       tR R ltR R ltR R ltR R ltR R ltR R lt R R lt!R R lt"]! R 4      t#R! R" lt$R# R$ lt%R% R& lt&]]	. ]'3,          ]'3,          t(R' R( lt)R,R) R* llt*R# )-    )annotationsN)deque)CallableContextManagerDict	GeneratorGenericTypeVarUnion)wcwidthEventDummyContextzsphinx.ext.autodoc_SenderT)	covariantc                  r    ] tR t^-tRtRR R lltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltRtR# )r   a}  
Simple event to which event handlers can be attached. For instance::

    class Cls:
        def __init__(self):
            # Define event. The first parameter is the sender.
            self.event = Event(self)

    obj = Cls()

    def handler(sender):
        pass

    # Add event handler by using the += operator.
    obj.event += handler

    # Fire event.
    obj.event()
Nc               $    V ^8  d   QhRRRRRR/# )   senderr   handlerz Callable[[_Sender], None] | NonereturnNone )formats   "S/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/prompt_toolkit/utils.py__annotate__Event.__annotate__B   s$      (H	    c                	<    Wn         . V n        Ve   W,          p R # R # N)r   	_handlers)selfr   r   s   &&&r   __init__Event.__init__B   s"     :<OD r   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   r   K   s     ! !$ !r   c                P    V P                    F  pV! V P                  4       K  	  R# )zFire event.Nr    r   r!   r   s   & r   __call__Event.__call__K   s    ~~GDKK  &r   c                   V ^8  d   QhRR/# r%   r   )r   s   "r   r   r   P   s      d r   c                    V ! 4        R# )z!Alias for just calling the event.Nr   r!   s   &r   fire
Event.fireP   s    r   c                    V ^8  d   QhRRRR/# r   r   Callable[[_Sender], None]r   r   r   )r   s   "r   r   r   T   s     ' '#< ' 'r   c                <    V P                   P                  V4       R# )z{
Add another handler to this callback.
(Handler should be a callable that takes exactly one parameter: the
sender object.)
N)r    appendr(   s   &&r   add_handlerEvent.add_handlerT   s     	g&r   c                    V ^8  d   QhRRRR/# r1   r   )r   s   "r   r   r   ]   s     + +&? +D +r   c                `    WP                   9   d   V P                   P                  V4       R# R# )z&
Remove a handler from this callback.
N)r    remover(   s   &&r   remove_handlerEvent.remove_handler]   s%     nn$NN!!'* %r   c                    V ^8  d   QhRRRR/# r   r   r2   r   zEvent[_Sender]r   )r   s   "r   r   r   d          9 n r   c                (    V P                  V4       V # )z3
`event += handler` notation for adding a handler.
)r5   r(   s   &&r   __iadd__Event.__iadd__d   s     	!r   c                    V ^8  d   QhRRRR/# r=   r   )r   s   "r   r   r   k   r>   r   c                (    V P                  V4       V # )z5
`event -= handler` notation for removing a handler.
)r:   r(   s   &&r   __isub__Event.__isub__k   s     	G$r   r'   r   )__name__
__module____qualname____firstlineno____doc__r"   r)   r.   r5   r:   r@   rD   __static_attributes__r   r   r   r   r   -   s/    (!
'+ r   c                  2    ] tR t^stRtR R ltR R ltRtR# )r   z-
(contextlib.nested is not available on Py3)
c                   V ^8  d   QhRR/# r%   r   )r   s   "r   r   DummyContext.__annotate__x   s      4 r   c                	    R # r   r   r-   s   &r   	__enter__DummyContext.__enter__x       r   c                    V ^8  d   QhRRRR/# )r   aobjectr   r   r   )r   s   "r   r   rN   {   s      6 d r   c                	    R # r   r   )r!   rT   s   &*r   __exit__DummyContext.__exit__{   rR   r   r   N)rF   rG   rH   rI   rJ   rP   rW   rK   r   r   r   r   r   s   s     r   c                  F   a  ] tR t^tRt^@t^tR V 3R lltR R ltRt	V ;t
# )_CharSizesCachez
Cache for wcwidth sizes.
c                   V ^8  d   QhRR/# r%   r   )r   s   "r   r   _CharSizesCache.__annotate__   s     1 1$ 1r   c                	B   < \         SV `  4        \        4       V n        R # r   )superr"   r   _long_strings)r!   	__class__s   &r   r"   _CharSizesCache.__init__   s    ).r   c                    V ^8  d   QhRRRR/# r   stringstrr   intr   )r   s   "r   r   r\      s      # # r   c                	^  a  \        V4      ^8X  d   \        ^ \        V4      4      pM\        V 3R lV 4       4      pVS V&   \        V4      S P                  8  dR   S P
                  pVP                  V4       \        V4      S P                  8  d   VP                  4       pVS 9   d   S V V# )   c              3  6   <"   T F  pSV,          x  K  	  R # 5ir   r   ).0cr!   s   & r   	<genexpr>._CharSizesCache.__missing__.<locals>.<genexpr>   s     1&Qa&s   )	lenmaxr   sumLONG_STRING_MIN_LENr_   r4   MAX_LONG_STRINGSpopleft)r!   rd   resultlong_stringskey_to_removes   f&   r   __missing___CharSizesCache.__missing__   s     v;!GFO,F1&11F V v;111--L'< 4#8#88 , 4 4 6 D(]+r   )r_   )rF   rG   rH   rI   rJ   rq   rr   r"   rw   rK   __classcell__)r`   s   @r   rZ   rZ      s*     1 1
 r   rZ   c                    V ^8  d   QhRRRR/# rc   r   )r   s   "r   r   r      s     % %s %s %r   c                    \         V ,          # )z7
Return width of a string. Wrapper around ``wcwidth``.
)_CHAR_SIZES_CACHE)rd   s   &r   
get_cwidthr}      s     V$$r   c                   V ^8  d   QhRR/# r   r   boolr   )r   s   "r   r   r      s     & & &r   c                 "    \        \        R4      # )z}
Returns `True` when the Python implementation supports
suspend-to-background. This is typically `False' on Windows systems.
SIGTSTP)hasattrsignalr   r   r   suspend_to_background_supportedr      s    
 69%%r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     # #D #r   c                 (    \         P                  R8H  # )z!
True when we are using Windows.
win32)sysplatformr   r   r   
is_windowsr      s     <<7""r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     
 
D 
r   c                 J    \         P                  R8X  d   ^ RIHp  V ! 4       # R# )zK
True when we are using Windows, but VT100 escape sequences are supported.
r   is_win_vt100_enabledF)r   r   prompt_toolkit.output.windows10r   r   s    r   is_windows_vt100_supportedr      s     ||wH#%%r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     S S Sr   c                 ~    \         P                  R8H  ;'       d$    \        P                  P	                  RR4      R8H  # )z/
True when the ConEmu Windows console is used.
r   
ConEmuANSIOFFON)r   r   osenvirongetr   r   r   is_conemu_ansir      s/     <<7"RRrzz~~lE'Jd'RRr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     J J Jr   c                 Z    \         P                  ! 4       P                  P                  R8H  # )z2
True when the current thread is the main thread.
_MainThread)	threadingcurrent_threadr`   rF   r   r   r   in_main_threadr      s$     ##%//88MIIr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     * *t *r   c                 h    \         P                  P                  RR4      p V P                  4       R9   # )z<
True if env variable is set to true (true, TRUE, True, 1).
PROMPT_TOOLKIT_BELLtrue)1r   )r   r   r   lowervalues    r   get_bell_environment_variabler      s*     JJNN0&9E;;=M))r   c                   V ^8  d   QhRR/# )r   r   re   r   )r   s   "r   r   r      s     & &s &r   c                 B    \         P                  P                  RR4      # )z&Return the $TERM environment variable.TERM )r   r   r   r   r   r   get_term_environment_variabler      s    ::>>&"%%r   _Tc               $    V ^8  d   QhRRRRRR/# )r   itemszlist[_T]weightsz	list[int]r   zGenerator[_T, None, None]r   )r   s   "r   r   r      s$     3 33'33r   c              #  d  "   \        V 4      \        V4      8X  g   Q h\        V 4      ^ 8  g   Q h. p. p\        W4       F0  w  rEV^ 8  g   K  VP                  V4       VP                  V4       K2  	  Tp TpV '       g   \        R4      hV  Uu. uF  p^ NK  	  pp\        V 4      p\	        V4      p	^ p Rp
V
'       dc   Rp
\        \        V4      W4       FE  w  rpW{,          Wl,          \        V	4      ,          8  g   K+  Vx  W{;;,          ^,          uu&   Rp
KG  	  Kj  V^,          pKx  u upi 5i)a  
Generator that keeps yielding items from the items list, in proportion to
their weight. For instance::

    # Getting the first 70 items from this generator should have yielded 10
    # times A, 20 times B and 40 times C, all distributed equally..
    take_using_weights(['A', 'B', 'C'], [5, 10, 20])

:param items: List of items to take from.
:param weights: Integers representing the weight. (Numbers have to be
                integers, not floats.)
z+Did't got any items with a positive weight.TF)rn   zipr4   
ValueErrorro   rangefloat)r   r   items2weights2itemwialready_taken
item_count
max_weightaddingitem_iweights   &&           r   take_using_weightsr      s     u:W%%%u:>> FHu&q5MM$OOA '
 EG FGG !&&1QM&UJWJ	A
F(+E*,=u(N$f (1:j8I+IIJ!)Q.)!F	 )O 	
Q# 's*   AD01D0?D0D+$D0>=D0 0D0c                    V ^8  d   QhRRRR/# )r   r   zCallable[[], str] | strr   re   r   )r   s   "r   r   r   "        ) c r   c                Z    \        V 4      '       d   \        V ! 4       4      # \        V 4      # )z$Turn callable or string into string.)callableto_strre   r   s   &r   r   r   "  !    eg5zr   c                    V ^8  d   QhRRRR/# )r   r   zCallable[[], int] | intr   rf   r   )r   s   "r   r   r   *  r   r   c                Z    \        V 4      '       d   \        V ! 4       4      # \        V 4      # )zTurn callable or int into int.)r   to_intrf   r   s   &r   r   r   *  r   r   c                    V ^8  d   QhRRRR/# )r   r   AnyFloatr   r   r   )r   s   "r   r   r   5  s      H  r   c                Z    \        V 4      '       d   \        V ! 4       4      # \        V 4      # )z"Turn callable or float into float.)r   to_floatr   r   s   &r   r   r   5  s"      U|r   c                    V ^8  d   QhRRRR/# )r   termz
str | Noner   r   r   )r   s   "r   r   r   =  s     
/ 
/: 
/ 
/r   c                    V f*   \        \        P                  P                  RR4      4      # V P	                  4       R9   # )z
True if this terminal type is considered "dumb".

If so, we should fall back to the simplest possible form of line editing,
without cursor positioning and color support.
r   r   )dumbunknown)is_dumb_terminalr   r   r   r   )r   s   &r   r   r   =  s5     |

vr :;;::<...r   )r   r   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   )+
__future__r   r   r   r   r   collectionsr   typingr   r   r   r   r	   r
   r   r   __all__modulesSPHINX_AUTODOC_RUNNINGr   r   r   re   rf   rZ   r|   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s   " 	  
     ( .< 
)t
,CGG CL	>$' 	&d38n &R $% %&#
SJ*&
 T]3l "e)$e+,
/ 
/r   