ó
    °"³j.  ã                  óR   • S r SSKJr  SSKrSSKJr  SSKJr  S	S jrS	S jr	S
S jr
g)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)Ú
getproxiesc                óv   •  [         R                  " U R                  S5      S   5        g! [         a     gf = f©NÚ/r   FT)Ú	ipaddressÚIPv4AddressÚsplitÚ	Exception©Úhostnames    ÚT/home/mande/repo/quber/.venv/lib/python3.13/site-packages/anthropic/_utils/_httpx.pyÚis_ipv4_hostnamer      ó<   € ðÜ×Ò˜hŸn™n¨SÓ1°!Ñ4Ô5ð øô ó Ùðúó   ‚(+ «
8·8c                óv   •  [         R                  " U R                  S5      S   5        g! [         a     gf = fr   )r	   ÚIPv6Addressr   r   r   s    r   Úis_ipv6_hostnamer      r   r   c                 ó  • [        5       n 0 nS H1  nU R                  U5      (       d  M  X   nSU;   a  UOSU 3X S3'   M3     U R                  SS5      R                  S5       Vs/ s H  oDR                  5       PM     nnU H}  nUS:X  a  0 s  $ U(       d  M  SU;   a  SX'   M"  [	        U5      (       a
  SUS	U 3'   M<  [        U5      (       a  SUS
U S3'   MW  UR                  5       S:X  a
  SUS	U 3'   Mu  SUSU 3'   M     U$ s  snf )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://ÚnoÚ Ú,Ú*Nzall://zall://[Ú]Ú	localhostzall://*)r   Úgetr   Ústripr   r   Úlower)Ú
proxy_infoÚmountsÚschemer   ÚhostÚno_proxy_hostss         r   Úget_environment_proxiesr(       s&  € ô “€JØ$&€Fã*ˆØ�>‰>˜&×!Ó!Ø!Ñ)ˆHØ16¸(Ó1B¡XÈ'ÐRZÐQ[ÐH\ˆF�X˜S�>Ó"ñ +ð
 0:¯~©~¸dÀBÓ/G×/MÑ/MÈcÔ/RÓSÒ/R t—j‘j–lÑ/R€NÐSÛ"ˆØ�s‹?ØŠIßˆXØ˜Ó Ø#'�Ó Ü! (×+Ñ+Ø.2�˜ ˜zÐ*Ó+Ü! (×+Ñ+Ø04�˜  
¨!Ð,Ó-Ø—‘Ó! [Ó0Ø.2�˜ ˜zÐ*Ó+à/3�˜  
Ð+Ó,ñ #ð €Mùò! Ts   Á'D)r   ÚstrÚreturnÚbool)r*   zMapping[str, str | None])Ú__doc__Ú
__future__r   r	   Útypingr   Úurllib.requestr   r   r   r(   © ó    r   Ú<module>r2      s'   ðñõ #ã Ý Ý %ôôõ r1   