Ë
    Ã?Æix
  ã                  ó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	)u,  VKN (Vergi Kimlik NumarasÄ±, Turkish tax identification number).

The Vergi Kimlik NumarasÄ± is the Turkish tax identification number used for
businesses. The number consists of 10 digits where the first digit is derived
from the company name.

More information:

* https://www.turkiye.gov.tr/gib-intvrg-vergi-kimlik-numarasi-dogrulama

>>> validate('4540536920')
'4540536920'
>>> validate('4540536921')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('454053692')
Traceback (most recent call last):
    ...
InvalidLength: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó4   — t        | «      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    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/tr/vkn.pyÚcompactr   1   s   € ô �‹=×ÑÓ Ð ó    c                ó¸   — d}t        t        | dd «      d«      D ]-  \  }}t        |«      |z   dz  }|sŒ|d|z  z  dz  xs d}||z  }Œ/ t        d|z
  dz  «      S )z3Calculate the check digit for the specified number.r   Né	   é   é
   é   )Ú	enumerateÚreversedÚintÚstr)r
   ÚsÚiÚnÚc1Úc2s         r   Úcalc_check_digitr   7   sv   € à	€AÜœ( 6¨"¨1 :Ó.°Ó2ò ‰ˆˆ1Ü�!‹f�q‰j˜BÑˆÚØ˜˜Q™‘- 1Ñ$Ò)¨ˆBØ�‰G‰Að	ô
 ��Q‘˜"‰}ÓÐr   c                ó¬   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | «      | d   k7  r
t        «       ‚| S )õc   Check if the number is a valid Vergi Kimlik NumarasÄ±. This checks the
    length and check digits.r   éÿÿÿÿ)r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr	   s    r   Úvalidater$   B   sP   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ˜Ó 6¨"¡:Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr$   ÚValidationErrorr	   s    r   Úis_validr(   O   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>r/      s)   ðñ*õ, #ä ß 'ó!óó
ôr   