+
    yaÒj6;  ã                   óê   € ^ RI t ^ RIHt ^ RIHt ^RIHtHtHtH	t	H
t
Ht ^RIHt ] P                  ! ]4      tRtR R ltR	 R
 ltR R ltR R ltR R ltR R ltR R ltR R ltRR R lltR# )é    N)ÚBytesIO)ÚIO)ÚWHITESPACESÚWHITESPACES_AS_BYTESÚBinaryStreamTypeÚ
StreamTypeÚlogger_warningÚread_non_whitespace)ÚPdfReadErrori    c                ó0   € V ^8„  d   QhR\         R\        /# ©é   ÚstreamÚreturn)r   Úbool)Úformats   "ÚQ/opt/data/home/.local/lib/python3.14/site-packages/pypdf/generic/_image_inline.pyÚ__annotate__r   1   s   € ÷ Vñ V¤Jð V´4ñ Vó    c                 óî   € \        V 4      pWP                  ^4      ,          pV P                  \        V4      ) ^4       VR,          R8H  ;'       d%    VR,          R8H  ;'       g    VR,          \        9   # )r   ºNr   Nó   EIºr   é   Nr   )r
   ÚreadÚseekÚlenr   )r   Úei_toks   & r   Ú_check_end_image_markerr   1   sa   € Ü  Ó(€FØ
�k‰k˜!‹nÕ€FØ
‡K�K”�V“�˜aÔ Ø�"�:˜Ñ×UÐU F¨3¥K°3Ñ$6×$TÐ$T¸&À½+ÌÑ:TÐUr   c                ó0   € V ^8„  d   QhR\         R\        /# r   ©r   Úbytes)r   s   "r   r   r   8   s   € ÷ #ñ #¬Zð #¼Eñ #r   c                óJ  € \        4       p \        V 4      V P                  \        4      ;p,           pV'       d	   V'       g   \	        R4      hVP                  R4      pV^ 8¼  d>   WRV^,            ,          pV P                  \        V4      ) V,           ^,           ^4       MÛVP                  R4      pV^ 8¼  d�   V P                  \        V4      ) V,           ^,
          ^4       V P                  ^4      pV\        9   d/   V P                  R^4       V P                  ^4      pV^,          pK9  WRV ,          pMC\        V4      ^8X  d   W,          p\	        R4      hWRR ,          pV P                  R^4       EKs  \        V 4      '       g   \	        R4      h\        V4      # )zT
Extract HexEncoded stream from inline image.
The stream will be moved onto the EI.
úUnexpected end of stream.ó   >Nr   úEI stream not found.éþÿÿÿ)Ú	bytearrayr
   r   ÚBUFFER_SIZEr   Úfindr   r   r   r   r"   )r   Údata_outÚ
read_bytesÚdata_bufferedÚpos_tokÚpos_eiÚcs   &      r   Ú extract_inline__ascii_hex_decoder1   8   sk  € ô
 ‹{€Hà
Ü+¨FÓ3ÀVÇ[Á[ÔQ\ÓE]Ð7]°zÕ^ˆß§JÜÐ:Ó;Ð;Ø×$Ñ$ TÓ*ˆØ�aŒ<Ø m¨°!­Ð4Õ4ˆHØ�K‰Kœ˜]Ó+Ð+¨gÕ5¸Õ9¸1Ô=ØØ×#Ñ# EÓ*ˆØ�QŒ;Ø�K‰Kœ˜]Ó+Ð+¨fÕ4°qÕ8¸!Ô<Ø—‘˜A“ˆAØ”{Ô"Ø—‘˜B Ô"Ø—K‘K “N�Ø˜!•’Ø g vÐ.Õ.ˆHØÜˆ}Ó Ô"ØÕ%ˆHÜÐ:Ó;Ð;à # 2Ð&Õ&ˆØ�‰�B˜×ä" 6×*Ò*ÜÐ1Ó2Ð2Ü�‹?Ðr   c                ó0   € V ^8„  d   QhR\         R\        /# r   r!   )r   s   "r   r   r   ^   s   € ÷ ñ ¬:ð ¼%ñ r   c                ó  € \        4       p \        V 4      V P                  \        4      ;p,           pV'       d	   V'       g   \	        R4      hVP                  R4      pV^ 8¼  d>   WRV^,            ,          pV P                  \        V4      ) V,           ^,           ^4       MB\        V4      ^8X  d   W,          p\	        R4      hWRR ,          pV P                  R^4       KÚ  \        V 4      '       g   \	        R4      h\        V4      # )zM
Extract A85 stream from inline image.
The stream will be moved onto the EI.
r$   s   ~>Nr&   r'   )
r(   r
   r   r)   r   r*   r   r   r   r"   )r   r+   r,   r-   r.   s   &    r   Úextract_inline__ascii85_decoder4   ^   sð   € ô
 ‹{€Hà
Ü+¨FÓ3ÀVÇ[Á[ÔQ\ÓE]Ð7]°zÕ^ˆß§JÜÐ:Ó;Ð;Ø×$Ñ$ UÓ+ˆØ�aŒ<Ø m¨°!­Ð4Õ4ˆHØ�K‰Kœ˜]Ó+Ð+¨gÕ5¸Õ9¸1Ô=ØÜˆ}Ó Ô"ØÕ%ˆHÜÐ:Ó;Ð;ØØˆRð
õ 	
ˆð 	�‰�B˜Öä" 6×*Ò*ÜÐ1Ó2Ð2Ü�‹?Ðr   c                ó0   € V ^8„  d   QhR\         R\        /# r   r!   )r   s   "r   r   r   {   s   € ÷ $ñ $¬jð $¼Uñ $r   c                ó´  € \        4       p V P                  \        4      pV'       g   \        R4      hVP	                  R4      pV^ 8¼  dÝ   W#^,           V^,            pVP                  R4      '       g   VP                  R4      '       d>   WRV^,            ,          pV P                  \        V4      ) V,           ^,           ^4       M^\        R\        R7       VP	                  R4      pV^ 8”  d6   WRV ,          pV P                  \        V4      ) V,           ^,
          ^4       MW,          pEK(  \        V 4      '       g   \        R4      h\        V4      # )z^
Extract RL (RunLengthDecode) stream from inline image.
The stream will be moved onto the EI.
r$   ó   €r   Nz=Early EOD in RunLengthDecode of inline image, using fallback.)Úsourcer&   )r(   r   r)   r   r*   Ú
startswithÚendswithr   r   r	   Ú__name__r   r"   )r   r+   r-   r.   Úafter_tokenÚ	ei_markers   &     r   Ú!extract_inline__run_length_decoder>   {   s(  € ô
 ‹{€Hà
ØŸ™¤KÓ0ˆßÜÐ:Ó;Ð;Ø×$Ñ$ WÓ-ˆØ�aŒ<ð (°!­°gÀµkÐBˆKØ×%Ñ% e×,Ò,°×0DÑ0DÀU×0KÒ0KØ¨-¨G°a­KÐ8Õ8�Ø—‘œS Ó/Ð/°'Õ9¸AÕ=¸qÕAäÐ^ÔgoÕpØ)×.Ñ.¨uÓ5�	Ø˜q”=Ø¨k°	Ð :Õ:�HØ—K‘K¤ ]Ó!3Ð 3°iÕ ?À!Õ CÀQÔGØØÕ!‹ä" 6×*Ò*ÜÐ1Ó2Ð2Ü�‹?Ðr   c                ó0   € V ^8„  d   QhR\         R\        /# r   )r   r"   )r   s   "r   r   r   ¢   s   € ÷ ,ñ ,Ô'7ð ,¼Eñ ,r   c                óæ  a € R V 3R llp\        4       pRp V! ^4      pV'       g   VR8X  d	   W$,          pVR8w  d   K)  RpV! ^4      pW$,          pVR8X  d   S P                  R^4       KV  VR8X  d   K_  VR8X  d   MNVR9   g   Kp  V! ^4      pW$,          pV^ ,          R	,          V^,          ,           pW!! V^,
          4      ,          pKµ  \        S 4      '       g   \        R
4      h\	        V4      # )zT
Extract DCT (JPEG) stream from inline image.
The stream will be moved onto the EI.
c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úlengthr   )Úintr"   )r   s   "r   r   Ú0extract_inline__dct_decode.<locals>.__annotate__§   s   € ÷ ñ ”Sð œUñ r   c                 óh   <€ SP                  V 4      pVe   \        V4      V 8w  d   \        R4      hV# )Nr$   )r   r   r   )rB   Ú_resultr   s   & €r   r   Ú(extract_inline__dct_decode.<locals>.read§   s4   ø€ ð —+‘+˜fÓ%ˆØŠ?œc '›l¨fÔ4ÜÐ:Ó;Ð;Øˆr   FTó   ÿó    ó   Ùs&   ÀÁÂÃÄÅÆÇÉÊËÌÍÎÏÚÛÜÝÞßàáâãäåæçèéêëìíîïþé   r&   éÿÿÿÿ)r(   r   r   r   r"   )r   r   r+   Ú	not_firstr0   Úszs   f     r   Úextract_inline__dct_decoderO   ¢   sê   ø€ ÷
ð ô ‹{€Hð €IØ
Ù�‹Gˆß˜˜gœØ�MˆHØ�Œ<ÙØˆ	Ù�‹GˆØ�ˆØ�Œ<Ø�K‰K˜˜AÖØ�'Œ\ÙØ�'Œ\ØØðTö
ñ
 �Q“ˆAØ�MˆHØ�1•˜•˜a �dÕ"ˆBØ˜˜R !�V›Õ$ŠHä" 6×*Ò*ÜÐ1Ó2Ð2Ü�‹?Ðr   c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   Ú
stream_outÚpositionr   )r   rC   r   )r   s   "r   r   r   Ñ   s!   € ÷ ñ ¬7ð ¼cð Ädñ r   c                óº   € V^ 8:  d   R# V P                  4       pV P                  V^,
          4       V P                  ^4      \        9   pV P                  V4       V# )a  
Check whether the byte in front of `position` is a whitespace.

Returns:
    Whether the preceding byte is whitespace. If no preceding byte exists,
    returns ``False`` because the ``EI`` marker is at the beginning of the
    image data and is therefore not delimited by anything.
F)Útellr   r   r   )rQ   rR   Úsaved_positionÚis_whitespaces   &&  r   Ú_is_preceded_by_whitespacerW   Ñ   sQ   € ð �1„}ÙØ—_‘_Ó&€Nð ‡O�O�H˜q•LÔ!Ø—O‘O AÓ&¬+Ñ5€MØ‡O�O�NÔ#ØÐr   c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   r   Ú
first_byter   )r   r"   r   )r   s   "r   r   r   å   s!   € ÷ ñ ¬Zð ÄUð Ìtñ r   c                óN  € V P                  4       pVR8X  d)   V P                  ^4      pVR8H  ;'       g
    V\        9   pMSVR8X  dK   V P                  ^4      pVR,          R8H  ;'       d%    VR,          R8H  ;'       g    VR,          \        9   pMRpV P                  V^ 4       V# )a(  
Check whether `first_byte` starts an exact `Q` or `EMC` operator.

`first_byte` has already been consumed from the stream, which is restored to its
current position afterwards. Looking at this byte alone is not sufficient, as
binary image data can easily be mistaken for one of these operators.
ó   Qr   ó   Er   s   MCr   F)rT   r   r   r   )r   rY   rR   ÚsuffixÚis_closing_operators   &&   r   Ú _is_followed_by_closing_operatorr_   å   s�   € ð �{‰{‹}€HØ�TÔØ—‘˜Q“ˆØ$¨™m×DÐD¨v¼Ñ/DÑØ	�tÔ	Ø—‘˜Q“ˆØ$ R�j¨EÑ1×hÐh°v¸cµ{ÀcÑ7I×7gÐ7gÈVÐTWÍ[Ô\gÑMgÑà#ÐØ
‡K�K�˜!ÔØÐr   c                ó0   € V ^8„  d   QhR\         R\        /# r   r!   )r   s   "r   r   r   ú   s   € ÷ :!ñ :!¤:ð :!´%ñ :!r   c                ó>  € \        4       p V P                  \        4      pV'       g   \        R4      hVP	                  R4      pVR8X  d   VP                  V4       KT  VP                  V^ V^,            4       VP                  4       ^,
          pV P                  V^,           \        V4      ,
          ^4       V P                  4       pV P                  ^4      pVR8w  d   V P                  V^ 4       Kë  V P                  ^4      pVR8X  d<   V P                  V^,
          ^ 4       VP                  V4        VP                  4       # V\        9  d   V P                  V^ 4       EK^  V\        9   d   V P                  ^4      pK  \        W4      '       g'   \        W4      '       g   V P                  V^ 4       EK³  \        V 4      '       d   V P                  V^ 4       EKÙ  V P                  V^,
          ^ 4       VP                  V4        VP                  4       # )zLegacy method, used by defaultr$   r\   ó   Ir   rL   )r   r   r)   r   r*   ÚwriterT   r   r   Útruncater   rW   r_   Úis_followed_by_binary_dataÚgetvalue)r   rQ   r-   r/   Ú
sav_pos_eiÚ	saved_posÚtok2Útok3s   &       r   Úextract_inline_defaultrk   ú   sÉ  € ä“€Jà
ØŸ™¤KÓ0ˆßÜÐ:Ó;Ð;Ø×#Ñ#Øó
ˆð �RŒ<Ø×Ñ˜]Ö+ð ×Ñ˜]¨1¨v¸­zÐ:Ô;Ø#Ÿ™Ó*¨QÕ.ˆJà�K‰K˜ �
¤S¨Ó%7Õ7¸Ô;ØŸ™›ˆIà—;‘;˜q“>ˆDØ�tŒ|Ø—‘˜I qÔ)ÙØ—;‘;˜q“>ˆDØ�sŒ{ð —‘˜I¨�M¨1Ô-Ø×#Ñ# JÔ/Øð2 ×ÑÓ Ð ð1 œ;Ô&Ø—‘˜I qÔ)ÚØœ+Ô%Ø—{‘{ 1“~’ô .¨j×EÒEÔNnØ÷Oò Oð —‘˜I qÔ)ÚÜ)¨&×1Ò1ð —‘˜I qÔ)Úð �K‰K˜	 A� qÔ)Ø×Ñ 
Ô+Øà×ÑÓ Ð r   c                óR   € V ^8„  d   QhR\         \        ,          R\        R\        /# )r   r   rB   r   )r   r"   rC   r   )r   s   "r   r   r   7  s%   € ÷ 6ñ 6¤r¬%¥yð 6¼#ð 6Ätñ 6r   c                óü  € V P                  4       pV P                  V4      pV P                  V4       V'       g   R# RpRp\        V4       FC  w  rgV^ 8  d   V\        9  d    R# V\        9   pVf   V'       g   TpVf   K7  V'       g   KA  Tp M	  Vf   R# Vf   TpWT,
          p	W4V p
V
P                  R4      '       d
   V	^8”  d   R# V
P                  RR4      P                  4       '       d   R# V	^8”  d   R# R# )a³  
Check if the next bytes of the stream look like binary image data or regular page content.

This is just some heuristics due to the PDF specification being too imprecise about
inline images containing the `EI` marker which would end an image. Starting with PDF 2.0,
we finally get a mandatory length field, but with (proper) PDF 2.0 support being very limited
everywhere, we should not expect to be able to remove such hacks in the near future - especially
considering legacy documents as well.

The actual implementation draws some inspiration from
https://github.com/itext/itext-java/blob/9.1.0/kernel/src/main/java/com/itextpdf/kernel/pdf/canvas/parser/util/InlineImageParsingUtils.java
FNTó   /ó   .r   )rT   r   r   Ú	enumerater   r9   ÚreplaceÚisdigit)r   rB   rR   ÚdataÚoperator_startÚoperator_endÚindexÚbyterV   Úoperator_lengthÚoperators   &&         r   re   re   7  sû   € ð �{‰{‹}€HØ�;‰;�vÓ€DØ
‡K�K�ÔßÙØ€NØ€Lä  –‰ˆØ�"Œ9˜Ô%9Ô9ò ØÔ 4Ñ4ˆØÒ!¯-à"ˆNØÔ%¯-©-ð !ˆLÙñ 'ð ÒáØÒàˆØ"Õ3€OØ <Ð0€HØ×Ñ˜4× Ò  _°qÔ%8áØ×Ñ˜˜cÓ"×*Ñ*×,Ò,áØ˜Ôñ Ùr   )é
   )ÚloggingÚior   Útypingr   Ú_utilsr   r   r   r   r	   r
   Úerrorsr   Ú	getLoggerr;   Úloggerr)   r   r1   r4   r>   rO   rW   r_   rk   re   © r   r   Ú<module>rƒ      sm   ðó8 Ý Ý ÷÷ õ "à	×	Ò	˜8Ó	$€ð €õVõ#õLõ:$õN,õ^õ(õ*:!÷z6ñ 6r   