Ë
    Ã?ÆiÉ  ã                  óŠ   — d Z ddlmZ ddlZddlZddl­ ddlmZ  ej                  d«      Z	dZ
dd„Zdd	„Zdd
„Zdd„Zdd„Zy)a  ID number (Mauritian national identifier).

The Mauritian national ID number is a unique 14 alphanumeric identifier
assigned at birth to identify individuals. It is displayed on the National
Identity Card.

The number consists of one alphabetic character and thirteen digits:

* the first character of the person's surname at birth
* 2 digits for day of birth
* 2 digits for month of birth
* 2 digits for year of birth
* 6 digit unique id
* a check digit

More information:

* https://mnis.govmu.org/English/ID%20Card/Pages/default.aspx
é    )ÚannotationsN)Ú*)Úcleanz^[A-Z][0-9]+[0-9A-Z]$Ú$0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZc                óR   — t        | d«      j                  «       j                  «       S )zmConvert the number to the minimal representation. This strips
    surrounding whitespace and separation dash.ú )r   ÚupperÚstrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/mu/nid.pyÚcompactr   9   s#   € ô �˜Ó×#Ñ#Ó%×+Ñ+Ó-Ð-ó    c                ó\   — t        d„ t        | dd «      D «       «      }t        d|z
  dz     S )z)Calculate the check digit for the number.c              3  óX   K  — | ]"  \  }}d |z
  t         j                  |«      z  –— Œ$ y­w)é   N)Ú	_alphabetÚindex)Ú.0ÚiÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>A   s.   è ø€ ò 4Ù�A�qð �a‘œ9Ÿ?™?¨1Ó-Õ-ñ 4ùs   ‚(*Né   é   )ÚsumÚ	enumerater   )r   Úchecks     r   Úcalc_check_digitr   ?   s8   € äñ 4Ü% f¨S¨b kÓ2ô4ó 4€Eä�b˜5‘j BÑ&Ñ'Ð'r   c                óº   — t        | dd «      }t        | dd «      }t        | dd «      }	 t        j                  |dz   ||«      S # t        $ r t	        «       ‚w xY w)zrConvert the part of the number that represents a date into a
    datetime. Note that the century may be incorrect.é   é   é   é   iÐ  )ÚintÚdatetimeÚdateÚ
ValueErrorÚInvalidComponent)r   ÚdayÚmonthÚyears       r   Ú	_get_dater,   F   sh   € ô ˆf�Q�qˆkÓ
€CÜ��q˜�Ó€EÜˆv�a˜ˆ{Ó€Dð!Ü�}‰}˜T D™[¨%°Ó5Ð5øÜò !ÜÓ Ð ð!ús   ¬A ÁAc                óÖ   — t        | «      } t        | «      dk7  r
t        «       ‚t        j	                  | «      s
t        «       ‚t        | «      | d   k7  r
t        «       ‚t        | «       | S )z)Check if the number is a valid ID number.r   éÿÿÿÿ)	r   ÚlenÚInvalidLengthÚ_nid_reÚmatchÚInvalidFormatr   ÚInvalidChecksumr,   r   s    r   Úvalidater5   R   sZ   € ä�V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�=‰=˜Ô Ü‹oÐÜ˜Ó 6¨"¡:Ò-ÜÓÐÜˆfÔØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z,Check if the number provided is a valid RFC.F)Úboolr5   ÚValidationErrorr   s    r   Úis_validr9   _   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡")r   ÚstrÚreturnr:   )r   r:   r;   zdatetime.date)r   r:   r;   r7   )Ú__doc__Ú
__future__r   r%   ÚreÚstdnum.exceptionsÚstdnum.utilr   Úcompiler1   r   r   r   r,   r5   r9   © r   r   ú<module>rC      sN   ðñ*õ( #ã Û 	ä Ý ð ˆ"�*‰*Ð,Ó
-€ð 3€	ó.ó(ó	!ó
ôr   