+
    i                         ^ RI HtHtHtHt ^RIHt ^RIHtH	t	H
t
HtHtHt ]'       d   ^RIHt ^RIHt ^RIHt  ! R R4      t ! R	 R
4      t]]]3,          tR R ltR R ltR R ltR# )    )TYPE_CHECKINGOptionalUnioncast)logger_warning)ArrayObjectDictionaryObjectIndirectObject	PdfObjectTextStringObjectis_null_or_none)
PageObject)	PdfReader)	PdfWriterc                   Z   a  ] tR t^*t o R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	# )
NamedReferenceLinkzGNamed reference link being preserved until we can resolve it correctly.c                (   < V ^8  d   QhRS[ RRRR/# )   	reference
source_pdfr   returnN)r   )format__classdict__s   "Y/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/pypdf/generic/_link.py__annotate__NamedReferenceLink.__annotate__-   s$     & &"2 & &PT &    c                    Wn         W n        R# )z0reference: TextStringObject with named referenceN
_reference_source_pdf)selfr   r   s   &&&r   __init__NamedReferenceLink.__init__-   s    #%r   c                4   < V ^8  d   QhRS[ S[R3,          /# )r   r   N)r   r
   )r   r   s   "r   r   r   2   s     9 9eND,@&A 9r   c                    V P                   P                  P                  \        V P                  4      4      pV'       d   VP
                  # R # N)r!   named_destinationsgetstrr    page)r"   destinations   & r   find_referenced_page'NamedReferenceLink.find_referenced_page2   s:    &&99==c$//>RS#.{8D8r   c                (   < V ^8  d   QhRRRS[ RR/# r   
target_pdfr   new_pager   Nr
   )r   r   s   "r   r   r   6   s(     Y Y+ Y YTX Yr   c                    \        V P                  4      VP                  9  d2   VP                  \        V P                  4      VP                  4       R# R# z2target_pdf: PdfWriter which the new link went intoN)r*   r    r(   add_named_destinationpage_numberr"   r1   r2   s   &&&r   patch_reference"NamedReferenceLink.patch_reference6   s@     tz'D'DD,,S-A8CWCWX Er   r   N
__name__
__module____qualname____firstlineno____doc__r#   r-   r9   __static_attributes____classdictcell__r   s   @r   r   r   *   s(     Q& &
9 9Y Yr   r   c                   Z   a  ] tR t^=t o R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	# )
DirectReferenceLinkzHDirect reference link being preserved until we can resolve it correctly.c                $   < V ^8  d   QhRS[ RR/# )r   r   r   N)r   )r   r   s   "r   r    DirectReferenceLink.__annotate__@   s     $ $+ $$ $r   c                    Wn         R# )zIreference: an ArrayObject whose first element is the Page indirect objectNr    )r"   r   s   &&r   r#   DirectReferenceLink.__init__@   s    #r   c                    < V ^8  d   QhRS[ /# )r   r   r3   )r   r   s   "r   r   rG   D   s     " "n "r   c                (    V P                   ^ ,          # )r   rI   )r"   s   &r   r-   (DirectReferenceLink.find_referenced_pageD   s    q!!r   c                (   < V ^8  d   QhRRRS[ RR/# r0   r3   )r   r   s   "r   r   rG   G   s#     & &+ & &TX &r   c                "    W P                   ^ &   R# r5   rI   r8   s   &&&r   r9   #DirectReferenceLink.patch_referenceG   s    %r   rI   Nr;   rC   s   @r   rE   rE   =   s&     R$ $" "& &r   rE   c          	      d    V ^8  d   QhRRRRR\         \        \        \        3,          ,          /# )r   r2   r   old_pager   )listtupleReferenceLink)r   s   "r   r   r   O   s2      L L T%P]_lPlJmEn r   c                   V P                  R\        4       4      P                  4       pVP                  R\        4       4      P                  4       p\        V4      '       d   \        4       p\        V4      '       d   \        4       p\	        V\        4      '       d   \	        V\        4      '       g   \        RV RV R2\        4       . # V Uu. uF  p\        W@4      NK  	  ppV Uu. uF  p\        WA4      NK  	  pp\        WV4       UUu. uF  w  rxV'       g   K  V'       g   K  Wx3NK  	  upp# u upi u upi u uppi )zExtracts links from two pages on the assumption that the two pages are
the same. Produces one list of (new link, old link) tuples.
z/AnnotszExpected annotation arrays:  z. Ignoring annotations.)	r)   r   
get_objectr   
isinstancer   r<   _build_linkzip)	r2   rR   new_annotationsold_annotationslink	new_links	old_linksnew_linkold_links	   &&       r   extract_linksrc   O   s    ll9km<GGIOll9km<GGIO''%-''%-o{33:oWb;c;c*?*;1_<MMde	
 	
 :IIT,II9HIT,II y$$ "6( 	  	$  JIs   D4*D9D>D>)D>c                J    V ^8  d   QhR\         RRR\        \        ,          /# )r   indirect_objectr+   r   r   )r
   r   rU   )r   s   "r   r   r   m   s'       | Q^H_ r   c                    \        R VP                  4      p\        \        V P                  4       4      p\	        V\        4      '       d   VP                  R4      R8w  d   R# RV9   dL   \        \        VR,          4      pVP                  R4      R8w  d   R# RV9  d   R# \        VR,          V4      # RV9   d   \        VR,          V4      # R# )	r   z/Subtypez/LinkNz/Az/Sz/GoToz/Dz/Dest)r   pdfr	   rX   rY   r)   _create_link)re   r+   srcr^   actions   &&   r   rZ   rZ   m   s    
{DHH
%C /"<"<">?Dt-..488J3G73Rt|&T
3::dw&vF4L#..$DM3//r   c                J    V ^8  d   QhR\         RRR\        \        ,          /# )r   r   r   r   r   )r   r   rU   )r   s   "r   r   r      s&      I ; 8MCZ r   c                     \        V \        4      '       d   \        W4      # \        V \        4      '       d   \	        V 4      # R # r'   )rY   r   r   r   rE   )r   r   s   &&r   rh   rh      s6    )-..!)88)[))"9--r   N)typingr   r   r   r   _utilsr    r   r	   r
   r   r   r   _pager   _readerr   _writerr   r   rE   rU   rc   rZ   rh    r   r   <module>rt      sZ   > 8 7 # i i"##Y Y&& & (*==><*r   