
    01ii                     ~    S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr   " S S	\" S	\R                  5      \5      r
g
)z?Module containing the implementation of the URIReference class.    )
namedtuple   )compat)misc)normalizers)URIMixinc                   n   ^  \ rS rSrSrSr SU 4S jjr\R                  rS r	S r
\SS j5       rSrU =r$ )	URIReference   aU  Immutable object representing a parsed URI Reference.

.. note::

    This class is not intended to be directly instantiated by the user.

This object exposes attributes for the following components of a
URI:

- scheme
- authority
- path
- query
- fragment

.. attribute:: scheme

    The scheme that was parsed for the URI Reference. For example,
    ``http``, ``https``, ``smtp``, ``imap``, etc.

.. attribute:: authority

    Component of the URI that contains the user information, host,
    and port sub-components. For example,
    ``google.com``, ``127.0.0.1:5000``, ``username@[::1]``,
    ``username:password@example.com:443``, etc.

.. attribute:: path

    The path that was parsed for the given URI Reference. For example,
    ``/``, ``/index.php``, etc.

.. attribute:: query

    The query component for a given URI Reference. For example, ``a=b``,
    ``a=b%20c``, ``a=b+c``, ``a=b,c=d,e=%20f``, etc.

.. attribute:: fragment

    The fragment component of a URI. For example, ``section-3.1``.

This class also provides extra attributes for easier access to information
like the subcomponents of the authority component.

.. attribute:: userinfo

    The user information parsed from the authority.

.. attribute:: host

    The hostname, IPv4, or IPv6 address parsed from the authority.

.. attribute:: port

    The port parsed from the authority.
 c                 z   > [         [        U ]  U U=(       d    SU=(       d    SU=(       d    SUU5      nXgl        U$ )zCreate a new URIReference.N)superr
   __new__encoding)	clsscheme	authoritypathqueryfragmentr   ref	__class__s	           E/home/james-whalen/.local/lib/python3.13/site-packages/rfc3986/uri.pyr   URIReference.__new__U   sA     L#.NdLD
  
    c                 p   Un[        U[        5      (       a	  [        U6 nO+[        U[        5      (       d   [        R                  U5      n[        U 5      [        U5      :H  nU=(       d    U R                  U5      $ ! [         a.    [	        SR                  [        U5      R                  5      5      ef = f)z"Compare this reference to another.z)Unable to compare URIReference() to {0}())	
isinstancetupler
   from_string	TypeErrorformattype__name__normalized_equality)selfother	other_refnaive_equalitys       r   __eq__URIReference.__eq__f   s    	eU##$e,IE<00(44U;	 ti(88D!9!9)!DD  ?FFU,, s   A= =8B5c           	         [        [        R                  " U R                  =(       d    S5      [        R                  " U R
                  U R                  U R                  45      [        R                  " U R                  =(       d    S5      [        R                  " U R                  5      [        R                  " U R                  5      U R                  5      $ )zNormalize this reference as described in Section 6.2.2.

This is not an in-place normalization. Instead this creates a new
URIReference.

:returns: A new reference object with normalized components.
:rtype: URIReference
 )r
   r   normalize_schemer   normalize_authorityuserinfohostportnormalize_pathr   normalize_queryr   normalize_fragmentr   r   )r%   s    r   	normalizeURIReference.normalizey   s     (():;++		4995 &&tyyB7''

3**4==9MM	
 		
r   c           
      >   [         R                  " X5      n[        R                  R	                  U5      R                  5       nU " US   US   [        R                  " US   U5      [        R                  " US   U5      [        R                  " US   U5      U5      $ )zParse a URI reference from the given unicode URI string.

:param str uri_string: Unicode URI to be parsed into a reference.
:param str encoding: The encoding of the string provided
:returns: :class:`URIReference` or subclass thereof
r   r   r   r   r   )r   to_strr   URI_MATCHERmatch	groupdictr   encode_component)r   
uri_stringr   	split_uris       r   r   URIReference.from_string   s     ]]:8
$$**:6@@B	hk"((6):HE((7);XF((:)>I
 	
r   )zutf-8)r#   
__module____qualname____firstlineno____doc__slotsr   r   __hash__r)   r5   classmethodr   __static_attributes____classcell__)r   s   @r   r
   r
      sF    7r E AH ~~HE&
, 
 
r   r
   N)rC   collectionsr   r,   r   r   r   _mixinr   URI_COMPONENTSr
   r   r   r   <module>rL      s6    E  #    H
:nd.A.ABH H
r   