
    hT	                    *   S SK Jr  S SKrS SKrS SKrS SKrS SKJr  SSKJ	r	J
r
  \R                  " S5      S   r\R                  \R                  \\\	4   \
4      r\R                  \\R$                  \\	4   4   rSS jrSS	 jr S     SS
 jjrg)    )annotationsN)BytesIO   )_TYPE_FIELD_VALUE_TUPLERequestFieldzutf-8   c                 r    [         R                  " [        R                  " S5      5      R	                  5       $ )zF
Our embarrassingly-simple replacement for mimetools.choose_boundary.
   )binasciihexlifyosurandomdecode     B/var/www/html/env/lib/python3.13/site-packages/urllib3/filepost.pychoose_boundaryr      s&     BJJrN+2244r   c              #     #    [        U [        R                  5      (       a  U R                  5       nOU nU H3  n[        U[        5      (       a  Uv   M  [        R
                  " U6 v   M5     g7f)zv
Iterate over fields.

Supports list of (k, v) tuples and dicts, and lists of
:class:`~urllib3.fields.RequestField`.

N)
isinstancetypingMappingitemsr   from_tuples)fieldsiterablefields      r   iter_field_objectsr      sU      &&..))<<>e\**K**E22	 s   A-A/c                ^   [        5       nUc
  [        5       n[        U 5       H  nUR                  SU S3R	                  S5      5        [        U5      R                  UR                  5       5        UR                  n[        U[        5      (       a  [        U5      n[        U[        5      (       a  [        U5      R                  U5        OUR                  U5        UR                  S5        M     UR                  SU S3R	                  S5      5        SU 3nUR                  5       U4$ )a  
Encode a dictionary of ``fields`` using the multipart/form-data MIME format.

:param fields:
    Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`).
    Values are processed by :func:`urllib3.fields.RequestField.from_tuples`.

:param boundary:
    If not specified, then a random boundary will be generated using
    :func:`urllib3.filepost.choose_boundary`.
z--z
zlatin-1s   
z--
zmultipart/form-data; boundary=)r   r   r   writeencodewriterrender_headersdatar   intstrgetvalue)r   boundarybodyr   r#   content_types         r   encode_multipart_formdatar*   3   s     9D"$#F+

Rz&--i89t5//12zzdC  t9DdC  4Lt$JJt

7 ,  	JJH:V$++I673H:>L==?L((r   )returnr%   )r   _TYPE_FIELDSr+   ztyping.Iterable[RequestField])N)r   r,   r'   z
str | Noner+   ztuple[bytes, str])
__future__r   r   codecsr   r   ior   r   r   r   lookupr!   SequenceUniontupler%   _TYPE_FIELDS_SEQUENCEr   r,   r   r   r*   r   r   r   <module>r5      s    "   	   9	w		"
LLs334lBC  ||
NN3//0253. 26&)&)$.&)&)r   