Ë
    Ã?Æi4  ã                  ó†   — d Z ddlmZ ddlZddl­ ddlmZ  ej                  d«      Z e	d«      Z
dd„Zdd	„Zdd
„Zdd„Zy)a}  SSN (U.S. Social Security Number).

The Social Security Number is used to identify individuals for taxation
purposes. It is a 9-digit number that consists of a 3-digit area number, a
2-digit group number and a 4-digit serial number. The number does not use a
check digit.

Some validation options are available but with the introduction of Social
Security Number Randomization it is no longer possible to validate using the
High Group History List. Some areas, groups and ranges can be blacklisted
though.

There are several on-line verification facilities available, either for
Employers or at a fee but validation requires more information than just the
number (e.g. name, date of birth, etc). Another means of validation is the
Death Master File which can be ordered on DVD.

More information:

* https://en.wikipedia.org/wiki/Social_Security_number
* https://www.ssa.gov/employer/verifySSN.htm
* https://en.wikipedia.org/wiki/Death_Master_File

>>> validate('536-90-4399')
'536904399'
>>> validate('1112-23333')  # dash in the wrong place
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> validate('666-00-0000')  # invalid area
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('078-05-1120')  # blacklisted entry
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> compact('1234-56-789')
'123456789'
>>> format('111223333')
'111-22-3333'
é    )ÚannotationsN)Ú*)Úcleanz?^(?P<area>[0-9]{3})-?(?P<group>[0-9]{2})-?(?P<serial>[0-9]{4})$)z078-05-1120z457-55-5462z219-09-9999c                ó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.ú-)r   Ústrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/us/ssn.pyÚcompactr   O   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c                ór  — t         j                  t        | d«      j                  «       «      }|s
t	        «       ‚|j                  d«      }|j                  d«      }|j                  d«      }|dk(  s|dk(  s|d   dk(  s
|d	k(  s|d
k(  r
t        «       ‚t        | «      t        v r
t        «       ‚t        | «      S )zgCheck if the number is a valid SSN. This checks the length, groups and
    formatting if it is present.Ú ÚareaÚgroupÚserialÚ000Ú666r   Ú9Ú00Ú0000)
Ú_ssn_reÚsearchr   r   ÚInvalidFormatr   ÚInvalidComponentÚformatÚ_ssn_blacklistr   )r
   Úmatchr   r   r   s        r   Úvalidater   U   s¦   € ô �N‰Nœ5 ¨Ó,×2Ñ2Ó4Ó5€EÙÜ‹oÐØ�;‰;�vÓ€DØ�K‰K˜Ó €EØ�[‰[˜Ó"€Fð ˆu‚}˜ š¨¨a©°CªØ�‚}˜ &Ò(ÜÓ Ð äˆfƒ~œÑ'ÜÓ Ð Ü�6‹?Ðr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z#Check if the number is a valid SSN.F)Úboolr   ÚValidationErrorr	   s    r   Úis_validr#   i   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óP   — t        | «      dk(  r| dd dz   | dd z   dz   | dd z   } | S )z8Reformat the number to the standard presentation format.é	   Né   r   é   )Úlenr	   s    r   r   r   q   s>   € ä
ˆ6ƒ{�aÒØ˜˜�˜cÑ! F¨1¨Q KÑ/°#Ñ5¸¸q¸r¸
ÑBˆØ€Mr   )r
   ÚstrÚreturnr)   )r
   r)   r*   r!   )Ú__doc__Ú
__future__r   ÚreÚstdnum.exceptionsÚstdnum.utilr   Úcompiler   Úsetr   r   r   r#   r   © r   r   ú<module>r3      sP   ðñ()õV #ã 	ä Ý ð ˆ"�*‰*ØFóH€ñ ÐBÓC€ó&óó(ôr   