Ë
    ìì�iº	  ã                   óÜ   — d Z ddlZddlZd„ Z ej                  dej
                  «      Z ej                  dej
                  «      Zd„ Ze	dk(  rddl
Z
 ed e
j                  «       «       yy)	zi Python implementation of ASCII85/ASCIIHex decoder (Adobe version).

This code is in the public domain.

é    Nc                 óH  — dx}}d}| D ]–  }d|k  r9|dk  r4|dz  }|dz  |dz
  z   }|dk(  sŒ#|t        j                  d|«      z  }dx}}ŒA|d	k(  r|dk(  sJ ‚|d
z  }ŒS|dk(  sŒY|r:t        d|z
  «      D ]
  }|dz  dz   }Œ |t        j                  d|«      d|dz
   z  } |S  |S )a]  
    In ASCII85 encoding, every four bytes are encoded with five ASCII
    letters, using 85 different types of characters (as 256**4 < 85**5).
    When the length of the original bytes is not a multiple of 4, a special
    rule is used for round up.

    The Adobe's ASCII85 implementation is slightly different from
    its original in handling the last characters.

    The sample string is taken from:
      http://en.wikipedia.org/w/index.php?title=Ascii85

    >>> ascii85decode(b'9jqo^BlbD-BleB1DJ+*+F(f,q')
    b'Man is distinguished'
    >>> ascii85decode(b'E,9)oF*2M7/c~>')
    b'pleasure.'
    r   ó    é!   éu   é   éU   é   z>Léz   s       é~   éT   N)ÚstructÚpackÚrange)ÚdataÚnÚbÚoutÚcÚ_s         úu/var/www/ITT-ServiceAPI-Services/ITT-Document-Scan/mrzscanner/mrzenv/lib/python3.12/site-packages/pdfminer/ascii85.pyÚascii85decoder      sæ   € ð$ €I€AˆØ
€CØò ˆØ�Š7�q˜C’xØ�‰FˆAØ�"‘�a˜‘d‘ˆAØ�A‹vØ”v—{‘{ 4¨Ó+Ñ+�Ø�	�‘AØ�#ŠXØ˜’6ˆM�6Ø�;Ñ‰CØ�#‹XÙÜ˜q ™s›ò  �AØ˜"™˜R™‘Að à”v—{‘{ 4¨Ó+¨D¨Q¨q©SÐ1Ñ1�ØØ€Jð!ð  €Jr   z([a-f\d]{2})z#^(?:[a-f\d]{2}|\s)*([a-f\d])[\s>]*$c                 ó$  — | j                  d«      } t        j                  | «      D �cg c]  }t        |d«      ‘Œ }}t        j                  | «      }|r-|j                  t        |j                  d«      d«      dz  «       t        |«      S c c}w )a‡  
    ASCIIHexDecode filter: PDFReference v1.4 section 3.3.1
    For each pair of ASCII hexadecimal digits (0-9 and A-F or a-f), the
    ASCIIHexDecode filter produces one byte of binary data. All white-space
    characters are ignored. A right angle bracket character (>) indicates
    EOD. Any other characters will cause an error. If the filter encounters
    the EOD marker after reading an odd number of hexadecimal digits, it
    will behave as if a 0 followed the last digit.

    >>> asciihexdecode(b'61 62 2e6364   65')
    b'ab.cde'
    >>> asciihexdecode(b'61 62 2e6364   657>')
    b'ab.cdep'
    >>> asciihexdecode(b'7>')
    b'p'
    Úlatin1é   r   é   )	ÚdecodeÚhex_reÚfindallÚintÚtrail_reÚsearchÚappendÚgroupÚbytes)r   Úhxr   Úms       r   Úasciihexdecoder'   9   st   € ð" �;‰;�xÓ €DÜ"(§.¡.°Ó"6Ö
8˜2ŒC��2�JÐ
8€CÐ
8Ü�‰˜Ó€AÙØ�
‰
”3�q—w‘w˜q“z "Ó%¨Ñ*Ô+Ü�‹:Ðùò	 9s   ©BÚ__main__zpdfminer.ascii85)Ú__doc__Úrer   r   ÚcompileÚ
IGNORECASEr   r    r'   Ú__name__ÚdoctestÚprintÚtestmod© r   r   ú<module>r2      sr   ðñó 
Û ò$ðN 
ˆ�‰�O R§]¡]Ó	3€Øˆ2�:‰:Ð<¸b¿m¹mÓL€òð2 ˆzÒÛÙ	Ð
˜o˜gŸo™oÓ/Õ0ð r   