Ë
    Ã?Æiû  ã                  óz   — d Z ddlmZ ddl­ ddlmZ ddlmZmZ g d¢Z	ej                  Z
dd„Zdd„Zdd	„Zdd
„Zy)a1  MOA (Thailand Memorandum of Association Number).

Memorandum of Association Number (aka Company's Taxpayer Identification
Number) are numbers issued by the Department of Business Development.

The number consists of 13 digits of which the last is a check digit following
the same algorithm as in the Personal Identity Number (PIN). It uses a
different grouping format and always starts with zero to indicate that the
number issued by DBD.

More information:

* https://www.dbd.go.th/download/pdf_kc/s09/busin_2542-48.pdf

>>> compact('0 10 5 536 11201 4')
'0105536112014'
>>> validate('0994000617721')
'0994000617721'
>>> validate('0-99-4-000-61772-1')
'0994000617721'
>>> validate('0-99-4-000-61772-3')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('0993000133978')
'0-99-3-000-13397-8'
é    )Úannotations)Ú*)Úpin)ÚcleanÚisdigits)ÚcompactÚcalc_check_digitÚvalidateÚis_validÚformatc                ó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/th/moa.pyr   r   >   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                óÐ   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚| d   dk7  r
t        «       ‚| d   t        | «      k7  r
t        «       ‚| S )zmCheck if the number is a valid MOA Number. This checks the length,
    formatting, component and check digit.é   r   Ú0éÿÿÿÿ)r   ÚlenÚInvalidLengthr   ÚInvalidFormatÚInvalidComponentr	   ÚInvalidChecksumr   s    r   r
   r
   D   sf   € ô �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐØˆa�y�CÒÜÓ Ð Øˆb�zÔ% fÓ-Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z"Check whether the number is valid.F)Úboolr
   ÚValidationErrorr   s    r   r   r   S   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c           
     ój   — t        | «      } dj                  | dd | dd | dd | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.ú-Né   é   é   é   é   )r   Újoinr   s    r   r   r   [   sS   € ä�V‹_€FØ�8‰8Øˆr�ˆ
�F˜1˜Q�K ¨¨! ¨f°Q°q¨k¸6À!ÀB¸<Øˆrˆsˆðó ð r   N)r   ÚstrÚreturnr'   )r   r'   r(   r   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚ	stdnum.thr   Ústdnum.utilr   r   Ú__all__r	   r   r
   r   r   © r   r   ú<module>r0      sB   ðñ(õ8 #ä Ý ß 'ò L€ð ×'Ñ'Ð ó'óóôr   