
    ,h                   	   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  G d d	e      Z G d
 de      Ze G d d             Z G d dej                         Z G d dej                         Z G d dej                         Z G d dej                         Z G d dej                         Z G d dej                         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	 	 	 	 dd*Z 	 d	 	 	 	 	 	 	 dd+Z!	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd,Z"	 	 	 	 d	 	 	 	 	 	 	 	 	 dd-Z#dd.Z$	 	 	 	 dd/Z%	 d	 	 	 dd0Z&	 	 	 d	 	 	 	 	 	 	 dd1Z'	 	 	 	 dd2Z(	 	 	 d	 	 	 	 	 	 	 dd3Z)	 	 	 d	 	 	 	 	 	 	 dd4Z*	 	 d	 	 	 	 	 dd5Z+	 	 d	 	 	 	 	 dd6Z,	 d	 	 	 	 	 	 	 dd7Z-	 	 d	 	 	 	 	 	 	 	 	 dd8Z.	 	 	 d	 	 	 	 	 	 	 dd9Z/	 	 	 	 dd:Z0	 	 	 	 	 	 	 	 dd;Z1dd<Z2dd=Z3dd>Z4dd?Z5	 d	 	 	 	 	 	 	 dd@Z6	 d	 	 	 	 	 ddAZ7	 	 	 	 ddBZ8	 	 	 	 ddCZ9	 	 	 	 	 	 ddDZ:	 	 	 	 	 	 ddEZ;ddFZ<	 	 	 	 	 	 ddGZ=ddHZ>	 	 	 	 	 	 ddIZ?	 	 	 	 ddJZ@	 	 d	 	 	 	 	 	 	 ddKZA	 	 	 	 ddLZB	 	 	 	 d	 	 	 	 	 	 	 	 	 ddMZC	 	 	 	 	 	 	 	 ddNZD	 d	 	 	 	 	 	 	 ddOZE	 	 	 d	 	 	 	 	 	 	 	 	 ddPZF	 	 	 	 ddQZG	 	 	 	 ddRZH	 	 	 	 ddSZIddTZJ	 	 	 	 ddUZK	 	 	 	 	 	 ddVZL	 	 	 	 	 	 ddWZM	 	 	 	 	 	 ddXZNddYZO	 	 	 	 ddZZP	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd[ZQ	 	 	 	 dd\ZR	 d	 	 	 	 	 dd]ZS ed^      e G d_ d`                    ZT eda      e G db dc                    ZU edd      e G de df                    ZV edg      e G dh di                    ZW edj      e G dk dl                    ZX edm      e G dn do                    ZY edp      e G dq dr                    ZZ eds      e G dt du                    Z[ edv      e G dw dx                    Z\ edy      e G dz d{                    Z] ed|      e G d} d~                    Z^ ed      e G d d                    Z_ ed      e G d d                    Z` ed      e G d d                    Za ed      e G d d                    Zb ed      e G d d                    Zcy)    )annotations   )event_classT_JSON_DICT)	dataclassN)page)runtimec                  <     e Zd ZdZddZedd       Z fdZ xZS )NodeIdz%
    Unique DOM node identifier.
    c                    | S N selfs    m/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v134/dom.pyto_jsonzNodeId.to_json           c                     | |      S r   r   clsjsons     r   	from_jsonzNodeId.from_json       4yr   c                >    dj                  t        | 	               S )Nz
NodeId({})formatsuper__repr__r   	__class__s    r   r   zNodeId.__repr__   s    ""57#3#566r   returnint)r   r$   r#   r   	__name__
__module____qualname____doc__r   classmethodr   r   __classcell__r!   s   @r   r   r      s+      7 7r   r   c                  <     e Zd ZdZddZedd       Z fdZ xZS )BackendNodeIdzq
    Unique DOM node identifier used to reference a node that may not have been pushed to the
    front-end.
    c                    | S r   r   r   s    r   r   zBackendNodeId.to_json$   r   r   c                     | |      S r   r   r   s     r   r   zBackendNodeId.from_json'   r   r   c                >    dj                  t        | 	               S )NzBackendNodeId({})r   r    s    r   r   zBackendNodeId.__repr__+   s    "))%'*:*<==r   r"   )r   r$   r#   r.   r%   r,   s   @r   r.   r.      s+      > >r   r.   c                  F    e Zd ZU dZded<   ded<   ded<   d Zed	        Zy
)BackendNodez,
    Backend node with a friendly name.
    r$   	node_typestr	node_namer.   backend_node_idc                    t               }| j                  |d<   | j                  |d<   | j                  j	                         |d<   |S )NnodeTypenodeNamebackendNodeId)dictr4   r6   r7   r   r   r   s     r   r   zBackendNode.to_json<   sC    v>>Z>>Z $ 4 4 < < >_r   c                t     | t        |d         t        |d         t        j                  |d               S )Nr9   r:   r;   )r4   r6   r7   )r$   r5   r.   r   r   s     r   r   zBackendNode.from_jsonC   s<    $z*+$z*+)33D4IJ
 	
r   Nr&   r'   r(   r)   __annotations__r   r*   r   r   r   r   r3   r3   /   s4     N N"" 
 
r   r3   c                      e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd& Z(e)d'        Z*y())
PseudoTypez
    Pseudo element type.
    z
first-linezfirst-letter	checkmarkbeforeafterzpicker-iconmarkerbackdropcolumn	selectionzsearch-textztarget-textzspelling-errorzgrammar-error	highlightzfirst-line-inheritedzscroll-markerzscroll-marker-groupzscroll-button	scrollbarzscrollbar-thumbzscrollbar-buttonzscrollbar-trackzscrollbar-track-piecezscrollbar-cornerresizerzinput-list-buttonzview-transitionzview-transition-groupzview-transition-image-pairzview-transition-oldzview-transition-newplaceholderzfile-selector-buttonzdetails-contentpickerc                    | j                   S r   valuer   s    r   r   zPseudoType.to_jsonu       zzr   c                     | |      S r   r   r   s     r   r   zPseudoType.from_jsonx   r   r   N)+r&   r'   r(   r)   
FIRST_LINEFIRST_LETTER	CHECKMARKBEFOREAFTERPICKER_ICONMARKERBACKDROPCOLUMN	SELECTIONSEARCH_TEXTTARGET_TEXTSPELLING_ERRORGRAMMAR_ERROR	HIGHLIGHTFIRST_LINE_INHERITEDSCROLL_MARKERSCROLL_MARKER_GROUPSCROLL_BUTTON	SCROLLBARSCROLLBAR_THUMBSCROLLBAR_BUTTONSCROLLBAR_TRACKSCROLLBAR_TRACK_PIECESCROLLBAR_CORNERRESIZERINPUT_LIST_BUTTONVIEW_TRANSITIONVIEW_TRANSITION_GROUPVIEW_TRANSITION_IMAGE_PAIRVIEW_TRANSITION_OLDVIEW_TRANSITION_NEWPLACEHOLDERFILE_SELECTOR_BUTTONDETAILS_CONTENTPICKERr   r*   r   r   r   r   rB   rB   L   s     J!LIFEKFHFIKK%N#MI1#M/#MI'O)'O3)G+'O3!=//K1'OF  r   rB   c                  2    e Zd ZdZdZdZdZd Zed        Z	y)ShadowRootTypez
    Shadow root type.
    z
user-agentopenclosedc                    | j                   S r   rP   r   s    r   r   zShadowRootType.to_json   rR   r   c                     | |      S r   r   r   s     r   r   zShadowRootType.from_json   r   r   N)
r&   r'   r(   r)   
USER_AGENTOPEN_CLOSEDr   r*   r   r   r   r   ry   ry   }   s1     JEF  r   ry   c                  2    e Zd ZdZdZdZdZd Zed        Z	y)CompatibilityModez&
    Document compatibility mode.
    
QuirksModeLimitedQuirksModeNoQuirksModec                    | j                   S r   rP   r   s    r   r   zCompatibilityMode.to_json   rR   r   c                     | |      S r   r   r   s     r   r   zCompatibilityMode.from_json   r   r   N)
r&   r'   r(   r)   QUIRKS_MODELIMITED_QUIRKS_MODENO_QUIRKS_MODEr   r*   r   r   r   r   r   r      s2     K-#N  r   r   c                  2    e Zd ZdZdZdZdZd Zed        Z	y)PhysicalAxesz)
    ContainerSelector physical axes
    
HorizontalVerticalBothc                    | j                   S r   rP   r   s    r   r   zPhysicalAxes.to_json   rR   r   c                     | |      S r   r   r   s     r   r   zPhysicalAxes.from_json   r   r   N)
r&   r'   r(   r)   
HORIZONTALVERTICALBOTHr   r*   r   r   r   r   r   r      s1     JHD  r   r   c                  2    e Zd ZdZdZdZdZd Zed        Z	y)LogicalAxesz(
    ContainerSelector logical axes
    InlineBlockr   c                    | j                   S r   rP   r   s    r   r   zLogicalAxes.to_json   rR   r   c                     | |      S r   r   r   s     r   r   zLogicalAxes.from_json   r   r   N)
r&   r'   r(   r)   INLINEBLOCKr   r   r*   r   r   r   r   r   r      s1     FED  r   r   c                  .    e Zd ZdZdZdZd Zed        Zy)ScrollOrientationz%
    Physical scroll orientation
    
horizontalverticalc                    | j                   S r   rP   r   s    r   r   zScrollOrientation.to_json   rR   r   c                     | |      S r   r   r   s     r   r   zScrollOrientation.from_json   r   r   N)	r&   r'   r(   r)   r   r   r   r*   r   r   r   r   r   r      s,     JH  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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d0<   dZd1ed2<   dZd-ed3<   d4 Ze d5        Z!y)6Nodez
    DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.
    DOMNode is a base node mirror type.
    r   node_idr.   r7   r$   r4   r5   r6   
local_name
node_valueNtyping.Optional[NodeId]	parent_idtyping.Optional[int]child_node_countz"typing.Optional[typing.List[Node]]childrenz!typing.Optional[typing.List[str]]
attributestyping.Optional[str]document_urlbase_url	public_id	system_idinternal_subsetxml_versionnamerQ   ztyping.Optional[PseudoType]pseudo_typepseudo_identifierztyping.Optional[ShadowRootType]shadow_root_typeztyping.Optional[page.FrameId]frame_idztyping.Optional[Node]content_documentshadow_rootstemplate_contentpseudo_elementsimported_documentz)typing.Optional[typing.List[BackendNode]]distributed_nodestyping.Optional[bool]is_svgz"typing.Optional[CompatibilityMode]compatibility_modeztyping.Optional[BackendNode]assigned_slotis_scrollablec                   t               }| j                  j                         |d<   | j                  j                         |d<   | j                  |d<   | j
                  |d<   | j                  |d<   | j                  |d<   | j                  | j                  j                         |d<   | j                  | j                  |d<   | j                  +| j                  D cg c]  }|j                          c}|d	<   | j                  | j                  D cg c]  }| c}|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(                  j                         |d<   | j*                  | j*                  |d<   | j,                  | j,                  j                         |d<   | j.                  | j.                  j                         |d<   | j0                  | j0                  j                         |d<   | j2                  +| j2                  D cg c]  }|j                          c}|d<   | j4                  | j4                  j                         |d<   | j6                  +| j6                  D cg c]  }|j                          c}|d<   | j8                  | j8                  j                         |d<   | j:                  +| j:                  D cg c]  }|j                          c}|d<   | j<                  | j<                  |d<   | j>                  | j>                  j                         |d<   | j@                  | j@                  j                         |d<   | jB                  | jB                  |d <   |S c c}w c c}w c c}w c c}w c c}w )!NnodeIdr;   r9   r:   	localName	nodeValueparentIdchildNodeCountr   r   documentURLbaseURLpublicIdsystemIdinternalSubset
xmlVersionr   rQ   
pseudoTypepseudoIdentifiershadowRootTypeframeIdcontentDocumentshadowRootstemplateContentpseudoElementsimportedDocumentdistributedNodesisSVGcompatibilityModeassignedSlotisScrollable)"r<   r   r   r7   r4   r6   r   r   r   r   r   r   r   r   r   r   r   r   r   rQ   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   is      r   r   zNode.to_json4  s   v--/X $ 4 4 < < >_>>Z>>Z OO[ OO[>>%#~~557D  ,%)%:%:D!"==$59]]C		CD??&-1__!=!!=D("&"3"3D==$"mmDO>>%#~~D>>%#~~D+%)%9%9D!"'!%!1!1D99 99DL::! JJDM'!%!1!1!9!9!;D!!-'+'='=D#$  ,%)%:%:%B%B%DD!"==$"mm335DO  ,&*&;&;&C&C&ED"#(8<8I8I"J1199;"JD  ,&*&;&;&C&C&ED"#+;?;O;O%Paaiik%PD!"!!-'+'='='E'E'GD#$!!-=A=S=S'T		'TD#$;;" KKDM"".(,(?(?(G(G(ID$%)#'#5#5#=#=#?D )#'#5#5D _  D!=8 #K &Q (Us   P=	QQ6QQc                    | d=i dt         j                  |d         dt        j                  |d         dt        |d         dt	        |d         d	t	        |d
         dt	        |d         dd|v rt         j                  |d         nd dd|v rt        |d         nd dd|v r&|d   D cg c]  }t
        j                  |       c}nd dd|v r|d   D cg c]  }t	        |       c}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        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                  j                  |d(         nd d)d*|v rt
        j                  |d*         nd d+d,|v r&|d,   D cg c]  }t
        j                  |       c}nd d-d.|v rt
        j                  |d.         nd d/d0|v r&|d0   D cg c]  }t
        j                  |       c}nd d1d2|v rt
        j                  |d2         nd d3d4|v r&|d4   D cg c]  }t        j                  |       c}nd d5d6|v rt        |d6         nd d7d8|v rt        j                  |d8         nd d9d:|v rt        j                  |d:         nd d;d<|v rt        |d<         S d S c c}w c c}w c c}w c c}w c c}w )>Nr   r   r7   r;   r4   r9   r6   r:   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rQ   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r.   r$   r5   r   rB   ry   r   FrameIdr3   boolr   r   r   r   s      r   r   zNode.from_jsonr  s    !
$$T(^4!
)33D4IJ!
 $z*+!
 $z*+	!

 4,-!
 4,-!
 =G$<Nf&&tJ'78TX!
 =MPT<TS&6!78Z^!
 GQTXFXj1ABAdnnQ'B^b!
 @Lt?S\(:;1A;Y]!
 6Cd5JT-01PT!
 .7$->Si)D!
 0:T/Ac$z*+t!
 0:T/Ac$z*+t!
 <Lt;SC%5 67Y]!
  4@43GD./T!!
" '-nT&\"$#!
$ )04#d7m$T%!
& EQTXDX
,,T,-?@^b'!
( @RUY?Yc$'9":;_c)!
* RbeiQi^55d;K6LMos+!
, AJT@QT\\++DO<W[-!
. IZ]aHaT^^D1B,CDgk/!
0 N[^bMbT-5HI$..+Ihl1!
2 IZ]aHaT^^D1B,CDgk3!
4 TdgkSk=M8NO1T^^A.Oqu5!
6 K]`dJddnnT2D-EFjn7!
8 _qtx^xFXAYZA{44Q7Z  C9!
: +2T/4W&t;!
< ZmptYt0::4@S;TUz~=!
> JX[_I_+//^0DEei?!
@ 9G$8N$tN34A!
 !	
@ UYA!
 !	
 C; JOZs   3M+ M0M5M:M?)"r&   r'   r(   r)   r@   r   r   r   r   r   r   r   r   r   r   r   rQ   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r*   r   r   r   r   r   r      s    O #" N N O O *.I&- .2*1 48H07 59J18 *.L&- &*H") '+I#* '+I#* -1O)0 )-K%, "&D
% #'E& 04K,3 /3+2 9=5< /3H+2 /3+2 8<L4; /3+2 ;?O7>
 04,3 DH@G %)F!(=A:A26M/6+/M(/<| "
 "
r   r   c                  <    e Zd ZU dZded<   ded<   d Zed        Zy)	DetachedElementInfozm
    A structure to hold the top-level node of a detached tree and an array of its retained descendants.
    r   	tree_nodetyping.List[NodeId]retained_node_idsc                    t               }| j                  j                         |d<   | j                  D cg c]  }|j                          c}|d<   |S c c}w )NtreeNoderetainedNodeIds)r<   r   r   r   r   s      r   r   zDetachedElementInfo.to_json  sM    v>>113Z8<8N8N"O1199;"O #Ps   Ac           	          | t         j                  |d         |d   D cg c]  }t        j                  |       c}      S c c}w )Nr   r   )r   r   )r   r   r   r   s      r   r   zDetachedElementInfo.from_json  sB    nnT*%56<@AR<STqv//2T
 	
T   A
Nr?   r   r   r   r   r     s-     O** 
 
r   r   c                  T    e Zd ZU dZded<   ded<   ded<   dZded<   d	 Zed
        Zy)RGBAz,
    A structure holding an RGBA color.
    r$   rgbNztyping.Optional[float]ac                    t               }| j                  |d<   | j                  |d<   | j                  |d<   | j                  | j                  |d<   |S )Nr   r   r   r   )r<   r   r   r   r   r=   s     r   r   zRGBA.to_json  sL    vFFS	FFS	FFS	66DIr   c           	          | t        |d         t        |d         t        |d         d|v rt        |d               S d       S )Nr   r   r   r   )r   r   r   r   )r$   floatr   s     r   r   zRGBA.from_json  sQ    $s)n$s)n$s)n"%+eDI	
 	
 48	
 	
r   )	r&   r'   r(   r)   r@   r   r   r*   r   r   r   r   r   r     sB     F F F !%A$ 
 
r   r   c                  <     e Zd ZdZddZedd       Z fdZ xZS )Quadzc
    An array of quad vertices, x immediately followed by y for each point, points clock-wise.
    c                    | S r   r   r   s    r   r   zQuad.to_json  r   r   c                     | |      S r   r   r   s     r   r   zQuad.from_json  r   r   c                >    dj                  t        | 	               S )NzQuad({})r   r    s    r   r   zQuad.__repr__  s      !1!344r   )r#   typing.List[float])r   r   r#   r   r%   r,   s   @r   r   r     s+      5 5r   r   c                  r    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
Zded<   d Zed        Zy
)BoxModelz
    Box model.
    r   contentpaddingbordermarginr$   widthheightNz!typing.Optional[ShapeOutsideInfo]shape_outsidec                   t               }| j                  j                         |d<   | j                  j                         |d<   | j                  j                         |d<   | j
                  j                         |d<   | j                  |d<   | j                  |d<   | j                  | j                  j                         |d<   |S )Nr   r  r  r  r  r  shapeOutside)	r<   r   r   r  r  r  r  r  r  r=   s     r   r   zBoxModel.to_json  s    v,,..0Y,,..0Y,,.X,,.X

WX)#'#5#5#=#=#?D r   c                B    | t         j                  |d         t         j                  |d         t         j                  |d         t         j                  |d         t        |d         t        |d         d|v rt        j                  |d               S d       S )	Nr   r  r  r  r  r  r  )r   r  r  r  r  r  r  )r   r   r$   ShapeOutsideInfor   s     r   r   zBoxModel.from_json  s    NN4	?3NN4	?3>>$x.1>>$x.1d7m$tH~&N\`dNd*44T.5IJ
 	
 ko
 	
r   )	r&   r'   r(   r)   r@   r  r   r*   r   r   r   r   r   r     sW     M M L L J K 8<M4;
 	
 	
r   r   c                  F    e Zd ZU dZded<   ded<   ded<   d Zed        Zy	)
r
  z$
    CSS Shape Outside details.
    r   boundsztyping.List[typing.Any]shapemargin_shapec                    t               }| j                  j                         |d<   | j                  D cg c]  }| c}|d<   | j                  D cg c]  }| c}|d<   |S c c}w c c}w )Nr  r  marginShape)r<   r  r   r  r  r   s      r   r   zShapeOutsideInfo.to_json#  s_    v,,.X$(JJ/q/W*.*;*;<Qq<] 0<s   	A$	A)c                     | t         j                  |d         |d   D cg c]  }| c}|d   D cg c]  }| c}      S c c}w c c}w )Nr  r  r  )r  r  r  )r   r   r   s      r   r   zShapeOutsideInfo.from_json*  sJ    >>$x.1"7m,1,%)-%89!9
 	
,9s
   	A
	A	Nr?   r   r   r   r
  r
    s7     L #" *) 
 
r   r
  c                  P    e Zd ZU dZded<   ded<   ded<   ded<   d Zed        Zy	)
Rectz
    Rectangle.
    r   xyr  r  c                    t               }| j                  |d<   | j                  |d<   | j                  |d<   | j                  |d<   |S )Nr  r  r  r  )r<   r  r  r  r  r=   s     r   r   zRect.to_jsonD  sB    vFFS	FFS	

WXr   c           	     z     | t        |d         t        |d         t        |d         t        |d               S )Nr  r  r  r  )r  r  r  r  )r   r   s     r   r   zRect.from_jsonL  s?    DIDIW&h(	
 	
r   Nr?   r   r   r   r  r  3  s<     H H L M 
 
r   r  c                  8    e Zd ZU ded<   ded<   d Zed        Zy)CSSComputedStylePropertyr5   r   rQ   c                V    t               }| j                  |d<   | j                  |d<   |S )Nr   rQ   )r<   r   rQ   r=   s     r   r   z CSSComputedStyleProperty.to_json^  s(    vyyV

Wr   c                F     | t        |d         t        |d               S )Nr   rQ   )r   rQ   )r5   r   s     r   r   z"CSSComputedStyleProperty.from_jsond  s'    T&\"d7m$
 	
r   N)r&   r'   r(   r@   r   r*   r   r   r   r   r  r  V  s)     I J 
 
r   r  c              #     K   t               }| j                         |d<   d|d}|}|d   D cg c]  }t        |       c}S c c}w w)z
    Collects class names for the node with given id and all of it's child nodes.

    **EXPERIMENTAL**

    :param node_id: Id of the node to collect class names.
    :returns: Class name list.
    r   z DOM.collectClassNamesFromSubtreemethodparams
classNamesr<   r   r5   r   r  cmd_dictr   r   s        r    collect_class_names_from_subtreer$  l  sS      &F(F84H >D ./qCF///   .A
AA
c              #     K   t               }| j                         |d<   |j                         |d<   ||j                         |d<   d|d}|}t        j                  |d         S w)a  
    Creates a deep copy of the specified node and places it into the target container before the
    given anchor.

    **EXPERIMENTAL**

    :param node_id: Id of the node to copy.
    :param target_node_id: Id of the element to drop the copy into.
    :param insert_before_node_id: *(Optional)* Drop the copy before this node (if absent, the copy becomes the last child of ```targetNodeId```).
    :returns: Id of the node clone.
    r   targetNodeIdinsertBeforeNodeIdz
DOM.copyTor  r<   r   r   r   r   target_node_idinsert_before_node_idr  r#  r   s         r   copy_tor-    sx       &F(F8+335F>('<'D'D'F#$H >DDN++   A'A)c              #     K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   |||d<   |||d<   d|d}|}t        j                  |d         S w)	a  
    Describes node given its id, does not require domain to be enabled. Does not start tracking any
    objects, can be used for automation.

    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :param depth: *(Optional)* The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)* Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
    :returns: Node description.
    r   r;   objectIddepthpiercezDOM.describeNoder  node)r<   r   r   r   )r   r7   	object_idr1  r2  r  r#  r   s           r   describe_noder5    s     $ &F"??,x""1"9"9";&..0zw!x$H >D>>$v,''s   A9A;c              #     K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}yw)aY  
    Scrolls the specified rect of the given node into view if not already visible.
    Note: exactly one between nodeId, backendNodeId and objectId should be passed
    to identify the node.

    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :param rect: *(Optional)* The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.
    Nr   r;   r0  rectzDOM.scrollIntoViewIfNeededr  r<   r   )r   r7   r4  r7  r  r#  r   s          r   scroll_into_view_if_neededr9    s       &F"??,x""1"9"9";&..0zv.H >Ds   A)A+c               #     K   ddi} | }yw)z0
    Disables DOM agent for the given page.
    r  zDOM.disableNr   r#  r   s     r   disabler<    s     
 	-H >D   
c              #  <   K   t               }| |d<   d|d}|}yw)z
    Discards search results from the session with the given id. ``getSearchResults`` should no longer
    be called for that search.

    **EXPERIMENTAL**

    :param search_id: Unique search session identifier.
    searchIdzDOM.discardSearchResultsr  Nr<   )	search_idr  r#  r   s       r   discard_search_resultsrB    s/      &F"F:,H >D   c              #  @   K   t               }| | |d<   d|d}|}yw)z
    Enables DOM agent for the given page.

    :param include_whitespace: **(EXPERIMENTAL)** *(Optional)* Whether to include whitespaces in the children array of returned Nodes.
    NincludeWhitespacez
DOM.enabler  r@  )include_whitespacer  r#  r   s       r   enablerG    s6      &F%&8"#H >Ds   c              #     K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}yw)z
    Focuses the given element.

    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    Nr   r;   r0  z	DOM.focusr  r8  r   r7   r4  r  r#  r   s         r   focusrJ    sn      &F"??,x""1"9"9";&..0zH >Ds   AAc              #     K   t               }| j                         |d<   d|d}|}|d   D cg c]  }t        |       c}S c c}w w)z
    Returns attributes for the specified node.

    :param node_id: Id of the node to retrieve attributes for.
    :returns: An interleaved array of node attribute names and values.
    r   zDOM.getAttributesr  r   r!  r"  s        r   get_attributesrL  -  sS      &F(F8%H >D ./qCF///r%  c              #     K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}t        j                  |d         S w)a!  
    Returns boxes for the given node.

    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :returns: Box model for the node.
    r   r;   r0  zDOM.getBoxModelr  model)r<   r   r   r   rI  s         r   get_box_modelrO  @  s      &F"??,x""1"9"9";&..0z#H >Dd7m,,s   A+A-c              #    K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a  
    Returns quads that describe node position on the page. This method
    might return multiple quads for inline nodes.

    **EXPERIMENTAL**

    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :returns: Quads that describe node layout relative to viewport.
    r   r;   r0  zDOM.getContentQuadsr  quads)r<   r   r   r   )r   r7   r4  r  r#  r   r   s          r   get_content_quadsrR  \  s       &F"??,x""1"9"9";&..0z'H >D'+G}5!DNN1555s   AB A;8B c              #  |   K   t               }| | |d<   |||d<   d|d}|}t        j                  |d         S w)a  
    Returns the root DOM node (and optionally the subtree) to the caller.
    Implicitly enables the DOM domain events for the current target.

    :param depth: *(Optional)* The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)* Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
    :returns: Resulting node.
    r1  r2  zDOM.getDocumentr  rootr<   r   r   )r1  r2  r  r#  r   s        r   get_documentrV  {  sW      &Fw!x#H >D>>$v,''s   :<c              #     K   t               }| | |d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a#  
    Returns the root DOM node (and optionally the subtree) to the caller.
    Deprecated, as it is not designed to work well with the rest of the DOM agent.
    Use DOMSnapshot.captureSnapshot instead.

    :param depth: *(Optional)* The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)* Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
    :returns: Resulting node.
    r1  r2  zDOM.getFlattenedDocumentr  nodesrU  )r1  r2  r  r#  r   r   s         r   get_flattened_documentrY    se      &Fw!x,H >D'+G}5!DNN1555s   )AA
Ac              #    K   t               }| j                         |d<   |D cg c]  }|j                          c}|d<   |||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w c c}w w)a  
    Finds nodes with a given computed style in a subtree.

    **EXPERIMENTAL**

    :param node_id: Node ID pointing to the root of a subtree.
    :param computed_styles: The style to filter nodes by (includes nodes if any of properties matches).
    :param pierce: *(Optional)* Whether or not iframes and shadow roots in the same target should be traversed when returning the results (default is false).
    :returns: Resulting nodes.
    r   computedStylesr2  zDOM.getNodesForSubtreeByStyler  nodeIdsr)  )r   computed_stylesr2  r  r   r#  r   s          r   get_nodes_for_subtree_by_styler^    s      &F(F85DE		EF!x1H >D)-i9AFQ99  F :s   "BA7BA<4Bc              #    K   t               }| |d<   ||d<   |||d<   |||d<   d|d}|}t        j                  |d         t        j                  j                  |d	         d
|v rt
        j                  |d
         fS dfS w)a  
    Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is
    either returned or not.

    :param x: X coordinate.
    :param y: Y coordinate.
    :param include_user_agent_shadow_dom: *(Optional)* False to skip to the nearest non-UA shadow root ancestor (default: false).
    :param ignore_pointer_events_none: *(Optional)* Whether to ignore pointer-events: none on elements and hit test them.
    :returns: A tuple with the following items:

        0. **backendNodeId** - Resulting node.
        1. **frameId** - Frame this node belongs to.
        2. **nodeId** - *(Optional)* Id of the node at given coordinates, only when enabled and requested document.
    r  r  NincludeUserAgentShadowDOMignorePointerEventsNonezDOM.getNodeForLocationr  r;   r   r   )r<   r.   r   r   r   r   )r  r  include_user_agent_shadow_domignore_pointer_events_noner  r#  r   s          r   get_node_for_locationrd    s     ( &FF3KF3K$0.K*+!-,F()*H >D_ 56tI/,4,<h(  CG s   BBc              #     K   t               }| | j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}t        |d         S w)a  
    Returns node's HTML markup.

    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    :returns: Outer HTML markup.
    r   r;   r0  zDOM.getOuterHTMLr  	outerHTMLr!  rI  s         r   get_outer_htmlrg    s~      &F"??,x""1"9"9";&..0z$H >DtK !!s   A!A#c              #     K   t               }| j                         |d<   d|d}|}t        j                  |d         S w)z
    Returns the id of the nearest ancestor that is a relayout boundary.

    **EXPERIMENTAL**

    :param node_id: Id of the node.
    :returns: Relayout boundary node id for the given node.
    r   zDOM.getRelayoutBoundaryr  r)  r   r  r#  r   s       r   get_relayout_boundaryrj    sK      &F(F8+H >DDN++   ?Ac              #     K   t               }| |d<   ||d<   ||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a  
    Returns search results from given ``fromIndex`` to given ``toIndex`` from the search with the given
    identifier.

    **EXPERIMENTAL**

    :param search_id: Unique search session identifier.
    :param from_index: Start index of the search result to be returned.
    :param to_index: End index of the search result to be returned.
    :returns: Ids of the search result nodes.
    r?  	fromIndextoIndexzDOM.getSearchResultsr  r\  r<   r   r   )rA  
from_indexto_indexr  r#  r   r   s          r   get_search_resultsrr  "  sf       &F"F:$F; F9(H >D)-i9AFQ999s   *AAAc               #     K   ddi} | }yw)z
    Hides any highlight.
    r  zDOM.hideHighlightNr   r;  s     r   hide_highlightrt  >       
 	%H >Dr=  c               #     K   ddi} | }yw)z
    Highlights DOM node.
    r  zDOM.highlightNodeNr   r;  s     r   highlight_noderw  H  ru  r=  c               #     K   ddi} | }yw)z%
    Highlights given rectangle.
    r  zDOM.highlightRectNr   r;  s     r   highlight_rectry  R  ru  r=  c               #     K   ddi} | }yw)z:
    Marks last undoable state.

    **EXPERIMENTAL**
    r  zDOM.markUndoableStateNr   r;  s     r   mark_undoable_stater{  \  s      	)H >Dr=  c              #     K   t               }| j                         |d<   |j                         |d<   ||j                         |d<   d|d}|}t        j                  |d         S w)a  
    Moves node into the new container, places it before the given anchor.

    :param node_id: Id of the node to move.
    :param target_node_id: Id of the element to drop the moved node into.
    :param insert_before_node_id: *(Optional)* Drop node before this one (if absent, the moved node becomes the last child of ```targetNodeId```).
    :returns: New id of the moved node.
    r   r'  r(  z
DOM.moveTor  r)  r*  s         r   move_tor}  h  sx      &F(F8+335F>('<'D'D'F#$H >DDN++r.  c              #     K   t               }| |d<   |||d<   d|d}|}t        |d         t        |d         fS w)a  
    Searches for a given string in the DOM tree. Use ``getSearchResults`` to access search results or
    ``cancelSearch`` to end this search session.

    **EXPERIMENTAL**

    :param query: Plain text or query selector or XPath search query.
    :param include_user_agent_shadow_dom: *(Optional)* True to search in user agent shadow DOM.
    :returns: A tuple with the following items:

        0. **searchId** - Unique search session identifier.
        1. **resultCount** - Number of search results.
    queryr`  zDOM.performSearchr  r?  resultCount)r<   r5   r$   )r  rb  r  r#  r   s        r   perform_searchr    sc     " &FF7O$0.K*+%H >DDD  s   <>c              #  j   K   t               }| |d<   d|d}|}t        j                  |d         S w)z
    Requests that the node is sent to the caller given its path. // FIXME, use XPath

    **EXPERIMENTAL**

    :param path: Path to node in the proprietary format.
    :returns: Id of the node for given path.
    pathzDOM.pushNodeByPathToFrontendr  r   ro  )r  r  r#  r   s       r   push_node_by_path_to_frontendr    sC      &FF6N0H >DDN++s   13c              #     K   t               }| D cg c]  }|j                          c}|d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w c c}w w)a  
    Requests that a batch of nodes is sent to the caller given their backend node ids.

    **EXPERIMENTAL**

    :param backend_node_ids: The array of backend node ids.
    :returns: The array of ids of pushed nodes that correspond to the backend ids specified in backendNodeIds.
    backendNodeIdsz#DOM.pushNodesByBackendIdsToFrontendr  r\  r)  )backend_node_idsr  r   r#  r   s        r   %push_nodes_by_backend_ids_to_frontendr    sl      &F5EF		FF7H >D)-i9AFQ99  G :s   A'AA'A"A'c              #     K   t               }| j                         |d<   ||d<   d|d}|}t        j                  |d         S w)z
    Executes ``querySelector`` on a given node.

    :param node_id: Id of the node to query upon.
    :param selector: Selector string.
    :returns: Query selector result.
    r   selectorzDOM.querySelectorr  r)  )r   r  r  r#  r   s        r   query_selectorr    sU      &F(F8!F:%H >DDN++   AAc              #     K   t               }| j                         |d<   ||d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)z
    Executes ``querySelectorAll`` on a given node.

    :param node_id: Id of the node to query upon.
    :param selector: Selector string.
    :returns: Query selector result.
    r   r  zDOM.querySelectorAllr  r\  r)  )r   r  r  r#  r   r   s         r   query_selector_allr    sc      &F(F8!F:(H >D)-i9AFQ999s   3AAAc               #  p   K   ddi} | }|d   D cg c]  }t         j                  |       c}S c c}w w)a  
    Returns NodeIds of current top layer elements.
    Top layer is rendered closest to the user within a viewport, therefore its elements always
    appear on top of all other content.

    **EXPERIMENTAL**

    :returns: NodeIds of top layer elements
    r  zDOM.getTopLayerElementsr\  r   r   r#  r   r   s      r   get_top_layer_elementsr    sA      	+H >D)-i9AFQ999   616c              #     K   t               }| j                         |d<   ||d<   d|d}|}t        j                  |d         S w)a   
    Returns the NodeId of the matched element according to certain relations.

    **EXPERIMENTAL**

    :param node_id: Id of the node from which to query the relation.
    :param relation: Type of relation to get.
    :returns: NodeId of the element matching the queried relation.
    r   relationzDOM.getElementByRelationr  r)  )r   r  r  r#  r   s        r   get_element_by_relationr  	  sU      &F(F8!F:,H >DDN++r  c               #     K   ddi} | }yw)z?
    Re-does the last undone action.

    **EXPERIMENTAL**
    r  zDOM.redoNr   r;  s     r   redor  !        	*H >Dr=  c              #  b   K   t               }| j                         |d<   ||d<   d|d}|}yw)z
    Removes attribute with given name from an element with given id.

    :param node_id: Id of the element to remove attribute from.
    :param name: Name of the attribute to remove.
    r   r   zDOM.removeAttributer  Nr8  r   r   r  r#  r   s        r   remove_attributer  -  s?      &F(F8F6N'H >D   -/c              #  X   K   t               }| j                         |d<   d|d}|}yw)zT
    Removes node with given id.

    :param node_id: Id of the node to remove.
    r   zDOM.removeNoder  Nr8  ri  s       r   remove_noder  A  s6      &F(F8"H >D   (*c              #  t   K   t               }| j                         |d<   |||d<   |||d<   d|d}|}yw)aO  
    Requests that children of the node with given id are returned to the caller in form of
    ``setChildNodes`` events where not only immediate children are retrieved, but all children down to
    the specified depth.

    :param node_id: Id of the node to get children for.
    :param depth: *(Optional)* The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
    :param pierce: *(Optional)* Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
    r   Nr1  r2  zDOM.requestChildNodesr  r8  )r   r1  r2  r  r#  r   s         r   request_child_nodesr  R  sU      &F(F8w!x)H >Ds   68c              #     K   t               }| j                         |d<   d|d}|}t        j                  |d         S w)aW  
    Requests that the node is sent to the caller given the JavaScript node object reference. All
    nodes that form the path from the node to the root are also sent to the client as a series of
    ``setChildNodes`` notifications.

    :param object_id: JavaScript object id to convert into node.
    :returns: Node id for given object.
    r0  zDOM.requestNoder  r   r)  r4  r  r#  r   s       r   request_noder  m  sM      &F"**,F:#H >DDN++rk  c              #     K   t               }| | j                         |d<   ||j                         |d<   |||d<   ||j                         |d<   d|d}|}t        j                  j	                  |d         S w)a  
    Resolves the JavaScript node object for a given NodeId or BackendNodeId.

    :param node_id: *(Optional)* Id of the node to resolve.
    :param backend_node_id: *(Optional)* Backend identifier of the node to resolve.
    :param object_group: *(Optional)* Symbolic group name that can be used to release multiple objects.
    :param execution_context_id: *(Optional)* Execution context in which to resolve the node.
    :returns: JavaScript object wrapper for given node.
    r   r;   objectGroupexecutionContextIdzDOM.resolveNoder  object)r<   r   r	   RemoteObjectr   )r   r7   object_groupexecution_context_idr  r#  r   s          r   resolve_noder    s      &F"??,x""1"9"9"; ,}'';'C'C'E#$#H >D))$x.99s   A<A>c              #  l   K   t               }| j                         |d<   ||d<   ||d<   d|d}|}yw)z
    Sets attribute for an element with given id.

    :param node_id: Id of the element to set attribute for.
    :param name: Attribute name.
    :param value: Attribute value.
    r   r   rQ   zDOM.setAttributeValuer  Nr8  )r   r   rQ   r  r#  r   s         r   set_attribute_valuer    sH      &F(F8F6NF7O)H >Ds   24c              #  p   K   t               }| j                         |d<   ||d<   |||d<   d|d}|}yw)a  
    Sets attributes on element with given id. This method is useful when user edits some existing
    attribute value and types in several attribute name/value pairs.

    :param node_id: Id of the element to set attributes for.
    :param text: Text with a number of attributes. Will parse this text using HTML parser.
    :param name: *(Optional)* Attribute name to replace with new attributes derived from text in case text parsed successfully.
    r   textNr   zDOM.setAttributesAsTextr  r8  )r   r  r   r  r#  r   s         r   set_attributes_as_textr    sN      &F(F8F6Nv+H >Ds   46c              #     K   t               }| D cg c]  }| c}|d<   ||j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}yc c}w w)a4  
    Sets files for the given file input element.

    :param files: Array of file paths to set.
    :param node_id: *(Optional)* Identifier of the node.
    :param backend_node_id: *(Optional)* Identifier of the backend node.
    :param object_id: *(Optional)* JavaScript object id of the node wrapper.
    filesNr   r;   r0  zDOM.setFileInputFilesr  r8  )r  r   r7   r4  r  r   r#  r   s           r   set_file_input_filesr    s      &F"'(Qq(F7O"??,x""1"9"9";&..0z)H >D )s   A.	A)AA.c              #  <   K   t               }| |d<   d|d}|}yw)z
    Sets if stack traces should be captured for Nodes. See ``Node.getNodeStackTraces``. Default is disabled.

    **EXPERIMENTAL**

    :param enable: Enable or disable.
    rG  zDOM.setNodeStackTracesEnabledr  Nr@  )rG  r  r#  r   s       r   set_node_stack_traces_enabledr    s/      &FF81H >DrC  c              #     K   t               }| j                         |d<   d|d}|}d|v r"t        j                  j	                  |d         S dS w)z
    Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.

    **EXPERIMENTAL**

    :param node_id: Id of the node to get stack traces for.
    :returns: *(Optional)* Creation stack trace, if available.
    r   zDOM.getNodeStackTracesr  creationN)r<   r   r	   
StackTracer   ri  s       r   get_node_stack_tracesr    s_      &F(F8*H >D=G4=O7''Z(89YUYYs   AAc              #  r   K   t               }| j                         |d<   d|d}|}t        |d         S w)z
    Returns file information for the given
    File wrapper.

    **EXPERIMENTAL**

    :param object_id: JavaScript object id of the node wrapper.
    :returns: 
    r0  zDOM.getFileInfor  r  r!  r  s       r   get_file_infor    sG      &F"**,F:#H >DtF|s   57c               #  p   K   ddi} | }|d   D cg c]  }t         j                  |       c}S c c}w w)zh
    Returns list of detached nodes

    **EXPERIMENTAL**

    :returns: The list of detached nodes
    r  zDOM.getDetachedDomNodesdetachedNodes)r   r   r  s      r   get_detached_dom_nodesr  -  sC      	+H >D6:?6KL))!,LLLr  c              #  X   K   t               }| j                         |d<   d|d}|}yw)z
    Enables console to refer to the node with given id via $x (see Command Line API for more details
    $x functions).

    **EXPERIMENTAL**

    :param node_id: DOM node id to be accessible by means of $x command line API.
    r   zDOM.setInspectedNoder  Nr8  ri  s       r   set_inspected_noder  <  s6      &F(F8(H >Dr  c              #     K   t               }| j                         |d<   ||d<   d|d}|}t        j                  |d         S w)z
    Sets node name for a node with given id.

    :param node_id: Id of the node to set name for.
    :param name: New node's name.
    :returns: New node's id.
    r   r   zDOM.setNodeNamer  r)  r  s        r   set_node_namer  P  sT      &F(F8F6N#H >DDN++r  c              #  b   K   t               }| j                         |d<   ||d<   d|d}|}yw)z
    Sets node value for a node with given id.

    :param node_id: Id of the node to set value for.
    :param value: New node's value.
    r   rQ   zDOM.setNodeValuer  Nr8  )r   rQ   r  r#  r   s        r   set_node_valuer  f  s?      &F(F8F7O$H >Dr  c              #  b   K   t               }| j                         |d<   ||d<   d|d}|}yw)z
    Sets node HTML markup, returns new node id.

    :param node_id: Id of the node to set markup for.
    :param outer_html: Outer HTML markup to set.
    r   rf  zDOM.setOuterHTMLr  Nr8  )r   
outer_htmlr  r#  r   s        r   set_outer_htmlr  z  s@      &F(F8$F;$H >Dr  c               #     K   ddi} | }yw)zA
    Undoes the last performed action.

    **EXPERIMENTAL**
    r  zDOM.undoNr   r;  s     r   undor    r  r=  c              #     K   t               }| j                         |d<   d|d}|}t        j                  |d         d|v rt        j                  |d         fS dfS w)aE  
    Returns iframe node that owns iframe with the given domain.

    **EXPERIMENTAL**

    :param frame_id:
    :returns: A tuple with the following items:

        0. **backendNodeId** - Resulting node.
        1. **nodeId** - *(Optional)* Id of the node at given coordinates, only when enabled and requested document.
    r   zDOM.getFrameOwnerr  r;   r   N)r<   r   r.   r   r   )r   r  r#  r   s       r   get_frame_ownerr    s{      &F ((*F9%H >D_ 56,4,<h( BF s   AA c              #    K   t               }| j                         |d<   |||d<   ||j                         |d<   ||j                         |d<   |||d<   d|d}|}d|v rt        j                  |d         S dS w)	a  
    Returns the query container of the given node based on container query
    conditions: containerName, physical and logical axes, and whether it queries
    scroll-state. If no axes are provided and queriesScrollState is false, the
    style container is returned, which is the direct parent or the closest
    element with a matching container-name.

    **EXPERIMENTAL**

    :param node_id:
    :param container_name: *(Optional)*
    :param physical_axes: *(Optional)*
    :param logical_axes: *(Optional)*
    :param queries_scroll_state: *(Optional)*
    :returns: *(Optional)* The container node for the given node, or null if not found.
    r   NcontainerNamephysicalAxeslogicalAxesqueriesScrollStatezDOM.getContainerForNoder  r)  )r   container_namephysical_axeslogical_axesqueries_scroll_stater  r#  r   s           r   get_container_for_noder    s     . &F(F8!"0 !.!6!6!8~ , 4 4 6}'';#$+H >D/74/?6DN+ITIs   A=A?c              #     K   t               }| j                         |d<   d|d}|}|d   D cg c]  }t        j                  |       c}S c c}w w)a2  
    Returns the descendants of a container query container that have
    container queries against this container.

    **EXPERIMENTAL**

    :param node_id: Id of the container node to find querying descendants from.
    :returns: Descendant nodes with container queries against the given container.
    r   z&DOM.getQueryingDescendantsForContainerr  r\  r)  r"  s        r   &get_querying_descendants_for_containerr    sY      &F(F8:H >D)-i9AFQ999s   .AAAc              #     K   t               }| j                         |d<   |||d<   d|d}|}t        j                  |d         S w)a!  
    Returns the target anchor element of the given anchor query according to
    https://www.w3.org/TR/css-anchor-position-1/#target.

    **EXPERIMENTAL**

    :param node_id: Id of the positioned element from which to find the anchor.
    :param anchor_specifier: *(Optional)* An optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element.
    :returns: The anchor element of the given anchor query.
    r   anchorSpecifierzDOM.getAnchorElementr  r)  )r   anchor_specifierr  r#  r   s        r   get_anchor_elementr    s\      &F(F8#$4 !(H >DDN++s   AAzDOM.attributeModifiedc                  B    e Zd ZU dZded<   ded<   ded<   ed	d       Zy)
AttributeModifiedz9
    Fired when ``Element``'s attribute is modified.
    r   r   r5   r   rQ   c                t     | t         j                  |d         t        |d         t        |d               S )Nr   r   rQ   )r   r   rQ   r   r   r5   r   s     r   r   zAttributeModified.from_json  s9    $$T(^4T&\"d7m$
 	
r   N)r   r   r#   r  r&   r'   r(   r)   r@   r*   r   r   r   r   r  r    s*     O
IJ
 
r   r  zDOM.attributeRemovedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	AttributeRemovedz8
    Fired when ``Element``'s attribute is removed.
    r   r   r5   r   c                Z     | t         j                  |d         t        |d               S )Nr   r   )r   r   r  r   s     r   r   zAttributeRemoved.from_json/  s-    $$T(^4T&\"
 	
r   N)r   r   r#   r  r  r   r   r   r  r  $  s%     O
I
 
r   r  zDOM.characterDataModifiedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	CharacterDataModifiedz5
    Mirrors ``DOMCharacterDataModified`` event.
    r   r   r5   character_datac                Z     | t         j                  |d         t        |d               S )Nr   characterData)r   r  r  r   s     r   r   zCharacterDataModified.from_jsonB  s.    $$T(^4tO45
 	
r   N)r   r   r#   r  r  r   r   r   r  r  7  s&     O
 
r   r  zDOM.childNodeCountUpdatedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	ChildNodeCountUpdatedzB
    Fired when ``Container``'s child node count has changed.
    r   r   r$   r   c                Z     | t         j                  |d         t        |d               S )Nr   r   )r   r   )r   r   r$   r   s     r   r   zChildNodeCountUpdated.from_jsonU  s/    $$T(^4 &6!78
 	
r   N)r   r   r#   r  r  r   r   r   r  r  J  s&     O
 
r   r  zDOM.childNodeInsertedc                  B    e Zd ZU dZded<   ded<   ded<   ed	d       Zy)
ChildNodeInsertedz,
    Mirrors ``DOMNodeInserted`` event.
    r   parent_node_idprevious_node_idr   r3  c                     | t         j                  |d         t         j                  |d         t        j                  |d               S )NparentNodeIdpreviousNodeIdr3  )r  r  r3  r   r   r   r   s     r   r   zChildNodeInserted.from_jsonj  sF    !++D,@A#--d3C.DEV-
 	
r   N)r   r   r#   r  r  r   r   r   r  r  ]  s,     
J
 
r   r  zDOM.childNodeRemovedc                  8    e Zd ZU dZded<   ded<   edd       Zy)ChildNodeRemovedz+
    Mirrors ``DOMNodeRemoved`` event.
    r   r  r   c                n     | t         j                  |d         t         j                  |d               S )Nr  r   )r  r   r  r   s     r   r   zChildNodeRemoved.from_json~  s4    !++D,@A$$T(^4
 	
r   N)r   r   r#   r  r  r   r   r   r  r  s  s&     O
 
r   r  zDOM.distributedNodesUpdatedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	DistributedNodesUpdatedzD
    **EXPERIMENTAL**

    Called when distribution is changed.
    r   insertion_point_idztyping.List[BackendNode]r   c           	          | t         j                  |d         |d   D cg c]  }t        j                  |       c}      S c c}w )NinsertionPointIdr   )r  r   )r   r   r3   r   s      r   r   z!DistributedNodesUpdated.from_json  sE    %//5G0HIAEFXAYZA{44Q7Z
 	
Zr   N)r   r   r#   r  r  r   r   r   r  r    s'     //
 
r   r  zDOM.documentUpdatedc                  "    e Zd ZdZedd       Zy)DocumentUpdatedzY
    Fired when ``Document`` has been totally updated. Node ids are no longer valid.
    c                     |        S r   r   r   s     r   r   zDocumentUpdated.from_json       
 	
r   N)r   r   r#   r  r&   r'   r(   r)   r*   r   r   r   r   r  r    s    
 
 
r   r  zDOM.inlineStyleInvalidatedc                  .    e Zd ZU dZded<   edd       Zy)InlineStyleInvalidatedzr
    **EXPERIMENTAL**

    Fired when ``Element``'s inline style is modified via a CSS property modification.
    r   node_idsc                f     | |d   D cg c]  }t         j                  |       c}      S c c}w )Nr\  )r  r  r   s      r   r   z InlineStyleInvalidated.from_json  s/    37	?Caf&&q)C
 	
Cs   .N)r   r   r#   r  r  r   r   r   r  r    s!     "!
 
r   r  zDOM.pseudoElementAddedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	PseudoElementAddedzT
    **EXPERIMENTAL**

    Called when a pseudo element is added to an element.
    r   r   r   pseudo_elementc                n     | t         j                  |d         t        j                  |d               S )Nr   pseudoElement)r   r	  r  r   s     r   r   zPseudoElementAdded.from_json  s3    &&tJ'78>>$*?@
 	
r   N)r   r   r#   r  r  r   r   r   r  r    s'     
 
r   r  zDOM.topLayerElementsUpdatedc                  "    e Zd ZdZedd       Zy)TopLayerElementsUpdatedzK
    **EXPERIMENTAL**

    Called when top layer elements are changed.
    c                     |        S r   r   r   s     r   r   z!TopLayerElementsUpdated.from_json  r  r   N)r   r   r#   r  r  r   r   r   r  r    s     
 
r   r  zDOM.scrollableFlagUpdatedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	ScrollableFlagUpdatedzP
    **EXPERIMENTAL**

    Fired when a node's scrollability state changes.
    z
dom.NodeIdr   r   r   c                n     | t         j                  j                  |d         t        |d               S )Nr   r   )r   r   )domr   r   r   r   s     r   r   zScrollableFlagUpdated.from_json  s2    JJ((h8tN34
 	
r   N)r   r   r#   r  r  r   r   r   r  r    s'     
 
r   r  zDOM.pseudoElementRemovedc                  8    e Zd ZU dZded<   ded<   edd       Zy)PseudoElementRemovedzX
    **EXPERIMENTAL**

    Called when a pseudo element is removed from an element.
    r   r   pseudo_element_idc                n     | t         j                  |d         t         j                  |d               S )Nr   pseudoElementId)r   r  r  r   s     r   r   zPseudoElementRemoved.from_json  s6    &&tJ'78$..t4E/FG
 	
r   N)r   r   r#   r  r  r   r   r   r  r    s'     
 
r   r  zDOM.setChildNodesc                  8    e Zd ZU dZded<   ded<   edd       Zy)	SetChildNodesz
    Fired when backend wants to provide client with the missing DOM structure. This happens upon
    most of the calls requesting node ids.
    r   r   ztyping.List[Node]rX  c           	          | t         j                  |d         |d   D cg c]  }t        j                  |       c}      S c c}w )Nr   rX  )r   rX  r  r   s      r   r   zSetChildNodes.from_json  s@    &&tJ'78.27m<4>>!$<
 	
<r   N)r   r   r#   r  r  r   r   r   r  r    s'    
 
 
r   r  zDOM.shadowRootPoppedc                  8    e Zd ZU dZded<   ded<   edd       Zy)ShadowRootPoppedzS
    **EXPERIMENTAL**

    Called when shadow root is popped from the element.
    r   host_idroot_idc                n     | t         j                  |d         t         j                  |d               S )NhostIdrootId)r  r  r  r   s     r   r   zShadowRootPopped.from_json-  s3    $$T(^4$$T(^4
 	
r   N)r   r   r#   r  r  r   r   r   r  r     s%     OO
 
r   r  zDOM.shadowRootPushedc                  8    e Zd ZU dZded<   ded<   edd       Zy)	ShadowRootPushedzS
    **EXPERIMENTAL**

    Called when shadow root is pushed into the element.
    r   r  r   rT  c                n     | t         j                  |d         t        j                  |d               S )Nr   rT  )r  rT  r  r   s     r   r   zShadowRootPushed.from_jsonB  s1    $$T(^4V-
 	
r   N)r   r   r#   r#  r  r   r   r   r#  r#  5  s%     O
J
 
r   r#  )r   r   r#   z<typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[str]]r   )r   r   r+  r   r,  r   r#   2typing.Generator[T_JSON_DICT, T_JSON_DICT, NodeId])NNNNN)r   r   r7   typing.Optional[BackendNodeId]r4  'typing.Optional[runtime.RemoteObjectId]r1  r   r2  r   r#   0typing.Generator[T_JSON_DICT, T_JSON_DICT, Node])NNNN)
r   r   r7   r&  r4  r'  r7  ztyping.Optional[Rect]r#   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r#   r)  )rA  r5   r#   r)  )rF  r   r#   r)  )NNN)r   r   r7   r&  r4  r'  r#   r)  )r   r   r7   r&  r4  r'  r#   z4typing.Generator[T_JSON_DICT, T_JSON_DICT, BoxModel])r   r   r7   r&  r4  r'  r#   z=typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[Quad]])NN)r1  r   r2  r   r#   r(  )r1  r   r2  r   r#   z=typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[Node]])r   r   r]  z%typing.List[CSSComputedStyleProperty]r2  r   r#   ?typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[NodeId]])
r  r$   r  r$   rb  r   rc  r   r#   zntyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BackendNodeId, page.FrameId, typing.Optional[NodeId]]])r   r   r7   r&  r4  r'  r#   /typing.Generator[T_JSON_DICT, T_JSON_DICT, str])r   r   r#   r%  )rA  r5   rp  r$   rq  r$   r#   r*  )r  r5   rb  r   r#   zBtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[str, int]])r  r5   r#   r%  )r  ztyping.List[BackendNodeId]r#   r*  )r   r   r  r5   r#   r%  )r   r   r  r5   r#   r*  )r#   r*  )r   r   r  r5   r#   r%  )r   r   r   r5   r#   r)  )r   r   r#   r)  )r   r   r1  r   r2  r   r#   r)  )r4  runtime.RemoteObjectIdr#   r%  )
r   r   r7   r&  r  r   r  z+typing.Optional[runtime.ExecutionContextId]r#   z@typing.Generator[T_JSON_DICT, T_JSON_DICT, runtime.RemoteObject])r   r   r   r5   rQ   r5   r#   r)  )r   r   r  r5   r   r   r#   r)  )
r  ztyping.List[str]r   r   r7   r&  r4  r'  r#   r)  )rG  r   r#   r)  )r   r   r#   zOtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Optional[runtime.StackTrace]])r4  r,  r#   r+  )r#   zLtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[DetachedElementInfo]])r   r   r   r5   r#   r%  )r   r   rQ   r5   r#   r)  )r   r   r  r5   r#   r)  )r   zpage.FrameIdr#   z`typing.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[BackendNodeId, typing.Optional[NodeId]]])r   r   r  r   r  ztyping.Optional[PhysicalAxes]r  ztyping.Optional[LogicalAxes]r  r   r#   zCtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Optional[NodeId]])r   r   r#   r*  )r   r   r  r   r#   r%  )d
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r$   r   r.   r3   EnumrB   ry   r   r   r   r   r   r   r   listr   r   r
  r  r  r$  r-  r5  r9  r<  rB  rG  rJ  rL  rO  rR  rV  rY  r^  rd  rg  rj  rr  rt  rw  ry  r{  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r#  r   r   r   <module>r5     s{
   # * !    7S 7>C >  
 
 
8. .bTYY  		  499  $))  		  H
 H
 H
V 
 
 
,  
  
  
F54 5 /
 /
 /
d 
 
 
: 
 
 
D 
 
 
*00	C00 :>,,,  7, 
:	,< ,0:>=A&*(,"(("(7"( ;"( $	"(
 &"( 
8"(L ,0:>=A&*	(7 ; $	
 
8@	7* 480	7& ,0:>=A(7 ; 
8	400	C0( ,0:>=A-(-7- ;- 
<	-: ,0:>=A6(676 ;6 
E	6@ '+(,(#(%( 
8(4 '+(,6#6%6 
E6: )-::>: &: 
G	:> @D<@	$$$ (=$ %:	$
 
v$P ,0:>=A"("7" ;" 
7	"8,,	9,*::: : 
G	:8	 :>,,,  7, 
:	,8 @D'< 
J@,,	9,*:4:	F:*,,, 
:,,::: 
G:,:",,, 
:,0	 
8(	7& '+(,# & 
8	6,),	9,, ,0:>-1LP	:(:7: +: J	:
 
H:@  
8	4 &* # 
8	6 ,0:>=A	( 8 ;	
 
8:	7&ZZ	VZ*)	6,M	7(,,, 
:,, 
8( 
8(		g: 047;596:&J&J,&J 5&J 3	&J
 4&J 
K&JR::	F:0 26,,., 
:,4 $%

 
  &
( #$

 
  %
" ()

 
  *
" ()

 
  *
" $%

 
  &
( #$

 
  %
" *+

 
  ,
& "#


 

  $

 )*

 
  +
  %&

 
  '
& *+

 
  ,
 ()

 
  *
& '(

 
  )
&  !

 
  "
$ #$

 
  %
& #$

 
  %
r   