Ë
    Ü_Ëi²  ã                  ó  — d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZmZ ddlmZmZ ddlmZmZmZmZmZmZmZmZmZmZ d	Zed
d	d
dddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zed
d	d
dddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)z*Tools to parse and validate a MongoDB URI.é    )Úannotations)ÚAnyÚOptional)Úunquote_plus)Ú_SrvResolver)ÚSRV_SERVICE_NAMEÚ_CaseInsensitiveDictionary)ÚConfigurationErrorÚ
InvalidURI)
Ú_ALLOWED_TXT_OPTSÚDEFAULT_PORTÚSCHEMEÚ
SCHEME_LENÚSRV_SCHEME_LENÚ_check_optionsÚ_make_options_case_sensitiveÚ_validate_uriÚsplit_hostsÚsplit_optionsFTNc              ƒ  ó¦   K  — t        | |||||«      }|j                  t        | |||||||«      ƒ d{  –—† «       t        |d   «      |d<   |S 7 Œ­w)až  Parse and validate a MongoDB URI.

    Returns a dict of the form::

        {
            'nodelist': <list of (host, port) tuples>,
            'username': <username> or None,
            'password': <password> or None,
            'database': <database name> or None,
            'collection': <collection name> or None,
            'options': <dict of MongoDB URI options>,
            'fqdn': <fqdn of the MongoDB+SRV URI> or None
        }

    If the URI scheme is "mongodb+srv://" DNS SRV and TXT lookups will be done
    to build nodelist and options.

    :param uri: The MongoDB URI to parse.
    :param default_port: The port number to use when one wasn't specified
          for a host in the URI.
    :param validate: If ``True`` (the default), validate and
          normalize all options. Default: ``True``.
    :param warn: When validating, if ``True`` then will warn
          the user then ignore any invalid options or values. If ``False``,
          validation will error when options are unsupported or values are
          invalid. Default: ``False``.
    :param normalize: If ``True``, convert names of URI options
          to their internally-used names. Default: ``True``.
    :param connect_timeout: The maximum time in milliseconds to
          wait for a response from the DNS server.
    :param srv_service_name: A custom SRV service name

    .. versionchanged:: 4.14
       ``options`` is now type ``dict`` as opposed to a ``_CaseInsensitiveDictionary``.

    .. versionchanged:: 4.6
       The delimiting slash (``/``) between hosts and connection options is now optional.
       For example, "mongodb://example.com?tls=true" is now a valid URI.

    .. versionchanged:: 4.0
       To better follow RFC 3986, unquoted percent signs ("%") are no longer
       supported.

    .. versionchanged:: 3.9
        Added the ``normalize`` parameter.

    .. versionchanged:: 3.6
        Added support for mongodb+srv:// URIs.

    .. versionchanged:: 3.5
        Return the original value of the ``readPreference`` MongoDB URI option
        instead of the validated read preference mode.

    .. versionchanged:: 3.1
        ``warn`` added so invalid options can be ignored.
    NÚoptions)r   ÚupdateÚ
_parse_srvr   )	ÚuriÚdefault_portÚvalidateÚwarnÚ	normalizeÚconnect_timeoutÚsrv_service_nameÚsrv_max_hostsÚresults	            úb/var/www/pod-logistic/pod-api/venv/lib/python3.12/site-packages/pymongo/asynchronous/uri_parser.pyÚ	parse_urir$   )   sn   è ø€ ôD ˜3 ¨h¸¸iÈÓW€FØ
‡M�MÜØØØØØØØØó	
÷ 		
ôô 5°V¸IÑ5FÓG€Fˆ9ÑØ€Mð		
ús   ‚1A³A´Ac              ƒ  ó  K  — | j                  t        «      rd}| t        d  }	nd}| t        d  }	t	        «       }
|	j                  d«      \  }}}d|v r|j                  d«      \  }}}n|}|r|
j                  t        ||||«      «       |€|
j                  dt        «      }d|v r|j                  d«      \  }}}n|}t        |«      }|xs |
j                  d«      }|�rt        |d ¬«      }|d	   \  }}|xs |
j                  d
«      }t        ||||«      }|j                  «       ƒ d {  –—† }|j                  «       ƒ d {  –—† }|rMt        ||||«      }t!        |«      t"        z
  rt%        d«      ‚|j'                  «       D ]  \  }}||
vsŒ||
|<   Œ |
j                  d«      r|rt)        d«      ‚|
j                  d«      r|rt)        d«      ‚d|
vrd|
vr|rdnd|
d<   nt        ||¬«      }t+        ||
«       ||
dœS 7 Œ×7 ŒÁ­w)NFTú?ú/ÚsrvServiceNameú@ÚsrvMaxHosts)r   r   ÚconnectTimeoutMSzDOnly authSource, replicaSet, and loadBalanced are supported from DNSÚloadBalancedz0You cannot specify loadBalanced with srvMaxHostsÚ
replicaSetz.You cannot specify replicaSet with srvMaxHostsÚtlsÚsslÚtrue)Únodelistr   )Ú
startswithr   r   r   r	   Ú	partitionr   r   Úgetr   Ú
rpartitionr   r   r   Ú	get_hostsÚget_optionsÚsetr   r
   Úitemsr   r   )r   r   r   r   r   r   r    r!   Úis_srvÚscheme_freer   Úhost_plus_db_partÚ_ÚoptsÚ	host_partÚhostsÚnodesÚfqdnÚportÚdns_resolverÚdns_optionsÚparsed_dns_optionsÚoptÚvals                           r#   r   r   |   s7  è ø€ ð ‡~�~”fÔØˆØœ*˜+Ð&‰àˆØœ.˜/Ð*ˆä(Ó*€Gà!,×!6Ñ!6°sÓ!;ÑÐ�q˜$Ø
ÐÑØ+×5Ñ5°cÓ:‰ˆ	�1‘aà%ˆ	áØ�‰”} T¨8°T¸9ÓEÔFØÐØ"Ÿ;™;Ð'7Ô9IÓJÐØ
ˆiÑØ×*Ñ*¨3Ó/‰ˆˆ1‰eàˆä˜Ó€EØ!Ò? W§[¡[°Ó%?€MÚÜ˜E°Ô5ˆØ˜1‘X‰
ˆˆdð *ÒL¨W¯[©[Ð9KÓ-LˆÜ# D¨/Ð;KÈ]Ó[ˆØ"×,Ñ,Ó.×.ˆØ(×4Ñ4Ó6×6ˆÙÜ!.¨{¸HÀdÈIÓ!VÐÜÐ%Ó&Ô):Ò:Ü(ØZóð ð /×4Ñ4Ó6ò '‘��SØ˜gÒ%Ø#&�G˜C’Lð'ð �;‰;�~Ô&©=ÜÐOÓPÐPØ�;‰;�|Ô$©ÜÐMÓNÐNØ˜Ñ E°Ñ$8Ù%-™T°6ˆG�EŠNä˜E°Ô=ˆä�5˜'Ô"ð Øñð ð- /øØ6ús,   ‚D)HÄ+HÄ,HÅHÅAHÆA4HÈH)r   Ústrr   úOptional[int]r   Úboolr   rK   r   rK   r   zOptional[float]r    zOptional[str]r!   rJ   Úreturnzdict[str, Any])Ú__doc__Ú
__future__r   Útypingr   r   Úurllib.parser   Ú!pymongo.asynchronous.srv_resolverr   Úpymongo.commonr   r	   Úpymongo.errorsr
   r   Úpymongo.uri_parser_sharedr   r   r   r   r   r   r   r   r   r   Ú_IS_SYNCr$   r   © ó    r#   ú<module>rX      s+  ðñ  1Ý "ç  Ý %å :ß Gß 9÷÷ ÷ ð €ð
 #/ØØØØ'+Ø&*Ø#'ðPØ	ðPàðPð ðPð ð	Pð
 ðPð %ðPð $ðPð !ðPð óPðj #/ØØØØ'+Ø&*Ø#'ðEØ	ðEàðEð ðEð ð	Eð
 ðEð %ðEð $ðEð !ðEð ôErW   