Ë
    Õ±1hJ  ã                  óÀ   — d dl mZ d dlZd dlZd dlZddlmZmZ ddgZ	dZ
ej                   G d„ d«      «       Zdd	„Zej                   G d
„ d«      «       Zdd„Zdd„Zy)é    )ÚannotationsNé   )ÚInvalidProxyÚ
InvalidURIÚ	parse_uriÚWebSocketURIz:/?#[]@!$&'()*+,;=c                  ó„   — e Zd ZU dZded<   ded<   ded<   ded<   ded	<   d
Zded<   d
Zded<   edd„«       Zedd„«       Z	y
)r   a  
    WebSocket URI.

    Attributes:
        secure: :obj:`True` for a ``wss`` URI, :obj:`False` for a ``ws`` URI.
        host: Normalized to lower case.
        port: Always set even if it's the default.
        path: May be empty.
        query: May be empty if the URI doesn't include a query component.
        username: Available when the URI contains `User Information`_.
        password: Available when the URI contains `User Information`_.

    .. _User Information: https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1

    ÚboolÚsecureÚstrÚhostÚintÚportÚpathÚqueryNú
str | NoneÚusernameÚpasswordc                óx   — | j                   r| j                   }nd}| j                  r|d| j                  z   z  }|S )Nú/ú?)r   r   )ÚselfÚresource_names     úL/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/websockets/uri.pyr   zWebSocketURI.resource_name+   s7   € à�9Š9Ø ŸI™I‰MàˆMØ�:Š:Ø˜S 4§:¡:Ñ-Ñ-ˆMØÐó    c                óh   — | j                   €y | j                  €J ‚| j                   | j                  fS ©N©r   r   ©r   s    r   Ú	user_infozWebSocketURI.user_info5   ó2   € à�=‰=Ð ØØ�}‰}Ð(Ð(Ð(Ø—‘˜tŸ}™}Ð-Ð-r   )Úreturnr   ©r"   ztuple[str, str] | None)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   Úpropertyr   r    © r   r   r   r      s\   … ñð  ƒLØ
ƒIØ
ƒIØ
ƒIØƒJØ€HˆjÓØ€HˆjÓàòó ðð ò.ó ñ.r   c           	     óŽ  — t         j                  j                  | «      }|j                  dvrt	        | d«      ‚|j
                  €t	        | d«      ‚|j                  dk7  rt	        | d«      ‚|j                  dk(  }|j
                  }|j                  xs |rdnd}|j                  }|j                  }|j                  }|j                  }|�|€t	        | d	«      ‚	 | j                  d
«       t#        |||||||«      S # t        $ r¼ |j                  d«      j                  «       }t         j                  j                  |t         ¬«      }t         j                  j                  |t         ¬«      }|�N|€J ‚t         j                  j                  |t         ¬«      }t         j                  j                  |t         ¬«      }Y ŒÕw xY w)zÊ
    Parse and validate a WebSocket URI.

    Args:
        uri: WebSocket URI.

    Returns:
        Parsed WebSocket URI.

    Raises:
        InvalidURI: If ``uri`` isn't a valid WebSocket URI.

    )ÚwsÚwsszscheme isn't ws or wssúhostname isn't providedÚ z"fragment identifier is meaninglessr-   é»  éP   ú"username provided without passwordÚasciiÚidna©Úsafe)ÚurllibÚparseÚurlparseÚschemer   ÚhostnameÚfragmentr   r   r   r   r   ÚencodeÚUnicodeEncodeErrorÚdecodeÚquoteÚDELIMSr   )	ÚuriÚparsedr   r   r   r   r   r   r   s	            r   r   r   =   sš  € ô �\‰\×"Ñ" 3Ó'€FØ‡}�}˜MÑ)Ü˜Ð6Ó7Ð7Ø‡�ÐÜ˜Ð7Ó8Ð8Ø‡�˜"ÒÜ˜ÐBÓCÐCà�]‰]˜eÑ#€FØ�?‰?€DØ�;‰;Ò1¡&™3¨b€DØ�;‰;€DØ�L‰L€EØ�‰€HØ�‰€Hð Ð Ð 0Ü˜ÐBÓCÐCðAØ�
‰
�7Ôô ˜  d¨D°%¸À8ÓLÐLøô ò 	Að �{‰{˜6Ó"×)Ñ)Ó+ˆÜ�|‰|×!Ñ! $¬VÐ!Ó4ˆÜ—‘×"Ñ" 5¬vÐ"Ó6ˆØÐØÐ'Ð'Ð'Ü—|‘|×)Ñ)¨(¼Ð)Ó@ˆHÜ—|‘|×)Ñ)¨(¼Ð)Ó@ˆHùð	Aús   ÃC? Ã?CGÇGc                  ó^   — e Zd ZU dZded<   ded<   ded<   dZded	<   dZded
<   edd„«       Zy)ÚProxyaè  
    Proxy.

    Attributes:
        scheme: ``"socks5h"``, ``"socks5"``, ``"socks4a"``, ``"socks4"``,
            ``"https"``, or ``"http"``.
        host: Normalized to lower case.
        port: Always set even if it's the default.
        username: Available when the proxy address contains `User Information`_.
        password: Available when the proxy address contains `User Information`_.

    .. _User Information: https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1

    r   r:   r   r   r   Nr   r   r   c                óh   — | j                   €y | j                  €J ‚| j                   | j                  fS r   r   r   s    r   r    zProxy.user_info†   r!   r   r#   )	r$   r%   r&   r'   r(   r   r   r)   r    r*   r   r   rE   rE   o   s>   … ñð ƒKØ
ƒIØ
ƒIØ€HˆjÓØ€HˆjÓàò.ó ñ.r   rE   c                ó`  — t         j                  j                  | «      }|j                  dvrt	        | d|j                  › d�«      ‚|j
                  €t	        | d«      ‚|j                  dvrt	        | d«      ‚|j                  dk7  rt	        | d«      ‚|j                  dk7  rt	        | d	«      ‚|j                  }|j
                  }|j                  xs |j                  d
k(  rdnd}|j                  }|j                  }|�|€t	        | d«      ‚	 | j                  d«       t#        |||||«      S # t        $ rr |j                  d«      j                  «       }|�N|€J ‚t         j                  j                  |t         ¬«      }t         j                  j                  |t         ¬«      }Y Œ‰w xY w)z°
    Parse and validate a proxy.

    Args:
        proxy: proxy.

    Returns:
        Parsed proxy.

    Raises:
        InvalidProxy: If ``proxy`` isn't a valid proxy.

    )Úsocks5hÚsocks5Úsocks4aÚsocks4ÚhttpsÚhttpzscheme z isn't supportedr.   )r/   r   zpath is meaninglessr/   zquery is meaninglesszfragment is meaninglessrL   r0   r1   r2   r3   r4   r5   )r7   r8   r9   r:   r   r;   r   r   r<   r   r   r   r=   r>   r?   r@   rA   rE   )ÚproxyrC   r:   r   r   r   r   s          r   Úparse_proxyrO   Ž   s˜  € ô �\‰\×"Ñ" 5Ó)€FØ‡}�}ÐWÑWÜ˜5 G¨F¯M©M¨?Ð:JÐ"KÓLÐLØ‡�ÐÜ˜5Ð";Ó<Ð<Ø‡{�{˜)Ñ#Ü˜5Ð"7Ó8Ð8Ø‡|�|�rÒÜ˜5Ð"8Ó9Ð9Ø‡�˜"ÒÜ˜5Ð";Ó<Ð<à�]‰]€FØ�?‰?€DØ�;‰;ÒC &§-¡-°7Ò":™3À€DØ�‰€HØ�‰€Hð Ð Ð 0Ü˜5Ð"FÓGÐGð	AØ�‰�WÔô �˜˜t X¨xÓ8Ð8øô ò Að �{‰{˜6Ó"×)Ñ)Ó+ˆØÐØÐ'Ð'Ð'Ü—|‘|×)Ñ)¨(¼Ð)Ó@ˆHÜ—|‘|×)Ñ)¨(¼Ð)Ó@ˆHùðAús   ÄD2 Ä2A8F-Æ,F-c                óT  — t         j                  j                  | j                  › d| j                  › �«      ryt         j                  j                  «       }| j                  rg d¢}ng d¢}|D ]7  }|j                  |«      }|€Œ|dk(  r|j                  d«      rd|dd z   }|c S  y)	zU
    Return the proxy to use for connecting to the given WebSocket URI, if any.

    ú:N)r-   ÚsocksrL   )r,   rR   rL   rM   rR   zhttp://z
socks5h://é   )	r7   ÚrequestÚproxy_bypassr   r   Ú
getproxiesr   ÚgetÚ
startswith)rB   ÚproxiesÚschemesr:   rN   s        r   Ú	get_proxyr[   À   s£   € ô
 ‡~�~×"Ñ" c§h¡h Z¨q°·±°
Ð#;Ô<Øô �n‰n×'Ñ'Ó)€GØ
‡z‚zÚ+‰â2ˆàò ˆØ—‘˜FÓ#ˆØÑØ˜Ò  U×%5Ñ%5°iÔ%@Ø$ u¨Q¨R yÑ0�ØŠLðð r   )rB   r   r"   r   )rN   r   r"   rE   )rB   r   r"   r   )Ú
__future__r   ÚdataclassesÚurllib.parser7   Úurllib.requestÚ
exceptionsr   r   Ú__all__rA   Ú	dataclassr   r   rE   rO   r[   r*   r   r   ú<module>rc      sx   ðÝ "ã Û Û ç 0ð ˜Ð
'€ð 
€ð ×Ñ÷(.ð (.ó ð(.óV/Mðd ×Ñ÷.ð .ó ð.ó</9ôd!r   