+
    TiN                       a  RM tG0 t R tRtRt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHtHtHtHtHt ]P0                  R
,          RN8  d   ^ RIHt M^ RIHt ]P0                  RO8  d   ^ RIHt M^ RIHt ^RIHtHtHt ] ] ]!]!]!3,          ] ]!]!]!3,          ] ]!]!]!3,          3,          t"] ^ k ] ]!]!]!]!]!]!3,          t#] ^k ]],          t$]]%]$3,          t&R R lt'R R lt(R R lt)RPt*RPW                  ]*4      t,R],,           R,           t-RQR R llt.R R lt/R R lt0R R lt1R R  lt2R! R" lt3R# R$ lt4R% R& lt5R' R( lt6R) R* lt7]R+ R, l4       t8]R- R. l4       t8]R/ R0 l4       t8R1 R2 lt8RRR3 R4 llt9R5 R6 lt:R7 R8 lt;R9 R: lt<R; R< lt=R= R> lt>R? R@ lt?RA RB lt@RSRC RD lltARE RF ltB ! RG RH4      tC]
 ! RI RJ4      4       tD]P                   ! RK RL4      4       tFR# )Tz"Utility functions for PDF library.zMathieu Fenniakzbiziqe@mathieu.fenniak.netN)	dataclass)datetimetimezone)DEFAULT_BUFFER_SIZE)SEEK_CUR)Pattern)IOAnyOptionalUnionoverload:N   N)	TypeAliasSelf)STREAM_TRUNCATED_PREMATURELYDeprecationErrorPdfStreamErrorc                \    V ^8  d   QhR\         \        ,          R\         \        ,          /# )r   textreturn)r
   strr   )formats   "W/home/kuhnn/.local/share/uv/tools/nano-pdf/lib/python3.14/site-packages/pypdf/_utils.py__annotate__r   N   s#     9 9Xc] 9x/A 9    c                    T pV '       g   R # V ^ ,          P                  4       '       d
   RV ,           p V P                  R4      '       d
   V R,          p V P                  RR4      P                  RR4      P                  RR4      p \        V P	                  R4      V P	                  R4      4      pV^ 8  d!   V\        V 4      ^,
          8w  d
   V R	,          p R FS  p \        P                  ! W4      pV P                  R
4      '       d!   VP                  \        P                  R7      pVu # 	  \        RV 24      h  \         d     Ks  i ; i)NzD:Zz0000+' -00z+0000)tzinfozCan not convert date: )r   r   )zD:%YzD:%Y%mzD:%Y%m%dz
D:%Y%m%d%HzD:%Y%m%d%H%MD:%Y%m%d%H%M%SzD:%Y%m%d%H%M%S%z)isdigitendswithreplacemaxfindlenr   strptimer   utc
ValueError)r   orgtextifds   &    r   parse_iso8824_dater4   N   s   GAwd{}}Z  <<S!))#s3;;CDDDIIcNDIIcN+A1uc$i!m#	!!$*A }}W%%IIX\\I2H!" -gY7
88  		s   D==EEc                0    V ^8  d   QhR\         R\        /# )r   dtr   )r   r   )r   s   "r   r   r   n   s      H  r   c                   V P                  R4      pV P                  em   V P                  4       pVf   Q h\        VP	                  4       4      p\        \        V4      R4      w  rEV^<,          pV^ 8  d   RMRpW VR RVR R2,          pV# )z
Convert a datetime object to PDF date string format.

Converts datetime to the PDF date format D:YYYYMMDDHHmmSSOHH'mm
as specified in the PDF Reference.

Args:
    dt: A datetime object to convert.

Returns:
    A date string in PDF format.
r&   i  r    r#   02dr!   )strftimer%   	utcoffsetinttotal_secondsdivmodabs)r6   date_stroffsetr<   hours	remainderminutessigns   &       r   format_iso8824_daterE   n   s     {{+,H	yy!!!F0023!#m"4d;r/#q(scfU3KqQ77Or   c                <    V ^8  d   QhR\         R\         R\         /# )r   header1header2r   r   )r   s   "r   r   r      s!     - - -s -s -r   c                    Rp. pW9   d!   VP                  VP                  V 4      4       W9   d!   VP                  VP                  V4      4       \        V4      ^ 8X  d   \        RV : RV: R24      hV\	        V4      ,          # )%PDF-1.3zNeither z nor z are proper headers)rK   z%PDF-1.4z%PDF-1.5z%PDF-1.6z%PDF-1.7z%PDF-2.0)appendindexr,   r/   r*   )rG   rH   versionspdf_header_indicess   &&  r   _get_max_pdf_version_headerrP      s    H !!(.."9:!!(.."9:
!#8G;eG;>QRSSC*+,,r   r      [   ]c                R    V ^8  d   QhR\         R\        \        ,          R\        /# )r   streammaxcharsr   )
StreamTyper
   r;   bytes)r   s   "r   r   r      s&      *  QV r   c                    Rp V P                  ^4      pVP                  4       '       g	   V'       g    V# W#,          p\        V4      V8X  g   KM   V# )a  
Read non-whitespace characters and return them.

Stops upon encountering whitespace or when maxchars is reached.

Args:
    stream: The data stream from which was read.
    maxchars: The maximum number of bytes returned; by default unlimited.

Returns:
    The data which was read.

r   )readisspacer,   )rT   rU   txttoks   &&  r   read_until_whitespacer]      sM     C
kk!n;;== J 	
s8xJr   c                0    V ^8  d   QhR\         R\        /# r   rT   r   rV   rW   )r   s   "r   r   r      s      
 u r   c                d    V P                  ^4      pV\        9   d   V P                  ^4      pK  V# )z
Find and read the next non-whitespace character (ignores whitespace).

Args:
    stream: The data stream from which was read.

Returns:
    The data which was read.

rY   WHITESPACESrT   r\   s   & r   read_non_whitespacere      s+     ++a.C

kk!nJr   c                0    V ^8  d   QhR\         R\        /# r_   )rV   bool)r   s   "r   r   r      s        r   c                    V P                  ^4      p^ pV\        9   d   V^,          pV P                  ^4      pK'  V^ 8  # )z
Similar to read_non_whitespace, but return a boolean if at least one
whitespace character was read.

Args:
    stream: The data stream from which was read.

Returns:
    True if one or more whitespace was skipped, otherwise return False.

rb   )rT   r\   cnts   &  r   skip_over_whitespacerj      s=     ++a.C
C

qkk!n7Nr   c                0    V ^8  d   QhR\         R\        /# )r   valuer   )rW   rg   )r   s   "r   r   r      s     9 9E 9d 9r   c                j    \         ;QJ d    R V  4       F  '       d   K   R# 	  R# ! R V  4       4      # )z
Check if the given value consists of whitespace characters only.

Args:
    value: The bytes to check.

Returns:
    True if the value only has whitespace characters, otherwise return False.

c              3   2   "   T F  q\         9   x  K  	  R # 5iN)WHITESPACES_AS_BYTES).0bs   & r   	<genexpr>+check_if_whitespace_only.<locals>.<genexpr>   s     8%Q((%s   FT)all)rl   s   &r   check_if_whitespace_onlyrv      s-     38%83383838%888r   c                (    V ^8  d   QhR\         RR/# r   rT   r   NrV   )r   s   "r   r   r      s     A Aj AT Ar   c                     V P                  ^4      pV P                  R^4       VR8X  d/   VR9  d&   V P                  ^4      pVR8X  g   K!  \        R4      hR# R# )      %r   zFile ended unexpectedly.N)   
   )rY   seekr   rd   s   & r   skip_over_commentr      sV    
++a.C
KKA
d{'++a.Ccz$%?@@ ( r   c                R    V ^8  d   QhR\         R\        \        ,          R\        /# )r   rT   regexr   )rV   r   rW   )r   s   "r   r   r      s%      Z  5 r   c                @   Rp V P                  ^4      pV'       g   V# VP                  W#,           4      pVe]   V P                  VP                  4       \	        V4      \	        V4      ,           ,
          ^4       W#,           RVP                  4        p V# W#,          pK  )z
Read until the regular expression pattern matched (ignore the match).
Treats EOF on the underlying stream as the end of the token to be matched.

Args:
    regex: re.Pattern

Returns:
    The read bytes.

r   N)rY   searchr   startr,   )rT   r   namer\   ms   &&   r   read_until_regexr      s     D
kk"oKLL$=KK	SYS%9:A>J!''),DK 	r   c                <    V ^8  d   QhR\         R\        R\        /# )r   rT   to_readr   )rV   r;   rW   )r   s   "r   r   r     s!       c e r   c                    V P                  4       V8  d   \        R4      hV P                  V) \        4       V P	                  V4      pV P                  V) \        4       V# )z
Given a stream at position X, read a block of size to_read ending at position X.

This changes the stream's position to the beginning of where the block was
read.

Args:
    stream:
    to_read:

Returns:
    The data which was read.

z!Could not read malformed PDF file)tellr   r   r   rY   )rT   r   rY   s   && r   read_block_backwardsr     sQ     {{}w@AA
KK(#;;wD
KK(#Kr   c                0    V ^8  d   QhR\         R\        /# r_   r`   )r   s   "r   r   r   (  s     7( 7(z 7(e 7(r   c                d   . pRpV P                  4       ^ 8X  d   \        \        4      h \        \        V P                  4       4      pV^ 8X  d   M\        W4      p\        V4      ^,
          pV'       g)   V^ 8  d   WE,          R9  d   V^,          pK  V^ 8  d   RpV'       d;   VP                  WE^,           R 4       V^ 8  d   WE,          R9   d   V^,          pK  MVP                  V4       V^ 8  g   K  V P                  V^,           \        4        RP                  VRRR1,          4      # )a  
Given a byte stream with current position X, return the previous line.

All characters between the first CR/LF byte found before X
(or, the start of the file, if no such byte is found) and position X
After this call, the stream will be positioned one byte after the
first non-CRLF character found beyond the first CR/LF byte before X,
or, if no such byte is found, at the beginning of the stream.

Args:
    stream: StreamType:

Returns:
    The data which was read.

FTs   
Nr   r}   )r   r   r   minr   r   r,   rL   r   r   join)rT   line_content
found_crlfr   blockidxs   &     r   read_previous_liner   (  s   " LJ{{}9::
)6;;=9a< %V5%j1n (uz8qax!

 Agi 01(uzW4q &!8 KKa*88L2&''r   c                <    V ^8  d   QhR\         R\         R\         /# )r   arr   r   )TransformationMatrixType)r   s   "r   r   r   b  s$      $<r   c                 h   a \         ;QJ d    . V3R  lV  4       F  NK  	  5# ! V3R  lV  4       4      # )c              3      <a"   T FE  o\         ;QJ d    . V3R  l\        S!   4       F  NK  	  5M! V3R  l\        S!   4       4      x  KG  	  R# 5i)c              3   \   <"   T F!  p\        R  \        SV4       4       4      x  K#  	  R# 5i)c              3   \   "   T F"  w  r\        V4      \        V4      ,          x  K$  	  R # 5iro   )float)rq   r1   js   &  r   rs   6matrix_multiply.<locals>.<genexpr>.<genexpr>.<genexpr>f  s"     @-$!%(U1X%%-s   *,N)sumzip)rq   colrows   & r   rs   ,matrix_multiply.<locals>.<genexpr>.<genexpr>f  s%     TGSc@#c3-@@@Gs   ),N)tupler   )rq   r   rr   s   &@r   rs   "matrix_multiply.<locals>.<genexpr>e  s>      C 	TCQRGTTCQRGTTTs
   A=A)r   )r   rr   s   &fr   matrix_multiplyr   b  s7     5 5 5   r   c                (    V ^8  d   QhR\         RR/# rx   ry   )r   s   "r   r   r   k  s     	 	* 	 	r   c                X   RpV P                  V) ^4       \        RR4      ;_uu_ 4       pVP                  V P                  V4      4       VP                  R4       VP                  V P                  V4      4       RRR4       V P                  V) ^4       R#   + '       g   i     L%; i)z5Create text file showing current location in context.i  zpypdf_pdfLocation.txtwbs   HEREN)r   openwriterY   )rT   radius	output_fhs   &  r   mark_locationr   k  s     F
KK	%t	,	,	F+, F+, 
- KK	 
-	,s   ABB)	c                0    V ^8  d   QhR\         R\        /# r   rr   r   r   r;   )r   s   "r   r   r   x        C C r   c                     R # ro    rr   s   &r   ord_r   w      r   c                0    V ^8  d   QhR\         R\         /# r   rW   )r   s   "r   r   r   }  s      E e r   c                     R # ro   r   r   s   &r   r   r   |  r   r   c                0    V ^8  d   QhR\         R\         /# r   r;   )r   s   "r   r   r     r   r   c                     R # ro   r   r   s   &r   r   r     r   r   c                ~    V ^8  d   QhR\         \        \        \        3,          R\         \        \        3,          /# r   )r   r;   r   rW   )r   s   "r   r   r     s.      E#sE/" uS%Z'8 r   c                 H    \        V \        4      '       d   \        V 4      # V # ro   )
isinstancer   ordr   s   &r   r   r     s    !S1vHr   c                4    V ^8  d   QhR\         R\        RR/# )r   msg
stacklevelr   Nr   )r   s   "r   r   r     s&     B B3 BC B Br   c                 @    \         P                  ! V \        VR 7       R# ))r   N)warningswarnDeprecationWarning)r   r   s   &&r   	deprecater     s    MM#)jAr   c                (    V ^8  d   QhR\         RR/# )r   r   r   NrI   )r   s   "r   r   r     s        S  T  r   c                     \        V 4      hro   )r   )r   s   &r   deprecationr     s    
3
r   c                @    V ^8  d   QhR\         R\         R\         RR/# r   old_namenew_name
removed_inr   NrI   )r   s   "r   r   r     s)         QU r   c                0    \        V  RV RV R2^4       R# )zFIssue a warning that a feature will be removed, but has a replacement., is deprecated and will be removed in pypdf . Use 	 instead.Nr   r   r   r   s   &&&r   deprecate_with_replacementr     s'    *@FS[R\\ef	r   c                @    V ^8  d   QhR\         R\         R\         RR/# r   rI   )r   s   "r   r   r     s)      3 # 3 SW r   c                .    \        V  RV RV R24       R# )zMRaise an exception that a feature was already removed, but has a replacement.( is deprecated and was removed in pypdf r   r   Nr   r   s   &&&r   deprecation_with_replacementr     s"    *<ZLxjXabr   c                4    V ^8  d   QhR\         R\         RR/# r   r   r   r   NrI   )r   s   "r   r   r     s&     U U3 UC UD Ur   c                *    \        V  RV R2^4       R# )zCIssue a warning that a feature will be removed without replacement.r   .Nr   r   r   s   &&r   deprecate_no_replacementr     s    B:,aPRSTr   c                4    V ^8  d   QhR\         R\         RR/# r   rI   )r   s   "r   r   r     s&     P PS Pc Pd Pr   c                (    \        V  RV R24       R# )zJRaise an exception that a feature was already removed without replacement.r   r   Nr   r   s   &&r   deprecation_no_replacementr     s    4&@ANOr   c                4    V ^8  d   QhR\         R\         RR/# r   r   srcr   NrI   )r   s   "r   r   r     s!     	& 	&c 	& 	& 	&r   c                P    \         P                  ! V4      P                  V 4       R# )z
Use this instead of logger.error directly.

That allows people to overwrite it more easily.

See the docs on when to use which:
https://pypdf.readthedocs.io/en/latest/user/suppress-warnings.html
N)logging	getLoggererrorr   r   s   &&r   logger_errorr     s     c  %r   c                4    V ^8  d   QhR\         R\         RR/# r   rI   )r   s   "r   r   r     s!     ( ( (# ($ (r   c                P    \         P                  ! V4      P                  V 4       R# )aa  
Use this instead of logger.warning directly.

That allows people to overwrite it more easily.

## Exception, warnings.warn, logger_warning
- Exceptions should be used if the user should write code that deals with
  an error case, e.g. the PDF being completely broken.
- warnings.warn should be used if the user needs to fix their code, e.g.
  DeprecationWarnings
- logger_warning should be used if the user needs to know that an issue was
  handled by pypdf, e.g. a non-compliant PDF being read in a way that
  pypdf could apply a robustness fix to still read it. This applies mainly
  to strict=False mode.
N)r   r   warningr   s   &&r   logger_warningr     s      c""3'r   c          
          V ^8  d   QhR\         R\        \         \        3,          R\        \         \         3,          R\        RR/# )r   	func_namekwargsaliasesfailr   N)r   dictr	   rg   )r   s   "r   r   r     sD          cN 59#s(^ KO 	 r   c                &   VP                  4        F|  w  rEWA9   g   K  V'       d   \        V RV R24      hWQ9   d   \        V  RV RV RV RV R2
4      hVP                  V4      W&   \        P
                  ! V RV R2\        ^R7       K~  	  R	# )
z
Helper function to deprecate arguments.

Args:
    func_name: Name of the function to be deprecated
    kwargs:
    aliases:
    fail:

z# is deprecated as an argument. Use z insteadz received both z and z as an argument. z is deprecated. Use r   )messagecategoryr   N)itemsr   	TypeErrorpopr   r   r   )r   r   r   r   old_termnew_terms   &&&&  r   rename_kwargsr    s     &mmo&j CH:XV  ! k
%z J$$,: .#*I/ 
  &zz(3FMMj CH:XV+ .r   c                0    V ^8  d   QhR\         R\        /# )r   rW   r   )r;   r   )r   s   "r   r   r     s     % % % %r   c                     V R8  d   V  R2# V R8  d   V R,          R R2# V R8  d   V R,          R R2# V R,          R R2# )	
   z Bytez.1fz kBz MBz GBi  i@B i ʚ;r   r   s   &r   _human_readable_bytesr	    s_    u}u}%-$C((u}%-$C((emC $$r   c                   b   a  ] tR tRt o RtRV 3R lR lltRV 3R lR lltV 3R lR	 ltR
tV t	R# )classpropertyi  z{
Decorator that converts a method with a single cls argument into a property
that can be accessed directly from the class.
Nc                   < V ^8  d   QhRR/# )r   r   Nr   )r   __classdict__s   "r   r   classproperty.__annotate__"  s      t r   c                    Wn         R # ro   fgetselfmethods   &&r   __init__classproperty.__init__"  s    	r   c                    < V ^8  d   QhRS[ /# r   r   )r	   )r   r  s   "r   r   r  %  s      S r   c                $    V P                  V4      # ro   r  )r  instanceclss   &&&r   __get__classproperty.__get__%  s    yy~r   c                    < V ^8  d   QhRS[ /# r  r   )r   r  s   "r   r   r  (  s       r   c                    Wn         V # ro   r  r  s   &&r   getterclassproperty.getter(  s    	r   r  ro   )
__name__
__module____qualname____firstlineno____doc__r  r  r   __static_attributes____classdictcell__r  s   @r   r  r    s(     
   r   r  c                   n   a  ] tR tRt o ^RIHt Rt Rt Rt V 3R lR lt	V 3R lR	 lt
V 3R
 ltRtV tR# )Filei-  )IndirectObjectr"   r   Nc                    < V ^8  d   QhRS[ /# r  rI   )r   r  s   "r   r   File.__annotate__>  s     m m mr   c           	         V P                   P                   R V P                   R\        \	        V P
                  4      4       R2# )z(name=z, data: ))	__class__r"  r   r	  r,   datar  s   &r   __str__File.__str__>  s?    ..))*&8DYZ]^b^g^gZhDiCjjkllr   c                    < V ^8  d   QhRS[ /# r  rI   )r   r  s   "r   r   r.  A  s     C C# Cr   c                d    V P                  4       R R R\        V P                  4       R2,           # )Nz, hash: r0  r}   )r4  hashr2  r3  s   &r   __repr__File.__repr__A  s,    ||~cr"xTYY/@%BBBr   c                N   < V ^8  d   Qh/ S[ ;R&   S[;R&   S[S[,          ;R&   # )r   r   r2  indirect_reference)r   rW   r
   r,  )r   r  s   "r   r   r.  -  s0      N	    !07 r   r   )r"  r#  r$  r%  genericr,  r   r2  r<  r4  r9  __annotate_func__r'  r(  r)  s   @r   r+  r+  -  sJ     'D D 48m mC C)  r   r+  c                      a  ] tR tRt o ]P
                  ! R4      tV 3R lR ltV 3R lR ltV 3R lR lt	V 3R	 lR
 lt
V 3R lR ltRtV tR# )VersioniE  z^(\d+)(.*)$c                $   < V ^8  d   QhRS[ RR/# )r   version_strr   NrI   )r   r  s   "r   r   Version.__annotate__I  s     ; ;C ;D ;r   c                >    Wn         V P                  V4      V n        R # ro   )rB  _parse_version
components)r  rB  s   &&r   r  Version.__init__I  s    &--k:r   c                L   < V ^8  d   QhRS[ RS[S[S[S[ 3,          ,          /# )r   rB  r   )r   listr   r;   )r   r  s   "r   r   rC  M  s(     ! !# !$uS#X2G !r   c                >   VP                  R 4      p. pV F  p\        P                  P                  V4      pV'       g   VP	                  ^ V34       K?  VP                  ^4      pVP                  ^4      pVf   ^ pVP	                  \        V4      V34       K  	  V# )r   )splitr@  COMPONENT_PATTERNmatchrL   groupr;   )r  rB  rF  parsed_components	componentrM  integer_prefixsuffixs   &&      r   rE  Version._parse_versionM  s     &&s+
#I--33I>E!((!Y8"[[^N[[^F%!"$$c.&96%BC $ ! r   c                &   < V ^8  d   QhRS[ RS[/# r   otherr   )objectrg   )r   r  s   "r   r   rC  \  s     3 3F 3t 3r   c                d    \        V\        4      '       g   R # V P                  VP                  8H  # F)r   r@  rF  )r  rV  s   &&r   __eq__Version.__eq__\  s'    %))%"2"222r   c                    < V ^8  d   QhRS[ /# r  r   )r   r  s   "r   r   rC  a  s     > ># >r   c                V    \        V P                  \        V P                  4      34      # ro   )r8  r1  r   rF  r3  s   &r   __hash__Version.__hash__a  s    T^^U4??%;<==r   c                &   < V ^8  d   QhRS[ RS[/# rU  )r	   rg   )r   r  s   "r   r   rC  e  s     < <C <D <r   c                \   \        V\        4      '       g   \        R \        V4       24      h\	        V P
                  VP
                  4       F1  w  r#Vw  rEVw  rgWF8  d    R# WF8  d    R# WW8  d    R# WW8  g   K0   R# 	  \        V P
                  4      \        VP
                  4      8  # )z#Version cannot be compared against TF)r   r@  r/   typer   rF  r,   )r  rV  self_componentother_component
self_valueself_suffixother_valueother_suffixs   &&      r   __lt__Version.__lt__e  s    %))B4;-PQQ/24??EDTDT/U+N&4#J(7%K'')) 0V 4??#c%*:*:&;;;r   )rF  rB  N)r"  r#  r$  r%  recompilerL  r  rE  rZ  r^  ri  r'  r(  r)  s   @r   r@  r@  E  sF     

>2; ;! !3 3
> >< <r   r@  c                h    V ^8  d   Qh/ ^ \         9   d
   \        ;R&   ^\         9   d
   \        ;R&   # )r   r   CompressedTransformationMatrix)__conditional_annotations__r   )r   s   "r   r   r      s8     ( (N ) O )T 	 U )r   )   r  )rp     )       	r~      r       ro   )rp  rY  )Hro  r&  
__author____author_email__	functoolsr   rk  sysr   dataclassesr   r   r   ior   osr   r   typingr   r	   r
   r   r   version_infor   typing_extensionsr   errorsr   r   r   r   r   r   rn  rV   r   StrByteTyper4   rE   rP   rc   r   rp   WHITESPACES_AS_REGEXPr]   re   rj   rv   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r  r+  total_orderingr@  r   )ro  s   @r   <module>r     s  8 )
/    	 
  ! ' "    B7" +w&  ',	%
eUE&9 :E%PUBU<VV'   -2	5%u,-   W
CO$9@2-& :xx, 33d: 2"(9A427(t	 
 
 
 
 
 
B U
P
	&(& F%Z " C C C. 1< 1< 1<r   