Ë
    Ã?Æi  ã                  óˆ   — d Z ddlmZ ddl­ ddlmZmZ  e edd«      «      Z	dd„Z
dd„Zdd	„Zdd
„Z	 	 d	 	 	 	 	 	 	 dd„Zy)u
  Ð£Ð�ÐŸ, UNP (Ð£Ñ‡ÐµÑ‚Ð½Ñ‹Ð¹ Ð½Ð¾Ð¼ÐµÑ€ Ð¿Ð»Ð°Ñ‚ÐµÐ»ÑŒÑ‰Ð¸ÐºÐ°, the Belarus VAT number).

The Ð£Ð�ÐŸ (UNP) or Ð£Ñ‡ÐµÑ‚Ð½Ñ‹Ð¹ Ð½Ð¾Ð¼ÐµÑ€ Ð¿Ð»Ð°Ñ‚ÐµÐ»ÑŒÑ‰Ð¸ÐºÐ° (Uchetniy nomer platel'shika,
Payer account number) is issued to organisations and individuals for tax
purposes. The number consists of 9 digits (numeric for organisations,
alphanumeric for individuals) and contains a region identifier, a serial per
region and a check digit.

More information:

* https://be.wikipedia.org/wiki/Ð£Ð»Ñ–ÐºÐ¾Ð²Ñ‹_Ð½ÑƒÐ¼Ð°Ñ€_Ð¿Ð»Ð°Ñ†ÐµÐ»ÑŒÑˆÑ‡Ñ‹ÐºÐ°
* http://pravo.levonevsky.org/bazaby09/sbor37/text37892/index3.htm

>>> validate('200988541')
'200988541'
>>> validate('Ð£Ð�ÐŸ MA1953684')
'MA1953684'
>>> validate('200988542')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsu   Ð�Ð’Ð•ÐšÐœÐ�ÐžÐ Ð¡Ð¢Ú
ABEKMHOPCTc                óÐ   — t        | d«      j                  «       j                  «       } dD ]"  }| j                  |«      sŒ| t	        |«      d } Œ$ dj                  d„ | D «       «      S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú )u   Ð£Ð�ÐŸÚUNPNÚ c              3  óH   K  — | ]  }t         j                  ||«      –— Œ y ­w©N)Ú_cyrillic_to_latinÚget©Ú.0Úxs     úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/by/unp.pyú	<genexpr>zcompact.<locals>.<genexpr>A   s   è ø€ Ò@°AÔ%×)Ñ)¨!¨Q×/Ñ@ùs   ‚ ")r   ÚupperÚstripÚ
startswithÚlenÚjoin)ÚnumberÚprefixs     r   Úcompactr   9   sf   € ô �6˜3Ó×%Ñ%Ó'×-Ñ-Ó/€FØ#ò *ˆØ×Ñ˜VÕ$ØœC ›K˜LÐ)‰Fð*ð �7‰7Ñ@¸Ô@Ó@Ð@ó    c                ó   ‡— t        | «      } dŠd}t        | «      s)| d   t        dj                  | d   «      «      z   | dd z   } t	        ˆfd„t        || «      D «       «      d	z  }|d
kD  r
t        «       ‚t        |«      S )z)Calculate the check digit for the number.Ú$0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ)é   é   é   é   é   é   é   é   r   Ú
ABCEHKMOPTé   é   Nc              3  óL   •K  — | ]  \  }}|‰j                  |«      z  –— Œ y ­wr   )Úindex)r   ÚwÚnÚalphabets      €r   r   z#calc_check_digit.<locals>.<genexpr>K   s#   øè ø€ ÒC¡d a¨ˆA�—‘˜qÓ!Õ!ÑCùs   ƒ!$é   é	   )r   r   Ústrr,   ÚsumÚzipÚInvalidChecksum)r   ÚweightsÚcr/   s      @r   Úcalc_check_digitr8   D   s€   ø€ ä�V‹_€FØ5€HØ+€GÜ�FÔØ˜‘œS ×!3Ñ!3°F¸1±IÓ!>Ó?Ñ?À&ÈÈÀ*ÑLˆÜÓC¬c°'¸6Ó.BÔCÓCÀbÑH€AØˆ1‚uÜÓÐÜˆq‹6€Mr   c                ó.  — t        | «      } t        | «      dk7  r
t        «       ‚t        | dd «      s
t	        «       ‚t        | dd «      st        d„ | dd D «       «      s
t	        «       ‚| d   dvr
t        «       ‚| d   t        | «      k7  r
t        «       ‚| S )z^Check if the number is a valid number. This checks the length,
    formatting and check digit.r1   r*   Nc              3  ó$   K  — | ]  }|d v –— Œ
 y­w)r(   N© r   s     r   r   zvalidate.<locals>.<genexpr>Y   s   è ø€ Ò+RÀ!¨A°Ô,=Ñ+Rùs   ‚r   Ú1234567ABCEHKMéÿÿÿÿ)	r   r   ÚInvalidLengthr   ÚInvalidFormatÚallÚInvalidComponentr8   r5   ©r   s    r   ÚvalidaterC   Q   s–   € ô �V‹_€FÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�F˜1˜2�JÔÜ‹oÐÜ�F˜2˜A�JÔ¬Ñ+RÀvÈbÈqÀzÔ+RÔ(RÜ‹oÐØˆa�yÐ(Ñ(ÜÓ Ð Øˆb�zÔ% fÓ-Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z&Check if the number is a valid number.F)ÚboolrC   ÚValidationErrorrB   s    r   Úis_validrG   b   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó¦   — ddl }|j                  dt        | «      dddœ||¬«      }|j                  r|j                  r|j                  «       d   S y)	aç  Retrieve registration information from the portal.nalog.gov.by web site.

    The `timeout` argument specifies the network timeout in seconds.

    The `verify` argument is either a boolean that determines whether the
    server's certificate is validate or a string which must be a path the CA
    certificate bundle to use for verification.

    This basically returns the JSON response from the web service as a dict.
    Will return ``None`` if the number is invalid or unknown.
    r   Nz+https://www.portal.nalog.gov.by/grp/getDatazUTF-8Újson)ÚunpÚcharsetÚtype)ÚparamsÚtimeoutÚverifyÚrow)Úrequestsr   r   ÚokÚcontentrI   )r   rN   rO   rQ   Úresponses        r   Úcheck_nalogrU   j   s\   € ó( Ø�|‰|Ø5ä˜6“?ØØñð Øð ó €Hð ‡{‚{�x×'Ò'Ø�}‰}‹˜uÑ%Ð%Ør   N)r   r2   Úreturnr2   )r   r2   rV   rE   )é   T)r   r2   rN   ÚfloatrO   z
bool | strrV   zdict[str, str | None] | None)Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   Údictr4   r   r   r8   rC   rG   rU   r;   r   r   ú<module>r^      su   ðñ*õ. #ä ß 'ñ ™#ØØóó Ð óAó
óó"ð ØðØðàðð ðð "ô	r   