Ë
    Ã?Æi  ã                  ój   — d Z ddlm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dd„Zy)a–  Konto nr. (Norwegian bank account number)

Konto nr. is the country-specific part in Norwegian IBAN codes. The number
consists of 11 digits, the first 4 are the bank identifier and the last is a
check digit. This module does not check if the bank identifier exists.

More information:

* https://www.ecbs.org/iban/norway-bank-account-number.html

>>> validate('8601 11 17947')
'86011117947'
>>> validate('0000.4090403')  # postgiro bank code
'4090403'
>>> validate('8601 11 17949')  # invalid check digits
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('86011117947')
'8601.11.17947'
>>> to_iban('8601 11 17947')
'NO93 8601 11 17947'
é    )Úannotations)Úluhn)Ú*)ÚcleanÚisdigitsc                óf   — t        | d«      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 .-Ú0000é   N)r   ÚstripÚ
startswith©Únumbers    úX/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/no/kontonr.pyÚcompactr   4   s7   € ô �6˜5Ó!×'Ñ'Ó)€FØ×Ñ˜Ô Ø˜˜�ˆØ€Mó    c           	     óV   — d}t        t        d„ t        || «      D «       «      dz  «      S )z2Calculate the check digit for the 11-digit number.)
é   é   é   é	   r
   é   r   r   r   r   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z$_calc_check_digit.<locals>.<genexpr>@   s   è ø€ Ò?¡$ ! Q�1”s˜1“v•:Ñ?ùs   ‚é   )ÚstrÚsumÚzip)r   Úweightss     r   Ú_calc_check_digitr#   =   s)   € à,€GÜŒsÑ?¬#¨g°vÓ*>Ô?Ó?À"ÑDÓEÐEr   c                óö   — t        | «      } t        | «      s
t        «       ‚t        | «      dk(  rt	        j
                  | «       | S t        | «      dk(  rt        | «      | d   k7  r
t        «       ‚| S t        «       ‚)ú<Check if the number provided is a valid bank account number.r   r   éÿÿÿÿ)	r   r   ÚInvalidFormatÚlenr   Úvalidater#   ÚInvalidChecksumÚInvalidLengthr   s    r   r)   r)   C   ss   € ä�V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�aÒÜ�‰�fÔð €Mô 
ˆV‹˜Ò	Ü˜VÓ$¨¨r©
Ò2Ü!Ó#Ð#ð €Mô ‹oÐr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r%   F)Úboolr)   ÚValidationErrorr   s    r   Úis_validr/   R   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ón   — ddl m} d| v rdnd}|j                  d|j                  d| z   «      z   | f«      S )zConvert the number to an IBAN.r   )Úibanú Ú ÚNOÚNO00)Ústdnumr1   ÚjoinÚcalc_check_digits)r   r1   Ú	separators      r   Úto_ibanr:   Z   sB   € åØ˜f‘}‘¨"€IØ�>‰>Øˆt×%Ñ% f¨v¡oÓ6Ñ6Øðó ð r   c                óp   — t        | «      j                  d«      } dj                  | dd | dd | dd g«      S )z8Reformat the number to the standard presentation format.r   ú.Nr
   r   )r   Úzfillr7   r   s    r   Úformatr>   c   sG   € ä�V‹_×"Ñ" 2Ó&€FØ�8‰8Øˆr�ˆ
Øˆq�ˆØˆqˆrˆ
ðó ð r   N)r   r   Úreturnr   )r   r   r?   r-   )Ú__doc__Ú
__future__r   r6   r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r#   r)   r/   r:   r>   © r   r   ú<module>rE      s7   ðñ*õ0 #å Ü ß 'óóFóóóôr   