Ë
    Ã?ÆiØ	  ã                  óN   — d Z ddlmZ ddl­ ddlmZmZ d
d„Zd
d„Zd
d„Z	dd„Z
y	)aõ  IDNO (Moldavian company identification number).

The IDNO is used in Moldavia as unique identifier for legal entities. The
number consists of 13 digits. The first digit identifies the registry,
followed by three digits for the year the code was assigned. The number ends
with five identifier digits and a check digit.

More information:

* https://www.idno.md

>>> validate('1008600038413')
'1008600038413'
>>> validate('1008600038412')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú )r   Ústrip©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/md/idno.pyÚcompactr   .   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c           	     óV   — d}t        t        d„ t        || «      D «       «      dz  «      S )zCalculate the check digit.)é   é   é   r   r   r   r   r   r   r   r   r   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>7   s   è ø€ Ò?¡$ ! Q�1”s˜1“v•:Ñ?ùs   ‚é
   )ÚstrÚsumÚzip)r   Úweightss     r   Úcalc_check_digitr   4   s)   € à2€GÜŒsÑ?¬#¨g°vÓ*>Ô?Ó?À"ÑDÓEÐEr   c                ó¬   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚| d   t        | «      k7  r
t        «       ‚| S )ú^Check if the number provided is valid. This checks the length,
    formatting and check digit.é   éÿÿÿÿ)r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr
   s    r   Úvalidater'   :   sQ   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐØˆb�zÔ% fÓ-Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r    F)Úboolr'   ÚValidationErrorr
   s    r   Úis_validr+   G   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   r   Úreturnr   )r   r   r,   r)   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r'   r+   © r   r   ú<module>r2      s*   ðñ*õ& #ä ß 'ó&óFó
ôr   