Ë
    Ã?Æi³  ã                  ób   — d Z ddlmZ ddl­ ddlmZ ddlmZ dZdd„Z	dd„Z
dd	„Zdd
„Zdd„Zy)aÄ  SEPA Identifier of the Creditor (AT-02).

This identifier is indicated in the ISO 20022 data element `Creditor Scheme
Identification`. The creditor can be a legal entity, or an association that
is not a legal entity, or a person.

The first two digits contain the ISO country code, the next two are check
digits for the ISO 7064 Mod 97, 10 checksum, the next tree contain the
Creditor Business Code (or `ZZZ` if no business code used) and the remainder
contains the country-specific identifier.

>>> validate('ES 23 ZZZ 47690558N')
'ES23ZZZ47690558N'
>>> validate('ES2300047690558N')
'ES2300047690558N'
>>> compact('ES++()+23ZZZ4//7690558N')
'ES23ZZZ47690558N'
>>> calc_check_digits('ESXXZZZ47690558N')
'23'
é    )Úannotations)Ú*)Ú	mod_97_10)ÚcleanÚ$0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZc                óR   — t        | d«      j                  «       j                  «       S )zŠConvert the AT-02 number to the minimal representation. This strips
    the number of any valid separators and removes invalid characters.z -/?:().m'+")r   ÚstripÚupper©Únumbers    úV/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/eu/at_02.pyÚcompactr   4   s#   € ô �˜Ó)×/Ñ/Ó1×7Ñ7Ó9Ð9ó    c                óD   — dj                  d„ | dd | dd z   D «       «      S )zÇPrepare the number to its base10 representation so it can be checked
    with the ISO 7064 Mod 97, 10 algorithm. That means excluding positions 5
    to 7 and moving the first four digits to the end.Ú c              3  óX   K  — | ]"  }t        t        j                  |«      «      –— Œ$ y ­w)N)ÚstrÚ	_alphabetÚindex)Ú.0Úxs     r   ú	<genexpr>z_to_base10.<locals>.<genexpr>>   s   è ø€ ÒL¨q”3”y—‘ qÓ)×*ÑLùs   ‚(*é   Né   )Újoinr   s    r   Ú
_to_base10r   :   s*   € ð �7‰7ÑL°F¸1¸2°JÀÈÈÀÑ4KÔLÓLÐLr   c                óŒ   — t        | «      } 	 t        | «      }t	        j
                  |«       | S # t        $ r t        «       ‚w xY w)ú.Check if the number provided is a valid AT-02.)r   r   Ú	ExceptionÚInvalidFormatr   Úvalidate)r   Útest_numbers     r   r!   r!   A   sH   € ä�V‹_€FðÜ  Ó(ˆô ×Ñ�{Ô#Ø€Møô	 ò Ü‹oÐðús	   �/ ¯Ac                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr!   ÚValidationErrorr   s    r   Úis_validr&   M   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óŽ   — t        | «      } dj                  | dd d| dd f«      } t        j                  t	        | «      dd «      S )z‚Calculate the check digits that should be put in the number to make it
    valid. Check digits in the supplied number are ignored.r   Né   Ú00r   éþÿÿÿ)r   r   r   Úcalc_check_digitsr   r   s    r   r+   r+   U   sK   € ô �V‹_€Fà�W‰W�f˜R˜a�j $¨¨q¨r¨
Ð3Ó4€FÜ×&Ñ&¤z°&Ó'9¸#¸2Ð'>Ó?Ð?r   N)r   r   Úreturnr   )r   r   r,   r$   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.iso7064r   Ústdnum.utilr   r   r   r   r!   r&   r+   © r   r   ú<module>r3      s:   ðñ(õ* #ä Ý $Ý ð 3€	ó:óMó	óô@r   