Ë
    Ã?Æ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	)uü  BRN (ì‚¬ì—…ìž� ë“±ë¡� ë²ˆí˜¸, South Korea Business Registration Number).

The Business Registration Number is issued by the district tax office in the
local jurisdiction for tax purposes. The number consists of 10 digits and
contain the tax office number (3 digits), the type of business (2 digits), a
serially assigned value (4 digits) and a single check digit.

More information:

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

>>> validate('116-82-00276')
'1168200276'
>>> validate('1168200276')
'1168200276'
>>> validate(' 116 - 82 - 00276  ')
'1168200276'
>>> validate('123456789')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('1348672683')
'134-86-72683'
é    )Úannotations)Ú*)Ú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    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/kr/brn.pyÚcompactr   5   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                óº   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚| dd dk  s| dd dk(  s| dd dk(  r
t        «       ‚| S )	zgCheck if the number is a valid South Korea BRN number.

    This checks the length and formatting.
    é
   Né   Ú101é   Ú00éÿÿÿÿÚ0000)r   ÚlenÚInvalidLengthr   ÚInvalidFormatÚInvalidComponentr	   s    r   Úvalidater   >   sg   € ô
 �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐØˆbˆq€z�EÒ˜V A a˜[¨DÒ0°F¸1¸R°LÀFÒ4JÜÓ Ð Ø€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z6Check if the number is a valid South Korea BRN number.F)Úboolr   ÚValidationErrorr	   s    r   Úis_validr   M   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } dj                  | dd | dd | dd g«      S )z8Reformat the number to the standard presentation format.ú-Nr   r   )r   Újoinr	   s    r   Úformatr"   U   s3   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨! ¨f°Q°R¨jÐ9Ó:Ð:r   N)r
   ÚstrÚreturnr#   )r
   r#   r$   r   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   r"   © r   r   ú<module>r*      s)   ðñ,õ2 #ä ß 'ó'óóô;r   