Ë
    Ã?ÆiN  ã                  ór   — 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d	d
ddddœZ	dd„Z
dd„Zdd„Zdd„Zy)u  CNIC number (Pakistani Computerised National Identity Card number).

The CNIC (Computerised National Identity Card, Ù‚ÙˆÙ…ÛŒ Ø´Ù†Ø§Ø®ØªÛŒ Ú©Ø§Ø±Úˆ) or SNIC
(Smart National Identity Card) is issued by by Pakistan's NADRA (National
Database and Registration Authority) to citizens of 18 years or older.

The number consists of 13 digits and encodes the person's locality (5
digits), followed by 7 digit serial number an a single digit indicating
gender.

More Information:

* https://en.wikipedia.org/wiki/CNIC_(Pakistan)
* https://www.nadra.gov.pk/identity/identity-cnic/

>>> validate('34201-0891231-8')
'3420108912318'
>>> validate('42201-0397640-8')
'4220103976408'
>>> get_gender('42201-0397640-8')
'F'
>>> get_province('42201-0397640-8')
'Sindh'
>>> format('3420108912318')
'34201-0891231-8'
é    )Ú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/pk/cnic.pyÚcompactr   7   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c                ó:   — t        | «      } | d   dv ry| d   dv ryy)z+Get the person's birth gender ('M' or 'F').éÿÿÿÿÚ13579ÚMÚ2468ÚFN)r   r
   s    r   Ú
get_genderr   =   s,   € ä�V‹_€FØˆb�z�WÑØØ	�‰�vÑ	ØØr   zKhyber PakhtunkhwaÚFATAÚPunjabÚSindhÚBalochistanÚ	IslamabadzGilgit-Baltistan)Ú1Ú2Ú3Ú4Ú5Ú6Ú7c                óH   — t        | «      } t        j                  | d   «      S )zGet the person's province.r   )r   Ú	PROVINCESÚgetr
   s    r   Úget_provincer%   S   s   € ä�V‹_€FÜ�=‰=˜ ™Ó#Ð#r   c                óÊ   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | «      s
t        «       ‚t        | «      s
t        «       ‚| S )z\Check if the number is a valid CNIC. This checks the length, formatting
    and some digits.é   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidComponentr%   r
   s    r   Úvalidater,   Y   sX   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�fÔÜÓ Ð Ü˜ÔÜÓ Ð Ø€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z$Check if the number is a valid CNIC.F)Úboolr,   ÚValidationErrorr
   s    r   Úis_validr0   h   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } dj                  | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.r   Né   é   )r   Újoinr
   s    r   Úformatr5   p   s3   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨" ¨v°b°c¨{Ð;Ó<Ð<r   N)r   ÚstrÚreturnr6   )r   r6   r7   z
str | None)r   r6   r7   r.   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r#   r%   r,   r0   r5   © r   r   ú<module>r=      sQ   ðñ,õ6 #ä ß 'ó&óð 
Ø	Ø	Ø	Ø	Ø	Ø	ñ€	ó$óóô=r   