ó
    ¶®i   ã                   ó   • S r SSKrSSKrSSKrSSKJrJrJrJr  SSK	J
r  SSKJr  SSKJ
r
  Sr " S S	\5      r " S
 S\5      r " S S\5      rS\\
\4   S\\\4   4S jrS\S\\   4S jrS\4S jrS\S\4S jrg)za
wsproto/utilities
~~~~~~~~~~~~~~~~~

Utility functions that do not belong in a separate module.
é    N)ÚDictÚListÚOptionalÚUnion)ÚHeadersé   )ÚEvents$   258EAFA5-E914-47DA-95CA-C5AB0DC85B11c                   ó   • \ rS rSrSrg)ÚProtocolErroré   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    Ú>C:\des-py\RoboSAPF\venv\Lib\site-packages\wsproto/utilities.pyr   r      s   † Úr   r   c                   ó   • \ rS rSrSrSrg)ÚLocalProtocolErroré   z¸Indicates an error due to local/programming errors.

This is raised when the connection is asked to do something that
is either incompatible with the state or the websocket standard.

r   N)r   r   r   r   Ú__doc__r   r   r   r   r   r      s   † ñò 	r   r   c                   óF   ^ • \ rS rSrSrS	S\S\\   SS4U 4S jjjrSr	U =r
$ )
ÚRemoteProtocolErroré$   aQ  Indicates an error due to the remote's actions.

This is raised when processing the bytes from the remote if the
remote has sent data that is incompatible with the websocket
standard.

.. attribute:: event_hint

   This is a suggested wsproto Event to send to the client based
   on the error. It could be None if no hint is available.

NÚmessageÚ
event_hintÚreturnc                 ó0   >• X l         [        TU ]	  U5        g ©N)r   ÚsuperÚ__init__)Úselfr   r   Ú	__class__s      €r   r"   ÚRemoteProtocolError.__init__2   s   ø€ Ø$ŒÜ‰Ñ˜Õ!r   )r   r    )r   r   r   r   r   Ústrr   r	   r"   r   Ú__classcell__)r$   s   @r   r   r   $   s+   ø† ññ" ð "°¸%±ð "ÈD÷ "ö "r   r   Úh11_headersr   c                 ó¾   • 0 nU  H&  u  p#UR                  U/ 5      R                  U5        M(     0 nUR                  5        H  u  p%SR                  U5      XB'   M     U$ )Ns   , )Ú
setdefaultÚappendÚitemsÚjoin)r(   Úname_to_valuesÚnameÚvalueÚname_to_normed_valueÚvaluess         r   Únormed_header_dictr3   8   sc   € ð
 02€NÛ"‰ˆØ×!Ñ! $¨Ó+×2Ñ2°5Ö9ñ #àÐØ&×,Ñ,Ö.‰ˆØ%*§Z¡Z°Ó%7ÐÓ"ñ /àÐr   r0   c                 óˆ   • U R                  S5       Vs/ s H!  oR                  S5      R                  5       PM#     sn$ s  snf )Nó   ,Úascii)ÚsplitÚdecodeÚstrip)r0   Úpieces     r   Úsplit_comma_headerr;   K   s5   € Ø7<·{±{À4Ô7HÓIÒ7H¨e�L‰L˜Ó!×'Ñ'Ö)Ñ7HÑIÐIùÒIs   ”(?c                  óV   • [         R                  " [        R                  " S5      5      $ )Né   )Úbase64Ú	b64encodeÚosÚurandomr   r   r   Úgenerate_noncerB   O   s   € ô ×ÒœBŸJšJ r›NÓ+Ð+r   Útokenc                 óˆ   • U [         -   n[        R                  " U5      R                  5       n[        R
                  " U5      $ r    )ÚACCEPT_GUIDÚhashlibÚsha1Údigestr>   r?   )rC   Úaccept_tokens     r   Úgenerate_accept_tokenrJ   U   s4   € Øœ;Ñ&€LÜ—<’< Ó-×4Ñ4Ó6€LÜ×Ò˜LÓ)Ð)r   )r   r>   rF   r@   Útypingr   r   r   r   Úh11._headersr   Ú
H11HeadersÚeventsr	   rE   Ú	Exceptionr   r   r   Úbytesr3   r&   r;   rB   rJ   r   r   r   Ú<module>rQ      s®   ðñó Û Û 	ß .Ó .å .å Ý ð 6€ô	�Iô 	ô	˜ô 	ô"˜-ô "ð(  E¨'°:Ð*=Ñ$>ð  À4ÈÈuÈÑCUô  ð&J˜eð J¨¨S©	ô Jð,˜ô ,ð* ð *¨5õ *r   