
    g`                    `   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 G d dej                        Ze G d d             Z G d dej                        Zd2dZd2dZ	 	 	 	 d3	 	 	 	 	 	 	 	 	 	 	 d4dZd2dZ	 	 d5	 	 	 	 	 	 	 d6dZ	 	 	 	 d3	 	 	 	 	 	 	 	 	 	 	 d7dZ	 	 d5	 	 	 	 	 	 	 d8dZ	 	 d5	 	 	 	 	 	 	 	 	 	 	 	 	 d9dZ	 d:	 	 	 	 	 d;dZ	 	 	 	 d<dZ	 d:	 	 	 d=dZ	 	 	 	 d<dZ	 	 	 	 d<dZ	 	 	 	 d>d Z 	 	 	 	 d>d!Z!	 	 	 	 d<d"Z"	 	 	 	 d<d#Z#	 	 	 	 d<d$Z$	 d:	 	 	 d?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 d0 d1                    Z)y)@    )annotations   )event_classT_JSON_DICT)	dataclassN)dom)page)runtimec                      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ed        Zy)GridHighlightConfigzC
    Configuration data for the highlighting of Grid elements.
    Ntyping.Optional[bool]show_grid_extension_linesshow_positive_line_numbersshow_negative_line_numberstyping.Optional[dom.RGBA]grid_border_colorcell_border_colorgrid_border_dashcell_border_dashrow_gap_colorrow_hatch_colorcolumn_gap_colorcolumn_hatch_colorc                   t               }| j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d	<   | j                  | j                  j                         |d
<   | j                  | j                  j                         |d<   |S )NshowGridExtensionLinesshowPositiveLineNumbersshowNegativeLineNumbersgridBorderColorcellBorderColorgridBorderDashcellBorderDashrowGapColorrowHatchColorcolumnGapColorcolumnHatchColor)dictr   r   r   r   to_jsonr   r   r   r   r   r   r   selfjsons     a/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v85/overlay.pyr'   zGridHighlightConfig.to_json7   s   v))5-1-K-KD)***6.2.M.MD*+**6.2.M.MD*+!!-&*&<&<&D&D&FD"#!!-&*&<&<&D&D&FD"#  ,%)%:%:D!"  ,%)%:%:D!")"&"4"4"<"<">D+$($8$8$@$@$BD!  ,%)%:%:%B%B%DD!""".'+'>'>'F'F'HD#$    c                    | 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        j                  j                  |d         nd d|v r"t        j                  j                  |d         nd d|v rt        |d         nd d|v rt        |d         nd d|v r"t        j                  j                  |d         nd d	|v r"t        j                  j                  |d	         nd d
|v r"t        j                  j                  |d
         nd d|v r't        j                  j                  |d               S d       S )Nr   r   r   r   r   r    r!   r"   r#   r$   r%   )r   r   r   r   r   r   r   r   r   r   r   )boolr   RGBA	from_jsonclsr*   s     r+   r0   zGridHighlightConfig.from_jsonQ   sj   NfjnNnd40H+I&JtxPimqPqtD1J,K'Lw{PimqPqtD1J,K'Lw{M^bfMfchh006G1HIlpM^bfMfchh006G1HIlp=MQU=UT$'7"89[_=MQU=UT$'7"89[_ERVZEZ#((,,T--@A`dIX\`I`CHH..tO/DEfjK[_cKcSXX//5E0FGimOaeiOisxx11$7I2JK
 	
 pt
 	
r,   )__name__
__module____qualname____doc__r   __annotations__r   r   r   r   r   r   r   r   r   r   r'   classmethodr0    r,   r+   r   r      s     8<4; 9= 5< 9= 5< 4807 4807 /3+2 /3+2 04M,3 26O.5 37/6 59184 
 
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ed        Zy)HighlightConfigzC
    Configuration data for the highlighting of page elements.
    Nr   	show_infoshow_stylesshow_rulersshow_accessibility_infoshow_extension_linesr   content_colorpadding_colorborder_colormargin_colorevent_target_colorshape_colorshape_margin_colorcss_grid_colortyping.Optional[ColorFormat]color_formatz$typing.Optional[GridHighlightConfig]grid_highlight_configc                \   t               }| j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j                  | j                  |d<   | j
                  | j
                  |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d	<   | j                  | j                  j                         |d
<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   | j                   | j                   j                         |d<   |S )NshowInfo
showStyles
showRulersshowAccessibilityInfoshowExtensionLinescontentColorpaddingColorborderColormarginColoreventTargetColor
shapeColorshapeMarginColorcssGridColorcolorFormatgridHighlightConfig)r&   r<   r=   r>   r?   r@   rA   r'   rB   rC   rD   rE   rF   rG   rH   rJ   rK   r(   s     r+   r'   zHighlightConfig.to_json   s   v>>%#~~D'!%!1!1D'!%!1!1D''3,0,H,HD()$$0)-)B)BD%&)#'#5#5#=#=#?D )#'#5#5#=#=#?D ("&"3"3";";"=D("&"3"3";";"=D"".'+'>'>'F'F'HD#$'!%!1!1!9!9!;D"".'+'>'>'F'F'HD#$*#'#6#6#>#>#@D ("&"3"3";";"=D%%1*.*D*D*L*L*ND&'r,   c                    | 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 d|v rt        |d         nd d|v r"t        j                  j                  |d         nd d|v r"t        j                  j                  |d         nd d|v r"t        j                  j                  |d         nd d	|v r"t        j                  j                  |d	         nd d
|v r"t        j                  j                  |d
         nd d|v r"t        j                  j                  |d         nd d|v r"t        j                  j                  |d         nd d|v r"t        j                  j                  |d         nd d|v rt        j                  |d         nd d|v rt
        j                  |d               S d       S )NrM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   )r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rJ   rK   )r.   r   r/   r0   ColorFormatr   r1   s     r+   r0   zHighlightConfig.from_json   s   0:d0Bd4
+,4@D4HT,/0d4@D4HT,/0dKbfjKjD.E)F$GptEY]aEad+?&@!AgkFTX\F\#((,,T.-ABbfFTX\F\#((,,T.-ABbfDQUYDY++D,?@_cDQUYDY++D,?@_cOaeiOisxx11$7I2JKosBNRVBV**4+=>\`OaeiOisxx11$7I2JKosGUY]G]388--d>.BCcgGTX\G\..tM/BCbf`uy}`}"5"?"?EZ@["\
 	
 DH
 	
r,   )r3   r4   r5   r6   r<   r7   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rJ   rK   r'   r8   r0   r9   r,   r+   r;   r;   b   s     (,I$+ *.K&- *.K&- 6:29 37/6 04M,3 04M,3 /3L+2 /3L+2 5918 .2K*1 5918 15N-4 26L.5 CG?F D 
 
r,   r;   c                  .    e Zd ZdZdZdZd Zed        Zy)r]   rgbhslhexc                    | j                   S Nvaluer)   s    r+   r'   zColorFormat.to_json       zzr,   c                     | |      S rc   r9   r1   s     r+   r0   zColorFormat.from_json       4yr,   N)	r3   r4   r5   RGBHSLHEX_r'   r8   r0   r9   r,   r+   r]   r]      s*    
C
CD  r,   r]   c                  N    e Zd ZU dZded<   dZded<   dZded<   d Zed	        Z	y)
HingeConfigz-
    Configuration for dual screen hinge
    zdom.RectrectNr   rA   outline_colorc                    t               }| j                  j                         |d<   | j                  | j                  j                         |d<   | j                  | j                  j                         |d<   |S )Nro   rR   outlineColor)r&   ro   r'   rA   rp   r(   s     r+   r'   zHingeConfig.to_json   sn    vyy((*V)#'#5#5#=#=#?D )#'#5#5#=#=#?D r,   c                     | t         j                  j                  |d         d|v r"t         j                  j                  |d         nd d|v r't         j                  j                  |d               S d       S )Nro   rR   rr   )ro   rA   rp   )r   Rectr0   r/   r1   s     r+   r0   zHingeConfig.from_json   sw    ##DL1FTX\F\#((,,T.-ABbfFTX\F\#((,,T.-AB
 	
 cg
 	
r,   )
r3   r4   r5   r6   r7   rA   rp   r'   r8   r0   r9   r,   r+   rn   rn      sA     N 04M,3 04M,3 
 
r,   rn   c                  6    e Zd ZdZdZdZdZdZd Ze	d        Z
y)	InspectModesearchForNodesearchForUAShadowDOMcaptureAreaScreenshotshowDistancesnonec                    | j                   S rc   rd   rf   s    r+   r'   zInspectMode.to_json   rg   r,   c                     | |      S rc   r9   r1   s     r+   r0   zInspectMode.from_json  ri   r,   N)r3   r4   r5   SEARCH_FOR_NODESEARCH_FOR_UA_SHADOW_DOMCAPTURE_AREA_SCREENSHOTSHOW_DISTANCESNONEr'   r8   r0   r9   r,   r+   rv   rv      s6    %O55$ND  r,   rv   c               #     K   ddi} | }yw)z(
    Disables domain notifications.
    methodzOverlay.disableNr9   cmd_dictr*   s     r+   disabler     s     
 	#H >D   
c               #     K   ddi} | }yw)z'
    Enables domain notifications.
    r   zOverlay.enableNr9   r   s     r+   enabler     s     
 	"H >Dr   c              #     K   t               }| j                         |d<   |||d<   |||d<   ||j                         |d<   |||d<   d|d}|}t        |d         S w)	a  
    For testing.

    :param node_id: Id of the node to get highlight object for.
    :param include_distance: *(Optional)* Whether to include distance info.
    :param include_style: *(Optional)* Whether to include style info.
    :param color_format: *(Optional)* The color format to get config with (default: hex).
    :param show_accessibility_info: *(Optional)* Whether to show accessibility info (default: true).
    :returns: Highlight data for the node.
    nodeIdincludeDistanceincludeStylerZ   rP   z!Overlay.getHighlightObjectForTestr   params	highlightr&   r'   )node_idinclude_distanceinclude_stylerJ   r?   r   r   r*   s           r+   get_highlight_object_for_testr     s     " &F(F8#$4 ! !.~ , 4 4 6}**A&'5H >D[!""s   AA!c               #     K   ddi} | }yw)z
    Hides any highlight.
    r   zOverlay.hideHighlightNr9   r   s     r+   hide_highlightr   >  s     
 	)H >Dr   c              #     K   t               }| j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}yw)aM  
    Highlights owner element of the frame with given id.

    :param frame_id: Identifier of the frame to highlight.
    :param content_color: *(Optional)* The content box highlight fill color (default: transparent).
    :param content_outline_color: *(Optional)* The content box highlight outline color (default: transparent).
    frameIdNrR   contentOutlineColorzOverlay.highlightFramer   r   )frame_idrA   content_outline_colorr   r   r*   s         r+   highlight_framer   H  sk      &F ((*F9 !.!6!6!8~((=(E(E(G$%*H >D   AAc              #     K   t               }| j                         |d<   ||j                         |d<   ||j                         |d<   ||j                         |d<   |||d<   d|d}|}yw)	a  
    Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or
    objectId must be specified.

    :param highlight_config: A descriptor for the highlight appearance.
    :param node_id: *(Optional)* Identifier of the node to highlight.
    :param backend_node_id: *(Optional)* Identifier of the backend node to highlight.
    :param object_id: *(Optional)* JavaScript object id of the node to be highlighted.
    :param selector: *(Optional)* Selectors to highlight relevant nodes.
    highlightConfigNr   backendNodeIdobjectIdselectorzOverlay.highlightNoder   r   )highlight_configr   backend_node_id	object_idr   r   r   r*   s           r+   highlight_noder   a  s     " &F 0 8 8 :F"??,x""1"9"9";&..0z%z)H >Ds   A.A0c              #     K   t               }| j                         |d<   ||j                         |d<   ||j                         |d<   d|d}|}yw)a1  
    Highlights given quad. Coordinates are absolute with respect to the main frame viewport.

    :param quad: Quad to highlight
    :param color: *(Optional)* The highlight fill color (default: transparent).
    :param outline_color: *(Optional)* The highlight outline color (default: transparent).
    quadNcolorrr   zOverlay.highlightQuadr   r   )r   r   rp   r   r   r*   s         r+   highlight_quadr     sb      &F\\^F6N--/w !.!6!6!8~)H >Dr   c              #     K   t               }| |d<   ||d<   ||d<   ||d<   ||j                         |d<   ||j                         |d<   d|d	}|}yw)
a  
    Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.

    :param x: X coordinate
    :param y: Y coordinate
    :param width: Rectangle width
    :param height: Rectangle height
    :param color: *(Optional)* The highlight fill color (default: transparent).
    :param outline_color: *(Optional)* The highlight outline color (default: transparent).
    xywidthheightNr   rr   zOverlay.highlightRectr   r   )	r   r   r   r   r   rp   r   r   r*   s	            r+   highlight_rectr     sx     $ &FF3KF3KF7OF8--/w !.!6!6!8~)H >Ds   AAc              #     K   t               }| j                         |d<   ||j                         |d<   d|d}|}yw)av  
    Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted.
    Backend then generates 'inspectNodeRequested' event upon element selection.

    :param mode: Set an inspection mode.
    :param highlight_config: *(Optional)* A descriptor for the highlight appearance of hovered-over nodes. May be omitted if ```enabled == false```.
    modeNr   zOverlay.setInspectModer   r   )r   r   r   r   r*   s        r+   set_inspect_moder     sN      &F\\^F6N#$4$<$<$> !*H >Ds   =?c              #  <   K   t               }| |d<   d|d}|}yw)zu
    Highlights owner element of all frames detected to be ads.

    :param show: True for showing ad highlights
    showzOverlay.setShowAdHighlightsr   Nr&   r   r   r   r*   s       r+   set_show_ad_highlightsr     .      &FF6N/H >D   c              #  @   K   t               }| | |d<   d|d}|}yw)zk
    :param message: *(Optional)* The message to display, also triggers resume and step over controls.
    Nmessagez"Overlay.setPausedInDebuggerMessager   r   )r   r   r   r*   s       r+   set_paused_in_debugger_messager     s5      &F#y6H >Ds   c              #  <   K   t               }| |d<   d|d}|}yw)zn
    Requests that backend shows debug borders on layers

    :param show: True for showing debug borders
    r   zOverlay.setShowDebugBordersr   Nr   r   s       r+   set_show_debug_bordersr     r   r   c              #  <   K   t               }| |d<   d|d}|}yw)zh
    Requests that backend shows the FPS counter

    :param show: True for showing the FPS counter
    r   zOverlay.setShowFPSCounterr   Nr   r   s       r+   set_show_fps_counterr     s.      &FF6N-H >Dr   c              #  <   K   t               }| |d<   d|d}|}yw)zl
    Requests that backend shows paint rectangles

    :param result: True for showing paint rectangles
    resultzOverlay.setShowPaintRectsr   Nr   r   r   r   r*   s       r+   set_show_paint_rectsr     s/      &FF8-H >Dr   c              #  <   K   t               }| |d<   d|d}|}yw)zt
    Requests that backend shows layout shift regions

    :param result: True for showing layout shift regions
    r   z!Overlay.setShowLayoutShiftRegionsr   Nr   r   s       r+   set_show_layout_shift_regionsr   (  s/      &FF85H >Dr   c              #  <   K   t               }| |d<   d|d}|}yw)zx
    Requests that backend shows scroll bottleneck rects

    :param show: True for showing scroll bottleneck rects
    r   z$Overlay.setShowScrollBottleneckRectsr   Nr   r   s       r+    set_show_scroll_bottleneck_rectsr   9  s.      &FF6N8H >Dr   c              #  <   K   t               }| |d<   d|d}|}yw)zt
    Requests that backend shows hit-test borders on layers

    :param show: True for showing hit-test borders
    r   zOverlay.setShowHitTestBordersr   Nr   r   s       r+   set_show_hit_test_bordersr   J  s.      &FF6N1H >Dr   c              #  <   K   t               }| |d<   d|d}|}yw)zf
    Paints viewport size upon main frame resize.

    :param show: Whether to paint size or not.
    r   z#Overlay.setShowViewportSizeOnResizer   Nr   r   s       r+    set_show_viewport_size_on_resizer   [  s.      &FF6N7H >Dr   c              #  \   K   t               }| | j                         |d<   d|d}|}yw)zp
    Add a dual screen device hinge

    :param hinge_config: *(Optional)* hinge data, null means hideHinge
    NhingeConfigzOverlay.setShowHinger   r   )hinge_configr   r   r*   s       r+   set_show_hinger   l  s>      &F , 4 4 6}(H >Ds   *,zOverlay.inspectNodeRequestedc                  .    e Zd ZU dZded<   edd       Zy)InspectNodeRequestedz
    Fired when the node should be inspected. This happens after call to ``setInspectMode`` or when
    user manually inspects an element.
    zdom.BackendNodeIdr   c                T     | t         j                  j                  |d               S )Nr   )r   )r   BackendNodeIdr0   r1   s     r+   r0   zInspectNodeRequested.from_json  s(    --77_8MN
 	
r,   N)r*   r   returnr   r3   r4   r5   r6   r7   r8   r0   r9   r,   r+   r   r   ~  s!    
 '&
 
r,   r   zOverlay.nodeHighlightRequestedc                  .    e Zd ZU dZded<   edd       Zy)NodeHighlightRequestedzc
    Fired when the node should be highlighted. This happens after call to ``setInspectMode``.
    
dom.NodeIdr   c                T     | t         j                  j                  |d               S )Nr   )r   )r   NodeIdr0   r1   s     r+   r0   z NodeHighlightRequested.from_json  s%    JJ((h8
 	
r,   N)r*   r   r   r   r   r9   r,   r+   r   r     s!     
 
r,   r   zOverlay.screenshotRequestedc                  .    e Zd ZU dZded<   edd       Zy)ScreenshotRequestedzN
    Fired when user asks to capture screenshot of some area on the page.
    zpage.Viewportviewportc                T     | t         j                  j                  |d               S )Nr   )r   )r	   Viewportr0   r1   s     r+   r0   zScreenshotRequested.from_json  s&    ]],,T*-=>
 	
r,   N)r*   r   r   r   r   r9   r,   r+   r   r     s!     
 
r,   r   zOverlay.inspectModeCanceledc                  "    e Zd ZdZedd       Zy)InspectModeCanceledz3
    Fired when user cancels the inspect mode.
    c                     |        S rc   r9   r1   s     r+   r0   zInspectModeCanceled.from_json  s     
 	
r,   N)r*   r   r   r   )r3   r4   r5   r6   r8   r0   r9   r,   r+   r   r     s    
 
 
r,   r   )r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])NNNN)r   r   r   r   r   r   rJ   rI   r?   r   r   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, dict])NN)r   zpage.FrameIdrA   r   r   r   r   r   )r   r;   r   ztyping.Optional[dom.NodeId]r   z"typing.Optional[dom.BackendNodeId]r   z'typing.Optional[runtime.RemoteObjectId]r   typing.Optional[str]r   r   )r   zdom.Quadr   r   rp   r   r   r   )r   intr   r   r   r   r   r   r   r   rp   r   r   r   rc   )r   rv   r   z typing.Optional[HighlightConfig]r   r   )r   r.   r   r   )r   r   r   r   )r   r.   r   r   )r   ztyping.Optional[HingeConfig]r   r   )*
__future__r   utilr   r   dataclassesr   enumtyping r   r	   r
   r   r;   Enumr]   rn   rv   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r9   r,   r+   <module>r      s   # * !      M
 M
 M
` e
 e
 e
P
$)) 
 
 
 
>$))  37/3599= # #/ # - # 3	 #
 "7 # 
8 #F 48;?0  9 
8	6 04>B=A)-), < ;	
 ' 
8H ,037( 1 
8	< ,037  	
 ) 1 
8H >B: 
8,	7$ )-%	7 	7"	7"	7"	7"	7"	7"	7$ 6:2	7$ +,

 
  -
 -.


 

  /

 *+

 
  ,
 *+


 

  ,

r,   