Ë
    _§1hG  ã                   óp   — d Z ddlmZmZmZ ddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZ dZ G d	„ d
«      ZdZy)z.
wsproto
~~~~~~~

A WebSocket implementation.
é    )Ú	GeneratorÚOptionalÚUnioné   )Ú
ConnectionÚConnectionStateÚConnectionType)ÚEvent)ÚH11Handshake)ÚHeadersz1.2.0c                   ó’   — e Zd ZdZdeddfd„Zedefd„«       Zde	de
eef   ddfd	„Zd
edefd„Zdee   ddfd„Zdeeddf   fd„Zy)ÚWSConnectionzN
    Represents the local end of a WebSocket connection to a remote peer.
    Úconnection_typeÚreturnNc                 ó`   — |t         j                  u | _        t        |«      | _        d| _        y)z­
        Constructor

        :param wsproto.connection.ConnectionType connection_type: Controls
            whether the library behaves as a client or as a server.
        N)r	   ÚCLIENTÚclientr   Ú	handshakeÚ
connection)Úselfr   s     úN/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/wsproto/__init__.pyÚ__init__zWSConnection.__init__   s)   € ð &¬×)>Ñ)>Ð>ˆŒÜ% oÓ6ˆŒØ04ˆ�ó    c                 ór   — | j                   €| j                  j                  S | j                   j                  S )z_
        :returns: Connection state
        :rtype: wsproto.connection.ConnectionState
        )r   r   Ústate©r   s    r   r   zWSConnection.state!   s.   € ð �?‰?Ð"Ø—>‘>×'Ñ'Ð'Ø�‰×$Ñ$Ð$r   ÚheadersÚpathc                 ó<   — | j                   j                  ||«       y )N)r   Úinitiate_upgrade_connection)r   r   r   s      r   r    z(WSConnection.initiate_upgrade_connection+   s   € ð 	�‰×2Ñ2°7¸DÕAr   Úeventc                 óÔ   — d}| j                   €;|| j                  j                  |«      z  }| j                  j                   | _         |S || j                   j                  |«      z  }|S )a‹  
        Generate network data for the specified event.

        When you want to communicate with a WebSocket peer, you should construct
        an event and pass it to this method. This method will return the bytes
        that you should send to the peer.

        :param wsproto.events.Event event: The event to generate data for
        :returns bytes: The data to send to the peer
        r   )r   r   Úsend)r   r!   Údatas      r   r#   zWSConnection.send0   sd   € ð ˆØ�?‰?Ð"Ø�D—N‘N×'Ñ'¨Ó.Ñ.ˆDØ"Ÿn™n×7Ñ7ˆDŒOð ˆð �D—O‘O×(Ñ(¨Ó/Ñ/ˆDØˆr   r$   c                 óÀ   — | j                   €7| j                  j                  |«       | j                  j                   | _         y| j                   j                  |«       y)zý
        Feed network data into the connection instance.

        After calling this method, you should call :meth:`events` to see if the
        received data triggered any new events.

        :param bytes data: Data received from remote peer
        N)r   r   Úreceive_data)r   r$   s     r   r&   zWSConnection.receive_dataC   sC   € ð �?‰?Ð"Ø�N‰N×'Ñ'¨Ô-Ø"Ÿn™n×7Ñ7ˆD�Oà�O‰O×(Ñ(¨Õ.r   c              #   ó¶   K  — | j                   j                  «       E d{  –—†  | j                  �#| j                  j                  «       E d{  –—†  yy7 Œ47 Œ­w)z”
        A generator that yields pending events.

        Each event is an instance of a subclass of
        :class:`wsproto.events.Event`.
        N)r   Úeventsr   r   s    r   r(   zWSConnection.eventsR   sL   è ø€ ð —>‘>×(Ñ(Ó*×*Ð*Ø�?‰?Ð&Ø—‘×-Ñ-Ó/×/Ñ/ð 'ð 	+øà/ús!   ‚A A¡-AÁAÁAÁA)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   Úpropertyr   r   r   r   ÚbytesÚstrr    r
   r#   r   r&   r   r(   © r   r   r   r      s¡   „ ñð	5¨ð 	5¸4ó 	5ð ð%�ò %ó ð%ðBØðBØ&+¨E°3¨JÑ&7ðBà	óBð
˜%ð  Eó ð&/ ¨%¡ð /°Tó /ð	0˜	 %¨¨tÐ"3Ñ4ô 	0r   r   )r	   r   N)r,   Útypingr   r   r   r   r   r   r	   r(   r
   r   r   r   Ú__version__r   Ú__all__r0   r   r   ú<module>r4      s:   ðñ÷ .Ñ -ç CÑ CÝ Ý #Ý à€÷J0ñ J0ðZ -�r   