Ë
    Ã?Æiu  ã                  ó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
)aý  BSN (Burgerservicenummer, the Dutch citizen identification number).

The BSN is a unique personal identifier and has been introduced as the
successor to the sofinummer. It is issued to each Dutch national. The number
consists of up to nine digits (the leading zeros are commonly omitted) and
contains a simple checksum.

More information:

* https://en.wikipedia.org/wiki/National_identification_number#Netherlands
* https://nl.wikipedia.org/wiki/Burgerservicenummer
* https://www.burgerservicenummer.nl/

>>> validate('1112.22.333')
'111222333'
>>> validate('1112.52.333')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('1112223334')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('111222333')
'1112.22.333'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óT   — t        | d«      j                  «       j                  d«      S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -.é	   )r   ÚstripÚzfill©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/nl/bsn.pyÚcompactr   5   s%   € ô �˜Ó×%Ñ%Ó'×-Ñ-¨aÓ0Ð0ó    c                ób   — t        d„ t        | dd «      D «       «      t        | d   «      z
  dz  S )zWCalculate the checksum over the number. A valid number should have
    a checksum of 0.c              3  óD   K  — | ]  \  }}d |z
  t        |«      z  –— Œ y­w)r   N)Úint)Ú.0ÚiÚns      r   ú	<genexpr>zchecksum.<locals>.<genexpr>>   s!   è ø€ ÒD¡T Q¨��Q‘œ#˜a›&Õ ÑDùs   ‚ Néÿÿÿÿé   )ÚsumÚ	enumerater   r   s    r   Úchecksumr   ;   s:   € ô ÑD¬Y°v¸c¸r°{Ó-CÔDÓDÜ��r‘
‹OñØ!ñ"ð "r   c                óÂ   — t        | «      } t        | «      rt        | «      dk  r
t        «       ‚t	        | «      dk7  r
t        «       ‚t        | «      dk7  r
t        «       ‚| S )zfCheck if the number is a valid BSN. This checks the length and whether
    the check digit is correct.r   r   )r   r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr   s    r   Úvalidater!   B   sW   € ô �V‹_€FÜ�FÔœs 6›{¨aÒ/Ü‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�Ó˜1ÒÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z#Check if the number is a valid BSN.F)Úboolr!   ÚValidationErrorr   s    r   Úis_validr%   O   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óF   — t        | «      } | dd dz   | dd z   dz   | dd z   S )z?Reformat the passed number to the standard presentation format.Né   ú.é   )r   r   s    r   Úformatr*   W   s7   € ä�V‹_€FØ�"�1ˆ:˜Ñ˜f Q q˜kÑ)¨CÑ/°&¸¸°*Ñ<Ð<r   N)r   ÚstrÚreturnr+   )r   r+   r,   r   )r   r+   r,   r#   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r!   r%   r*   © r   r   ú<module>r2      s.   ðñ(õ6 #ä ß 'ó1ó"ó
óô=r   