
    '	4jW                         d dl Z d dlmZ d dlmZmZmZ ddlmZm	Z	m
Z
 erddlmZ ddlmZ  G d d	e      Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Zy)    N)ABC)TYPE_CHECKINGOptionalUnion   )	PDFStringbuild_obj_dictcreate_dictionary_string)StandardSecurityHandler)Destinationc            	           e Zd Zdded    ddfdZ	 	 dded   dee   defdZ	 	 	 dd	eeee	f      ded   dee   defd
Z
y)ActionNnext_actionreturnc                     || _         y)zz
        Args:
            next (PDFObject | str): optional reference to another Action to trigger after this one
        N)next)selfr   s     9/DATA/.local/lib/python3.12/site-packages/fpdf/actions.py__init__zAction.__init__   s    
  	    _security_handlerr   _obj_idc                     t         N)NotImplementedError)r   r   r   s      r   	serializezAction.serialize   s
    
 "!r   
key_valuesc                 t    |i }| j                   r| j                   |d<   t        |||      }t        |d      S )NNext )
field_join)r   r	   r
   )r   r   r   r   obj_dicts        r   
_serializezAction._serialize   s@     J99!%Jv!*.?I'SAAr   r   NN)NNN)__name__
__module____qualname__r   r   intstrr   dictobjectr#    r   r   r   r      s     HX$6  $   BF!%"#$=>" #" 
	" 37AE!%	BT#v+./B $$=>B #	B
 
Br   r   c                   ^     e Zd Zd
dedee   ddf fdZ	 	 dded   dee   def fd	Z xZ	S )	URIActionNurir   r   c                 2    t         |   |       || _        y r   )superr   r/   )r   r/   r   	__class__s      r   r   zURIAction.__init__*   s    %r   r   r   r   c                 X    t         |   dt        | j                  d      d||      S )Nz/URITencrypt)su_r_ir   r   )r1   r#   r   r/   r   r   r   r2   s      r   r   zURIAction.serialize.   s5    
 w!9TXXt#DE/ " 
 	
r   r   r$   
r%   r&   r'   r)   r   r   r   r(   r   __classcell__r2   s   @r   r.   r.   )   s\    C hv.> $  BF!%	
#$=>	
 #	
 
		
 	
r   r.   c                   ^     e Zd Zd
dedee   ddf fdZ	 	 dded   dee   def fd	Z xZ	S )NamedActionNaction_namer   r   c                 d    t         |   |       |dvrt        j                  d       || _        y )N)NextPagePrevPage	FirstPageLastPagezNon-standard named action added)r1   r   warningswarnr?   )r   r?   r   r2   s      r   r   zNamedAction.__init__;   s.    %OOMM;<&r   r   r   r   c                 H    t         |   dd| j                   d||      S )Nz/Named/)r6   nr8   )r1   r#   r?   r9   s      r   r   zNamedAction.serializeA   s8    
 w!1T%5%5$6!78/ " 
 	
r   r   r$   r:   r<   s   @r   r>   r>   :   s]    'C 'hv6F 'RV ' BF!%	
#$=>	
 #	
 
		
 	
r   r>   c                   j     e Zd Z	 ddeedf   dee   ddf fdZ	 	 dded   d	ee   def fd
Z	 xZ
S )
GoToActionNdestr   r   r   c                     t         |   |       t        |t              r!|j	                  d      rt        |dd  d      }|| _        y )N#r   Tr4   )r1   r   
isinstancer)   
startswithr   rL   )r   rL   r   r2   s      r   r   zGoToAction.__init__N   s@     	%dC T__S%9T!"Xt4D	r   r   r   r   c                 B    t         |   d| j                  d||      S )Nz/GoTo)r6   dr8   )r1   r#   rL   r9   s      r   r   zGoToAction.serializeV   s.    
 w!		*/ " 
 	
r   r   r$   )r%   r&   r'   r   r)   r   r   r   r(   r   r;   r<   s   @r   rK   rK   M   sl    OS#},-<DV<L	 BF!%	
#$=>	
 #	
 
		
 	
r   rK   c            	       d     e Zd Z	 ddedddee   ddf fdZ	 	 dded	   d
ee   def fdZ xZ	S )GoToRemoteActionNfilerL   r   r   r   c                 @    t         |   |       || _        || _        y r   )r1   r   rU   rL   )r   rU   rL   r   r2   s       r   r   zGoToRemoteAction.__init__c   s      	%		r   r   r   r   c                 n    t         |   dt        | j                  d      | j                  d||      S )Nz/GoToRTr4   )r6   frR   r8   )r1   r#   r   rU   rL   r9   s      r   r   zGoToRemoteAction.serializej   s;    
 w!499d!C$))T/ " 
 	
r   r   r$   r:   r<   s   @r   rT   rT   b   sj    NR,;CF;K	 BF!%	
#$=>	
 #	
 
		
 	
r   rT   c                   b     e Zd ZdZddedee   ddf fdZ	 	 dded   d	ee   def fd
Z	 xZ
S )LaunchActionzTAs of 2022, this does not seem honored by neither Adobe Acrobat nor Sumatra readers.NrU   r   r   c                 2    t         |   |       || _        y r   )r1   r   rU   )r   rU   r   r2   s      r   r   zLaunchAction.__init__y   s    %	r   r   r   r   c                 X    t         |   dt        | j                  d      d||      S )Nz/LaunchTr4   )r6   rX   r8   )r1   r#   r   rU   r9   s      r   r   zLaunchAction.serialize}   s5    
 w!)DIIt"DE/ " 
 	
r   r   r$   )r%   r&   r'   __doc__r)   r   r   r   r(   r   r;   r<   s   @r   rZ   rZ   v   s_    ZS x/? 4  BF!%	
#$=>	
 #	
 
		
 	
r   rZ   )rE   abcr   typingr   r   r   syntaxr   r	   r
   
encryptionr   r   r   r.   r>   rK   rT   rZ   r,   r   r   <module>rb      sj      1 1 G G3#BS B:
 
"
& 
&
 
*
v 
(
6 
r   