Ë
    Ã?Æ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^  NIT (NÃºmero De IdentificaciÃ³n Tributaria, Colombian identity code).

This number, also referred to as RUT (Registro Unico Tributario) is the
Colombian business tax number.

>>> validate('213.123.432-1')
'2131234321'
>>> validate('2131234325')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('2131234321')
'213.123.432-1'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óR   — t        | d«      j                  «       j                  «       S )zmConvert the number to the minimal representation. This strips
    surrounding whitespace and separation dash.z.,- )r   ÚupperÚstrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/co/nit.pyÚcompactr   ,   s#   € ô �˜Ó ×&Ñ&Ó(×.Ñ.Ó0Ð0ó    c           	     ó`   — d}t        d„ t        |t        | «      «      D «       «      dz  }d|   S )zZCalculate the check digit. The number passed should not have the
    check digit included.)é   é   é   é   é   é   é   é%   é)   é+   é/   é5   é;   éC   éG   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>6   s   è ø€ ÒB™4˜1˜aˆA”�A“�JÑBùs   ‚é   Ú01987654321)ÚsumÚzipÚreversed)r   ÚweightsÚss      r   Úcalc_check_digitr,   2   s6   € ð I€GÜÑB¤3 w´¸Ó0@Ó#AÔBÓBÀRÑG€AØ˜ÑÐr   c                óÔ   — t        | «      } dt        | «      cxk  rdk  st        «       ‚ t        «       ‚t        | «      s
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )z[Check if the number is a valid NIT. This checks the length, formatting
    and check digit.é   é   Néÿÿÿÿ)r   ÚlenÚInvalidLengthr   ÚInvalidFormatr,   ÚInvalidChecksumr
   s    r   Úvalidater5   :   sh   € ô �V‹_€FØ”�F“Ô!˜rÒ!Ü‹oÐð "Ü‹oÐÜ�FÔÜ‹oÐÜ˜˜s ˜Ó$¨¨r©
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z#Check if the number is a valid NIT.F)Úboolr5   ÚValidationErrorr
   s    r   Úis_validr9   G   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óœ   ‡ — t        ‰ «      Š dj                  ˆ fd„t        t        dt	        ‰ «       d«      «      D «       «      dz   ‰ d   z   S )z8Reformat the number to the standard presentation format.ú.c              3  ó.   •K  — | ]  }‰|d z
  | –— Œ y­w)r   N© )r!   Úir   s     €r   r$   zformat.<locals>.<genexpr>R   s    øè ø€ ò Øˆˆq�1‰u�QŒñùs   ƒr0   éýÿÿÿú-)r   Újoinr)   Úranger1   r
   s   `r   ÚformatrC   O   sR   ø€ ä�V‹_€FØ�8‰8ó Ü!)¬%°´S¸³[°LÀ"Ó*EÓ!Fôó àñà�R‰jñð r   N)r   ÚstrÚreturnrD   )r   rD   rE   r7   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r,   r5   r9   rC   r=   r   r   ú<module>rJ      s.   ðñ.õ #ä ß 'ó1óó
óôr   