
    Evgk                     J    d dl Z d dlmZ d dlmZ d ed          fdZd ZdS )    N)ValidationError)gettext_lazyFz!This is not a valid IPv6 address.c           	      ^   	 t          j        t          t          j        |                               }n/# t          $ r" t	          |ddt          d          i          w xY w|r|j        rt          |j                  S |j        rdt          |j                  z  S t          |          S )a  
    Clean an IPv6 address string.

    Raise ValidationError if the address is invalid.

    Replace the longest continuous zero-sequence with "::", remove leading
    zeroes, and make sure all hextets are lowercase.

    Args:
        ip_str: A valid IPv6 address.
        unpack_ipv4: if an IPv4-mapped address is found,
        return the plain IPv4 address (default=False).
        error_message: An error message used in the ValidationError.

    Return a compressed IPv6 address or the same value.
    invalidprotocolIPv6)codeparamsz	::ffff:%s)	ipaddressIPv6Addressint
ValueErrorr   _ipv4_mappedstr)ip_strunpack_ipv4error_messageaddrs       N/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/django/utils/ipv6.pyclean_ipv6_addressr      s    &
$S)>v)F)F%G%GHH 
 
 
	:qyy2I
 
 
 	


  3t' 34#$$$		 3S!12222t99s	   36 ,A"c                 T    	 t          j        |            n# t          $ r Y dS w xY wdS )zL
    Return whether or not the `ip_str` string is a valid IPv6 address.
    FT)r   r   r   )r   s    r   is_valid_ipv6_addressr   )   sB    f%%%%   uu4s    
%%)r   django.core.exceptionsr   django.utils.translationr   r   r   r        r   <module>r      su        2 2 2 2 2 2 6 6 6 6 6 6 QQ/R-S-S   D    r   