Ë
    Ã?Æi}  ã                  ón   — d Z ddlmZ ddlZddl­ ddlmZ  ej                  d«      Zd
d„Z	d
d„Z
dd	„Zy)uÁ  NIPT, NUIS (Numri i Identifikimit pÃ«r Personin e TatueshÃ«m, Albanian tax number).

The Albanian NIPT is a 10-digit number with the first and last character
being letters. The number is assigned to individuals and organisations for
tax purposes.

The first letter indicates the decade the number was assigned or date birth
date for individuals, followed by a digit for the year. The next two digits
contain the month (and gender for individuals and region for organisations)
followed by two digits for the day of the month. The remainder is a serial
followed by a check letter (check digit algorithm unknown).

More information:

* https://www.tatime.gov.al/eng/c/4/103/business-lifecycle

>>> validate('AL J 91402501 L')
'J91402501L'
>>> validate('K22218003V')
'K22218003V'
>>> validate('(AL) J 91402501')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('Z 22218003 V')
Traceback (most recent call last):
    ...
InvalidFormat: ...
é    )ÚannotationsN)Ú*)Úcleanz^[A-M][0-9]{8}[A-Z]$c                ó®   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } | j                  d«      r| dd } | S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú ÚALé   Nz(AL)é   )r   ÚupperÚstripÚ
startswith©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/al/nipt.pyÚcompactr   A   sY   € ô �6˜3Ó×%Ñ%Ó'×-Ñ-Ó/€FØ×Ñ˜ÔØ˜˜�ˆØ×Ñ˜Ô Ø˜˜�ˆØ€Mó    c                óŠ   — t        | «      } t        | «      dk7  r
t        «       ‚t        j	                  | «      s
t        «       ‚| S )zUCheck if the number is a valid VAT number. This checks the length and
    formatting.é
   )r   ÚlenÚInvalidLengthÚ_nipt_reÚmatchÚInvalidFormatr   s    r   Úvalidater   L   s:   € ô �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�>‰>˜&Ô!Ü‹oÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z*Check if the number is a valid VAT number.F)Úboolr   ÚValidationErrorr   s    r   Úis_validr   W   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡")r   ÚstrÚreturnr   )r   r   r    r   )Ú__doc__Ú
__future__r   ÚreÚstdnum.exceptionsÚstdnum.utilr   Úcompiler   r   r   r   © r   r   ú<module>r(      s:   ðñ.õ< #ã 	ä Ý ð ˆ2�:‰:Ð-Ó.€óóôr   