Ë
    Ã?Æi9	  ã                  ó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	)a  CVR (Momsregistreringsnummer, Danish VAT number).

The CVR (Momsregistreringsnummer, VAT) is an 8 digit number with a
straightforward check mechanism.

>>> validate('DK 13585628')
'13585628'
>>> validate('DK 13585627')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó‚   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } | S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -.,/:ÚDKé   N)r   ÚupperÚstripÚ
startswith©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/dk/cvr.pyÚcompactr   '   s@   € ô �6˜8Ó$×*Ñ*Ó,×2Ñ2Ó4€FØ×Ñ˜ÔØ˜˜�ˆØ€Mó    c                óD   — d}t        d„ t        || «      D «       «      dz  S )zCalculate the checksum.)r	   é   é   é   é   é   r	   é   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>zchecksum.<locals>.<genexpr>3   s   è ø€ Ò;™d˜a ˆq”3�q“6�zÑ;ùs   ‚é   )ÚsumÚzip)r   Úweightss     r   Úchecksumr#   0   s$   € à&€GÜÑ;¤c¨'°6Ó&:Ô;Ó;¸bÑ@Ð@r   c                ó¶   — t        | «      } t        | «      r| d   dk(  r
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | «      dk7  r
t        «       ‚| S )úkCheck if the number provided is a valid VAT number. This checks the
    length, formatting and check digit.r   Ú0é   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr#   ÚInvalidChecksumr   s    r   Úvalidater,   6   sW   € ô �V‹_€FÜ�FÔ˜v a™y¨CÒ/Ü‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�Ó˜1ÒÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r%   F)Úboolr,   ÚValidationErrorr   s    r   Úis_validr0   C   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr1   )r   r1   r2   r   )r   r1   r2   r.   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r#   r,   r0   © r   r   ú<module>r8      s*   ðñ(õ #ä ß 'óóAó
ôr   