o
    ©¼–iå"  ã                   @  sü   U d dl mZ d dlZd dlmZ d dlmZ g d¢ZG dd„ dƒZG dd	„ d	eƒZ	G d
d„ deƒZ
ejgZded< d!dd„Zd!dd„Zd!dd„Zd!dd„Zded< ded< ded< ej d¡rhe	ZeZeZdS ejdv rue
ZeZeZdS edej› d ƒ‚)"é    )ÚannotationsN)ÚCallable)ÚClassVar)ÚreadcharÚreadkeyÚkeyc                   @  s‚  e Zd ZU dZded< dZded< dZded< dZded	< d
Zded< dZ	ded< dZ
ded< dZded< dZded< dZded< dZded< dZded< dZded< eZded< eZded< dZded< d Zded!< eZded"< d#Zded$< d%Zded&< d'Zded(< d)Zded*< d+Zded,< d-Zded.< d/Zded0< d1Zded2< d3Zded4< d5Zded6< d7Z ded8< d9Z!ded:< d;Z"ded<< d=S )>Ú_BaseKeyÚ
úClassVar[str]ÚLFúÚCRú ÚSPACEúÚESCú	ÚTABúÚCTRL_AúÚCTRL_BúÚCTRL_CúÚCTRL_DúÚCTRL_EúÚCTRL_FúÚCTRL_GúÚCTRL_HÚCTRL_IÚCTRL_JúÚCTRL_KúÚCTRL_LÚCTRL_MúÚCTRL_NúÚCTRL_OúÚCTRL_PúÚCTRL_QúÚCTRL_RúÚCTRL_SúÚCTRL_TúÚCTRL_UúÚCTRL_VúÚCTRL_WúÚCTRL_XúÚCTRL_YúÚCTRL_ZN)#Ú__name__Ú
__module__Ú__qualname__r   Ú__annotations__r   r   r   r   r   r   r   r   r   r   r!   r#   r$   r%   r'   r)   r*   r,   r.   r0   r2   r4   r6   r8   r:   r<   r>   r@   rB   rD   © rI   rI   ú]/var/www/html/livekit_bhavya/venv/lib/python3.10/site-packages/livekit/agents/cli/readchar.pyr   
   s@   
 r   c                   @  sp  e Zd ZU dZdZded< dZded< dZded< d	Zded
< dZ	ded< dZ
ded< dZded< dZded< dZded< dZded< dZded< dZded< dZded< dZded< dZded < d!Zded"< d#Zded$< d%Zded&< d'Zded(< d)Zded*< d+Zded,< d-Zded.< d/Zded0< d1Zded2< d3Zded4< d5Zded6< d7Zded8< e j!Z"ded9< eZ#ded:< d;S )<Ú	_PosixKeyz×Namespace of key codes specific to POSIX platforms (Linux, macOS, BSD).

    These values mirror those defined in the upstream ``_posix_key.py``
    module.  All attributes from :class:`_BaseKey` are inherited.
    úr
   Ú	BACKSPACEz[AÚUPz[BÚDOWNz[DÚLEFTz[CÚRIGHTz[2~ÚINSERTz[3~ÚSUPRz[HÚHOMEz[FÚENDz[5~ÚPAGE_UPz[6~Ú	PAGE_DOWNzOPÚF1zOQÚF2zORÚF3zOSÚF4z[15~ÚF5z[17~ÚF6z[18~ÚF7z[19~ÚF8z[20~ÚF9z[21~ÚF10z[23~ÚF11z[24~ÚF12z[ZÚ	SHIFT_TABz[3^ÚCTRL_ALT_SUPRzaÚALT_AzÚ
CTRL_ALT_AÚENTERÚDELETEN)$rE   rF   rG   Ú__doc__rM   rH   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   r   r   rh   ri   rI   rI   rI   rJ   rK   /   s>   
 rK   c                   @  sX  e Zd ZU dZdZded< dZded< dZded< d	Zded
< dZ	ded< dZ
ded< dZded< dZded< dZded< dZded< dZded< dZded< dZded< dZded< dZded < d!Zded"< d#Zded$< d%Zded&< d'Zded(< d)Zded*< d+Zded,< d-Zded.< d/Zded0< d1Zded2< d3Zded4< ejZ ded5< eZ!ded6< d7S )8Ú_WinKeyzÃNamespace of key codes specific to Windows platforms.

    These values mirror those defined in the upstream ``_win_key.py``
    module.  All attributes from :class:`_BaseKey` are inherited.
    r"   r
   rM   z HrN   z PrO   z KrP   z MrQ   z RrR   z SrS   z GrT   z OrU   z IrV   z QrW   z ;rX   z <rY   z =rZ   z >r[   z ?r\   z @r]   z Ar^   z Br_   z Cr`   z Dra   u    Â…rb   u    Â†rc   z ÚESC_2z ÚENTER_2rh   ri   N)"rE   rF   rG   rj   rM   rH   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rl   rm   r   r   rh   ri   rI   rI   rI   rJ   rk   d   s:   
 rk   z	list[str]ÚINTERRUPT_KEYSÚreturnÚstrc                  C  s†  ddl } ddl}tj ¡ }|  |¡}|  |¡}zj|d  | j| jB  M  < |d  | jO  < |  	|| j
|¡ tj d¡}W z|  	|| j|¡ W |S  ty   z%| |¡ |  |¡}|d  | j| jB | jB O  < |  	|| j|¡ W Y |S  ty}   Y nw Y |S w z
|  	|| j|¡ W w  tyÂ   z$| |¡ |  |¡}|d  | j| jB | jB O  < |  	|| j|¡ W Y w  tyÁ   Y Y w w w )au  Read a single character from standard input on POSIX systems.

    This function blocks until a character is available.  It uses
    ``termios`` to disable canonical input processing and echo so
    characters are returned immediately and without being echoed to
    the terminal.  The implementation closely follows the upstream
    ``_posix_read.readchar`` function.
    r   Né   é   )ÚtermiosÚttyÚsysÚstdinÚfilenoÚ	tcgetattrÚICANONÚECHOÚISIGÚ	tcsetattrÚ	TCSAFLUSHÚreadÚ	TCSADRAINÚ	ExceptionÚ	setcbreak)rs   rt   ÚfdÚold_settingsÚtermÚchÚcurrI   rI   rJ   Ú_posix_readchar›   sL   	


	ø

þÿøþ

ÿúr‡   c                  C  s†   t ƒ } | tv r	t‚| dkr| S t ƒ }|dvr| | S t ƒ }|dvr'| | | S t ƒ }|dvr6| | | | S t ƒ }| | | | | S )u%  Read the next keypress on POSIX systems.

    If a multiâ€‘byte escape sequence is encountered (for example, an arrow
    key or function key), the entire sequence is read and returned.
    ``KeyboardInterrupt`` is raised when a key listed in
    :data:`config.INTERRUPT_KEYS` is pressed.
    r   zO[Ú12356Ú01345789)r‡   rn   ÚKeyboardInterrupt)Úc1Úc2Úc3Úc4Úc5rI   rI   rJ   Ú_posix_readkey¾   s    r   c                  C  s   ddl } |  ¡ S )u[  Read a single UTFâ€‘16 code unit from standard input on Windows systems.

    This function blocks until a character is available.  It wraps
    ``msvcrt.getwch()`` from the standard library, which returns a
    single wide character (as a Python string).  The implementation is
    equivalent to the upstream ``_win_read.readchar`` function.
    r   N)ÚmsvcrtÚgetwch)r‘   rI   rI   rJ   Ú_win_readcharã   s   r“   c                  C  s`   t ƒ } | tv r	t‚| dv rdt ƒ  } d|   krdkr.n | S | t ƒ 7 } | jddd d¡} | S )a<  Read the next keypress on Windows systems.

    This function interprets Windows scan codes and surrogate pairs to
    return a key sequence that is compatible with the constants defined
    in :class:`_WinKey`.  ``KeyboardInterrupt`` is raised when a key
    listed in :data:`config.INTERRUPT_KEYS` is pressed.
    u    Ã ú u   í €u   í¿¿zutf-16Úsurrogatepass)Úerrors)r“   rn   rŠ   ÚencodeÚdecode)r…   rI   rI   rJ   Ú_win_readkeyð   s   

ür™   ztype[_PosixKey | _WinKey]r   zCallable[[], str]r   r   )ÚlinuxÚdarwinÚfreebsdÚopenbsd)Úwin32ÚcygwinzThe platform z is not supported yet)ro   rp   )Ú
__future__r   ru   Úcollections.abcr   Útypingr   Ú__all__r   rK   rk   r   rn   rH   r‡   r   r“   r™   ÚplatformÚ
startswithr   r   r   ÚNotImplementedErrorrI   rI   rI   rJ   Ú<module>   s2    %54

#
%

