Ë
    Ã?Æ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Ö  Ð Ð�ÐžÐšÐŸÐŸ, RNTRC (Individual taxpayer registration number in Ukraine).

The Ð Ð�ÐžÐšÐŸÐŸ (Ð ÐµÑ”Ñ�Ñ‚Ñ€Ð°Ñ†Ñ–Ð¹Ð½Ð¸Ð¹ Ð½Ð¾Ð¼ÐµÑ€ Ð¾Ð±Ð»Ñ–ÐºÐ¾Ð²Ð¾Ñ— ÐºÐ°Ñ€Ñ‚ÐºÐ¸ Ð¿Ð»Ð°Ñ‚Ð½Ð¸ÐºÐ° Ð¿Ð¾Ð´Ð°Ñ‚ÐºÑ–Ð²,
registration number of the taxpayer's registration card) is a unique
identification number that is provided to individuals within Ukraine. The
number consists of 10 digits, the last being a check digit.

More information:

* https://uk.wikipedia.org/wiki/Ð Ð�ÐžÐšÐŸÐŸ

>>> validate('1759013776')
'1759013776'
>>> validate('1759013770')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('12345')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format(' 25 30 41 40 71 ')
'2530414071'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )z1Convert the number to the minimal representation.ú )r   Ústrip©Únumbers    úV/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ua/rntrc.pyÚcompactr   4   s   € ä�˜Ó×#Ñ#Ó%Ð%ó    c                ó`   — d}t        d„ t        || «      D «       «      }t        |dz  dz  «      S )z%Calculate the check digit for number.)	éÿÿÿÿé   é   é	   é   é   é
   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   ‚é   r   )ÚsumÚzipÚstr)r   ÚweightsÚtotals      r   Úcalc_check_digitr#   9   s2   € à+€GÜÑ<¤s¨7°FÓ';Ô<Ó<€EÜ�˜‘
˜bÑ Ó!Ð!r   c                ó¬   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚| d   t        | «      k7  r
t        «       ‚| S )u�   Check if the number is a valid Ukraine RNTRC (Ð Ð�ÐžÐšÐŸÐŸ) number.

    This checks the length, formatting and check digit.
    r   r   )r   ÚlenÚInvalidLengthr   ÚInvalidFormatr#   ÚInvalidChecksumr
   s    r   Úvalidater)   @   sQ   € ô
 �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐØˆb�zÔ% fÓ-Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)uC   Check if the number is a valid Ukraine RNTRC (Ð Ð�ÐžÐšÐŸÐŸ) number.F)Úboolr)   ÚValidationErrorr
   s    r   Úis_validr-   O   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó   — t        | «      S )z8Reformat the number to the standard presentation format.)r   r
   s    r   Úformatr/   W   s   € ä�6‹?Ðr   N)r   r    Úreturnr    )r   r    r0   r+   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r#   r)   r-   r/   © r   r   ú<module>r6      s.   ðñ*õ2 #ä ß 'ó&ó
"óóôr   