+
    ~j                     z    ^ RI t ^ RIt^ RIHtHtHtHtHtHt ^RI	H
t
 ]! RRR7      t ! R R]],          4      tR# )	    N)CallableDictSetOptionalGenericTypeVar)loggerT_contraT)contravariantc                      a  ] tR t^
t o V 3R lR ltV 3R lR ltRV 3R lR lltRV 3R lR	 lltV 3R
 lR ltRt	V t
R# )EventEmitterc                   < V ^8  d   QhRR/# )   returnN )format__classdict__s   "n/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/livekit/rtc/event_emitter.py__annotate__EventEmitter.__annotate__   s     = =$ =    c                $    \        4       V n        R# )z,
Initialize a new instance of EventEmitter.
N)dict_events)selfs   &r   __init__EventEmitter.__init__   s     7;fr   c                $   < V ^8  d   QhRS[ RR/# )r   eventr   N)r
   )r   r   s   "r   r   r      s     -F -F( -Fd -Fr   c                   WP                   9   Ed   V P                   V,          P                  4       pV F  p \        P                  ! V4      pVP                  P                  4       p\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      pV'       d	   V! V!   Kx  V Uu. uF.  pVP                  VP                  VP                  39   g   K,  VNK0  	  p	p\        V	4      p
\        \        V4      V
4      pVRV pV! V!   K  	  R# R# u upi   \         d    h \         d    \        P                  ! RT 24        EK  i ; i)a  
Trigger all callbacks associated with the given event.

Args:
    event (T): The event to emit.
    *args: Positional arguments to pass to the callbacks.

Example:
    Basic usage of emit:

    ```python
    emitter = EventEmitter[str]()

    def greet(name):
        print(f"Hello, {name}!")

    emitter.on('greet', greet)
    emitter.emit('greet', 'Alice')  # Output: Hello, Alice!
    ```
c              3   R   "   T F  qP                   VP                  8H  x  K  	  R # 5iN)kindVAR_POSITIONAL).0ps   & r   	<genexpr>$EventEmitter.emit.<locals>.<genexpr>-   s     %Q&Qff0@0@&@&s   %'TFNzfailed to emit event )r   copyinspect	signature
parametersvaluesanyr#   POSITIONAL_ONLYPOSITIONAL_OR_KEYWORDlenmin	TypeError	Exceptionr	   	exception)r   r   args	callablescallbacksigparamshas_varargsr&   positional_params
num_paramsnum_argscallback_argss   &&*          r   emitEventEmitter.emit   s3   * LL U+002I%F!++H5C ^^224F"%#%Q&%Q###%Q&%Q"QK" $ &,-%+ vv!*;*;Q=T=T)UU A%+ * -
 &)):%;
#&s4y*#=(,Yh -0% & !- !   F$$'<UG%DEEFsB   ADD%D-D1)DD%-DDE4EENc                <   < V ^8  d   QhRS[ RS[S[,          RS[/# r   r   r8   r   r
   r   r   )r   r   s   "r   r   r   @   s'     6 6( 6hx.@ 6H 6r   c                `   a aaa Se   VVVV 3R loS P                  SS4      # R VV 3R llpV# )a<  
Register a callback to be called only once when the event is emitted.

If a callback is provided, it registers the callback directly.
If no callback is provided, it returns a decorator for use with function definitions.

Args:
    event (T): The event to listen for.
    callback (Callable, optional): The callback to register. Defaults to None.

Returns:
    Callable: The registered callback or a decorator if callback is None.

Example:
    Using once with a direct callback:

    ```python
    emitter = EventEmitter[str]()

    def greet_once(name):
        print(f"Hello once, {name}!")

    emitter.once('greet', greet_once)
    emitter.emit('greet', 'Bob')    # Output: Hello once, Bob!
    emitter.emit('greet', 'Bob')    # No output, callback was removed after first call
    ```

    Using once as a decorator:

    ```python
    emitter = EventEmitter[str]()

    @emitter.once('greet')
    def greet_once(name):
        print(f"Hello once, {name}!")

    emitter.emit('greet', 'Bob')    # Output: Hello once, Bob!
    emitter.emit('greet', 'Bob')    # No output
    ```
c                  <   < SP                  SS4       S! V / VB  R # r"   )off)r6   kwargsr8   r   once_callbackr   s   *,r   rI   (EventEmitter.once.<locals>.once_callbackk   s    .$)&)r   c                0    V ^8  d   QhR\         R\         /# r   r8   r   r   )r   s   "r   r   'EventEmitter.once.<locals>.__annotate__r           H    r   c                 ,   < SP                  SV 4       V # r"   )oncer8   r   r   s   &r   	decorator$EventEmitter.once.<locals>.decoratorr   s    		%*r   on)r   r   r8   rS   rI   s   fff @r   rQ   EventEmitter.once@   s;    R * * 775-00    r   c                <   < V ^8  d   QhRS[ RS[S[,          RS[/# rC   rD   )r   r   s   "r   r   r   x   s'     7 7 7HX,> 7( 7r   c                  a a Vet   \         P                  ! V4      '       d   \        R4      hSS P                  9  d   \	        4       S P                  S&   S P                  S,          P                  V4       V# R VV 3R llpV# )a  
Register a callback to be called whenever the event is emitted.

If a callback is provided, it registers the callback directly.
If no callback is provided, it returns a decorator for use with function definitions.

Args:
    event (T): The event to listen for.
    callback (Callable, optional): The callback to register. Defaults to None.

Returns:
    Callable: The registered callback or a decorator if callback is None.

Example:
    Using on with a direct callback:

    ```python
    emitter = EventEmitter[str]()

    def greet(name):
        print(f"Hello, {name}!")

    emitter.on('greet', greet)
    emitter.emit('greet', 'Charlie')  # Output: Hello, Charlie!
    ```

    Using on as a decorator:

    ```python
    emitter = EventEmitter[str]()

    @emitter.on('greet')
    def greet(name):
        print(f"Hello, {name}!")

    emitter.emit('greet', 'Charlie')  # Output: Hello, Charlie!
    ```
zsCannot register an async callback with `.on()`. Use `asyncio.create_task` within your synchronous callback instead.c                0    V ^8  d   QhR\         R\         /# rL   rM   )r   s   "r   r   %EventEmitter.on.<locals>.__annotate__   rO   r   c                 ,   < SP                  SV 4       V # r"   rU   rR   s   &r   rS   "EventEmitter.on.<locals>.decorator   s    x(r   )asyncioiscoroutinefunction
ValueErrorr   setadd)r   r   r8   rS   s   ff& r   rV   EventEmitter.onx   s|    N **844  J  DLL(&)eU#LL##H-O    r   c                *   < V ^8  d   QhRS[ RS[RR/# )r   r   r8   r   N)r
   r   )r   r   s   "r   r   r      s"     2 2 2X 2$ 2r   c                n    WP                   9   d%   V P                   V,          P                  V4       R# R# )a  
Unregister a callback from an event.

Args:
    event (T): The event to stop listening to.
    callback (Callable): The callback to remove.

Example:
    Removing a callback:

    ```python
    emitter = EventEmitter[str]()

    def greet(name):
        print(f"Hello, {name}!")

    emitter.on('greet', greet)
    emitter.off('greet', greet)
    emitter.emit('greet', 'Dave')  # No output, callback was removed
    ```
N)r   discard)r   r   r8   s   &&&r   rG   EventEmitter.off   s*    , LL LL''1 !r   )r   r"   )__name__
__module____qualname____firstlineno__r   r@   rQ   rV   rG   __static_attributes____classdictcell__)r   s   @r   r   r   
   s<     = =-F -F^6 6p7 7r2 2r   r   )r*   r^   typingr   r   r   r   r   r   logr	   r
   r   r   r   r   <module>rp      s3      B B :T2~278$ ~2r   