Ë
    Ã?ÆiÄ  ã                  óf   — d Z ddlmZ ddlmZ ddl­ ddlmZ ddlm	Z	m
Z
 dd„Zdd„Zdd	„Zdd
„Zy)aÞ  IdNr (Steuerliche Identifikationsnummer, German personal tax number).

The IdNr (or Steuer-IdNr) is a personal identification number that is
assigned to individuals in Germany for tax purposes and is meant to replace
the Steuernummer. The number consists of 11 digits and does not embed any
personal information.

More information:

* https://de.wikipedia.org/wiki/Steuerliche_Identifikationsnummer
* http://www.identifikationsmerkmal.de/

>>> validate('36 574 261 809')
'36574261809'
>>> validate('36574261890')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('36554266806')  # more digits repeated
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> format('36574261809')
'36 574 261 809'
é    )Úannotations)Údefaultdict)Ú*)Ú	mod_11_10)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -./,)r   Ústrip©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/de/idnr.pyÚcompactr   9   s   € ô �˜Ó!×'Ñ'Ó)Ð)ó    c                ó¬  — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚| j                  d«      r
t	        «       ‚t        t        «      }| dd D ]  }||xx   dz  cc<   Œ |j                  «       D �cg c]
  }|dkD  sŒ	|‘Œ }}t        |«      dk7  s|d   dvr
t	        «       ‚t        j                  | «      S c c}w )úzCheck if the number provided is a valid tax identification number.
    This checks the length, formatting and check digit.é   Ú0Né
   é   r   )é   é   )r   ÚlenÚInvalidLengthr   ÚInvalidFormatÚ
startswithr   ÚintÚvaluesr   Úvalidate)r   ÚcounterÚnÚcÚcountss        r   r   r   ?   sÊ   € ô �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐØ×Ñ˜ÔÜ‹oÐô *¬#Ó.€GØ�C�Rˆ[ò ˆØ�‹
�a‰Œ
ðà Ÿ™Ó)Ö3�A¨Q°«UŠaÐ3€FÐ3Ü
ˆ6ƒ{�aÒ˜6 !™9¨FÑ2Ü‹oÐÜ×Ñ˜fÓ%Ð%ùò 4s   Â
CÂCc                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   ÚValidationErrorr   s    r   Úis_validr&   T   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óZ   — t        | «      } dj                  | dd | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.ú Nr   é   é   )r   Újoinr   s    r   Úformatr,   ]   s;   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨! ¨f°Q°q¨k¸6À!À"¸:ÐFÓGÐGr   N)r   ÚstrÚreturnr-   )r   r-   r.   r$   )Ú__doc__Ú
__future__r   Úcollectionsr   Ústdnum.exceptionsÚstdnum.iso7064r   Ústdnum.utilr   r   r   r   r&   r,   © r   r   ú<module>r6      s0   ðñ,õ4 #å #ä Ý $ß 'ó*ó&ó*ôHr   