Ë
    Ã?Æiœ	  ã                  ó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´  UTR (United Kingdom Unique Taxpayer Reference).

A UTR (unique taxpayer reference) is a 10 digit number used to identify UK
taxpayers who have to submit a tax return.

More information:

* https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/UK-TIN.pdf

>>> validate('1955839661')
'1955839661'
>>> validate('2955839661')
Traceback (most recent call last):
    ...
InvalidChecksum: ..
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óp   — t        | d«      j                  «       j                  «       j                  d«      S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú ÚK)r   ÚupperÚstripÚlstrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/gb/utr.pyÚcompactr   ,   s.   € ô �˜Ó×#Ñ#Ó%×+Ñ+Ó-×4Ñ4°SÓ9Ð9ó    c                óJ   — d}dt        d„ t        | |«      D «       «      dz     S )zyCalculate the check digit for the number. The passed number should not
    have the check digit (the first one) included.)	é   é   é   é	   é
   é   é   é   é   Ú21987654321c              3  ó>   K  — | ]  \  }}t        |«      |z  –— Œ y ­w)N)Úint)Ú.0ÚnÚws      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>6   s   è ø€ ÒI©D¨A¨qœS ›V a�ZÑIùs   ‚é   )ÚsumÚzip)r   Úweightss     r   Úcalc_check_digitr'   2   s+   € ð +€GØœÑI´C¸ÀÓ4HÔIÓIÈBÑNÑOÐOr   c                ó²   — t        | «      } t        | «      s
t        «       ‚t        | «      dk(  s
t	        «       ‚| d   t        | dd «      k7  r
t        «       ‚| S )ú#Check if the number is a valid UTR.r   r   é   N)r   r   ÚInvalidFormatÚlenÚInvalidLengthr'   ÚInvalidChecksumr   s    r   Úvalidater/   9   sU   € ä�V‹_€FÜ�FÔÜ‹oÐÜˆv‹;˜"ÒÜ‹oÐØˆa�yÔ$ V¨A¨B ZÓ0Ò0ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r)   F)Úboolr/   ÚValidationErrorr   s    r   Úis_validr3   E   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr4   )r   r4   r5   r1   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r'   r/   r3   © r   r   ú<module>r;      s*   ðñ*õ" #ä ß 'ó:óPó	ôr   