Ë
    Ã?Æim  ã                  ó^   — d Z ddlmZ ddl­ ddlmZmZ dd„Zdddd	d
dœZdd„Z	dd„Z
dd„Zy)uÓ  RIF (Registro de IdentificaciÃ³n Fiscal, Venezuelan VAT number).

The Registro de IdentificaciÃ³n Fiscal (RIF) is the Venezuelan fiscal
registration number. The number consists of 10 digits where the first digit
denotes the type of number (person, company or government) and the last digit
is a check digit.

>>> validate('V-11470283-4')
'V114702834'
>>> validate('V-11470283-3')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óR   — t        | d«      j                  «       j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -)r   ÚupperÚstrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ve/rif.pyÚcompactr   *   s#   € ô �˜Ó×$Ñ$Ó&×,Ñ,Ó.Ð.ó    é   é   é   é   é   )ÚVÚEÚJÚPÚGc           
     óˆ   — t        | «      } d}t        | d      }|t        d„ t        || dd «      D «       «      z  }d|dz     S )z&Calculate the check digit for the RIF.)é   é   é   é   é   r   r   r   r   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>@   s   è ø€ Ò>™D˜A˜qˆQ”�Q“�ZÑ>ùs   ‚é   é	   Ú00987654321é   )r   Ú_company_typesÚsumÚzip)r   ÚweightsÚcs      r   Úcalc_check_digitr.   ;   sO   € ä�V‹_€FØ&€GÜ�v˜a‘yÑ!€AØŒÑ>¤C¨°¸¸!°Ó$=Ô>Ó	>Ñ>€AØ˜˜R™Ñ Ð r   c                óÜ   — t        | «      } t        | «      dk7  r
t        «       ‚| d   t        vr
t	        «       ‚t        | dd «      s
t        «       ‚| d   t        | «      k7  r
t        «       ‚| S )údCheck if the number provided is a valid RIF. This checks the length,
    formatting and check digit.é
   r   r%   Néÿÿÿÿ)	r   ÚlenÚInvalidLengthr)   ÚInvalidComponentr   ÚInvalidFormatr.   ÚInvalidChecksumr
   s    r   Úvalidater8   D   sl   € ô �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐØˆa�yœÑ&ÜÓ Ð Ü�F˜1˜2�JÔÜ‹oÐØˆb�zÔ% fÓ-Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r0   F)Úboolr8   ÚValidationErrorr
   s    r   Úis_validr<   S   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr=   )r   r=   r>   r:   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r)   r.   r8   r<   © r   r   ú<module>rD      sA   ðñ*õ #ä ß 'ó/ð 
Ø	
Ø	Ø	Ø	ñ€ó!óôr   