Ë
    ¨Œj¡Ì  ã            
       óö  — d dl Z d dlZd dlmZ d dlmZmZmZmZ d dl	m	Z	 d dl
mZmZmZmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZmZmZ ddlmZ ddlmZ ddlm Z m!Z!m"Z"m#Z# ddlm$Z% ddlm&Z' ddlm(Z) ddlm*Z+ ddl,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZB ddlCmDZD ddlEmFZFmGZG ddlHmIZI deJdeKdeeKeLedf   f   fd„ZM G d„ de4«      ZN G d„ d«      ZO G d „ d!eeef   «      ZPy)"é    N)Úabstractmethod)Ú	GeneratorÚIterableÚIteratorÚMapping)Údatetime)ÚAnyÚOptionalÚUnionÚcasté   )Ú
Encryption)Ú
PageObjectÚ_VirtualList)Úindex2label)Údeprecation_with_replacementÚlogger_warningÚparse_iso8824_date)ÚCatalogAttributes)ÚCatalogDictionary)ÚCheckboxRadioButtonAttributesÚGoToActionArgumentsÚPagesAttributesÚUserAccessPermissions)ÚCore)ÚDocumentInformationAttributes)ÚFieldDictionaryAttributes)ÚPageAttributes)ÚPdfReadErrorÚ
PyPdfError)ÚArrayObjectÚBooleanObjectÚByteStringObjectÚDestinationÚDictionaryObjectÚEncodedStreamObjectÚFieldÚFitÚFloatObjectÚIndirectObjectÚ
NameObjectÚ
NullObjectÚNumberObjectÚ	PdfObjectÚTextStringObjectÚ
TreeObjectÚViewerPreferencesÚcreate_string_objectÚis_null_or_none)ÚEmbeddedFile)ÚOutlineTypeÚPagemodeType)ÚXmpInformationÚdÚsizeÚreturn.c                 óh   — |dkD  rt        d«      ‚d| z   } | dd  } t        j                  d| «      d   S )Né   zInvalid size in convert_to_ints           iøÿÿÿz>qr   )r   ÚstructÚunpack)r8   r9   s     ú[/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/pypdf/_doc_common.pyÚconvert_to_intr@   Z   s@   € Øˆa‚xÜÐ;Ó<Ð<Ø+¨aÑ/€AØ	ˆ"ˆ#ˆ€AÜ�=‰=˜˜qÓ! !Ñ$Ð$ó    c                   óî  — e Zd ZdZdd„Zdedee   fd„Zedee   fd„«       Z	edee   fd„«       Z
edee   fd	„«       Zedee   fd
„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Zy)ÚDocumentInformationa…  
    A class representing the basic document metadata provided in a PDF File.
    This class is accessible through
    :py:class:`PdfReader.metadata<pypdf.PdfReader.metadata>`.

    All text properties of the document metadata have
    *two* properties, e.g. author and author_raw. The non-raw property will
    always return a ``TextStringObject``, making it ideal for a case where the
    metadata is being displayed. The raw property can sometimes return a
    ``ByteStringObject``, if pypdf was unable to decode the string's text
    encoding; this requires additional safety in the caller and therefore is not
    as commonly accessed.
    r:   Nc                 ó.   — t        j                  | «       y ©N)r%   Ú__init__©Úselfs    r?   rF   zDocumentInformation.__init__q   s   € Ü×!Ñ! $Õ'rA   Úkeyc                 ó‚   — | j                  |d «      }t        |t        «      r|S t        |t        «      rt	        |«      S y rE   )ÚgetÚ
isinstancer/   r#   Ústr)rH   rI   Úretvals      r?   Ú	_get_textzDocumentInformation._get_textt   s:   € Ø—‘˜#˜tÓ$ˆÜ�fÔ.Ô/ØˆMÜ�fÔ.Ô/Ü�v“;ÐØrA   c                 óà   — | j                  t        j                  «      rN| j                  t        j                  «      xs- | j                  t        j                  «      j	                  «       S dS )zŸ
        Read-only property accessing the document's title.

        Returns a ``TextStringObject`` or ``None`` if the title is not
        specified.
        N)rK   ÚDIÚTITLErO   Ú
get_objectrG   s    r?   ÚtitlezDocumentInformation.title|   sP   € ð �x‰xœŸ™Ô!ð �N‰Nœ2Ÿ8™8Ó$ÒG¨¯©´·±Ó(:×(EÑ(EÓ(Gð	
ð ð	
rA   c                 ó@   — | j                  t        j                  «      S )z>The "raw" version of title; can return a ``ByteStringObject``.)rK   rQ   rR   rG   s    r?   Ú	title_rawzDocumentInformation.title_rawŠ   s   € ð �x‰xœŸ™Ó!Ð!rA   c                 ó@   — | j                  t        j                  «      S )z¡
        Read-only property accessing the document's author.

        Returns a ``TextStringObject`` or ``None`` if the author is not
        specified.
        )rO   rQ   ÚAUTHORrG   s    r?   ÚauthorzDocumentInformation.author�   s   € ð �~‰~œbŸi™iÓ(Ð(rA   c                 ó@   — | j                  t        j                  «      S )z?The "raw" version of author; can return a ``ByteStringObject``.)rK   rQ   rX   rG   s    r?   Ú
author_rawzDocumentInformation.author_raw™   s   € ð �x‰xœŸ	™	Ó"Ð"rA   c                 ó@   — | j                  t        j                  «      S )z£
        Read-only property accessing the document's subject.

        Returns a ``TextStringObject`` or ``None`` if the subject is not
        specified.
        )rO   rQ   ÚSUBJECTrG   s    r?   ÚsubjectzDocumentInformation.subjectž   s   € ð �~‰~œbŸj™jÓ)Ð)rA   c                 ó@   — | j                  t        j                  «      S )z@The "raw" version of subject; can return a ``ByteStringObject``.)rK   rQ   r]   rG   s    r?   Úsubject_rawzDocumentInformation.subject_raw¨   ó   € ð �x‰xœŸ
™
Ó#Ð#rA   c                 ó@   — | j                  t        j                  «      S )ac  
        Read-only property accessing the document's creator.

        If the document was converted to PDF from another format, this is the
        name of the application (e.g. OpenOffice) that created the original
        document from which it was converted. Returns a ``TextStringObject`` or
        ``None`` if the creator is not specified.
        )rO   rQ   ÚCREATORrG   s    r?   ÚcreatorzDocumentInformation.creator­   s   € ð �~‰~œbŸj™jÓ)Ð)rA   c                 ó@   — | j                  t        j                  «      S )z@The "raw" version of creator; can return a ``ByteStringObject``.)rK   rQ   rc   rG   s    r?   Úcreator_rawzDocumentInformation.creator_raw¹   ra   rA   c                 ó@   — | j                  t        j                  «      S )aI  
        Read-only property accessing the document's producer.

        If the document was converted to PDF from another format, this is the
        name of the application (for example, macOS Quartz) that converted it to
        PDF. Returns a ``TextStringObject`` or ``None`` if the producer is not
        specified.
        )rO   rQ   ÚPRODUCERrG   s    r?   ÚproducerzDocumentInformation.producer¾   s   € ð �~‰~œbŸk™kÓ*Ð*rA   c                 ó@   — | j                  t        j                  «      S )zAThe "raw" version of producer; can return a ``ByteStringObject``.)rK   rQ   rh   rG   s    r?   Úproducer_rawz DocumentInformation.producer_rawÊ   ó   € ð �x‰xœŸ™Ó$Ð$rA   c                 óR   — t        | j                  t        j                  «      «      S )z:Read-only property accessing the document's creation date.)r   rO   rQ   ÚCREATION_DATErG   s    r?   Úcreation_datez!DocumentInformation.creation_dateÏ   s   € ô " $§.¡.´×1AÑ1AÓ"BÓCÐCrA   c                 ó@   — | j                  t        j                  «      S )zÉ
        The "raw" version of creation date; can return a ``ByteStringObject``.

        Typically in the format ``D:YYYYMMDDhhmmss[+Z-]hh'mm`` where the suffix
        is the offset from UTC.
        )rK   rQ   rn   rG   s    r?   Úcreation_date_rawz%DocumentInformation.creation_date_rawÔ   s   € ð �x‰xœ×(Ñ(Ó)Ð)rA   c                 óR   — t        | j                  t        j                  «      «      S )z”
        Read-only property accessing the document's modification date.

        The date and time the document was most recently modified.
        )r   rO   rQ   ÚMOD_DATErG   s    r?   Úmodification_datez%DocumentInformation.modification_dateÞ   s   € ô " $§.¡.´·±Ó"=Ó>Ð>rA   c                 ó@   — | j                  t        j                  «      S )zÕ
        The "raw" version of modification date; can return a
        ``ByteStringObject``.

        Typically in the format ``D:YYYYMMDDhhmmss[+Z-]hh'mm`` where the suffix
        is the offset from UTC.
        )rK   rQ   rs   rG   s    r?   Úmodification_date_rawz)DocumentInformation.modification_date_rawç   s   € ð �x‰xœŸ™Ó$Ð$rA   c                 ó@   — | j                  t        j                  «      S )z¢
        Read-only property accessing the document's keywords.

        Returns a ``TextStringObject`` or ``None`` if keywords are not
        specified.
        )rO   rQ   ÚKEYWORDSrG   s    r?   ÚkeywordszDocumentInformation.keywordsò   s   € ð �~‰~œbŸk™kÓ*Ð*rA   c                 ó@   — | j                  t        j                  «      S )zAThe "raw" version of keywords; can return a ``ByteStringObject``.)rK   rQ   rx   rG   s    r?   Úkeywords_rawz DocumentInformation.keywords_rawü   rl   rA   )r:   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rF   rM   r
   rO   ÚpropertyrT   rV   rY   r[   r^   r`   rd   rf   ri   rk   r   ro   rq   rt   rv   ry   r{   © rA   r?   rC   rC   b   s  „ ñó(ð˜Sð  X¨c¡]ó ð ð
�x ‘}ò 
ó ð
ð ð"˜8 C™=ò "ó ð"ð ð)˜ ™ò )ó ð)ð ð#˜H S™Mò #ó ð#ð ð*˜ #™ò *ó ð*ð ð$˜X c™]ò $ó ð$ð ð	*˜ #™ò 	*ó ð	*ð ð$˜X c™]ò $ó ð$ð ð	+˜( 3™-ò 	+ó ð	+ð ð%˜h s™mò %ó ð%ð ðD˜x¨Ñ1ò Dó ðDð ð* 8¨C¡=ò *ó ð*ð ð? 8¨HÑ#5ò ?ó ð?ð ð% x°¡}ò %ó ð%ð ð+˜( 3™-ò +ó ð+ð ð%˜h s™mò %ó ñ%rA   rC   c                   óì  — e Zd ZU dZdZeed<   dZee	e
      ed<   dZee   ed<   dZeed<   eedefd	„«       «       Zeedefd
„«       «       Zedeeef   dee   fd„«       Zedededefd„«       Zeedee   fd„«       «       Zedee   fd„«       Zedee   fd„«       Zedee   fd„«       Z defd„Z!dede
fd„Z"dede#eef   fd„Z$ede%ee&f   fd„«       Z'de(fd„Z)	 	 dWdee*df   dee%ee&f      de%ee&f   fd„Z+	 	 	 	 dXdee*   dee%e,e,f      dee,   dee	e      dee%ee,f      f
d„Z-d edefd!„Z.d"ee*ef   de%e,e,f   de,d#e,de	e   ddfd$„Z/dee*ef   de,de,de	e   ddf
d%„Z0de,d"e,d#e,ddfd&„Z1dYd'ede%ee,f   fd(„Z2d"ee3eef   de	e
   fd)„Z4edede&e5e6f   fd*„«       Z7e7jp                  d+edee&e
f   ddfd,„«       Z7ede9fd-„«       Z:	 dWd.ee   d/ee,   de9fd0„Z;edee(   fd1„«       Z<ededee=ef   dee   fd2„«       Z>d3e
dee   fd4„Z?d5e&dee   fd6„Z@d7eeeAf   d8ee	eeBede=ef         de&fd9„ZCd.edee&   fd:„ZDede	e
   fd;„«       ZEede	e   fd<„«       ZFedee   fd=„«       ZGedeeH   fd>„«       ZI	 	 	 	 dZd?ed@edee
f   dAee%ee,f      dee   ddf
dB„ZJ	 dYd3eee
ef   dCeddfdD„ZKdEedFedee   fdG„ZLdHede%eef   fdI„ZMedeeN   fdJ„«       ZOeedefdK„«       «       ZPedee%ee,f      fdL„«       ZQedeRee	eA   f   fdM„«       ZSedeTeUddf   fdN„«       ZVde	e   fdO„ZWdPede	eA   fdQ„ZX	 d[dRee   de%eeeAe	eA   f   f   fdS„ZYe	 	 dWdTedeZe   f   dUedeZe   f   de%ee,f   fdV„«       Z[y)\ÚPdfDocCommonzm
    Common functions from PdfWriter and PdfReader objects.

    This root class is strongly abstracted.
    FÚstrictNÚflattened_pagesÚ_encryptionÚ	_readonlyr:   c                  ó   — y rE   r�   rG   s    r?   Úroot_objectzPdfDocCommon.root_object  ó   € ð 	rA   c                  ó   — y rE   r�   rG   s    r?   Ú
pdf_headerzPdfDocCommon.pdf_header  rŠ   rA   Úindirect_referencec                  ó   — y rE   r�   ©rH   r�   s     r?   rS   zPdfDocCommon.get_object  ó   € ð 	rA   ÚindirectÚobjc                  ó   — y rE   r�   )rH   r‘   r’   s      r?   Ú_replace_objectzPdfDocCommon._replace_object!  ó   € àrA   c                  ó   — y rE   r�   rG   s    r?   Ú_infozPdfDocCommon._info%  rŠ   rA   c                 ój   — t        «       }| j                  €y|j                  | j                  «       |S )a  
        Retrieve the PDF file's document information dictionary, if it exists.

        Note that some PDF files use metadata streams instead of document
        information dictionaries, and these metadata streams will not be
        accessed by this function.
        N)rC   r—   Úupdate)rH   rN   s     r?   ÚmetadatazPdfDocCommon.metadata*  s.   € ô %Ó&ˆØ�:‰:ÐØØ�‰�d—j‘jÔ!ØˆrA   c                  ó   — y rE   r�   rG   s    r?   Úxmp_metadatazPdfDocCommon.xmp_metadata9  r•   rA   c                 ón  — | j                   j                  t        j                  d«      }|€y|j	                  «       }t        |t        «      sgt        |«      }t        |d«      r*|j                  �| j                  |j                  |«       |S || j                   t        t        j                  «      <   |S )zCReturns the existing ViewerPreferences as an overloaded dictionary.Nr�   )r‰   rK   ÚCDÚVIEWER_PREFERENCESrS   rL   r1   Úhasattrr�   r”   r+   )rH   Úos     r?   Úviewer_preferenceszPdfDocCommon.viewer_preferences=  s¡   € ð ×Ñ× Ñ ¤×!6Ñ!6¸Ó=ˆØˆ9ØØ�L‰L‹NˆÜ˜!Ô.Ô/Ü! !Ó$ˆAÜ�qÐ.Ô/°A×4HÑ4HÐ4TØ×$Ñ$ Q×%9Ñ%9¸1Ô=ð ˆð GH�× Ñ ¤¬B×,AÑ,AÓ!BÑCØˆrA   c                 óÒ   — | j                   r| j                  d   d   S | j                  €| j                  | j                  «       | j                  €J ‚t        | j                  «      S )zÜ
        Calculate the number of pages in this PDF file.

        Returns:
            The number of pages of the parsed PDF file.

        Raises:
            PdfReadError: If restrictions prevent this action.

        ú/Pagesú/Count)Úis_encryptedr‰   r…   Ú_flattenr‡   ÚlenrG   s    r?   Úget_num_pageszPdfDocCommon.get_num_pagesL  sb   € ð ×ÒØ×#Ñ# HÑ-¨hÑ7Ð7Ø×ÑÐ'Ø�M‰M˜$Ÿ.™.Ô)Ø×#Ñ#Ð/Ð/Ð/Ü�4×'Ñ'Ó(Ð(rA   Úpage_numberc                 ó”   — | j                   €| j                  | j                  «       | j                   €J d«       ‚| j                   |   S )a?  
        Retrieve a page by number from this PDF file.
        Most of the time ``.pages[page_number]`` is preferred.

        Args:
            page_number: The page number to retrieve
                (pages begin at zero)

        Returns:
            A :class:`PageObject<pypdf._page.PageObject>` instance.

        zhint for mypy)r…   r§   r‡   )rH   rª   s     r?   Úget_pagezPdfDocCommon.get_pagea  sH   € ð ×ÑÐ'Ø�M‰M˜$Ÿ.™.Ô)Ø×#Ñ#Ð/Ð@°Ó@Ð/Ø×#Ñ# KÑ0Ð0rA   c                 óì   ‡‡‡— t        t        | j                  d   «      Šdt        dt        dt        t
        t           t        f   fˆˆˆfd„Š ‰‰d«      \  }}t        |t        «      sJ d«       ‚||fS )z¯
        Retrieve the node and position within the /Kids containing the page.
        If page_number is greater than the number of pages, it returns the top node, -1.
        r¤   ÚnodeÚmir:   c                 ó€  •— t        t        | j                  dd«      «      }| d   dk(  r‰|k(  r| dfS d |dz   fS ‰|z
  |k\  r| ‰	k(  r‰	dfS d ||z   fS t        t        t        | d   «      «      D ]D  \  }}t        t
        |j                  «       «      } ‰||«      \  }}|�|dk  r| |fc S ||fc S |}ŒF t        d«      ‚)	Nr¥   r   z/Typeú/Pageéÿÿÿÿú/Kidsr   z"Unexpectedly cannot find the node.)r   ÚintrK   Ú	enumerater!   r%   rS   r    )
r®   r¯   ÚmaÚidxÚkidÚnÚirª   Úrecursive_callÚtops
          €€€r?   r»   z6PdfDocCommon._get_page_in_node.<locals>.recursive_call}  sç   ø€ ô ”c˜4Ÿ8™8 H¨aÓ0Ó1ˆBØ�G‰} Ò'Ø "Ò$Ø ˜8�OØ˜R !™V�|Ð#Ø˜bÑ  RÒ'Ø˜3’;Ø ˜7�NØ˜R "™W�}Ð$Ü%¤d¬;¸¸W¹Ó&FÖG‘��SÜÔ+¨S¯^©^Ó-=Ó>�Ù% c¨2Ó.‘��1Ø�=Ø˜1’uØ# S˜yÒ(à˜a˜4’KØ‘ð Hô ÐAÓBÐBrA   r   Úmypy)r   r%   r‰   r´   Útupler
   r.   rL   )rH   rª   r®   r·   r»   r¼   s    `  @@r?   Ú_get_page_in_nodezPdfDocCommon._get_page_in_nodes  s   ú€ ô Ô# T×%5Ñ%5°hÑ%?Ó@ˆð	CÜ"ð	CÜ(+ð	Cä”8œIÑ&¬Ð+Ñ,÷	Cñ. # 3¨Ó*‰	ˆˆcÜ˜$Ô 0Ô1Ð9°6Ó9Ð1Ø�SˆyÐrA   c                 ó"   — | j                  «       S )z8A read-only dictionary which maps names to destinations.)Ú_get_named_destinationsrG   s    r?   Únamed_destinationszPdfDocCommon.named_destinations˜  s   € ð ×+Ñ+Ó-Ð-rA   c                 ó~  — t        «       }t        j                  | j                  v �rut	        | j                  t        j                     t
        «      �rIt        t
        | j                  t        j                     «      }t        j                  |v r«t	        |t        j                     t
        «      rŠt        t
        |t        j                     «      }|j                  }t        j                  |v r#t        t         |t        j                     «      }|S t        «       }||t        t        j                  «      <   |S t        | d«      rSt        «       }| j                  |«      }||t        t        j                  «      <   ||t        t        j                  «      <   |S t        | d«      r”t        «       }| j                  |«      }|| j                  t        t        j                  «      <   t        «       }| j                  |«      }||t        t        j                  «      <   ||t        t        j                  «      <   |S )NÚ_add_object)r!   ÚCAÚNAMESr‰   rL   r%   r   ÚDESTSr�   r+   r    rÄ   )rH   Ú
named_destÚnamesÚdestsÚ	dests_refÚ	names_refs         r?   Úget_named_dest_rootz PdfDocCommon.get_named_dest_root�  s²  € Ü “]ˆ
Ü�8‰8�t×'Ñ'Ò'¬JØ×ÑœRŸX™XÑ&Ô(8õ-
ô Ô)¨4×+;Ñ+;¼B¿H¹HÑ+EÓFˆEÜ�x‰x˜5Ñ ¤Z°´b·h±h±ÔAQÔ%RäÔ-¨u´R·X±X©Ó?�Ø!×4Ñ4�	Ü—8‘8˜uÑ$ä!%¤k°5¼¿¹±?Ó!C�Jð& Ðô# "-£�JØ2<�Eœ*¤R§X¡XÓ.Ñ/ð  Ðô ˜˜}Ô-Ü(Ó*�Ø ×,Ñ,¨UÓ3�	Ø.7�”j¤§¡Ó*Ñ+Ø.8�”j¤§¡Ó*Ñ+ð Ðô �T˜=Ô)Ü$Ó&ˆEØ×(Ñ(¨Ó/ˆIØ5>ˆD×ÑœZ¬¯©Ó1Ñ2Ü$Ó&ˆEØ×(Ñ(¨Ó/ˆIØ*3ˆE”*œRŸX™XÓ&Ñ'Ø*4ˆE”*œRŸX™XÓ&Ñ'àÐrA   ÚtreerN   c                 ó  — |€¨i }| j                   }t        j                  |v r"t        t        |t        j                     «      }nft        j
                  |v rTt        t        |t        j
                     «      }t        j                  |v r!t        t        |t        j                     «      }t        |«      r|S |€J d«       ‚t        j                  |v rHt        t        |t        j                     «      D ]"  }| j                  |j                  «       |«       Œ$ |S t        j
                  |v rÝt        t        |t        j
                     «      }d}|t        |«      k  rª||   j                  «       }|dz  }t        |t        t         f«      sŒ=	 ||   j                  «       }|dz  }t        |t        «      rd|v r|d   }nŒq| j%                  ||«      }	|	�$|	|t        t         |	d   «      <   |	|t!        |«      <   |t        |«      k  rŒª|S |j'                  «       D ]X  \  }
}|j                  «       }t        |t        «      rd|v r|d   j                  «       }nŒ?| j%                  |
|«      }	|	€ŒT|	||
<   ŒZ |S # t"        $ r Y |S w xY w)a  
        Retrieve the named destinations present in the document.

        Args:
            tree: The current tree.
            retval: The previously retrieved destinations for nested calls.

        Returns:
            A dictionary which maps names to destinations.

        r½   r   r   ú/Dú/Title)r‰   rÅ   rÇ   r   r0   rÆ   r%   r3   r   ÚKIDSr!   rÁ   rS   r¨   rL   ÚbytesrM   Ú
IndexErrorÚ_build_destinationÚitems)rH   rÎ   rN   ÚcatalogrÉ   r¸   rº   rI   ÚvalueÚdestÚk__Úv__Úvals                r?   rÁ   z$PdfDocCommon._get_named_destinations¿  sa  € ð  ˆ>ØˆFØ×&Ñ&ˆGô �x‰x˜7Ñ"ÜœJ¨´·±Ñ(9Ó:‘Ü—‘˜WÑ$ÜÔ-¨w´r·x±xÑ/@ÓA�Ü—8‘8˜uÑ$Ü¤
¨E´"·(±(©OÓ<�Dä˜4Ô ØˆMØÐÐ' Ó'Ðä×Ñ 4Ñ'äœK¨¬o×.BÑ.BÑ)CÖD�Ø×,Ñ,¨S¯^©^Ó-=¸vÕFð EðJ ˆôE �X‰X˜ÑÜÔ)¨4´·±©>Ó:ˆEØˆAØ”c˜%“j’.Ø˜A‘h×)Ñ)Ó+�Ø�Q‘�Ü! #¬¬s |Ô4ØðØ! !™H×/Ñ/Ó1�Eð �Q‘�Ü˜eÔ%5Ô6Ø˜u‘}Ø % d¡™à Ø×.Ñ.¨s°EÓ:�ØÐ#Ø8<�Fœ4¤ T¨(¡^Ó4Ñ5à'+�Fœ3˜s›8Ñ$ð' ”c˜%“j“.ð> ˆð !ŸJ™JžL‘��SØ—n‘nÓ&�Ü˜cÔ#3Ô4Ø˜s‘{Ø! $™i×2Ñ2Ó4™à Ø×.Ñ.¨s°CÓ8�ØÑ#Ø"&�F˜3’Kð )ð ˆøô1 "ò Øð. ˆð1ús   ÆI7 É7	JÊJÚfileobjÚstackc                 óþ  ‡— t        j                  «       }|j                  t        j                  «       «       |€Li }| j                  }g }t
        j                  |v r)t        t        t           |t
        j                     «      Šny‰€|S |€J ‚d‰v rAt        t        ‰d   «      }|D ]'  }|j                  «       }	| j                  |	||||«       Œ) |S t        ˆfd„|D «       «      r| j                  ‰||||«       |S )aÇ  
        Extract field data if this PDF contains interactive form fields.

        The *tree*, *retval*, *stack* parameters are for recursive use.

        Args:
            tree: Current object to parse.
            retval: In-progress list of fields.
            fileobj: A file object (usually a text file) to write
                a report to on all interactive form fields found.
            stack: List of already parsed objects.

        Returns:
            A dictionary where each key is a field name, and each
            value is a :class:`Field<pypdf.generic.Field>` object. By
            default, the mapping name is used for keys.
            ``None`` if form data could not be located.

        Nz/Fieldsc              3   ó&   •K  — | ]  }|‰v –— Œ
 y ­wrE   r�   )Ú.0ÚattrrÎ   s     €r?   Ú	<genexpr>z*PdfDocCommon.get_fields.<locals>.<genexpr>8  s   øè ø€ Ð;Ñ*: $�˜”Ñ*:ùó   ƒ)ÚFAÚattributes_dictr™   r   r‰   rž   Ú	ACRO_FORMr   r
   r0   r!   rS   Ú_build_fieldÚany)
rH   rÎ   rN   rÝ   rÞ   Úfield_attributesr×   ÚfieldsÚfÚfields
    `        r?   Ú
get_fieldszPdfDocCommon.get_fields  sý   ø€ ô4 ×-Ñ-Ó/ÐØ×ÑÔ =× MÑ MÓ OÔPØˆ>ØˆFØ×&Ñ&ˆGØˆEä�|‰|˜wÑ&ÜœH¤ZÑ0°'¼"¿,¹,Ñ2GÓH‘àØˆ<ØˆMØÐ Ð Ð Ø˜ÑÜœ+ t¨I¡Ó7ˆFÛ�ØŸ™›�Ø×!Ñ! %¨°Ð:JÈEÕRð ð ˆô Ó;Ñ*:Ó;Ô;à×Ñ˜d F¨GÐ5EÀuÔMØˆrA   Úparentc                 ó  — d|v rt        t        |d   «      S d|v rF| j                  t        t        |d   «      «      dz   t        t        |j	                  dd«      «      z   S t        t        |j	                  dd«      «      S )Nú/TMú/ParentÚ.ú/TÚ )r   rM   Ú_get_qualified_field_namer%   rK   )rH   rï   s     r?   rö   z&PdfDocCommon._get_qualified_field_name=  s…   € Ø�F‰?Üœ˜V E™]Ó+Ð+Ø˜Ñà×.Ñ.ÜÔ)¨6°)Ñ+<Ó=óð ñô ”s˜FŸJ™J t¨RÓ0Ó1ñ	2ðô ”C˜Ÿ™ D¨"Ó-Ó.Ð.rA   rí   rê   c                 ó¼  ‡— t        ˆfd„dD «       «      ry | j                  ‰«      }|r$| j                  |‰|«       |j                  d«       t	        ‰«      ||<   ||   j
                  j                  «       }|j                  t        j                  d«      dk(  r+|t        t        j                  «         ||   t        d«      <   |j                  t        j                  d«      dk(  rqd|v rmt        t        |d   d	   j                  «       «      «      ||   t        d«      <   d
||   d   v�r™||   t        d«         j                  t        d
«      «       �nn|j                  t        j                  d«      dk(  �rJ|j                  t        j                   d«      t        j"                  j$                  z  dk7  �rg }t        |«      ||   t        d«      <   |j                  t        j&                  i «      D ]f  }	|	j                  «       }	t        |	d   d	   j                  «       «      D ]  }
|
|vsŒ|j                  |
«       Œ t        |«      ||   t        d«      <   Œh |j                  t        j                   d«      t        j"                  j(                  z  dk7  r(d
||   d   v r||   d   ||   d   j+                  d
«      = | j-                  ‰|||«       y )Nc              3   ó&   •K  — | ]  }|‰v–— Œ
 y ­wrE   r�   )rá   râ   rí   s     €r?   rã   z,PdfDocCommon._build_field.<locals>.<genexpr>R  s   øè ø€ Ð;©] Tˆt˜5Ô ©]ùrä   )rô   rñ   Ú
rõ   ú/Chz	/_States_ú/Btnz/APz/Nz/Offr   )Úallrö   Ú_write_fieldÚwriter'   r�   rS   rK   rå   ÚFTr+   ÚOptr!   ÚlistÚkeysÚappendÚFfÚFfBitsÚRadioÚKidsÚNoToggleToOffÚindexÚ_check_kids)rH   rí   rN   rÝ   rê   rÞ   rI   r’   ÚstatesÚkÚss    `         r?   rè   zPdfDocCommon._build_fieldJ  sd  ø€ ô Ó;©]Ó;Ô;ØØ×,Ñ,¨UÓ3ˆÙØ×Ñ˜g uÐ.>Ô?Ø�M‰M˜$ÔÜ˜E“lˆˆs‰Ø�S‰k×,Ñ,×7Ñ7Ó9ˆØ�7‰7”2—5‘5˜"Ó Ò&Ø36´zÄ"Ç&Á&Ó7IÑ3JˆF�3‰Kœ
 ;Ó/Ñ0Ø�7‰7”2—5‘5˜"Ó Ò'¨E°S©Lä3>Ü�S˜‘Z Ñ%×*Ñ*Ó,Ó-ó4ˆF�3‰Kœ
 ;Ó/Ñ0ð ˜V C™[¨Ñ5Ò5Ø�s‘œJ {Ó3Ñ4×;Ñ;¼JÀvÓ<NÖOØ�W‰W”R—U‘U˜BÓ 6Ó)¨c¯g©g´b·e±e¸QÓ.?Ä"Ç)Á)Ç/Á/Ñ.QÐUVÓ.VØ "ˆFÜ3>¸vÓ3FˆF�3‰Kœ
 ;Ó/Ñ0Ø—W‘WœRŸW™W bÖ)�Ø—L‘L“N�Ü˜a ™h t™n×1Ñ1Ó3Ö4�AØ ’ØŸ™ aÕ(ð 5ô 8CÀ6Ó7J��s‘œJ {Ó3Ò4ð *ð —‘œŸ™˜qÓ!¤B§I¡I×$;Ñ$;Ñ;¸qÒ@Ø˜f S™k¨+Ñ6Ñ6à˜3‘K Ñ,¨V°C©[¸Ñ-E×-KÑ-KÈFÓ-SÐTà×Ñ˜ ¨°Õ7rA   c                 ó  — ||v r#t        | j                  |«      › d�t        «       y |j                  |«       t        j
                  |v r=|t        j
                     D ]&  }|j                  «       }| j                  ||||«       Œ( y y )Nz already parsed)r   rö   r|   r  r   rÒ   rS   rî   )rH   rÎ   rN   rÝ   rÞ   r¸   s         r?   r
  zPdfDocCommon._check_kidst  s‚   € ð �5‰=ÜØ×1Ñ1°$Ó7Ð8¸ÐHÌ(ôð Ø�‰�TÔÜ×Ñ 4Ñ'àœO×0Ñ0Ô1�Ø—n‘nÓ&�Ø—‘  V¨W°eÕ<ñ 2ð (rA   c                 óX  — t        j                  «       }|t        j                  «       z   }|D ]Æ  }|t         j                  t         j                  fv rŒ&||   }	 |t         j
                  k(  r,dddddœ}||   |v rz|j                  |› d|||      › d�«       n\|t         j                  k(  r/	 ||   t         j                     }|j                  |› d|› d�«       n|j                  |› d||   › d�«       ŒÈ y # t        $ r ||   t         j                     }Y ŒVw xY w# t        $ r Y Œúw xY w)NÚButtonÚTextÚChoiceÚ	Signature)rû   ú/Txrú   z/Sigú: rù   )rå   Ú
attributesr   r  ÚAArÿ   rþ   ÚParentÚTMÚKeyErrorÚT)	rH   rÝ   rí   rê   Úfield_attributes_tuplerâ   Ú	attr_nameÚtypesÚnames	            r?   rý   zPdfDocCommon._write_field‡  sC  € Ü!#§¡£Ðà"Ô%B×%MÑ%MÓ%OÑOð 	ó +ˆDØÜ—‘Ü—‘ðñ ð Ø(¨Ñ.ˆIðØœ2Ÿ5™5’=ð !)Ø%Ø'Ø +ñ	�Eð ˜T‘{ eÑ+ØŸ™¨¨°2°e¸EÀ$¹KÑ6HÐ5IÈÐ&LÕMØœRŸY™YÒ&ð1Ø$ T™{¬2¯5©5Ñ1˜ð —M‘M Y K¨r°$°°rÐ":Õ;à—M‘M Y K¨r°%¸±+°¸bÐ"AÔBøñ5 +øô, $ò 1Ø$ T™{¬2¯4©4Ñ0šð1ûô
 ò áðús7   ÁADÂ-C8Ã2DÃ8DÄDÄDÄDÄ	D)Ä(D)Úfull_qualified_namec           
      óX  — dt         dt        t        t        f   dt         fd„}| j                  «       }|€i S i }|j	                  «       D ]]  \  }}|j                  d«      dk(  sŒ|r|j                  d«      ||<   Œ2|j                  d«      | |t        t         |d   «      |«      <   Œ_ |S )	a§  
        Retrieve form fields from the document with textual data.

        Args:
            full_qualified_name: to get full name

        Returns:
            A dictionary. The key is the name of the form field,
            the value is the content of the field.

            If the document contains multiple form fields with the same name, the
            second and following will get the suffix .2, .3, ...

        r  rë   r:   c                 ó\   ‡ — ‰ |vr‰ S ‰ dz   t        t        ˆ fd„|D «       «      dz   «      z   S )Nró   c              3   óL   •K  — | ]  }|j                  ‰d z   «      sŒd–— Œ y­w)ró   r   N)Ú
startswith)rá   Úkkr  s     €r?   rã   zIPdfDocCommon.get_form_text_fields.<locals>.indexed_key.<locals>.<genexpr>Â  s!   øè ø€ ÐG¡f °·±¸aÀ#¹gÕ0Fœ!¡fùs   ƒ$�$é   )rM   Úsum)r  rë   s   ` r?   Úindexed_keyz6PdfDocCommon.get_form_text_fields.<locals>.indexed_key¼  s=   ø€ Ø˜‰Ø�àØñä”cÓG¡fÓGÓGÈ!ÑKÓLñMðrA   ú/FTr  z/Vrô   )rM   Údictr	   rî   rÖ   rK   r   )rH   r   r(  Ú
formfieldsÚffrí   rØ   s          r?   Úget_form_text_fieldsz!PdfDocCommon.get_form_text_fields¬  s©   € ð 	œ3ð 	¬¬S´#¨X©ð 	¼3ó 	ð —_‘_Ó&ˆ
ØÐØˆIØˆØ&×,Ñ,Ö.‰LˆE�5Ø�y‰y˜Ó 5Ó(Ù&Ø %§	¡	¨$£�B�u’IàBGÇ)Á)ÈDÃ/�B‘{¤4¬¨U°4©[Ó#9¸2Ó>Ò?ð /ð ˆ	rA   c           
      ó®  ‡— dt         dt        dt        fˆfd„Š	 t        t         |j                  j                  «       «      }t         ‰|d«      «      rt        d«      ‚g }|j                  d	d
«      dk(  rQd|v r|d   j                  «       g}nÓ| j                  D �cg c]"  }|j                  |j                  dd
«      v r|‘Œ$ }}n›|j                  dd«      }|D ]„  }|j                  «       }|j                  d	d
«      dk(  sŒ)d|vsŒ.d|v r||d   j                  «       gz  }ŒJ|| j                  D �cg c]"  }|j                  |j                  dd
«      v r|‘Œ$ c}z  }Œ† |D �cg c]<  }t        |t        «      r|n'| j                  | j                  |j                  «         ‘Œ> c}S # t        $ r}t        d«      |‚d}~ww xY wc c}w c c}w c c}w )a†  
        Provides list of pages where the field is called.

        Args:
            field: Field Object, PdfObject or IndirectObject referencing a Field

        Returns:
            List of pages:
                - Empty list:
                    The field has no widgets attached
                    (either hidden field or ancestor field).
                - Single page list:
                    Page where the widget is present
                    (most common).
                - Multi-page list:
                    Field with multiple kids widgets
                    (example: radio buttons, field repeated on multiple pages).

        r’   rI   r:   c                 óp   •— || v r| |   S d| v r( ‰t        t        | d   j                  «       «      |«      S y )Nrò   )r   r%   rS   )r’   rI   Ú_get_inheriteds     €r?   r0  z<PdfDocCommon.get_pages_showing_field.<locals>._get_inheritedé  sG   ø€ Ø�c‰zØ˜3‘x�Ø˜CÑÙ%ÜÔ)¨3¨y©>×+DÑ+DÓ+FÓGÈóð ð rA   zField type is invalidNr)  zField is not validz/Subtyperõ   z/Widgetz/Pz/Annotsr³   r�   rô   )r%   rM   r	   r   r�   rS   Ú	ExceptionÚ
ValueErrorr3   rK   ÚpagesrL   r   Ú_get_page_number_by_indirect)	rH   rí   ÚexcÚretÚpÚkidsr  Úxr0  s	           @r?   Úget_pages_showing_fieldz$PdfDocCommon.get_pages_showing_fieldÒ  sõ  ø€ ð.	Ô 0ð 	´sð 	¼sõ 	ð	?äÔ)¨5×+CÑ+C×+NÑ+NÓ+PÓQˆEô ™>¨%°Ó7Ô8ÜÐ1Ó2Ð2ØˆØ�9‰9�Z Ó$¨	Ò1Ø�u‰}Ø˜T‘{×-Ñ-Ó/Ð0‘ð "ŸZšZóá'˜Ø×/Ñ/°1·5±5¸ÀBÓ3GÑGò Ø'ð ñ ð —9‘9˜W bÓ)ˆDÛ�Ø—L‘L“N�Ø—E‘E˜* bÓ)¨YÓ6¸TÈº]à˜q‘yØ  $¡× 2Ñ 2Ó 4Ð5Ñ5™àà%)§Z¢Zó á%/ Ø ×3Ñ3°q·u±u¸YÈÓ7KÑKò Ø%/ñ ñ ™ð ñ  ó	
ñ �ô ˜!œZÔ(ñ à—*‘*˜T×>Ñ>¸q×?SÑ?SÓTÑUñWð ñ	
ð 	
øô9 ò 	?ÜÐ4Ó5¸3Ð>ûð	?üòùò ùò

s*   ›(F+ Â'GÄ5'GÅ'AGÆ+	GÆ4G Ç Gc                 ój  — d| j                   vry| j                   d   }t        |t        «      r|j                  «       }t        |t        «      rt        |«      S t        |t        «      r(	 |^}}}t        |t        |«      «      }t        d||«      S y# t        $ r}t        d|› d|› �«      ‚d}~ww xY w)zý
        Property to access the opening destination (``/OpenAction`` entry in
        the PDF catalog). It returns ``None`` if the entry does not exist
        or is not set.

        Raises:
            Exception: If a destination is invalid.

        z/OpenActionNÚ
OpenActionzInvalid Destination r  )r‰   rL   rÓ   ÚdecoderM   r2   r!   r(   r¾   r$   r1  )rH   ÚoaÚpageÚtypÚarrayÚfitr5  s          r?   Úopen_destinationzPdfDocCommon.open_destination  s¼   € ð  × 0Ñ 0Ñ0ØØ×"Ñ" =Ñ1ˆÜ�bœ%Ô Ø—‘“ˆBÜ�bœ#ÔÜ'¨Ó+Ð+Ü�bœ+Ô&ðDØ$&Ð!��c˜EÜ˜#œu U›|Ó,�Ü" <°°sÓ;Ð;ð øô ò DÜÐ"6°r°d¸"¸S¸EÐ BÓCÐCûðDús   Á+&B Â	B2ÂB-Â-B2rÙ   c                 ó   — t        d«      ‚)NzNo setter for open_destination)ÚNotImplementedError)rH   rÙ   s     r?   rC  zPdfDocCommon.open_destination6  s   € ä!Ð"BÓCÐCrA   c                 ó"   — | j                  «       S )z©
        Read-only property for the outline present in the document
        (i.e., a collection of 'outline items' which are also known as
        'bookmarks').
        )Ú_get_outlinerG   s    r?   ÚoutlinezPdfDocCommon.outline:  s   € ð × Ñ Ó"Ð"rA   r®   rH  c                 ó  — |€Šg }| j                   }t        j                  |v rUt        t        |t        j                     «      }t        |t        «      r|S t        |«      sd|v rt        t        |d   «      }| j                  «       | _	        |€|S 	 | j                  |«      }|r|j                  |«       d|v r8g }| j                  t        t        |d   «      |«       |r|j                  |«       d|vr	 |S t        t        |d   «      }Œ{)Nz/Firstz/Next)r‰   ÚCOÚOUTLINESr   r%   rL   r,   r3   rÁ   Ú_named_destinationsÚ_build_outline_itemr  rG  )rH   r®   rH  r×   ÚlinesÚoutline_objÚsub_outlines          r?   rG  zPdfDocCommon._get_outlineC  s  € ð ˆ?ØˆGØ×&Ñ&ˆGô �{‰{˜gÑ%ÜÔ-¨w´r·{±{Ñ/CÓD�ä˜e¤ZÔ0Ø"�Nô ' uÔ-°(¸eÑ2CÜÔ 0°%¸±/ÓB�DØ'+×'CÑ'CÓ'EˆDÔ$àˆ<ØˆNð Ø×2Ñ2°4Ó8ˆKÙØ—‘˜{Ô+ð ˜4ÑØ)+�Ø×!Ñ!¤$Ô'7¸¸h¹Ó"HÈ+ÔVÙØ—N‘N ;Ô/à˜dÑ"Øð ˆô Ô(¨$¨w©-Ó8ˆDð rA   c                 óz   — | j                   }t        j                  |v rt        d|t        j                     «      S y)uN  
        Read-only property for the list of threads.

        See Â§12.4.3 from the PDF 1.7 or 2.0 specification.

        It is an array of dictionaries with "/F" (the first bead in the thread)
        and "/I" (a thread information dictionary containing information about
        the thread, such as its title, author, and creation date) properties or
        None if there are no articles.

        Since PDF 2.0 it can also contain an indirect reference to a metadata
        stream containing information about the thread, such as its title,
        author, and creation date.
        r!   N)r‰   rJ  ÚTHREADSr   )rH   r×   s     r?   ÚthreadszPdfDocCommon.threadsl  s4   € ð  ×"Ñ"ˆÜ�:‰:˜Ñ Ü˜ w¬r¯z©zÑ':Ó;Ð;ØrA   c                  ó   — y rE   r�   r�   s     r?   r4  z)PdfDocCommon._get_page_number_by_indirect�  r�   rA   r?  c                 ó8   — | j                  |j                  «      S )a  
        Retrieve page number of a given PageObject.

        Args:
            page: The page to get page number. Should be
                an instance of :class:`PageObject<pypdf._page.PageObject>`

        Returns:
            The page number or None if page is not found

        )r4  r�   )rH   r?  s     r?   Úget_page_numberzPdfDocCommon.get_page_number‡  s   € ð ×0Ñ0°×1HÑ1HÓIÐIrA   Údestinationc                 ó8   — | j                  |j                  «      S )zÝ
        Retrieve page number of a given Destination object.

        Args:
            destination: The destination to get page number.

        Returns:
            The page number or None if page is not found

        )r4  r?  )rH   rW  s     r?   Úget_destination_page_numberz(PdfDocCommon.get_destination_page_number•  s   € ð ×0Ñ0°×1AÑ1AÓBÐBrA   rT   rA  c                 óö  — d\  }}t        |t        t        f«      s t        |t        «      rt	        |«      dk(  s|€)t        «       }t        ||t        j                  «       «      S |^}}}	 t        ||t        ||¬«      «      S # t        $ rl t        d|›d|› �t        «       | j                  r‚ | j                  d   j                  }|€
t        «       n|}t        ||t        j                  «       «      cY S w xY w)N©NNr   )Úfit_typeÚfit_argszUnknown destination: Ú )rL   r,   rM   r!   r¨   r$   r(   rB  r   r   r|   r„   r3  r�   )rH   rT   rA  r?  r@  Útmpr�   s          r?   rÕ   zPdfDocCommon._build_destination¢  så   € ð ‰	ˆˆcô �uœz¬3Ð/Ô0Ü˜5¤+Ô.´3°u³:À²?Øˆ}ä“<ˆDÜ˜u d¬C¯G©G«IÓ6Ð6Ø!Ðˆˆc�Eð		EÜ˜u d¬C¸ÀuÔ,MÓNÐNøÜò 	EÜÐ2°5°)¸1¸U¸GÐDÄhÔOØ�{Š{Øà—*‘*˜Q‘-×2Ñ2ˆCØ14°¤¤À#ÐÜ˜uÐ&8¼#¿'¹'»)ÓDÒDð	Eús   Á+B ÂA2C8Ã7C8c                 ó¸  — d\  }}}	 t        d|d   «      }d|v ryt        t        |d   «      }t        t
        |t        j                     «      }|dk(  rbt        j                  |v r|t        j                     }n<| j                  r0t        d|›�«      ‚d	|v r|d	   }t        |t        «      r	d
|v r|d
   }t        |t        «      r| j                  ||«      }n�t        |t        «      r+	 | j                  || j                  |   j                  «      }nU|€| j                  ||«      }n@| j                  rt        d|›�«      ‚t        d|›d�t         «       | j                  |d «      }|ryd|v r!t        d„ |d   D «       «      |t        d«      <   d|v r|d   |t        d«      <   d|v r|d   |t        d«      <   t#        |j%                  dd«      dk\  «      |t        d«      <   ||_        	 |j(                  |_        |S # t        $ r  | j                  rt        d|›�«      ‚d}Y �Œw xY w# t        $ r | j                  |d «      }Y Œßw xY w# t*        $ r Y |S w xY w)N)NNNrM   rÑ   z(Outline Entry Missing /Title attribute: rõ   z/Az/GoToz%Outline Action Missing /D attribute: z/DestrÐ   zUnexpected destination zRemoved unexpected destination z from destinationz/Cc              3   ó2   K  — | ]  }t        |«      –— Œ y ­wrE   )r)   )rá   Úcs     r?   rã   z3PdfDocCommon._build_outline_item.<locals>.<genexpr>ù  s   è ø€ Ð<`ÑU_ÐPQ¼[È¿^ÑU_ùs   ‚z/Fr¥   r   z
/%is_open%)r   r  r„   r   r%   r+   r   ÚSÚDrL   r!   rÕ   rM   rL  Ú
dest_arrayr   r|   r"   rK   r®   r�   ÚAttributeError)rH   r®   rÙ   rT   Úoutline_itemÚactionÚaction_types          r?   rM  z PdfDocCommon._build_outline_itemÀ  s”  € Ø$4Ñ!ˆˆe�\ð	Ü˜  X¡Ó/ˆEð �4‰<äÔ*¨D°©JÓ7ˆFÜœz¨6Ô2E×2GÑ2GÑ+HÓIˆKØ˜gÒ%Ü&×(Ñ(¨FÑ2Ø!Ô"5×"7Ñ"7Ñ8‘DØ—[’[Ü&Ð)NÈtÈhÐ'WÓXÐXØ˜‰_à˜‘=ˆDä˜$Ô 0Ô1°d¸d±lØ˜D‘z�ä�dœKÔ(Ø×2Ñ2°5¸$Ó?‰LÜ˜œcÔ"ðDØ#×6Ñ6Ø˜4×3Ñ3°DÑ9×DÑDó ‘ð ˆ\ð  ×2Ñ2°5¸$Ó?‰Là�{Š{Ü"Ð%<¸T¸HÐ#EÓFÐFÜØ1°$°Ð9JÐKÜôð  ×2Ñ2°5¸$Ó?ˆLñ Ø�t‰|ä1<Ñ<`ÐUYÐZ^ÒU_Ó<`Ó1`�œZ¨Ó-Ñ.Ø�t‰|ð 26°d±�œZ¨Ó-Ñ.Ø˜4Ñð 6:¸(±^�œZ¨Ó1Ñ2ä5BØ—‘˜ 1Ó%¨Ñ*ó6ˆLœ LÓ1Ñ2ð !ˆÔð	Ø.2×.EÑ.EˆLÔ+ð ÐøôI ò 	Ø�{Š{Ü"Ð%MÈdÈXÐ#VÓWÐWØ‹Eð	ûô< ò Dà#×6Ñ6°u¸dÓC’ðDûôH ò 	ØØÐð	ús5   ˆG? Ã*)H+ Ç,I Ç?%H(È'H(È+I	ÉI	É	IÉIc                 óB   — t        | j                  | j                  «      S )aW  
        Property that emulates a list of :class:`PageObject<pypdf._page.PageObject>`.
        This property allows to get a page or a range of pages.

        Note:
            For PdfWriter only: Provides the capability to remove a page/range of
            page from the list (using the del operator). Remember: Only the page
            entry is removed, as the objects beneath can be used elsewhere. A
            solution to completely remove them - if they are not used anywhere - is
            to write to a buffer/temporary file and then load it into a new
            PdfWriter.

        )r   r©   r¬   rG   s    r?   r3  zPdfDocCommon.pages  s   € ô ˜D×.Ñ.°·±Ó>Ð>rA   c                 óx   — t        t        | j                  «      «      D �cg c]  }t        | |«      ‘Œ c}S c c}w )z²
        A list of labels for the pages in this document.

        This property is read-only. The labels are in the order that the pages
        appear in the document.
        )Úranger¨   r3  Úpage_index2page_label)rH   rº   s     r?   Úpage_labelszPdfDocCommon.page_labels  s3   € ô 9>¼cÀ$Ç*Á*»oÔ8NÓOÑ8N°1Ô% d¨AÕ.Ð8NÑOÐOùÒOs   ¡7c                 óx   — 	 t        t        | j                  t        j                     «      S # t
        $ r Y yw xY w)aï  
        Get the page layout currently being used.

        .. list-table:: Valid ``layout`` values
           :widths: 50 200

           * - /NoLayout
             - Layout explicitly not specified
           * - /SinglePage
             - Show one page at a time
           * - /OneColumn
             - Show one column at a time
           * - /TwoColumnLeft
             - Show pages in two columns, odd-numbered pages on the left
           * - /TwoColumnRight
             - Show pages in two columns, odd-numbered pages on the right
           * - /TwoPageLeft
             - Show two pages at a time, odd-numbered pages on the left
           * - /TwoPageRight
             - Show two pages at a time, odd-numbered pages on the right
        N)r   r+   r‰   rž   ÚPAGE_LAYOUTr  rG   s    r?   Úpage_layoutzPdfDocCommon.page_layout(  s5   € ð.	Üœ
 D×$4Ñ$4´R·^±^Ñ$DÓEÐEøÜò 	Ùð	ús   ‚*- ­	9¸9c                 ó@   — 	 | j                   d   S # t        $ r Y yw xY w)a2  
        Get the page mode currently being used.

        .. list-table:: Valid ``mode`` values
           :widths: 50 200

           * - /UseNone
             - Do not show outline or thumbnails panels
           * - /UseOutlines
             - Show outline (aka bookmarks) panel
           * - /UseThumbs
             - Show page thumbnails panel
           * - /FullScreen
             - Fullscreen view
           * - /UseOC
             - Show Optional Content Group (OCG) panel
           * - /UseAttachments
             - Show attachments panel
        z	/PageModeN)r‰   r  rG   s    r?   Ú	page_modezPdfDocCommon.page_modeD  s*   € ð*	Ø×#Ñ# KÑ0Ð0øÜò 	Ùð	ús   ‚ ‘	œÚ	list_onlyr3  Úinheritc                 óø  — t        t        j                  «      t        t        j                  «      t        t        j                  «      t        t        j
                  «      f}|€i }|€M| j                  }|j                  d«      j                  «       }t        |t        «      st        d«      ‚g | _        t        j                  |v r"t        t         |t        j                     «      }nt        j"                  |vrd}nd}|dk(  r{|D ]  }||v sŒ||   ||<   Œ t        t$        |t        j"                     «      D ]B  }	i }
t        |	t&        «      r|	|
d<   |	j                  «       }|sŒ-	  | j(                  |||fi |
¤Ž ŒD y|dk(  r]|j-                  «       D ]  \  }}||vsŒ|||<   Œ t/        | |«      }|s|j1                  |«       | j                  j3                  |«       yy# t*        $ r t        d«      ‚w xY w)aº  
        Process the document pages to ease searching.

        Attributes of a page may inherit from ancestor nodes
        in the page tree. Flattening means moving
        any inheritance data into descendant nodes,
        effectively removing the inheritance dependency.

        Note: It is distinct from another use of "flattening" applied to PDFs.
        Flattening a PDF also means combining all the contents into one single layer
        and making the file less editable.

        Args:
            list_only: Will only list the pages within _flatten_pages.
            pages:
            inherit:
            indirect_reference: Used recursively to flatten the /Pages object.

        Nr¤   zInvalid object in /Pagesr±   r�   z7Maximum recursion depth reached during page flattening.)r+   ÚPGÚ	RESOURCESÚMEDIABOXÚCROPBOXÚROTATEr‰   rK   rS   rL   r%   r   r…   r   ÚTYPEr   rM   rÒ   r!   r*   r§   ÚRecursionErrorrÖ   r   r™   r  )rH   rt  r3  ru  r�   Úinheritable_page_attributesr×   Útrâ   r?  Úaddtr’   Úattr_inrØ   Úpage_objs                  r?   r§   zPdfDocCommon._flatten^  sà  € ô6 ”r—|‘|Ó$Ü”r—{‘{Ó#Ü”r—z‘zÓ"Ü”r—y‘yÓ!ð	'
Ð#ð ˆ?ØˆGØˆ=ð ×&Ñ&ˆGØ—K‘K Ó)×4Ñ4Ó6ˆEÜ˜eÔ%5Ô6Ü"Ð#=Ó>Ð>Ø#%ˆDÔ ä×Ñ 5Ñ(Ü”S˜%¤× 4Ñ 4Ñ5Ó6‰Aä×!Ñ!¨Ñ.Ø‰AàˆAà�Š=Û3�Ø˜5’=Ø$)¨$¡K�G˜D’Mð 4ô œ[¨%´×0DÑ0DÑ*EÖF�Ø�Ü˜d¤NÔ3Ø15�DÐ-Ñ.Ø—o‘oÓ'�ÚðØ%˜Ÿ™ i°°gÑFÀÓFñ Gð �'Š\Ø")§-¡-¦/‘�˜ð  %Ò'Ø%*�E˜'’Nð	 #2ô
 " $Ð(:Ó;ˆHÙØ—‘ Ô&ð × Ñ ×'Ñ'¨Õ1ð øô	 *ò Ü*ØUóð ðús   Å)G$Ç$G9Úcleanc                 óx  — | j                   €| j                  | j                  «       | j                   €J ‚t        |t        «      r3|j                  «       }t        |t        «      st        dt        «       y|}t        |t        «      s	 | j                   j                  |«      }d|cxk  rt        | j                   «      k  sn t        dt        «       y| j                  |   j                  }| j                  |= |r|�| j                  |t!        «       «       yyy# t        $ r t        dt        «       Y yw xY w)a  
        Remove page from pages list.

        Args:
            page:
                * :class:`int`: Page number to be removed.
                * :class:`~pypdf._page.PageObject`: page to be removed. If the page appears many times
                  only the first one will be removed.
                * :class:`~pypdf.generic.IndirectObject`: Reference to page to be removed.

            clean: replace PageObject with NullObject to prevent annotations
                or destinations to reference a detached page.

        Nz(IndirectObject is not referencing a pagezCannot find page in pagesr   zPage number is out of range)r…   r§   r‡   rL   r*   rS   r   r   r|   r´   r	  r2  r¨   r3  r�   r”   r,   )rH   r?  rƒ  r7  Úinds        r?   Úremove_pagezPdfDocCommon.remove_page¯  s  € ð& ×ÑÐ'Ø�M‰M˜$Ÿ.™.Ô)Ø×#Ñ#Ð/Ð/Ð/Ü�dœNÔ+Ø—‘Ó!ˆAÜ˜a¤Ô,ÜÐIÌ8ÔTØØˆDä˜$¤Ô$ðØ×+Ñ+×1Ñ1°$Ó7�ð �TÔ5œC × 4Ñ 4Ó5Ô5ÜÐ8¼(ÔCØà�j‰j˜Ñ×1Ñ1ˆØ�J‰J�tÐÙ�S�_Ø× Ñ  ¤j£lÕ3ð %ˆ5øô ò ÜÐ:¼HÔEÙðús   Â
D ÄD9Ä8D9ÚnumÚgenc                 ó8   — t        ||| «      j                  «       S )a0  
        Used to ease development.

        This is equivalent to generic.IndirectObject(num,gen,self).get_object()

        Args:
            num: The object number of the indirect object.
            gen: The generation number of the indirect object.

        Returns:
            A PdfObject

        )r*   rS   )rH   r‡  rˆ  s      r?   Ú_get_indirect_objectz!PdfDocCommon._get_indirect_objectÛ  s   € ô ˜c 3¨Ó-×8Ñ8Ó:Ð:rA   Úpermissions_codec           	      ót  — t        ddd¬«       t        j                  t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  dœ}|j                  «       D ��ci c]  \  }}|||z  dk7  “Œ c}}S c c}}w )z>Take the permissions as an integer, return the allowed access.Údecode_permissionsÚuser_access_permissionsz5.0.0)Úold_nameÚnew_nameÚ
removed_in)ÚprintÚmodifyÚcopyÚannotationsÚformsÚaccessabilityÚassembleÚprint_high_qualityr   )r   r   ÚPRINTÚMODIFYÚEXTRACTÚADD_OR_MODIFYÚFILL_FORM_FIELDSÚEXTRACT_TEXT_AND_GRAPHICSÚASSEMBLE_DOCÚPRINT_TO_REPRESENTATIONrÖ   )rH   r‹  Úpermissions_mappingrI   Úflags        r?   r�  zPdfDocCommon.decode_permissionsë  s«   € ô 	%Ø)Ø.Øõ	
ô +×0Ñ0Ü+×2Ñ2Ü)×1Ñ1Ü0×>Ñ>Ü*×;Ñ;ä2×LÑLÜ-×:Ñ:Ü"7×"OÑ"Oñ

Ðð 1×6Ñ6Ô8ô
á8‘	��Tð Ð! DÑ(¨AÑ-Ñ-Ø8ò
ð 	
ùó 
s   ÂB4c                 óZ   — | j                   €yt        | j                   j                  «      S )zWGet the user access permissions for encrypted documents. Returns None if not encrypted.N)r†   r   ÚPrG   s    r?   rŽ  z$PdfDocCommon.user_access_permissions  s*   € ð ×ÑÐ#ØÜ$ T×%5Ñ%5×%7Ñ%7Ó8Ð8rA   c                  ó   — y)zè
        Read-only boolean property showing whether this PDF file is encrypted.

        Note that this property, if true, will remain true even after the
        :meth:`decrypt()<pypdf.PdfReader.decrypt>` method is called.
        Nr�   rG   s    r?   r¦   zPdfDocCommon.is_encrypted  s   € ð 	rA   c                 ó†  — d }i }| j                   }d|vs|d   sy t        t        |d   «      }d|v r�t        t        |d   «      }t	        |«      }|D ]l  }|}t        |«      }t        |t        «      sŒ!t        t        t           |j                  «       «      }|sŒIt        j                  |j                  «      }	|	||<   Œn |S )Nz	/AcroFormz/XFA)r‰   r   r0   r!   ÚiterÚnextrL   r*   r
   r&   rS   ÚzlibÚ
decompressÚ_data)
rH   rÎ   rN   r×   rë   rº   rì   Útagrí   Úess
             r?   ÚxfazPdfDocCommon.xfa  s¹   € à%)ˆØ!#ˆØ×"Ñ"ˆà˜gÑ%¨W°[Ò-AØä”J ¨Ñ 4Ó5ˆà�T‰>Üœ+ t¨F¡|Ó4ˆFÜ�V“ˆAÛ�Ø�Ü˜“G�Ü˜a¤Õ0Ü ¤Ô*=Ñ!>ÀÇÁÃÓO�EÚÜ!Ÿ_™_¨U¯[©[Ó9˜Ø&(˜˜sšð ð ˆrA   c                 ót   — t        | j                  «       D �ci c]  }|| j                  |f“Œ c}«      S c c}w )z1Mapping of attachment filenames to their content.)ÚLazyDictÚ_list_attachmentsÚ_get_attachment_list)rH   r  s     r?   ÚattachmentszPdfDocCommon.attachments0  sL   € ô ð !×2Ñ2Ô4óá4�Dð �t×0Ñ0°$Ð7Ñ7Ø4ñó
ð 	
ùòs   ˜5c              #   ó^   K  — t        j                  | j                  «      E d{  –—†  y7 Œ­w)zIterable of attachment objects.N)r4   Ú_loadr‰   rG   s    r?   Úattachment_listzPdfDocCommon.attachment_list:  s"   è ø€ ô  ×%Ñ% d×&6Ñ&6Ó7×7Ò7ús   ‚#-¥+¦-c                 óÂ   — g }| j                   D ]M  }|j                  |j                  «       |j                  x}|j                  k7  sŒ:|sŒ=|j                  |«       ŒO |S )zw
        Retrieves the list of filenames of file attachments.

        Returns:
            list of filenames

        )r·  r  r  Úalternative_name)rH   rÉ   Úentryr  s       r?   r²  zPdfDocCommon._list_attachments?  sU   € ð ˆØ×)Ô)ˆEØ�L‰L˜Ÿ™Ô$Ø×.Ñ.Ð.�°5·:±:Ó=Â$Ø—‘˜TÕ"ð *ð ˆrA   r  c                 óT   — | j                  |«      |   }t        |t        «      r|S |gS rE   )Ú_get_attachmentsrL   r  )rH   r  Úouts      r?   r³  z!PdfDocCommon._get_attachment_listN  s-   € Ø×#Ñ# DÓ)¨$Ñ/ˆÜ�cœ4Ô ØˆJØˆuˆrA   Úfilenamec                 ó¨  — i }| j                   D ]À  }t        «       }|j                  }|�@||j                  |hv r/||j                  k(  r|j                  n|}|j	                  |«       nŒ[|j                  |h}|D ]S  }|€Œ||v r;t        ||   t        «      s	||   g||<   ||   j                  |j                  «       ŒE|j                  ||<   ŒU ŒÂ |S )a“  
        Retrieves all or selected file attachments of the PDF as a dictionary of file names
        and the file data as a bytestring.

        Args:
            filename: If filename is None, then a dictionary of all attachments
                will be returned, where the key is the filename and the value
                is the content. Otherwise, a dictionary with just a single key
                - the filename - and its content will be returned.

        Returns:
            dictionary of filename -> Union[bytestring or List[ByteString]]
            If the filename exists multiple times a list of the different versions will be provided.

        )	r·  Úsetr¹  r  ÚaddrL   r  r  Úcontent)rH   r¾  r´  rº  rÉ   r¹  r  s          r?   r¼  zPdfDocCommon._get_attachmentsT  sà   € ð$ =?ˆØ×)Ô)ˆEÜ“EˆEØ$×5Ñ5ÐØÐ#Ø §
¡
Ð,<Ð=Ñ=Ø)1°U·Z±ZÒ)?˜5Ÿ:š:ÐEU�DØ—I‘I˜d•OààŸ™Ð%5Ð6�ã�Ø�<ØØ˜;Ñ&Ü% k°$Ñ&7¼Ô>Ø-8¸Ñ->Ð,?˜ DÑ)Ø Ñ%×,Ñ,¨U¯]©]Õ;à(-¯©�K Ò%ñ ð *ð* ÐrA   ÚincludeÚexcludec                  ó   — y)zø
        Integration into Jupyter Notebooks.

        This method returns a dictionary that maps a mime-type to its
        representation.

        .. seealso::

            https://ipython.readthedocs.io/en/stable/config/integrating.html
        Nr�   )rH   rÃ  rÄ  s      r?   Ú_repr_mimebundle_zPdfDocCommon._repr_mimebundle_~  s   € ð  	rA   r[  )NNNN)F)FNNNrE   )\r|   r}   r~   r   r„   ÚboolÚ__annotations__r…   r
   r  r   r†   r   r‡   r€   r   r%   r‰   rM   rŒ   r   r´   r*   r.   rS   r”   r—   rC   rš   r7   rœ   r1   r¢   r©   r¬   r¾   r¿   r*  r$   rÂ   r!   rÍ   r0   rÁ   r	   rî   rö   rè   r
  rý   r-  r'   r:  r/   r#   rC  Úsetterr5   rH  rG  rS  r,   r4  rV  rY  rÓ   r-   rÕ   rM  r3  rn  rq  r6   rs  r§   r†  rŠ  r�  r   rŽ  r¦   r¯  r   r´  r   r4   r·  r²  r³  r¼  r   rÆ  r�   rA   r?   rƒ   rƒ     s0  … ñð €FˆDÓà26€O�X˜d :Ñ.Ñ/Ó6à(,€K�˜*Ñ%Ó,à€IˆtÓàØðÐ-ò ó ó ðð Øð˜Cò ó ó ðð ðØ"'¨¨^Ð(;Ñ"<ðà	�)Ñ	òó ðð
 ð¨ð ¸Yð È9ò ó ðð Øð�xÐ 0Ñ1ò ó ó ðð ð˜(Ð#6Ñ7ò ó ðð ð˜h ~Ñ6ò ó ðð ð HÐ->Ñ$?ò ó ðð)˜só )ð*1 Cð 1¨Jó 1ð$#àð#ð 
Ð Ð$Ñ	%ó#ðJ ð. D¨¨kÐ)9Ñ$:ò .ó ð.ð [ó ðH )-Ø37ñGà�J Ð$Ñ%ðGð ˜˜c ;Ð.Ñ/Ñ0ðGð 
ˆc�;ÐÑ	ó	Gð\ &*Ø+/Ø!%Ø+/ñ0à�zÑ"ð0ð ˜˜c 3˜h™Ñ(ð0ð ˜#‘ð	0ð
 ˜˜Y™Ñ(ð0ð 
�$�s˜C�x‘.Ñ	!ó0ðd/Ð0@ð /ÀSó /ð(8à�ZÐ!1Ð1Ñ2ð(8ð �S˜#�X‘ð(8ð ð	(8ð
 ð(8ð �I‰ð(8ð 
ó(8ðT=à�JÐ 0Ð0Ñ1ð=ð ð=ð ð	=ð
 �I‰ð=ð 
ó=ð&# Cð #°ð #Àsð #Ètó #ñJ$¸ð $ÈÈcÐSVÈhÉó $ðLD
Ø˜5 )¨^Ð;Ñ<ðD
à	ˆjÑ	óD
ðL ðà	ˆt�[Ð"2Ð4DÐDÑ	Eòó ðð: ×ÑðD U¨4°°kÀ:Ð+MÑ%Nð DÐSWò Dó ðDð ð#˜ò #ó ð#ð QUñ'ØÐ-Ñ.ð'Ø@HÈÁð'à	ó'ðR ð˜ +Ñ.ò ó ðð( ðØ"'¨¨c°:¸~Ð(MÑ"Nðà	�#‰òó ðð
J Jð J°8¸C±=ó JðC°{ð CÀxÐPSÁ}ó CðEà�S˜%�ZÑ ðEð ØØ�l N°D¸*ÐFVÐVÑWññ
ðEð 
óEð<KÐ(8ð K¸XÀkÑ=Ró KðZ ð?�t˜JÑ'ò ?ó ð?ð  ðP˜T #™Yò Pó ðPð ð˜X c™]ò ó ðð6 ð˜8 LÑ1ò ó ðð6  Ø;?Ø,0Ø7;ñO2àðO2ð �TÐ+¨ZÐ7Ñ8ðO2ð ˜$˜s C˜x™.Ñ)ð	O2ð
 % ^Ñ4ðO2ð 
óO2ðh ñ*4à�C˜ ^Ð3Ñ4ð*4ð ð*4ð 
ó	*4ðX;¨ð ;°#ð ;¸(À9Ñ:Mó ;ð 
Ø #ð
à	ˆc�4ˆi‰ó
ð6 ð9¨Ð2GÑ)Hò 9ó ð9ð Øð˜dò ó ó ðð ð�X˜d 3¨ 8™nÑ-ò ó ðð. ð
˜W S¨$¨u©+Ð%5Ñ6ò 
ó ð
ð ð8 ¨<¸¸tÐ+CÑ!Dò 8ó ð8ð 4¨¡9ó ð¨ð °°e±ó ð )-ñ(Ø  ™ð(à	ˆc�5˜  U¡Ð+Ñ,Ð,Ñ	-ó(ðT ð /3Ø.2ñà�t˜X c™]Ð*Ñ+ðð �t˜X c™]Ð*Ñ+ðð 
ˆc�3ˆh‰ò	ó ñrA   rƒ   c                   óZ   — e Zd Zdededdfd„Zdedefd„Zdee   fd„Zde	fd	„Z
defd
„Zy)r±  ÚargsÚkwargsr:   Nc                 ó$   — t        |i |¤Ž| _        y rE   )r*  Ú	_raw_dict)rH   rË  rÌ  s      r?   rF   zLazyDict.__init__’  s   € Ü˜tÐ. vÑ.ˆ�rA   rI   c                 óN   — | j                   j                  |«      \  }} ||«      S rE   )rÎ  Ú__getitem__)rH   rI   ÚfuncÚargs       r?   rÐ  zLazyDict.__getitem__•  s$   € Ø—N‘N×.Ñ.¨sÓ3‰	ˆˆcÙ�C‹yÐrA   c                 ó,   — t        | j                  «      S rE   )r¨  rÎ  rG   s    r?   Ú__iter__zLazyDict.__iter__™  s   € Ü�D—N‘NÓ#Ð#rA   c                 ó,   — t        | j                  «      S rE   )r¨   rÎ  rG   s    r?   Ú__len__zLazyDict.__len__œ  s   € Ü�4—>‘>Ó"Ð"rA   c                 ó<   — dt        | j                  «       «      › d�S )NzLazyDict(keys=Ú))r  r  rG   s    r?   Ú__str__zLazyDict.__str__Ÿ  s   € Ø¤ T§Y¡Y£[Ó 1Ð2°!Ð4Ð4rA   )r|   r}   r~   r	   rF   rM   rÐ  r   rÔ  r´   rÖ  rÙ  r�   rA   r?   r±  r±  ‘  sW   „ ð/˜cð /¨Sð /°Tó /ð˜sð  só ð$˜( 3™-ó $ð#˜ó #ð5˜ô 5rA   r±  )Qr=   rª  Úabcr   Úcollections.abcr   r   r   r   r   Útypingr	   r
   r   r   r†   r   Ú_pager   r   Ú_page_labelsr   rm  Ú_utilsr   r   r   Ú	constantsr   rÅ   r   rž   r   r   r   r   r   rJ  r   rQ   r   rå   r   rw  Úerrorsr   r    Úgenericr!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   Úgeneric._filesr4   r  r5   r6   Úxmpr7   rÓ   r´   r¾   r@   rC   rƒ   r±  r�   rA   r?   Ú<module>rå     sâ   ðó> Û Ý ß BÓ BÝ ÷ó õ $ß +Ý >÷ñ õ
 /Ý .÷ó õ "Ý :Ý 6Ý +ß ,÷÷ ÷ ÷ ÷ ñ õ* )ß ,Ý ð%�eð % 3ð %¨5°°e¸CÀ¸H±oÐ1EÑ+Fó %ô]%Ð*ô ]%÷@Lñ Lô^$5ˆw�s˜C�xÑ õ 5rA   