§
    ÜŽ’jn  ã                  óN   — d Z ddlmZ ddlZddlmZ ddlmZ dd
„Zdd„Z	dd„Z
dS )ay  
This file includes code adapted from HTTPX's utility module
(https://github.com/encode/httpx/blob/336204f0121a9aefdebac5cacd81f912bafe8057/httpx/_utils.py).
We implement custom proxy handling to support configurations like `socket_options`,
which are not currently configurable through the HTTPX client.
For more context, see: https://github.com/encode/httpx/discussions/3514
é    )ÚannotationsN)ÚMapping)Ú
getproxiesÚhostnameÚstrÚreturnÚboolc                ó†   — 	 t          j        |                      d¦  «        d         ¦  «         n# t          $ r Y dS w xY wdS ©Nú/r   FT)Ú	ipaddressÚIPv4AddressÚsplitÚ	Exception©r   s    úEC:\Projects\DSCons\.venv\Lib\site-packages\anthropic\_utils\_httpx.pyÚis_ipv4_hostnamer      óS   € ðÝÔ˜hŸnšn¨SÑ1Ô1°!Ô4Ñ5Ô5Ð5Ð5øÝð ð ð Øˆuˆuðøøøàˆ4ó   ‚-0 °
>½>c                ó†   — 	 t          j        |                      d¦  «        d         ¦  «         n# t          $ r Y dS w xY wdS r   )r   ÚIPv6Addressr   r   r   s    r   Úis_ipv6_hostnamer      r   r   úMapping[str, str | None]c                 óÜ  — t          ¦   «         } i }dD ]0}|                      |¦  «        r| |         }d|v r|nd|› �||› d�<   Œ1d„ |                      dd¦  «                             d¦  «        D ¦   «         }|D ]r}|dk    ri c S |rdd|v rd	||<   Œt          |¦  «        r	d	|d
|› �<   Œ0t	          |¦  «        r
d	|d|› d�<   ŒI|                     ¦   «         dk    r	d	|d
|› �<   Œjd	|d|› �<   Œs|S )uô   
    Gets the proxy mappings based on environment variables.
    We use our own logic to parse these variables, as HTTPX
    doesnâ€™t allow full configuration of the underlying
    transport when proxies are set via environment variables.
    )ÚhttpÚhttpsÚallz://zhttp://c                ó6   — g | ]}|                      ¦   «         ‘ŒS © )Ústrip)Ú.0Úhosts     r   ú
<listcomp>z+get_environment_proxies.<locals>.<listcomp>0   s    € ÐSÐSÐS t�d—j’j‘l”lÐSÐSÐSó    ÚnoÚ ú,Ú*Nzall://zall://[ú]Ú	localhostzall://*)r   Úgetr   r   r   Úlower)Ú
proxy_infoÚmountsÚschemer   Úno_proxy_hostss        r   Úget_environment_proxiesr1       sn  € õ ‘”€JØ$&€Fà*ð ]ð ]ˆØ�>Š>˜&Ñ!Ô!ð 	]Ø! &Ô)ˆHØ16¸(Ð1BÐ1B X XÐH\ÐRZÐH\ÐH\ˆF�f�>�>�>Ñ"øàSÐS¨z¯~ª~¸dÀBÑ/GÔ/G×/MÒ/MÈcÑ/RÔ/RÐSÑSÔS€NØ"ð 4ð 4ˆØ�sŠ?ˆ?ØˆIˆIˆIØð 
	4Ø˜Ð Ð Ø#'��xÑ Ð Ý! (Ñ+Ô+ð 4Ø.2�Ð* Ð*Ð*Ñ+Ð+Ý! (Ñ+Ô+ð 4Ø04�Ð, Ð,Ð,Ð,Ñ-Ð-Ø—’Ñ!Ô! [Ò0Ð0Ø.2�Ð* Ð*Ð*Ñ+Ð+à/3�Ð+ Ð+Ð+Ñ,øà€Mr$   )r   r   r   r	   )r   r   )Ú__doc__Ú
__future__r   r   Útypingr   Úurllib.requestr   r   r   r1   r   r$   r   ú<module>r6      s™   ððð ð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %ðð ð ð ðð ð ð ð ð  ð  ð  ð  ð  r$   