Ë
    Ã?Æi  ã                  óV   — 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
dd	„Zy
)ué  NUIT (NÃºmero Ãšnico de IdentificaÃ§Ã£o Tributaria, Mozambique tax number).

This number consists of 9 digits, sometimes separated in three groups of three
digits using whitespace to make it easier to read.

The first digit indicates the type of entity. The next seven digits are a
sequential number. The last digit is the check digit, which is used to verify
the number was correctly typed.

More information:

* https://www.mobilize.org.mz/nuit-numero-unico-de-identificacao-tributaria/
* https://www.at.gov.mz/por/Perguntas-Frequentes2/NUIT

>>> validate('400339910')
'400339910'
>>> validate('400 005 834')
'400005834'
>>> validate('12345')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('400339910')
'400 339 910'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )z1Convert the number to the minimal representation.z -.)r   Ústrip©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/mz/nuit.pyÚcompactr   6   s   € ä�˜Ó×%Ñ%Ó'Ð'ó    c                óN   — d}t        d„ t        || «      D «       «      dz  }d|   S )zCalculate the check digit.)é   é	   é   é   é   é   r   r   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>>   s   è ø€ Ò<™t˜q !�”C˜“F•
Ñ<ùs   ‚é   Ú01234567891)ÚsumÚzip)r
   ÚweightsÚchecks      r   Úcalc_check_digitr!   ;   s.   € à&€GÜÑ<¤s¨7°FÓ';Ô<Ó<¸rÑA€EØ˜ÑÐr   c                ó²   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )ú6Check if the number is a valid Mozambique NUIT number.r   Néÿÿÿÿ)r   ÚlenÚInvalidLengthr   ÚInvalidFormatr!   ÚInvalidChecksumr	   s    r   Úvalidater)   B   sT   € ä�V‹_€FÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�FÔÜ‹oÐÜ˜˜s ˜Ó$¨¨r©
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r#   F)Úboolr)   ÚValidationErrorr	   s    r   Úis_validr-   N   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } dj                  | dd | dd | dd g«      S )z8Reformat the number to the standard presentation format.ú Né   éýÿÿÿ)r   Újoinr	   s    r   Úformatr3   V   s3   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨" ¨v°b°c¨{Ð;Ó<Ð<r   N)r
   ÚstrÚreturnr4   )r
   r4   r5   r+   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r!   r)   r-   r3   © r   r   ú<module>r;      s.   ðñ,õ4 #ä ß 'ó(ó
 ó	óô=r   