
     f|                       d dl mZ ddlmZmZ d dlmZ d dlZd dlZddl	m
Z
 ddl	mZ ddl	mZ e G d	 d
                      Ze G d d                      Ze G d d                      Ze G d d                      Ze G d d                      Z G d de          Z G d de          Ze G d d                      Ze G d d                      Ze G d d                      Z G d de          Ze G d d                       Ze G d! d"                      Ze G d# d$                      Ze G d% d&                      Zd9d)Zd9d*Z	 	 	 d:d;d2Z 	 	 	 	 d<d=d8Z!dS )>    )annotations   )event_classT_JSON_DICT)	dataclassN)dom)dom_debugger)pagec                     e Zd ZU dZded<   ded<   ded<   ded<   d	Zd
ed<   d	Zd
ed<   d	Zded<   d	Zded<   d	Z	ded<   d	Z
ded<   d	Zded<   d	Zded<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zd
ed<   d	Zded<   d	Zded<   d	Zd ed!<   d	Zd"ed#<   d	Zded$<   d	Zd%ed&<   d	Zd
ed'<   d	Zd
ed(<   d	Zd)ed*<   d	Zd)ed+<   d, Zed-             Zd	S ).DOMNodez!
    A Node in the DOM tree.
    int	node_typestr	node_name
node_valuezdom.BackendNodeIdbackend_node_idNtyping.Optional[str]
text_valueinput_valuetyping.Optional[bool]input_checkedoption_selected!typing.Optional[typing.List[int]]child_node_indexesz'typing.Optional[typing.List[NameValue]]
attributespseudo_element_indexestyping.Optional[int]layout_node_indexdocument_urlbase_urlcontent_languagedocument_encoding	public_id	system_idztyping.Optional[page.FrameId]frame_idcontent_document_indexztyping.Optional[dom.PseudoType]pseudo_typez#typing.Optional[dom.ShadowRootType]shadow_root_typeis_clickablez8typing.Optional[typing.List[dom_debugger.EventListener]]event_listenerscurrent_source_url
origin_urltyping.Optional[float]scroll_offset_xscroll_offset_yc                   t                      }| j        |d<   | j        |d<   | j        |d<   | j                                        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j	        
| j	        |d<   | j
        d	 | j
        D             |d
<   | j        d | j        D             |d<   | j        d | j        D             |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        | j                                        |d<   | j        
| j        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        
| j        |d<   | j        d | j        D             |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d <   |S )!NnodeTypenodeName	nodeValuebackendNodeId	textValue
inputValueinputCheckedoptionSelectedc                    g | ]}|S  r:   .0is     w/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/devtools/v126/dom_snapshot.py
<listcomp>z#DOMNode.to_json.<locals>.<listcomp>~   s    'K'K'Ka'K'K'K    childNodeIndexesc                6    g | ]}|                                 S r:   to_jsonr;   s     r>   r?   z#DOMNode.to_json.<locals>.<listcomp>        !G!G!G!!))++!G!G!Gr@   r   c                    g | ]}|S r:   r:   r;   s     r>   r?   z#DOMNode.to_json.<locals>.<listcomp>   s    +S+S+S!A+S+S+Sr@   pseudoElementIndexeslayoutNodeIndexdocumentURLbaseURLcontentLanguagedocumentEncodingpublicIdsystemIdframeIdcontentDocumentIndex
pseudoTypeshadowRootTypeisClickablec                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z#DOMNode.to_json.<locals>.<listcomp>   s     %P%P%Paaiikk%P%P%Pr@   eventListenerscurrentSourceURL	originURLscrollOffsetXscrollOffsetY)dictr   r   r   r   rD   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r.   r/   selfjsons     r>   rD   zDOMNode.to_jsono   s   vv>Z>Z O[ $ 4 < < > >_?& $D'!%!1D)#'#5D +%)%9D!"".'K'K43J'K'K'KD#$?&!G!Gt!G!G!GD&2+S+St7R+S+S+SD'(!-&*&<D"#("&"3D=$"mDO ,&*&;D"#!-'+'=D#$>%#~D>%#~D=$"m3355DO&2+/+FD'('!%!1!9!9!;!;D ,%)%:%B%B%D%DD!"("&"3D+%P%P4;O%P%P%PD!"".'+'>D#$?& $D+$($8D!+$($8D!r@   c           	     f    | d<i dt          |d                   dt          |d                   dt          |d                   dt          j                            |d                   d	d
|v rt          |d
                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rd |d         D             nd dd|v rd |d         D             nd dd|v rd |d         D             nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd|v rt          |d                   nd dd |v rt          |d                    nd d!d"|v rt          |d"                   nd d#d$|v rt          |d$                   nd d%d&|v rt          |d&                   nd d'd(|v r%t          j                            |d(                   nd d)d*|v rt          |d*                   nd d+d,|v r%t          j                            |d,                   nd d-d.|v r%t          j	                            |d.                   nd d/d0|v rt          |d0                   nd d1d2|v rd3 |d2         D             nd d4d5|v rt          |d5                   nd d6d7|v rt          |d7                   nd d8d9|v rt          |d9                   nd d:d;|v rt          |d;                   nd S )=Nr   r1   r   r2   r   r3   r   r4   r   r5   r   r6   r   r7   r   r8   r   rA   c                ,    g | ]}t          |          S r:   r   r;   s     r>   r?   z%DOMNode.from_json.<locals>.<listcomp>   s    III1AIIIr@   r   c                B    g | ]}t                               |          S r:   	NameValue	from_jsonr;   s     r>   r?   z%DOMNode.from_json.<locals>.<listcomp>   &    KKK1	++A..KKKr@   r   rG   c                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z%DOMNode.from_json.<locals>.<listcomp>   s    #Q#Q#QqCFF#Q#Q#Qr@   r   rH   r   rI   r    rJ   r!   rK   r"   rL   r#   rM   r$   rN   r%   rO   r&   rP   r'   rQ   r(   rR   r)   rS   r*   rU   c                L    g | ]!}t           j                            |          "S r:   )r	   EventListenerrd   r;   s     r>   r?   z%DOMNode.from_json.<locals>.<listcomp>   s)    eee\7AA!DDeeer@   r+   rV   r,   rW   r.   rX   r/   rY   r:   )r   r   r   BackendNodeIdrd   boolr
   FrameId
PseudoTypeShadowRootTypefloatclsr]   s     r>   rd   zDOMNode.from_json   s   s 
 
 
$z*+++
$z*+++
 4,---
  -77_8MNNN	

 2=1D1Ds4,---$
 4@43G3GD.///T
 9G$8N8N$tN3444TX
 =MPT<T<TD&6!7888Z^
 N`cgMgMgII5G0HIIIImq
 P\_cOcOcKK\8JKKKKim
 VlosUsUs#Q#QD9O4P#Q#Q#Q#Qy}
 ?PSW>W>Wc$'8"9:::]a
 6Cd5J5JT-0111PT
 .7$->->Si)))D
 >ORV=V=VS&7!8999\`
  @RUY?Y?Yc$'9":;;;_c!
" 0:T/A/Ac$z*+++t#
$ 0:T/A/Ac$z*+++t%
& AJT@Q@QT\++DO<<<W['
( I_bfHfHf3t,B'C#D#D#Dlp)
* IUX\H\H\00l1CDDDbf+
, VfimUmUmS/99$?O:PQQQsw-
. 7Dt6K6Kd=1222QU/
0 jz  ~B  jB  jBeedScNdeeee  HL1
2 ASVZ@Z@Zs4(:#;<<<`d3
4 2=1D1Ds4,---$5
6 =Lt<S<SE$"7888Y]7
8 =Lt<S<SE$"7888Y]9
 	
r@   ) __name__
__module____qualname____doc____annotations__r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r.   r/   rD   classmethodrd   r:   r@   r>   r   r      sN          NNN NNN OOO '&&& (,J++++ )-K,,,, ,0M//// .2O1111 =A@@@@ ;?J>>>> AEDDDD /32222 *.L---- &*H)))) .21111 /32222 '+I**** '+I**** /3H2222 487777 48K7777 =A@@@@
 +/L.... QUOTTTT 043333 (,J++++ /3O2222.2O22226 6 6p 
 
 [
 
 
r@   r   c                  N    e Zd ZU dZded<   ded<   ded<   d Zed             Zd	S )
InlineTextBoxz
    Details of post layout rendered text positions. The exact layout should not be regarded as
    stable and may change between versions.
    dom.Rectbounding_boxr   start_character_indexnum_charactersc                    t                      }| j                                        |d<   | j        |d<   | j        |d<   |S )NboundingBoxstartCharacterIndexnumCharacters)rZ   rz   rD   r{   r|   r[   s     r>   rD   zInlineTextBox.to_json   sD    vv"/7799]&*&@"# $ 3_r@   c                     | t           j                            |d                   t          |d                   t          |d                             S )Nr~   r   r   )rz   r{   r|   )r   Rectrd   r   ro   s     r>   rd   zInlineTextBox.from_json   sT    s++D,?@@"%d+@&A"B"BtO455
 
 
 	
r@   Nrq   rr   rs   rt   ru   rD   rv   rd   r:   r@   r>   rx   rx      st          
      
 
 [
 
 
r@   rx   c                      e Zd ZU dZded<   ded<   dZded<   dZd	ed
<   dZded<   dZded<   dZ	ded<   d Z
ed             ZdS )LayoutTreeNodezD
    Details of an element in the DOM tree with a LayoutObject.
    r   dom_node_indexry   rz   Nr   layout_textz+typing.Optional[typing.List[InlineTextBox]]inline_text_nodesr   style_indexpaint_orderr   is_stacking_contextc                ,   t                      }| j        |d<   | j                                        |d<   | j        
| j        |d<   | j        d | j        D             |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   |S )	NdomNodeIndexr~   
layoutTextc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z*LayoutTreeNode.to_json.<locals>.<listcomp>  s     &S&S&Sqqyy{{&S&S&Sr@   inlineTextNodes
styleIndex
paintOrderisStackingContext)	rZ   r   rz   rD   r   r   r   r   r   r[   s     r>   rD   zLayoutTreeNode.to_json  s    vv#2^"/7799]'!%!1D!-&S&SD<R&S&S&SD"#'!%!1D'!%!1D#/(,(@D$%r@   c                    | t          |d                   t          j                            |d                   d|v rt	          |d                   nd d|v rd |d         D             nd d|v rt          |d                   nd d|v rt          |d                   nd d|v rt          |d                   nd 	          S )
Nr   r~   r   r   c                B    g | ]}t                               |          S r:   )rx   rd   r;   s     r>   r?   z,LayoutTreeNode.from_json.<locals>.<listcomp>  s&    [[[a}66q99[[[r@   r   r   r   )r   rz   r   r   r   r   r   )r   r   r   rd   r   rj   ro   s     r>   rd   zLayoutTreeNode.from_json  s    stN344++D,?@@3?43G3GD.///T_ptx_x_x[[4HYCZ[[[[  C3?43G3GD.///T3?43G3GD.///TCVZ^C^C^T*=%> ? ? ?dh
 
 
 	
r@   )rq   rr   rs   rt   ru   r   r   r   r   r   rD   rv   rd   r:   r@   r>   r   r      s             )-K,,,, FJIIII )-K,,,,
 )-K,,,, 265555    	
 	
 [	
 	
 	
r@   r   c                  :    e Zd ZU dZded<   d Zed             ZdS )ComputedStylezQ
    A subset of the full ComputedStyle as defined by the request whitelist.
    ztyping.List[NameValue]
propertiesc                J    t                      }d | j        D             |d<   |S )Nc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z)ComputedStyle.to_json.<locals>.<listcomp>-  s     CCCaaiikkCCCr@   r   )rZ   r   r[   s     r>   rD   zComputedStyle.to_json+  s*    vvCC4?CCC\r@   c                :     | d |d         D                       S )Nc                B    g | ]}t                               |          S r:   rb   r;   s     r>   r?   z+ComputedStyle.from_json.<locals>.<listcomp>3  re   r@   r   )r   r:   ro   s     r>   rd   zComputedStyle.from_json0  s1    sKK\8JKKK
 
 
 	
r@   Nr   r:   r@   r>   r   r   #  sX           '&&&  
 
 
 [
 
 
r@   r   c                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )rc   z
    A name/value pair.
    r   namevaluec                J    t                      }| j        |d<   | j        |d<   |S )Nr   r   )rZ   r   r   r[   s     r>   rD   zNameValue.to_jsonB  s&    vvyV
Wr@   c                h     | t          |d                   t          |d                             S )Nr   r   )r   r   r   ro   s     r>   rd   zNameValue.from_jsonH  s9    sT&\""d7m$$
 
 
 	
r@   Nr   r:   r@   r>   rc   rc   7  s`           III JJJ   
 
 [
 
 
r@   rc   c                  B     e Zd ZdZddZed	d            Z fdZ xZS )
StringIndex3
    Index of the string in the strings table.
    returnr   c                    | S Nr:   r\   s    r>   rD   zStringIndex.to_jsonT      r@   r]   c                     | |          S r   r:   ro   s     r>   rd   zStringIndex.from_jsonW      s4yyr@   c                j    d                     t                                                                S )NzStringIndex({})formatsuper__repr__r\   	__class__s    r>   r   zStringIndex.__repr__[  s'     ''(8(8(:(:;;;r@   )r   r   )r]   r   r   r   	rq   rr   rs   rt   rD   rv   rd   r   __classcell__r   s   @r>   r   r   P  sv                [< < < < < < < < <r@   r   c                  B     e Zd ZdZddZed	d            Z fdZ xZS )
ArrayOfStringsr   r   typing.List[StringIndex]c                    | S r   r:   r   s    r>   rD   zArrayOfStrings.to_jsonc  r   r@   r]   c                     | |          S r   r:   ro   s     r>   rd   zArrayOfStrings.from_jsonf  r   r@   c                j    d                     t                                                                S )NzArrayOfStrings({})r   r   s    r>   r   zArrayOfStrings.__repr__j  s'    #**577+;+;+=+=>>>r@   )r   r   )r]   r   r   r   r   r   s   @r>   r   r   _  sv                [? ? ? ? ? ? ? ? ?r@   r   c                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )	RareStringDataz2
    Data that is only present on rare nodes.
    typing.List[int]indexr   r   c                r    t                      }d | j        D             |d<   d | j        D             |d<   |S )Nc                    g | ]}|S r:   r:   r;   s     r>   r?   z*RareStringData.to_json.<locals>.<listcomp>y      ///q///r@   r   c                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z*RareStringData.to_json.<locals>.<listcomp>z  s     999999r@   r   rZ   r   r   r[   s     r>   rD   zRareStringData.to_jsonw  sB    vv//DJ///W99dj999Wr@   c                \     | d |d         D             d |d         D                       S )Nc                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z,RareStringData.from_json.<locals>.<listcomp>      111a3q66111r@   r   c                B    g | ]}t                               |          S r:   r   rd   r;   s     r>   r?   z,RareStringData.from_json.<locals>.<listcomp>  s&    CCC;((++CCCr@   r   r   r   r:   ro   s     r>   rd   zRareStringData.from_json}  sE    s114=111CCT']CCC
 
 
 	
r@   Nr   r:   r@   r>   r   r   n  sd           ####   
 
 [
 
 
r@   r   c                  6    e Zd ZU ded<   d Zed             ZdS )RareBooleanDatar   r   c                J    t                      }d | j        D             |d<   |S )Nc                    g | ]}|S r:   r:   r;   s     r>   r?   z+RareBooleanData.to_json.<locals>.<listcomp>  r   r@   r   )rZ   r   r[   s     r>   rD   zRareBooleanData.to_json  s)    vv//DJ///Wr@   c                :     | d |d         D                       S )Nc                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z-RareBooleanData.from_json.<locals>.<listcomp>  r   r@   r   )r   r:   ro   s     r>   rd   zRareBooleanData.from_json  s0    s114=111
 
 
 	
r@   Nrq   rr   rs   ru   rD   rv   rd   r:   r@   r>   r   r     sL           
 
 
 [
 
 
r@   r   c                  @    e Zd ZU ded<   ded<   d Zed             ZdS )RareIntegerDatar   r   r   c                r    t                      }d | j        D             |d<   d | j        D             |d<   |S )Nc                    g | ]}|S r:   r:   r;   s     r>   r?   z+RareIntegerData.to_json.<locals>.<listcomp>  r   r@   r   c                    g | ]}|S r:   r:   r;   s     r>   r?   z+RareIntegerData.to_json.<locals>.<listcomp>  r   r@   r   r   r[   s     r>   rD   zRareIntegerData.to_json  sB    vv//DJ///W//DJ///Wr@   c                \     | d |d         D             d |d         D                       S )Nc                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z-RareIntegerData.from_json.<locals>.<listcomp>  r   r@   r   c                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z-RareIntegerData.from_json.<locals>.<listcomp>  r   r@   r   r   r:   ro   s     r>   rd   zRareIntegerData.from_json  sE    s114=111114=111
 
 
 	
r@   Nr   r:   r@   r>   r   r     sX            
 
 [
 
 
r@   r   c                  >     e Zd ZddZedd            Z fdZ xZS )		Rectangler   typing.List[float]c                    | S r   r:   r   s    r>   rD   zRectangle.to_json  r   r@   r]   c                     | |          S r   r:   ro   s     r>   rd   zRectangle.from_json  r   r@   c                j    d                     t                                                                S )NzRectangle({})r   r   s    r>   r   zRectangle.__repr__  s'    %%egg&6&6&8&8999r@   )r   r   )r]   r   r   r   )rq   rr   rs   rD   rv   rd   r   r   r   s   @r>   r   r     sl               [: : : : : : : : :r@   r   c                      e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   dZded<   dZded<   dZded<   dZded<   d Z	e
d             ZdS )DocumentSnapshotz
    Document snapshot.
    r   r   titler    r!   encoding_namer#   r$   r%   NodeTreeSnapshotnodesLayoutTreeSnapshotlayoutTextBoxSnapshot
text_boxesNr-   r.   r/   content_widthcontent_heightc                   t                      }| j                                        |d<   | j                                        |d<   | j                                        |d<   | j                                        |d<   | j                                        |d<   | j                                        |d<   | j                                        |d<   | j	                                        |d<   | j
                                        |d	<   | j                                        |d
<   | j                                        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   | j        
| j        |d<   |S )NrI   r   rJ   rK   encodingNamerM   rN   rO   r   r   	textBoxesrX   rY   contentWidthcontentHeight)rZ   r   rD   r   r    r!   r   r#   r$   r%   r   r   r   r.   r/   r   r   r[   s     r>   rD   zDocumentSnapshot.to_json  so   vv"/7799]
**,,W-//11Y"&"7"?"?"A"A#199;;^>1133Z>1133Z-//11Y
**,,W,,..X O3355[+$($8D!+$($8D!)#'#5D *$($7D!r@   c                    | t                               |d                   t                               |d                   t                               |d                   t                               |d                   t                               |d                   t                               |d                   t                               |d                   t                               |d                   t                              |d	                   t                              |d
                   t                              |d                   d|v rt          |d                   nd d|v rt          |d                   nd d|v rt          |d                   nd d|v rt          |d                   nd           S )NrI   r   rJ   rK   r   rM   rN   rO   r   r   r   rX   rY   r   r   )r   r   r    r!   r   r#   r$   r%   r   r   r   r.   r/   r   r   )r   rd   r   r   r   rn   ro   s     r>   rd   zDocumentSnapshot.from_json  s   s$..tM/BCC''W66 **4	?;;(2248I3JKK%//^0DEE!++D,<==!++D,<== **4	?;;",,T'];;%//X??&00k1BCC<Kt<S<SE$"7888Y]<Kt<S<SE$"7888Y]9G49O9O%^ 4555UY;Jd;R;R5o!6777X\
 
 
 	
r@   )rq   rr   rs   rt   ru   r.   r/   r   r   rD   rv   rd   r:   r@   r>   r   r     s0             "!!!         /3O2222 /3O2222 -1M0000 .2N1111  . 
 
 [
 
 
r@   r   c                     e Zd ZU dZdZded<   dZded<   dZded<   dZded	<   dZ	ded
<   dZ
ded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   dZded<   d Zed             ZdS )r   z!
    Table containing nodes.
    Nr   parent_indexr   ztyping.Optional[RareStringData]r(   )typing.Optional[typing.List[StringIndex]]r   r   z/typing.Optional[typing.List[dom.BackendNodeId]]r   z,typing.Optional[typing.List[ArrayOfStrings]]r   r   r   z typing.Optional[RareBooleanData]r   r   z typing.Optional[RareIntegerData]r&   r'   pseudo_identifierr)   r+   r,   c                h   t                      }| j        d | j        D             |d<   | j        d | j        D             |d<   | j        | j                                        |d<   | j        d | j        D             |d<   | j        d | j        D             |d	<   | j        d
 | j        D             |d<   | j        d | j        D             |d<   | j	        | j	                                        |d<   | j
        | j
                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   | j        | j                                        |d<   |S )Nc                    g | ]}|S r:   r:   r;   s     r>   r?   z,NodeTreeSnapshot.to_json.<locals>.<listcomp>Q      "@"@"@1"@"@"@r@   parentIndexc                    g | ]}|S r:   r:   r;   s     r>   r?   z,NodeTreeSnapshot.to_json.<locals>.<listcomp>S  s    :::a:::r@   r1   rR   c                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z,NodeTreeSnapshot.to_json.<locals>.<listcomp>W  s     DDD		DDDr@   r2   c                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z,NodeTreeSnapshot.to_json.<locals>.<listcomp>Y  s      F F F F F Fr@   r3   c                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z,NodeTreeSnapshot.to_json.<locals>.<listcomp>[  s     $O$O$OQQYY[[$O$O$Or@   r4   c                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z,NodeTreeSnapshot.to_json.<locals>.<listcomp>]  rE   r@   r   r5   r6   r7   r8   rP   rQ   pseudoIdentifierrS   rV   rW   )rZ   r   r   r(   rD   r   r   r   r   r   r   r   r   r&   r'   r   r)   r+   r,   r[   s     r>   rD   zNodeTreeSnapshot.to_jsonN  sW   vv("@"@d.?"@"@"@D>%::4>:::D ,%)%:%B%B%D%DD!">%DDT^DDDD?& F Fdo F F FD+$O$O$:N$O$O$OD!?&!G!Gt!G!G!GD?& $ 7 7 9 9D'!%!1!9!9!;!;D)#'#5#=#=#?#?D +%)%9%A%A%C%CD!"&2+/+F+N+N+P+PD'('!%!1!9!9!;!;D!-'+'='E'E'G'GD#$("&"3";";"="=D".'+'>'F'F'H'HD#$?& $ 7 7 9 9Dr@   c           	         | d(i dd|v rd |d         D             nd dd|v rd |d         D             nd dd|v r t                               |d                   nd d	d
|v rd |d
         D             nd dd|v rd |d         D             nd dd|v rd |d         D             nd dd|v rd |d         D             nd dd|v r t                               |d                   nd dd|v r t                               |d                   nd dd|v r t                              |d                   nd dd|v r t                              |d                   nd dd|v r t                              |d                   nd dd|v r t                               |d                   nd d d!|v r t                               |d!                   nd d"d#|v r t                              |d#                   nd d$d%|v r t                               |d%                   nd d&d'|v r t                               |d'                   nd S ))Nr   r   c                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z.NodeTreeSnapshot.from_json.<locals>.<listcomp>w      >>>Q#a&&>>>r@   r   r1   c                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z.NodeTreeSnapshot.from_json.<locals>.<listcomp>x  s    888!s1vv888r@   r(   rR   r   r2   c                B    g | ]}t                               |          S r:   r   r;   s     r>   r?   z.NodeTreeSnapshot.from_json.<locals>.<listcomp>z  s&    JJJA{,,Q//JJJr@   r   r3   c                B    g | ]}t                               |          S r:   r   r;   s     r>   r?   z.NodeTreeSnapshot.from_json.<locals>.<listcomp>{  s&    LLLQ--a00LLLr@   r   r4   c                L    g | ]!}t           j                            |          "S r:   )r   ri   rd   r;   s     r>   r?   z.NodeTreeSnapshot.from_json.<locals>.<listcomp>|  s)    [[[S.88;;[[[r@   r   c                B    g | ]}t                               |          S r:   r   rd   r;   s     r>   r?   z.NodeTreeSnapshot.from_json.<locals>.<listcomp>}  s&    PPP0033PPPr@   r   r5   r   r6   r   r7   r   r8   r&   rP   r'   rQ   r   r   r)   rS   r+   rV   r,   rW   r:   )r   rd   r   r   ro   s     r>   rd   zNodeTreeSnapshot.from_jsont  sf   s 
 
 
BOSWBWBW>>$}*=>>>>]a
<F$<N<N88tJ'78888TX
 RbeiQiQi^55d;K6LMMMos
 OY\`N`N`JJj9IJJJJfj	

 Q\_cPcPcLL${:KLLLLim
 `orv_v_v[[T/EZ[[[[  }A
 UadhThThPPT,=OPPPPnr
 GRUYFYFY~//[0ABBB_c
 IUX\H\H\00l1CDDDbf
 N\_cMcMc/33D4HIIIim
 RbeiQiQiO55d;K6LMMMos
 _ux|^|^|?#<#<TBX=Y#Z#Z#Z  CG
 IUX\H\H\00l1CDDDbf
 UgjnTnTnn66t<N7OPPPtx
 LY\`K`K`2243FGGGfj
  VhkoUoUo~77=O8PQQQuy!
" GRUYFYFY~//[0ABBB_c#
 	
r@   )rq   rr   rs   rt   r   ru   r   r(   r   r   r   r   r   r   r   r   r&   r'   r   r)   r+   r,   rD   rv   rd   r:   r@   r>   r   r     s          7;L:::: 48I7777 9=<<<< <@I???? =AJ@@@@ HLOKKKK @DJCCCC 37J6666 48K7777 7;M:::: 9=O<<<< @DCCCC 48K7777 :>====
 6:L9999 ;?>>>> 37J6666$ $ $L 
 
 [
 
 
r@   r   c                      e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   dZded<   dZded<   dZded<   dZded<   dZ	ded<   dZ
ded<   d Zed             ZdS )r   zM
    Table of details of an element in the DOM tree with a LayoutObject.
    r   
node_indexztyping.List[ArrayOfStrings]stylestyping.List[Rectangle]boundsr   textr   stacking_contextsNr   paint_ordersz'typing.Optional[typing.List[Rectangle]]offset_rectsscroll_rectsclient_rectsr   blended_background_colorsz#typing.Optional[typing.List[float]]text_color_opacitiesc                >   t                      }d | j        D             |d<   d | j        D             |d<   d | j        D             |d<   d | j        D             |d<   | j                                        |d	<   | j        d
 | j        D             |d<   | j        d | j        D             |d<   | j	        d | j	        D             |d<   | j
        d | j
        D             |d<   | j        d | j        D             |d<   | j        d | j        D             |d<   |S )Nc                    g | ]}|S r:   r:   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  s    8881Q888r@   	nodeIndexc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>       ;;;!!))++;;;r@   r  c                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  r  r@   r  c                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  s     777		777r@   r  stackingContextsc                    g | ]}|S r:   r:   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  r   r@   paintOrdersc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>       "J"J"J1199;;"J"J"Jr@   offsetRectsc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  r"  r@   scrollRectsc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  r"  r@   clientRectsc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  s     .c.c.cqqyy{{.c.c.cr@   blendedBackgroundColorsc                    g | ]}|S r:   r:   r;   s     r>   r?   z.LayoutTreeSnapshot.to_json.<locals>.<listcomp>  s    )O)O)O!)O)O)Or@   textColorOpacities)rZ   r  r  r  r  r  rD   r  r  r  r  r  r  r[   s     r>   rD   zLayoutTreeSnapshot.to_json  si   vv88888[;;t{;;;X;;t{;;;X77TY777V#'#9#A#A#C#C ("@"@d.?"@"@"@D("J"J8I"J"J"JD("J"J8I"J"J"JD("J"J8I"J"J"JD)5.c.cDDb.c.c.cD*+$0)O)OT5N)O)O)OD%&r@   c                    | d |d         D             d |d         D             d |d         D             d |d         D             t                               |d	                   d
|v rd |d
         D             nd d|v rd |d         D             nd d|v rd |d         D             nd d|v rd |d         D             nd d|v rd |d         D             nd d|v rd |d         D             nd           S )Nc                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  s    :::1A:::r@   r  c                B    g | ]}t                               |          S r:   r	  r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  s&    HHHAN,,Q//HHHr@   r  c                B    g | ]}t                               |          S r:   r   rd   r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  &    CCCqI''**CCCr@   r  c                B    g | ]}t                               |          S r:   r   r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  s&    AAAq+''**AAAr@   r  r  r   c                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  r  r@   r#  c                B    g | ]}t                               |          S r:   r0  r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  &    NNNQ)--a00NNNr@   r%  c                B    g | ]}t                               |          S r:   r0  r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  r5  r@   r'  c                B    g | ]}t                               |          S r:   r0  r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  r5  r@   r)  c                B    g | ]}t                               |          S r:   r   r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  s&    &i&i&iA{'<'<Q'?'?&i&i&ir@   r+  c                ,    g | ]}t          |          S r:   )rn   r;   s     r>   r?   z0LayoutTreeSnapshot.from_json.<locals>.<listcomp>  s    !O!O!Oq%((!O!O!Or@   )r  r  r  r  r  r  r  r  r  r  r  )r   rd   ro   s     r>   rd   zLayoutTreeSnapshot.from_json  s   s::[(9:::HHhHHHCCDNCCCAADLAAA-77=O8PQQBOSWBWBW>>$}*=>>>>]aR_cgRgRgNN$}:MNNNNmqR_cgRgRgNN$}:MNNNNmqR_cgRgRgNN$}:MNNNNmq nG  KO  nO  nO&i&iNgIh&i&i&i&i  UYSgkoSoSo!O!OD9M4N!O!O!O!Ouy
 
 
 	
r@   )rq   rr   rs   rt   ru   r  r  r  r  r  r  rD   rv   rd   r:   r@   r>   r   r     s          !    (''' #""" #""" '&&&
 7;L:::: =AL@@@@ =AL@@@@ =AL@@@@ LPOOOO AEDDDD  * 
 
 [
 
 
r@   r   c                  X    e Zd ZU dZded<   ded<   ded<   ded<   d Zed	             Zd
S )r   z
    Table of details of the post layout rendered text positions. The exact layout should not be regarded as
    stable and may change between versions.
    r   layout_indexr  r  startlengthc                    t                      }d | j        D             |d<   d | j        D             |d<   d | j        D             |d<   d | j        D             |d<   |S )	Nc                    g | ]}|S r:   r:   r;   s     r>   r?   z+TextBoxSnapshot.to_json.<locals>.<listcomp>  s    <<<Qq<<<r@   layoutIndexc                6    g | ]}|                                 S r:   rC   r;   s     r>   r?   z+TextBoxSnapshot.to_json.<locals>.<listcomp>  r  r@   r  c                    g | ]}|S r:   r:   r;   s     r>   r?   z+TextBoxSnapshot.to_json.<locals>.<listcomp>  r   r@   r<  c                    g | ]}|S r:   r:   r;   s     r>   r?   z+TextBoxSnapshot.to_json.<locals>.<listcomp>  s    111!111r@   r=  )rZ   r;  r  r<  r=  r[   s     r>   rD   zTextBoxSnapshot.to_json  sv    vv<<$*;<<<];;t{;;;X//DJ///W11T[111Xr@   c                     | d |d         D             d |d         D             d |d         D             d |d         D             	          S )
Nc                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z-TextBoxSnapshot.from_json.<locals>.<listcomp>  r  r@   r@  c                B    g | ]}t                               |          S r:   r0  r;   s     r>   r?   z-TextBoxSnapshot.from_json.<locals>.<listcomp>  r1  r@   r  c                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z-TextBoxSnapshot.from_json.<locals>.<listcomp>  r   r@   r<  c                ,    g | ]}t          |          S r:   r`   r;   s     r>   r?   z-TextBoxSnapshot.from_json.<locals>.<listcomp>  s    333qCFF333r@   r=  )r;  r  r<  r=  r:   ro   s     r>   rd   zTextBoxSnapshot.from_json  sp    s>>$}*=>>>CCDNCCC114=11133DN333	
 
 
 	
r@   Nr   r:   r@   r>   r   r     s          
 #""" #"""     
 
 [
 
 
r@   r   r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]c               #     K   ddi} | V }dS )z9
    Disables DOM snapshot agent for the given page.
    methodzDOMSnapshot.disableNr:   cmd_dictr]   s     r>   disablerN    s$      
 	'H >>DDDr@   c               #     K   ddi} | V }dS )z8
    Enables DOM snapshot agent for the given page.
    rK  zDOMSnapshot.enableNr:   rL  s     r>   enablerP  	  s$      
 	&H >>DDDr@   computed_style_whitelisttyping.List[str]include_event_listenersr   include_paint_orderinclude_user_agent_shadow_treetyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[DOMNode], typing.List[LayoutTreeNode], typing.List[ComputedStyle]]]c              #     K   t                      }d | D             |d<   |||d<   |||d<   |||d<   d|d}|V }d	 |d
         D             d |d         D             d |d         D             fS )a?  
    Returns a document snapshot, including the full DOM tree of the root node (including iframes,
    template contents, and imported documents) in a flattened array, as well as layout and
    white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is
    flattened.

    :param computed_style_whitelist: Whitelist of computed styles to return.
    :param include_event_listeners: *(Optional)* Whether or not to retrieve details of DOM listeners (default false).
    :param include_paint_order: *(Optional)* Whether to determine and include the paint order index of LayoutTreeNodes (default false).
    :param include_user_agent_shadow_tree: *(Optional)* Whether to include UA shadow tree in the snapshot (default false).
    :returns: A tuple with the following items:

        0. **domNodes** - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
        1. **layoutTreeNodes** - The nodes in the layout tree.
        2. **computedStyles** - Whitelisted ComputedStyle properties for each node in the layout tree.
    c                    g | ]}|S r:   r:   r;   s     r>   r?   z get_snapshot.<locals>.<listcomp>*  s    'L'L'La'L'L'Lr@   computedStyleWhitelistNincludeEventListenersincludePaintOrderincludeUserAgentShadowTreezDOMSnapshot.getSnapshotrK  paramsc                B    g | ]}t                               |          S r:   )r   rd   r;   s     r>   r?   z get_snapshot.<locals>.<listcomp>7  s&    888!		1		888r@   domNodesc                B    g | ]}t                               |          S r:   )r   rd   r;   s     r>   r?   z get_snapshot.<locals>.<listcomp>8  s&    FFF	!	!!	$	$FFFr@   layoutTreeNodesc                B    g | ]}t                               |          S r:   )r   rd   r;   s     r>   r?   z get_snapshot.<locals>.<listcomp>9  s&    DDD	 	 	#	#DDDr@   computedStylesrZ   )rQ  rS  rT  rU  r^  rM  r]   s          r>   get_snapshotrf    s      , &&F'L'L3K'L'L'LF#$**A&'&&9"#%1/M+,+ H >>D88tJ'7888FFd3D.EFFFDDT2B-CDDD r@   computed_stylesinclude_dom_rects!include_blended_background_colorsinclude_text_color_opacitiesityping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[typing.List[DocumentSnapshot], typing.List[str]]]c              #     K   t                      }d | D             |d<   |||d<   |||d<   |||d<   |||d<   d|d	}|V }d
 |d         D             d |d         D             fS )a  
    Returns a document snapshot, including the full DOM tree of the root node (including iframes,
    template contents, and imported documents) in a flattened array, as well as layout and
    white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is
    flattened.

    :param computed_styles: Whitelist of computed styles to return.
    :param include_paint_order: *(Optional)* Whether to include layout object paint orders into the snapshot.
    :param include_dom_rects: *(Optional)* Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
    :param include_blended_background_colors: **(EXPERIMENTAL)** *(Optional)* Whether to include blended background colors in the snapshot (default: false). Blended background color is achieved by blending background colors of all elements that overlap with the current element.
    :param include_text_color_opacities: **(EXPERIMENTAL)** *(Optional)* Whether to include text color opacity in the snapshot (default: false). An element might have the opacity property set that affects the text color of the element. The final text color opacity is computed based on the opacity of all overlapping elements.
    :returns: A tuple with the following items:

        0. **documents** - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.
        1. **strings** - Shared string table that all string properties refer to with indexes.
    c                    g | ]}|S r:   r:   r;   s     r>   r?   z$capture_snapshot.<locals>.<listcomp>U  s    ;;;a;;;r@   rd  Nr[  includeDOMRectsincludeBlendedBackgroundColorsincludeTextColorOpacitieszDOMSnapshot.captureSnapshotr]  c                B    g | ]}t                               |          S r:   )r   rd   r;   s     r>   r?   z$capture_snapshot.<locals>.<listcomp>d  s'    BBB1		#	#A	&	&BBBr@   	documentsc                ,    g | ]}t          |          S r:   r   r;   s     r>   r?   z$capture_snapshot.<locals>.<listcomp>e  s    )))AQ)))r@   stringsre  )rg  rT  rh  ri  rj  r^  rM  r]   s           r>   capture_snapshotru  =  s      . &&F;;?;;;F&&9"#$$5 !(43T/0#/.J*+/ H >>DBB[0ABBB))i))) r@   )r   rI  )NNN)
rQ  rR  rS  r   rT  r   rU  r   r   rV  )NNNN)rg  rR  rT  r   rh  r   ri  r   rj  r   r   rk  )"
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r
   r   rx   r   r   rc   r   r   listr   r   r   r   r   r   r   r   r   rN  rP  rf  ru  r:   r@   r>   <module>r}     s   # " " " " " * * * * * * * * ! ! ! ! ! !                     t
 t
 t
 t
 t
 t
 t
 t
n 
 
 
 
 
 
 
 
@ 5
 5
 5
 5
 5
 5
 5
 5
p 
 
 
 
 
 
 
 
& 
 
 
 
 
 
 
 
0< < < < <# < < <? ? ? ? ?T ? ? ? 
 
 
 
 
 
 
 
, 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
&	: 	: 	: 	: 	: 	: 	: 	: Z
 Z
 Z
 Z
 Z
 Z
 Z
 Z
z t
 t
 t
 t
 t
 t
 t
 t
n J
 J
 J
 J
 J
 J
 J
 J
Z "
 "
 "
 "
 "
 "
 "
 "
J       :>59@D	' ' ' ' 'X 6:37CG>B) ) ) ) ) ) )r@   