+
    '(jc!                         ^ 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Ht ]t ! R R]4      t ! R R]4      t]! R]R	7      t ! R
 R4      tR# )    )OrderedDict)Lock)AnyCallableDictListMappingOptionaloverloadSetTupleTypeVarUnionc                       ] tR t^tRtRtR# )PyeeExceptionz@An exception internal to pyee. Deprecated in favor of PyeeError. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       >/home/ubuntu/cf-venv/lib/python3.14/site-packages/pyee/base.pyr   r      s    Jr   r   c                       ] tR t^tRtRtR# )	PyeeErrorzAn error internal to pyee.r   Nr   r   r   r   r   r      s    $r   r   Handler)boundc                     a  ] tR t^!t o RtV 3R lR ltV 3R lR ltV 3R lR l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t	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR*V 3R lR  lltV 3R! lR" ltV 3R# lR$ ltR*V 3R% lR& lltV 3R' lR( ltR)tV tR# )+EventEmitteraB  The base event emitter class. All other event emitters inherit from
this class.

Most events are registered with an emitter via the `on` and `once`
methods, and fired with the `emit` method. However, pyee event emitters
have two *special* events:

- `new_listener`: Fires whenever a new listener is created. Listeners for
  this event do not fire upon their own creation.

- `error`: When emitted raises an Exception by default, behavior can be
  overridden by attaching callback to the event.

  For example:

```py
@ee.on('error')
def on_error(message):
    logging.err(message)

ee.emit('error', Exception('something blew up'))
```

All callbacks are handled in a synchronous, blocking manner. As in node.js,
raised exceptions are not automatically handled for you---you must catch
your own exceptions, and treat them accordingly.
c                $   < V ^8  d   QhRS[ RR/# )   selfreturnN)Self)format__classdict__s   "r   __annotate__EventEmitter.__annotate__>   s     " "t " "r   c                B    \        4       V n        \        4       V n        R # N)dict_eventsr   _lockr$   s   &r   __init__EventEmitter.__init__>   s     F 	  6
r   c                <   < V ^8  d   QhRS[ RS[S[S[3,          /# r#   r$   r%   r&   r	   strr   )r'   r(   s   "r   r)   r*   E   s$      4 GCH$5 r   c                @    V P                   P                  4       pVR  V# )r/   )__dict__copyr$   states   & r   __getstate__EventEmitter.__getstate__E   s     ""$'Nr   c                @   < V ^8  d   QhRS[ RS[S[S[3,          RR/# )r#   r$   r;   r%   Nr5   )r'   r(   s   "r   r)   r*   J   s+      4 S(9 d r   c                Z    V P                   P                  V4       \        4       V n        R # r,   )r8   updater   r/   r:   s   &&r   __setstate__EventEmitter.__setstate__J   s    U#V
r   c                D   < V ^8  d   QhRS[ RS[RS[S[.S[3,          /# r#   r$   eventr%   r&   r6   r   r   )r'   r(   s   "r   r)   r*   O   s$    GGGcGhy'/A&BGr   c                    R # r,   r   r$   rE   s   &&r   onEventEmitter.onN   s    DGr   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# r#   r$   rE   fr%   r&   r6   r   )r'   r(   s   "r   r)   r*   Q   s    >>>c>g>'>r   c                    R # r,   r   r$   rE   rM   s   &&&r   rI   rJ   P   s    ;>r   Nc                p   < V ^8  d   QhRS[ RS[RS[S[,          RS[S[S[S[.S[3,          3,          /# rL   )r&   r6   r
   r   r   r   )r'   r(   s   "r   r)   r*   S   sH      /  / / /#+G#4 /	w'G!344	5 /r   c                N    Vf   V P                  V4      # V P                  W4      # )a  Registers the function `f` to the event name `event`, if provided.

If `f` isn't provided, this method calls `EventEmitter#listens_to`, and
otherwise calls `EventEmitter#add_listener`. In other words, you may either
use it as a decorator:

```py
@ee.on('data')
def data_handler(data):
    print(data)
```

Or directly:

```py
ee.on('data', data_handler)
```

In both the decorated and undecorated forms, the event handler is
returned. The upshot of this is that you can call decorated handlers
directly, as well as use them in remove_listener calls.

Note that this method's return type is a union type. If you are using
mypy or pyright, you will probably want to use either
`EventEmitter#listens_to` or `EventEmitter#add_listener`.
)
listens_toadd_listenerrP   s   &&&r   rI   rJ   S   s)    : 9??5))$$U..r   c                D   < V ^8  d   QhRS[ RS[RS[S[.S[3,          /# rD   rF   )r'   r(   s   "r   r)   r*   u   s.       c hy'7I.J r   c                   a a R VV 3R llpV# )a  Returns a decorator which will register the decorated function to
the event name `event`:

```py
@ee.listens_to("event")
def data_handler(data):
    print(data)
```

By only supporting the decorator use case, this method has improved
type safety over `EventEmitter#on`.
c                0    V ^8  d   QhR\         R\         /# r#   rM   r%   )r   )r'   s   "r   r)   -EventEmitter.listens_to.<locals>.__annotate__   s     	 	' 	g 	r   c                 ,   < SP                  SW 4       V # r,   _add_event_handler)rM   rE   r$   s   &r   rI   #EventEmitter.listens_to.<locals>.on   s    ##E10Hr   r   )r$   rE   rI   s   ff r   rS   EventEmitter.listens_tou   s    	 	 	r   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rL   rN   )r'   r(   s   "r   r)   r*      s)      4   G r   c                *    V P                  WV4       V# )zRegister the function `f` to the event name `event`:

```
def data_handler(data):
    print(data)

h = ee.add_listener("event", data_handler)
```

By not supporting the decorator use case, this method has improved
type safety over `EventEmitter#on`.
r[   rP   s   &&&r   rT   EventEmitter.add_listener   s     	!,r   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# )r#   r$   rE   kvr&   r6   r   )r'   r(   s   "r   r)   r*      s)     ' ' 'c 'h '8 'r   c                   V P                  R W4       V P                  ;_uu_ 4        WP                  9  d   \        4       V P                  V&   W0P                  V,          V&   RRR4       R#   + '       g   i     R# ; i)new_listenerN)emitr/   r.   r   )r$   rE   rc   rd   s   &&&&r   r\   EventEmitter._add_event_handler   sR    		.%+ ZZZLL(&1mU#%&LL" ZZZs   =A..A?	c          
      `   < V ^8  d   QhRS[ RS[RS[S[R3,          RS[S[S[3,          RR/# )r#   r$   rM   args.kwargsr%   N)r&   r   r   r   r   r6   )r'   r(   s   "r   r)   r*      sK       CHo S#X	
 
r   c                    V! V/ VB  R # r,   r   )r$   rM   rk   rl   s   &&&&r   	_emit_runEventEmitter._emit_run   s     	
46r   c                6   < V ^8  d   QhRS[ RS[S[,          /# r4   )r&   r   r6   )r'   r(   s   "r   r)   r*      s     ( ($ (3s8 (r   c                H    \        V P                  P                  4       4      # )z6Get a set of events that this emitter is listening to.)setr.   keysr0   s   &r   event_namesEventEmitter.event_names   s    4<<$$&''r   c                0   < V ^8  d   QhRS[ RS[RS[RR/# )r#   r$   rE   errorr%   N)r&   r6   r   )r'   r(   s   "r   r)   r*      s/     Q Q4 Q QC QD Qr   c                `    VR 8X  d'   \        V\        4      '       d   Vh\        RV 24      hR# )rw   z%Uncaught, unspecified 'error' event: N)
isinstance	Exceptionr   )r$   rE   rw   s   &&&r   _emit_handle_potential_error)EventEmitter._emit_handle_potential_error   s4    G%++"Gw OPP	 r   c          
      b   < V ^8  d   QhRS[ RS[RS[S[R3,          RS[S[S[3,          RS[/# )r#   r$   rE   rk   .rl   r%   )r&   r6   r   r   r   bool)r'   r(   s   "r   r)   r*      sK       CHo S#X	
 
r   c           	        R pV P                   ;_uu_ 4        \        V P                  P                  V\	        4       4      P                  4       4      pRRR4       X F  pV P                  WbV4       RpK  	  V#   + '       g   i     L/; i)FNT)r/   listr.   getr   valuesrn   )r$   rE   rk   rl   handledfuncsrM   s   &&&&   r   _call_handlersEventEmitter._call_handlers   si     ZZZ))%?FFHIE ANN1F+G   Zs   <A::B
	c          
      8   < V ^8  d   QhRS[ RS[RS[RS[RS[/# )r#   r$   rE   rk   rl   r%   )r&   r6   r   r~   )r'   r(   s   "r   r)   r*      s;        	
 
r   c                ~    V P                  WV4      pV'       g#   T P                  Y'       d
   V^ ,          MR4       V# )a  Emit `event`, passing `*args` and `**kwargs` to each attached
function. Returns `True` if any functions are attached to `event`;
otherwise returns `False`.

Example:

```py
ee.emit('data', '00101001')
```

Assuming `data` is an attached function, this will call
`data('00101001')'`.
N)r   r{   )r$   rE   rk   rl   r   s   &&*, r   rh   EventEmitter.emit   s6    & %%e6:--eT!W$Or   c                B   < V ^8  d   QhRS[ RS[RS[S[,          RS[/# rL   )r&   r6   r
   r   )r'   r(   s   "r   r)   r*      s6       H 
	r   c                6   a a R VV 3R llpVf   V# V! V4      # )z[The same as `ee.on`, except that the listener is automatically
removed after being called.
c                0    V ^8  d   QhR\         R\         /# rX   )r   )r'   s   "r   r)   'EventEmitter.once.<locals>.__annotate__   s     	 	 	X 	r   c                 F   <a  R  VV V3R llpSP                  SS V4       S # )c                <    V ^8  d   QhR\         R\         R\         /# )r#   rk   rl   r%   )r   )r'   s   "r   r)   9EventEmitter.once.<locals>._wrapper.<locals>.__annotate__   s&     * *** *r   c                    < SP                   ;_uu_ 4        SSP                  9   d,   SSP                  S,          9   d   SP                  SS4       M R R R 4       R #  R R R 4       S! V / VB #   + '       g   i     L; ir,   )r/   r.   _remove_listener)rk   rl   rE   rM   r$   s   *,r   g.EventEmitter.once.<locals>._wrapper.<locals>.g   sj     ZZZ ,dll56I1I--eQ7#  Z 8	   $)&))  Zs   >A//A?	r[   )rM   r   rE   r$   s   f r   _wrapper#EventEmitter.once.<locals>._wrapper   s&    * * ##E1a0Hr   r   )r$   rE   rM   r   s   ff& r   onceEventEmitter.once   s#    	 	& 9OA;r   c                0   < V ^8  d   QhRS[ RS[RS[RR/# r#   r$   rE   rM   r%   Nre   )r'   r(   s   "r   r)   r*     s)     ( (t (C (H ( (r   c                    WP                   9   dM   V P                   V,          P                  V4       V P                   V,          '       g   V P                   V R# R# R# )zNaked unprotected removal.N)r.   poprP   s   &&&r   r   EventEmitter._remove_listener  sH    LL LL##A&<<&&LL' ' !r   c                0   < V ^8  d   QhRS[ RS[RS[RR/# r   re   )r'   r(   s   "r   r)   r*     s)     , ,d ,3 ,8 , ,r   c                    V P                   ;_uu_ 4        V P                  W4       RRR4       R#   + '       g   i     R# ; i)z&Removes the function `f` from `event`.N)r/   r   rP   s   &&&r   remove_listenerEventEmitter.remove_listener  s%    ZZZ!!%+ ZZZs	   1A	c                :   < V ^8  d   QhRS[ RS[S[,          RR/# )r#   r$   rE   r%   N)r&   r
   r6   )r'   r(   s   "r   r)   r*     s&     & &4 & & &r   c                    V P                   ;_uu_ 4        Ve   \        4       V P                  V&   M\        4       V n        RRR4       R#   + '       g   i     R# ; i)zdRemove all listeners attached to `event`.
If `event` is `None`, remove all listeners on all events.
N)r/   r   r.   r-   rH   s   &&r   remove_all_listeners!EventEmitter.remove_all_listeners  s8     ZZZ &1mU##v	 ZZZs   ,AA	c                <   < V ^8  d   QhRS[ RS[RS[S[,          /# rD   )r&   r6   r   r   )r'   r(   s   "r   r)   r*     s+     C C CS CT(^ Cr   c                x    \        V P                  P                  V\        4       4      P	                  4       4      # )z:Returns a list of all listeners registered to the `event`.)r   r.   r   r   rs   rH   s   &&r   	listenersEventEmitter.listeners  s)    DLL$$UKM:??ABBr   )r.   r/   r,   )r   r   r   r   r   r1   r<   rA   r   rI   rS   rT   r\   rn   rt   r{   r   rh   r   r   r   r   r   r   __classdictcell__)r(   s   @r   r!   r!   !   s     8" " 
  G G> > /  /D (  ' ' ( (Q Q   4 B( (, ,
& &C Cr   r!   N)collectionsr   	threadingr   typingr   r   r   r   r	   r
   r   r   r   r   r   r&   rz   r   r   r   r!   r   r   r   <module>r      s^    $     KI K% % )8
,{C {Cr   