
    +ii #                    z   U d dl mZ d dlZd dlZd dlmZ d dlmZ ddl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dlmZmZ ddlmZ ddlmZmZmZmZ ddlmZ ddlmZm Z  ej!        rddlm"Z"m#Z#  G d d          Z$ G d de$          Z%ej!        r$ e$dd           Z&de'd<    e%dd           Z(de'd<   dS dS )    )annotationsN)HTTPException)ResponseNotReady   )
_TYPE_BODY)HTTPConnectionProxyConfigport_by_scheme)TimeoutError)BaseHTTPResponse)_TYPE_SOCKET_OPTIONS)_DEFAULT_TIMEOUT_TYPE_TIMEOUT)Url   )_RequestError_TimeoutErrorsend_requestsend_streaming_request)EmscriptenRequest)EmscriptenHttpResponseWrapperEmscriptenResponse)BaseHTTPConnectionBaseHTTPSConnectionc                  ^   e Zd ZU ed         Zded<   ded<   ded<   ded	<   d
ed<   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Z	ded<   ded<   	 d=e
dd dddd!d>d%Z	 	 	 d?d@d*ZdAd+Z	 	 dBdd,d,d,d-dCd6ZdDd8ZdAd9ZedEd:            ZedEd;            ZedEd<            ZdS )FEmscriptenHTTPConnectionhttpztyping.ClassVar[int]default_portz%typing.ClassVar[_TYPE_SOCKET_OPTIONS]default_socket_optionszNone | floattimeoutstrhostintport	blocksizetuple[str, int] | Nonesource_address_TYPE_SOCKET_OPTIONS | Nonesocket_options
Url | NoneproxyProxyConfig | Noneproxy_configFboolis_verifiedNzbool | Noneproxy_is_verifiedztype[BaseHTTPResponse]response_classzEmscriptenResponse | None	_responser   i    )r    r'   r%   r)   r+   r-   r   returnNonec                   || _         || _        t          |t                    r|nd| _        d| _        d| _        d | _        d | _        d | _	        || _
        d | _        d | _        d| _        d S )Ng        r   TF)r"   r$   
isinstancefloatr    scheme_closedr2   r+   r-   r%   r'   r)   r/   )	selfr"   r$   r    r'   r%   r)   r+   r-   s	            k/var/www/html/bet.cuttalo.com/ml/venv/lib/python3.11/site-packages/urllib3/contrib/emscripten/connection.py__init__z!EmscriptenHTTPConnection.__init__.   sw     		",We"<"<Eww# 
 """     
int | Noneheaderstyping.Mapping[str, str] | Noner8   c                    d S N )r:   r"   r$   r?   r8   s        r;   
set_tunnelz#EmscriptenHTTPConnection.set_tunnelI   s	     	r=   c                    d S rB   rC   r:   s    r;   connectz EmscriptenHTTPConnection.connectR   s    r=   T)chunkedpreload_contentdecode_contentenforce_content_lengthmethodurlbody_TYPE_BODY | NonerH   rI   rJ   rK   c               h   d| _         |                    d          r)| j        d| j         }	nd}	| j         d| j         |	 | }t          ||| j        r| j        nd|          }
|
                    |           |r0|                                D ]\  }}|
	                    ||           d | _
        	 |st          |
          | _
        | j
        t          |
          | _
        d S d S # t          $ r}t          |j                  |d }~wt           $ r}t#          |j                  |d }~ww xY w)NF/: z://r   )rM   rL   r    rJ   )r9   
startswithr$   r8   r"   r   r    set_bodyitems
set_headerr2   r   r   r   r   messager   r   )r:   rL   rM   rN   r?   rH   rI   rJ   rK   r$   requestkves                 r;   rY   z EmscriptenHTTPConnection.requestU   s{    >># 	<y$&49[;;TY;;c;;C#$(L7DLLa)	
 
 
 	 	) ) )1""1a((((	2" A!7!@!@~%!-g!6!6 &% 	1 	1 	1qy))q0 	2 	2 	2	**1	2s$   61C+ +
D15D

D1D,,D1r   c                x    | j         &t          | j         | j         j        j        |           S t	                      )N)internal_responserM   
connection)r2   r   rY   rM   r   rF   s    r;   getresponsez$EmscriptenHTTPConnection.getresponse   sB    >%0"&.N*.    #$$$r=   c                "    d| _         d | _        d S )NT)r9   r2   rF   s    r;   closezEmscriptenHTTPConnection.close   s    r=   c                    | j         S )zWhether the connection either is brand new or has been previously closed.
        If this property is True then both ``is_connected`` and ``has_connected_to_proxy``
        properties must be False.
        )r9   rF   s    r;   	is_closedz"EmscriptenHTTPConnection.is_closed   s     |r=   c                    dS )zLWhether the connection is actively connected to any origin (proxy or target)TrC   rF   s    r;   is_connectedz%EmscriptenHTTPConnection.is_connected   s	     tr=   c                    dS )zWhether the connection has successfully connected to its proxy.
        This returns False if no proxy is in use. Used to determine whether
        errors are coming from the proxy layer or from tunnelling to the target origin.
        FrC   rF   s    r;   has_connected_to_proxyz/EmscriptenHTTPConnection.has_connected_to_proxy   s	     ur=   r   )r"   r!   r$   r#   r    r   r'   r&   r%   r#   r)   r(   r+   r*   r-   r,   r3   r4   )r   Nr   )
r"   r!   r$   r>   r?   r@   r8   r!   r3   r4   )r3   r4   )NN)rL   r!   rM   r!   rN   rO   r?   r@   rH   r.   rI   r.   rJ   r.   rK   r.   r3   r4   )r3   r   )r3   r.   )__name__
__module____qualname__r
   r   __annotations__r/   r0   r   r1   r   r<   rD   rG   rY   r`   rb   propertyrd   rf   rh   rC   r=   r;   r   r      s        )7)?L????AAAAIIIIIINNN****////$$$$K%)))))-JNJJJJ((((
 !
 "2156: +/! ! ! ! ! !< 37        #'37*2  $#'+*2 *2 *2 *2 *2 *2X% % % %       X    X    X  r=   r   c                  *    e Zd ZU ed         ZdZded<   dZded<   dZded<   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<   dZded<   ded<   dZded<   	 d-eddej        dddddddddddddddddd. fd+Z	 	 	 	 	 	 	 	 	 d/d0d,Z xZS )1EmscriptenHTTPSConnectionhttpsNint | str | None	cert_reqs
str | Noneca_certsca_cert_dirNone | str | bytesca_cert_data	cert_filekey_filekey_passwordtyping.Any | Nonessl_contextssl_versionr>   ssl_minimum_versionssl_maximum_version"None | str | typing.Literal[False]assert_hostnameassert_fingerprintr   i @  )r    r'   r%   r)   r+   r-   rs   r   r   server_hostnamer}   ru   rv   rx   r   r   r~   ry   rz   r{   r"   r!   r$   r#   r    r   r'   r&   r%   r)   None | _TYPE_SOCKET_OPTIONSr+   r*   r-   r,   r   r3   r4   c          
        t                                          ||||||||           d| _        || _        || _        || _        || _        || _        |
| _        || _	        || _
        || _        || _        |ot          j                            |          | _        |ot          j                            |          | _        || _        d | _        d| _        d S )N)r$   r    r'   r%   r)   r+   r-   rq   T)superr<   r8   rz   ry   r{   r}   r   r   r   r~   r   r   ospath
expanduserru   rv   rx   rs   r/   )r:   r"   r$   r    r'   r%   r)   r+   r-   rs   r   r   r   r}   ru   rv   rx   r   r   r~   ry   rz   r{   	__class__s                          r;   r<   z"EmscriptenHTTPSConnection.__init__   s    8 	))% 	 		
 		
 		
  "(&.."4&#6 #6  ARW%7%7%A%A&J27+=+=k+J+J(  r=   c
                    d S rB   rC   )
r:   rz   ry   rs   r{   ru   r   r   rv   rx   s
             r;   set_certz"EmscriptenHTTPSConnection.set_cert   s	     	r=   ri   ).r"   r!   r$   r#   r    r   r'   r&   r%   r#   r)   r   r+   r*   r-   r,   rs   rr   r   r   r   rt   r   rt   r}   r|   ru   rt   rv   rt   rx   rw   r   r>   r   r>   r~   rr   ry   rt   rz   rt   r{   rt   r3   r4   )	NNNNNNNNN)rz   rt   ry   rt   rs   rr   r{   rt   ru   rt   r   r   r   rt   rv   rt   rx   rw   r3   r4   )rj   rk   rl   r
   r   rs   rm   ru   rv   rx   r~   r   r   r   r   r   r   r<   r   __classcell__)r   s   @r;   rp   rp      s        !'*L"&I&&&&H"K""""'+L++++""""$(K((((&*****&*****7777%)))))
 : 
 "215 1 +/&*>B)-&*)-#"&+/*.*.(, $##'5:  :  :  :  :  :  :  : |  $ $&*#'#>B)-"&+/        r=   rp   rS   r   _supports_http_protocolr   _supports_https_protocol))
__future__r   r   typinghttp.clientr   r   _base_connectionr   r_   r   r	   r
   
exceptionsr   responser   util.connectionr   util.timeoutr   r   util.urlr   fetchr   r   r   r   rY   r   r   r   TYPE_CHECKINGr   r   r   rp   r   rm   r   rC   r=   r;   <module>r      s   " " " " " " " 				  7 6 6 6 6 6 ( ( ( ( ( ( * * * * * * E E E E E E E E E E & & & & & & ( ( ( ( ( ( 3 3 3 3 3 3 ; ; ; ; ; ; ; ;       U U U U U U U U U U U U & & & & & & G G G G G G G G	 LKKKKKKKKI I I I I I I IXY Y Y Y Y 8 Y Y Yz 
 U2J2J2q2Q2QQQQQ4M4MbRS4T4TTTTTTTU Ur=   