a
    $ñ»jùæ  ã                	   @  s  d dl mZ d dlZd dlZd dlmZ ddlmZmZ ddl	m
Z
 ddl	mZ ddl	mZ eG d	d
„ d
ƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZG dd„ dejƒZeG dd„ dƒƒZG dd„ dejƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd „ d ƒƒZeG d!d"„ d"ƒƒZeG d#d$„ d$ƒƒZeG d%d&„ d&ƒƒZeG d'd(„ d(ƒƒZeG d)d*„ d*ƒƒZeG d+d,„ d,ƒƒZeG d-d.„ d.ƒƒZ G d/d0„ d0ejƒZ!d1d2œd3d4„Z"d1d2œd5d6„Z#dœd7d8d8d9d8d:d;œd<d=„Z$d>d:d?œd@dA„Z%d7d:dBœdCdD„Z&d1d2œdEdF„Z'd�ddGdHdIdJd1dKœdLdM„Z(dždNdOdOd1dPœdQdR„Z)dŸdSdSdSdSdOdOd1dTœdUdV„Z*d d
dGdHdId1dWœdXdY„Z+d¡d0dZd1d[œd\d]„Z,d^d1d_œd`da„Z-d¢dJd1dbœdcdd„Z.d^d1d_œdedf„Z/d^d1d_œdgdh„Z0did1djœdkdl„Z1dmd1dnœdodp„Z2dqd1drœdsdt„Z3dud1dvœdwdx„Z4d^d1dyœdzd{„Z5d^d1dyœd|d}„Z6d^d1d_œd~d„Z7d^d1d_œd€d�„Z8d^d1d_œd‚dƒ„Z9d£d„d1d…œd†d‡„Z:dˆd1d‰œdŠd‹„Z;d¤dŒd1d�œdŽd�„Z<ed�ƒeG d‘d’„ d’ƒƒƒZ=ed“ƒeG d”d•„ d•ƒƒƒZ>ed–ƒeG d—d˜„ d˜ƒƒƒZ?ed™ƒeG dšd›„ d›ƒƒƒZ@dS )¥é    )ÚannotationsN)Ú	dataclassé   )Úevent_classÚT_JSON_DICT)Údom)Úpage)Úruntimec                   @  sD   e Zd ZU dZded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚSourceOrderConfigzR
    Configuration data for drawing the source order of an elements children.
    zdom.RGBAÚparent_outline_colorÚchild_outline_colorr   ©Úreturnc                 C  s&   t ƒ }| j ¡ |d< | j ¡ |d< |S )NÚparentOutlineColorÚchildOutlineColor)Údictr   Úto_jsonr   ©ÚselfÚjson© r   ú3E:\soccer\ml_env\Lib\site-packages\mycdp/overlay.pyr      s    zSourceOrderConfig.to_json©r   r   c                 C  s$   | t j |d ¡t j |d ¡d�S )Nr   r   )r   r   )r   ÚRGBAÚ	from_json©Úclsr   r   r   r   r   "   s    ÿüzSourceOrderConfig.from_jsonN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   Úclassmethodr   r   r   r   r   r
      s   
r
   c                   @  s$  e Zd ZU dZdZded< dZded< dZded< dZded< dZ	ded< dZ
ded	< dZd
ed< dZd
ed< dZd
ed< dZd
ed< dZded< dZded< dZded< dZded< dZd
ed< dZd
ed< dZd
ed< dZd
ed< dZd
ed< dZd
ed< ddœdd„Zedd dœdd„ƒZdS ) ÚGridHighlightConfigz9Configuration data for the highlighting of Grid elements.Nútyping.Optional[bool]Úshow_grid_extension_linesÚshow_positive_line_numbersÚshow_negative_line_numbersÚshow_area_namesÚshow_line_namesÚshow_track_sizesútyping.Optional[dom.RGBA]Úgrid_border_colorÚcell_border_colorÚrow_line_colorÚcolumn_line_colorÚgrid_border_dashÚcell_border_dashÚrow_line_dashÚcolumn_line_dashÚrow_gap_colorÚrow_hatch_colorÚcolumn_gap_colorÚcolumn_hatch_colorÚarea_border_colorÚgrid_background_colorr   r   c                 C  sÔ  t ƒ }| jd ur| j|d< | jd ur.| j|d< | jd urB| j|d< | jd urV| j|d< | jd urj| j|d< | jd ur~| j|d< | jd ur–| j ¡ |d< | j	d ur®| j	 ¡ |d< | j
d urÆ| j
 ¡ |d	< | jd urÞ| j ¡ |d
< | jd urò| j|d< | jd u�r| j|d< | jd u�r| j|d< | jd u�r4| j|d< | jd u�rN| j ¡ |d< | jd u�rh| j ¡ |d< | jd u�r‚| j ¡ |d< | jd u�rœ| j ¡ |d< | jd u�r¶| j ¡ |d< | jd u�rÐ| j ¡ |d< |S )NÚshowGridExtensionLinesÚshowPositiveLineNumbersÚshowNegativeLineNumbersÚshowAreaNamesÚshowLineNamesÚshowTrackSizesÚgridBorderColorÚcellBorderColorÚrowLineColorÚcolumnLineColorÚgridBorderDashÚcellBorderDashÚrowLineDashÚcolumnLineDashÚrowGapColorÚrowHatchColorÚcolumnGapColorÚcolumnHatchColorÚareaBorderColorÚgridBackgroundColor)r   r&   r'   r(   r)   r*   r+   r-   r   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r   r   r   r   r   \   sT    




















zGridHighlightConfig.to_jsonr   c                 C  s   | |  dd ¡d urt|d ƒnd |  dd ¡d ur<t|d ƒnd |  dd ¡d urZt|d ƒnd |  dd ¡d urxt|d ƒnd |  dd ¡d ur–t|d ƒnd |  dd ¡d ur´t|d ƒnd |  dd ¡d urÖtj |d ¡nd |  dd ¡d urøtj |d ¡nd |  d	d ¡d u�rtj |d	 ¡nd |  d
d ¡d u�r@tj |d
 ¡nd |  dd ¡d u�r`t|d ƒnd |  dd ¡d u�r€t|d ƒnd |  dd ¡d u�r t|d ƒnd |  dd ¡d u�rÀt|d ƒnd |  dd ¡d u�rätj |d ¡nd |  dd ¡d u�rtj |d ¡nd |  dd ¡d u�r,tj |d ¡nd |  dd ¡d u�rPtj |d ¡nd |  dd ¡d u�rttj |d ¡nd |  dd ¡d u�r˜tj |d ¡nd d�S )Nr;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   )r&   r'   r(   r)   r*   r+   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   )ÚgetÚboolr   r   r   r   r   r   r   r   ˆ   s|    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ�zGridHighlightConfig.from_json)r   r   r    r!   r&   r"   r'   r(   r)   r*   r+   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r   r#   r   r   r   r   r   r$   ,   s0   
,r$   c                   @  s”   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dœdd„Zedd dœdd„ƒZdS )ÚFlexContainerHighlightConfigzCConfiguration data for the highlighting of Flex container elements.Nútyping.Optional[LineStyle]Úcontainer_borderÚline_separatorÚitem_separatorútyping.Optional[BoxStyle]Úmain_distributed_spaceÚcross_distributed_spaceÚrow_gap_spaceÚcolumn_gap_spaceÚcross_alignmentr   r   c                 C  sÊ   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< | jd urN| j ¡ |d< | jd urf| j ¡ |d< | jd ur~| j ¡ |d< | jd ur–| j ¡ |d< | jd ur®| j ¡ |d< | j	d urÆ| j	 ¡ |d< |S )	NÚcontainerBorderÚlineSeparatorÚitemSeparatorÚmainDistributedSpaceÚcrossDistributedSpaceÚrowGapSpaceÚcolumnGapSpaceÚcrossAlignment)
r   rS   r   rT   rU   rW   rX   rY   rZ   r[   r   r   r   r   r     s(    



ÿ
ÿ


z$FlexContainerHighlightConfig.to_jsonr   c                 C  s
  | |  dd ¡d ur t |d ¡nd |  dd ¡d ur@t |d ¡nd |  dd ¡d ur`t |d ¡nd |  dd ¡d ur€t |d ¡nd |  dd ¡d ur t |d ¡nd |  dd ¡d urÀt |d ¡nd |  dd ¡d uràt |d ¡nd |  dd ¡d u�rt |d ¡nd d	�S )
Nr\   r]   r^   r_   r`   ra   rb   rc   )rS   rT   rU   rW   rX   rY   rZ   r[   )rO   Ú	LineStyler   ÚBoxStyler   r   r   r   r     s4    ÿÿÿÿÿÿÿÿÙz&FlexContainerHighlightConfig.from_json)r   r   r    r!   rS   r"   rT   rU   rW   rX   rY   rZ   r[   r   r#   r   r   r   r   r   rQ   ò   s   
rQ   c                   @  sX   e Zd ZU dZdZded< dZded< dZded< dd	œd
d„Ze	dd dœdd„ƒZ
dS )ÚFlexItemHighlightConfigz>Configuration data for the highlighting of Flex item elements.NrV   Úbase_size_boxrR   Úbase_size_borderÚflexibility_arrowr   r   c                 C  sR   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< | jd urN| j ¡ |d< |S )NÚbaseSizeBoxÚbaseSizeBorderÚflexibilityArrow)r   rg   r   rh   ri   r   r   r   r   r   V  s    


zFlexItemHighlightConfig.to_jsonr   c                 C  sh   | |  dd ¡d ur t |d ¡nd |  dd ¡d ur@t |d ¡nd |  dd ¡d ur`t |d ¡nd d�S )Nrj   rk   rl   )rg   rh   ri   )rO   re   r   rd   r   r   r   r   r   `  s    ÿÿÿòz!FlexItemHighlightConfig.from_json)r   r   r    r!   rg   r"   rh   ri   r   r#   r   r   r   r   r   rf   L  s   

rf   c                   @  sL   e Zd ZU dZdZded< dZded< ddœd	d
„Zedd dœdd„ƒZ	dS )rd   z%Style information for drawing a line.Nr,   Úcolorútyping.Optional[str]Úpatternr   r   c                 C  s6   t ƒ }| jd ur| j ¡ |d< | jd ur2| j|d< |S )Nrm   ro   )r   rm   r   ro   r   r   r   r   r   }  s    


zLineStyle.to_jsonr   c                 C  sH   | |  dd ¡d ur"tj |d ¡nd |  dd ¡d ur@t|d ƒnd d�S )Nrm   ro   )rm   ro   )rO   r   r   r   Ústrr   r   r   r   r   …  s    ÿÿ÷zLineStyle.from_json)
r   r   r    r!   rm   r"   ro   r   r#   r   r   r   r   r   rd   u  s   
rd   c                   @  sL   e Zd ZU dZdZded< dZded< ddœdd	„Zedd d
œdd„ƒZ	dS )re   z$Style information for drawing a box.Nr,   Ú
fill_colorÚhatch_colorr   r   c                 C  s:   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< |S )NÚ	fillColorÚ
hatchColor)r   rq   r   rr   r   r   r   r   r   �  s    

zBoxStyle.to_jsonr   c                 C  sL   | |  dd ¡d ur"tj |d ¡nd |  dd ¡d urDtj |d ¡nd d�S )Nrs   rt   )rq   rr   ©rO   r   r   r   r   r   r   r   r   ¥  s    ÿÿ÷zBoxStyle.from_json)
r   r   r    r!   rq   r"   rr   r   r#   r   r   r   r   r   re   •  s   
re   c                   @  s:   e Zd ZdZdZdZddœdd„Zedd dœd	d
„ƒZdS )ÚContrastAlgorithmZaaZaaaZapcarp   r   c                 C  s   | j S ©N©Úvalue©r   r   r   r   r   º  s    zContrastAlgorithm.to_jsonr   c                 C  s   | |ƒS rw   r   r   r   r   r   r   ½  s    zContrastAlgorithm.from_jsonN)	r   r   r    ZAAZAAAZAPCAr   r#   r   r   r   r   r   rv   µ  s   rv   c                   @  s  e Zd ZU dZdZded< dZded< dZded< dZded< dZ	ded< dZ
d	ed
< dZd	ed< dZd	ed< dZd	ed< dZd	ed< dZd	ed< dZd	ed< dZd	ed< dZded< dZded< dZded< dZded< dZded< dZded< ddœd d!„Zedd d"œd#d$„ƒZdS )%ÚHighlightConfigz9Configuration 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_configz-typing.Optional[FlexContainerHighlightConfig]Úflex_container_highlight_configz(typing.Optional[FlexItemHighlightConfig]Úflex_item_highlight_configz"typing.Optional[ContrastAlgorithm]Úcontrast_algorithmz7typing.Optional[ContainerQueryContainerHighlightConfig]Ú*container_query_container_highlight_configr   r   c                 C  sÎ  t ƒ }| jd ur| j|d< | jd ur.| j|d< | jd urB| j|d< | jd urV| j|d< | jd urj| j|d< | jd ur‚| j ¡ |d< | jd urš| j ¡ |d< | j	d ur²| j	 ¡ |d< | j
d urÊ| j
 ¡ |d	< | jd urâ| j ¡ |d
< | jd urú| j ¡ |d< | jd u�r| j ¡ |d< | jd u�r.| j ¡ |d< | jd u�rH| j ¡ |d< | jd u�rb| j ¡ |d< | jd u�r|| j ¡ |d< | jd u�r–| j ¡ |d< | jd u�r°| j ¡ |d< | jd u�rÊ| j ¡ |d< |S )NÚshowInfoÚ
showStylesÚ
showRulersÚshowAccessibilityInfoÚshowExtensionLinesÚcontentColorÚpaddingColorÚborderColorÚmarginColorÚeventTargetColorÚ
shapeColorÚshapeMarginColorÚcssGridColorÚcolorFormatÚgridHighlightConfigÚflexContainerHighlightConfigÚflexItemHighlightConfigÚcontrastAlgorithmÚ&containerQueryContainerHighlightConfig)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   ò  sV    















ÿÿÿzHighlightConfig.to_jsonr   c                 C  s„  | |  dd ¡d urt|d ƒnd |  dd ¡d ur<t|d ƒnd |  dd ¡d urZt|d ƒnd |  dd ¡d urxt|d ƒnd |  dd ¡d ur–t|d ƒnd |  dd ¡d ur¸tj |d ¡nd |  dd ¡d urÚtj |d ¡nd |  dd ¡d urütj |d ¡nd |  d	d ¡d u�r tj |d	 ¡nd |  d
d ¡d u�rDtj |d
 ¡nd |  dd ¡d u�rhtj |d ¡nd |  dd ¡d u�rŒtj |d ¡nd |  dd ¡d u�r°tj |d ¡nd |  dd ¡d u�rÒt |d ¡nd |  dd ¡d u�rôt |d ¡nd |  dd ¡d u�rt |d ¡nd |  dd ¡d u�r8t |d ¡nd |  dd ¡d u�rZt	 |d ¡nd |  dd ¡d u�r|t
 |d ¡nd d�S )Nr�   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�   )rO   rP   r   r   r   ÚColorFormatr$   rQ   rf   rv   Ú&ContainerQueryContainerHighlightConfigr   r   r   r   r   "  s†    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿýÿÿ
ÿýÿ›zHighlightConfig.from_json)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{   Â  s2   
þ
þ
0r{   c                   @  s>   e Zd ZdZdZdZdZddœdd„Zedd d	œd
d„ƒZ	dS )r£   ÚrgbZhslZhwbÚhexrp   r   c                 C  s   | j S rw   rx   rz   r   r   r   r   ”  s    zColorFormat.to_jsonr   c                 C  s   | |ƒS rw   r   r   r   r   r   r   —  s    zColorFormat.from_jsonN)
r   r   r    ÚRGBZHSLZHWBZHEX_r   r#   r   r   r   r   r   r£   Ž  s   r£   c                   @  sD   e Zd ZU dZded< ded< ddœdd	„Zedd d
œdd„ƒZdS )ÚGridNodeHighlightConfigz-Configurations for Persistent Grid Highlight.r$   r‹   ú
dom.NodeIdÚnode_idr   r   c                 C  s&   t ƒ }| j ¡ |d< | j ¡ |d< |S )Nrž   ÚnodeId)r   r‹   r   rª   r   r   r   r   r   ¤  s    zGridNodeHighlightConfig.to_jsonr   c                 C  s"   | t  |d ¡tj |d ¡d�S )Nrž   r«   )r‹   rª   )r$   r   r   ÚNodeIdr   r   r   r   r   ª  s    ÿüz!GridNodeHighlightConfig.from_jsonNr   r   r   r   r   r¨   œ  s   
r¨   c                   @  s@   e Zd ZU ded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚFlexNodeHighlightConfigrQ   rŒ   r©   rª   r   r   c                 C  s&   t ƒ }| j ¡ |d< | j ¡ |d< |S )NrŸ   r«   )r   rŒ   r   rª   r   r   r   r   r   »  s
    ÿzFlexNodeHighlightConfig.to_jsonr   c                 C  s"   | t  |d ¡tj |d ¡d�S )NrŸ   r«   )rŒ   rª   )rQ   r   r   r¬   r   r   r   r   r   Ã  s    ÿüz!FlexNodeHighlightConfig.from_jsonN©r   r   r    r"   r   r#   r   r   r   r   r   r­   ´  s
   
r­   c                   @  s`   e Zd ZU dZded< dZded< dZded< dZded< dd	œd
d„Ze	dd dœdd„ƒZ
dS )Ú"ScrollSnapContainerHighlightConfigNrR   Úsnapport_borderÚsnap_area_borderr,   Úscroll_margin_colorÚscroll_padding_colorr   r   c                 C  sj   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< | jd urN| j ¡ |d< | jd urf| j ¡ |d< |S )NÚsnapportBorderÚsnapAreaBorderÚscrollMarginColorÚscrollPaddingColor)r   r°   r   r±   r²   r³   r   r   r   r   r   Ø  s    



z*ScrollSnapContainerHighlightConfig.to_jsonr   c                 C  sŒ   | |  dd ¡d ur t |d ¡nd |  dd ¡d ur@t |d ¡nd |  dd ¡d urbtj |d ¡nd |  dd ¡d ur„tj |d ¡nd d�S )Nr´   rµ   r¶   r·   )r°   r±   r²   r³   )rO   rd   r   r   r   r   r   r   r   r   ä  s    ÿÿÿÿíz,ScrollSnapContainerHighlightConfig.from_json)r   r   r    r°   r"   r±   r²   r³   r   r#   r   r   r   r   r   r¯   Í  s   
r¯   c                   @  s@   e Zd ZU ded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚScrollSnapHighlightConfigr¯   Ú&scroll_snap_container_highlight_configr©   rª   r   r   c                 C  s&   t ƒ }| j ¡ |d< | j ¡ |d< |S )NÚ"scrollSnapContainerHighlightConfigr«   )r   r¹   r   rª   r   r   r   r   r     s
    ÿz!ScrollSnapHighlightConfig.to_jsonr   c                 C  s"   | t  |d ¡tj |d ¡d�S )Nrº   r«   )r¹   rª   )r¯   r   r   r¬   r   r   r   r   r     s    ÿüz#ScrollSnapHighlightConfig.from_jsonNr®   r   r   r   r   r¸      s
   
r¸   c                   @  sT   e Zd ZU dZded< dZded< dZded< dd	œd
d„Zedd dœdd„ƒZ	dS )ÚHingeConfigz$Configuration for dual screen hinge.zdom.RectÚrectNr,   r�   Úoutline_colorr   r   c                 C  sH   t ƒ }| j ¡ |d< | jd ur,| j ¡ |d< | jd urD| j ¡ |d< |S )Nr¼   r•   ÚoutlineColor)r   r¼   r   r�   r½   r   r   r   r   r   #  s    

zHingeConfig.to_jsonr   c                 C  sZ   | t j |d ¡| dd ¡d ur0t j |d ¡nd | dd ¡d urRt j |d ¡nd d�S )Nr¼   r•   r¾   )r¼   r�   r½   )r   ZRectr   rO   r   r   r   r   r   r   ,  s    ÿÿözHingeConfig.from_json)
r   r   r    r!   r"   r�   r½   r   r#   r   r   r   r   r   r»     s   
	r»   c                   @  sL   e Zd ZU dZded< ded< ded< ddœd	d
„Zedd dœdd„ƒZdS )ÚWindowControlsOverlayConfigz*Configuration for Window Controls Overlay.rP   Úshow_cssrp   Úselected_platformÚtheme_colorr   r   c                 C  s(   t ƒ }| j|d< | j|d< | j|d< |S )NÚshowCSSÚselectedPlatformÚ
themeColor)r   rÀ   rÁ   rÂ   r   r   r   r   r   H  s
    


z#WindowControlsOverlayConfig.to_jsonr   c                 C  s&   | t |d ƒt|d ƒt|d ƒd�S )NrÃ   rÄ   rÅ   )rÀ   rÁ   rÂ   )rP   rp   r   r   r   r   r   O  s
    


ýz%WindowControlsOverlayConfig.from_jsonNr   r   r   r   r   r¿   =  s   
r¿   c                   @  s@   e Zd ZU ded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚContainerQueryHighlightConfigr¤   r�   r©   rª   r   r   c                 C  s&   t ƒ }| j ¡ |d< | j ¡ |d< |S )Nr¢   r«   )r   r�   r   rª   r   r   r   r   r   a  s
    ÿz%ContainerQueryHighlightConfig.to_jsonr   c                 C  s"   | t  |d ¡tj |d ¡d�S )Nr¢   r«   )r�   rª   )r¤   r   r   r¬   r   r   r   r   r   i  s    ÿüz'ContainerQueryHighlightConfig.from_jsonNr®   r   r   r   r   rÆ   X  s
   
rÆ   c                   @  sH   e Zd ZU dZded< dZded< ddœdd„Zedd d	œd
d„ƒZdS )r¤   NrR   rS   Údescendant_borderr   r   c                 C  s:   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< |S )Nr\   ÚdescendantBorder)r   rS   r   rÇ   r   r   r   r   r   z  s    

z.ContainerQueryContainerHighlightConfig.to_jsonr   c                 C  sH   | |  dd ¡d ur t |d ¡nd |  dd ¡d ur@t |d ¡nd d�S )Nr\   rÈ   )rS   rÇ   )rO   rd   r   r   r   r   r   r   ‚  s    ÿÿ÷z0ContainerQueryContainerHighlightConfig.from_json)	r   r   r    rS   r"   rÇ   r   r#   r   r   r   r   r   r¤   s  s
   
r¤   c                   @  s@   e Zd ZU ded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚIsolatedElementHighlightConfigÚIsolationModeHighlightConfigÚisolation_mode_highlight_configr©   rª   r   r   c                 C  s&   t ƒ }| j ¡ |d< | j ¡ |d< |S )NÚisolationModeHighlightConfigr«   )r   rË   r   rª   r   r   r   r   r   œ  s
    ÿz&IsolatedElementHighlightConfig.to_jsonr   c                 C  s"   | t  |d ¡tj |d ¡d�S )NrÌ   r«   )rË   rª   )rÊ   r   r   r¬   r   r   r   r   r   ¤  s    ÿüz(IsolatedElementHighlightConfig.from_jsonNr®   r   r   r   r   rÉ   ”  s
   
rÉ   c                   @  sT   e Zd ZU dZded< dZded< dZded< ddœdd	„Zedd d
œdd„ƒZ	dS )rÊ   Nr,   Úresizer_colorÚresizer_handle_colorÚ
mask_colorr   r   c                 C  sR   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< | jd urN| j ¡ |d< |S )NÚresizerColorÚresizerHandleColorÚ	maskColor)r   rÍ   r   rÎ   rÏ   r   r   r   r   r   ¸  s    


z$IsolationModeHighlightConfig.to_jsonr   c                 C  sn   | |  dd ¡d ur"tj |d ¡nd |  dd ¡d urDtj |d ¡nd |  dd ¡d urftj |d ¡nd d�S )NrÐ   rÑ   rÒ   )rÍ   rÎ   rÏ   ru   r   r   r   r   r   Â  s    ÿÿÿòz&IsolationModeHighlightConfig.from_json)
r   r   r    rÍ   r"   rÎ   rÏ   r   r#   r   r   r   r   r   rÊ   ®  s   

rÊ   c                   @  sB   e Zd ZdZdZdZdZdZddœdd	„Ze	dd d
œdd„ƒZ
dS )ÚInspectModeZsearchForNodeZsearchForUAShadowDOMZcaptureAreaScreenshotZshowDistancesÚnonerp   r   c                 C  s   | j S rw   rx   rz   r   r   r   r   Þ  s    zInspectMode.to_jsonr   c                 C  s   | |ƒS rw   r   r   r   r   r   r   á  s    zInspectMode.from_jsonN)r   r   r    ZSEARCH_FOR_NODEZSEARCH_FOR_UA_SHADOW_DOMZCAPTURE_AREA_SCREENSHOTZSHOW_DISTANCESÚNONEr   r#   r   r   r   r   r   rÓ   ×  s   rÓ   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]r   c                  c  s   ddi} | V }dS )zDisables domain notifications.ÚmethodzOverlay.disableNr   ©Úcmd_dictr   r   r   r   Údisableæ  s    ÿrÙ   c                  c  s   ddi} | V }dS )zEnables domain notifications.rÖ   zOverlay.enableNr   r×   r   r   r   Úenableî  s    ÿrÚ   r©   r%   r‰   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, dict])rª   Úinclude_distanceÚinclude_stylerŠ   r   r   c                 c  sr   t ƒ }|  ¡ |d< |dur"||d< |dur2||d< |durF| ¡ |d< |durV||d< d|dœ}|V }t |d	 ƒS )
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.
    r«   NZincludeDistanceZincludeStyler�   r“   z!Overlay.getHighlightObjectForTest©rÖ   ÚparamsÚ	highlight©r   r   )rª   rÛ   rÜ   rŠ   r   rÞ   rØ   r   r   r   r   Úget_highlight_object_for_testö  s    þrá   ztyping.List[dom.NodeId])Únode_idsr   c                 c  s4   t ƒ }dd„ | D ƒ|d< d|dœ}|V }t |d ƒS )z¥
    For Persistent Grid testing.
    :param node_ids: Ids of the node to get highlight object for.
    :returns: Grid Highlight data for the node ids provided.
    c                 S  s   g | ]}|  ¡ ‘qS r   ©r   ©Ú.0Úir   r   r   Ú
<listcomp>#  ó    z7get_grid_highlight_objects_for_test.<locals>.<listcomp>ZnodeIdsz&Overlay.getGridHighlightObjectsForTestrÝ   Ú
highlights©r   )râ   rÞ   rØ   r   r   r   r   Ú#get_grid_highlight_objects_for_test  s    þrë   )rª   r   c                 c  s.   t ƒ }|  ¡ |d< d|dœ}|V }t |d ƒS )zŸ
    For Source Order Viewer testing.
    :param node_id: Id of the node to highlight.
    :returns: Source order highlight data for the node id provided.
    r«   z,Overlay.getSourceOrderHighlightObjectForTestrÝ   rß   rà   )rª   rÞ   rØ   r   r   r   r   Ú*get_source_order_highlight_object_for_test,  s    þrì   c                  c  s   ddi} | V }dS )zHides any highlight.rÖ   zOverlay.hideHighlightNr   r×   r   r   r   Úhide_highlight>  s    ÿrí   ztyping.Optional[dom.NodeId]z"typing.Optional[dom.BackendNodeId]z'typing.Optional[runtime.RemoteObjectId]rn   )Úhighlight_configrª   Úbackend_node_idÚ	object_idÚselectorr   c                 c  sr   t ƒ }|  ¡ |d< |dur&| ¡ |d< |dur:| ¡ |d< |durN| ¡ |d< |dur^||d< d|dœ}|V }dS )	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ÚobjectIdrñ   zOverlay.highlightNoderÝ   rà   )rî   rª   rï   rð   rñ   rÞ   rØ   r   r   r   r   Úhighlight_nodeF  s    þrõ   zdom.Quadr,   )Úquadrm   r½   r   c                 c  sN   t ƒ }|  ¡ |d< |dur&| ¡ |d< |dur:| ¡ |d< d|dœ}|V }dS )a8  
    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).
    rö   Nrm   r¾   zOverlay.highlightQuadrÝ   rà   )rö   rm   r½   rÞ   rØ   r   r   r   r   Úhighlight_quadi  s    þr÷   Úint)ÚxÚyÚwidthÚheightrm   r½   r   c           	      c  sb   t ƒ }| |d< ||d< ||d< ||d< |dur:| ¡ |d< |durN| ¡ |d< d|d	œ}|V }dS )
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).
    rù   rú   rû   rü   Nrm   r¾   zOverlay.highlightRectrÝ   rà   )	rù   rú   rû   rü   rm   r½   rÞ   rØ   r   r   r   r   Úhighlight_rectƒ  s    þrý   )Úsource_order_configrª   rï   rð   r   c                 c  sb   t ƒ }|  ¡ |d< |dur&| ¡ |d< |dur:| ¡ |d< |durN| ¡ |d< d|dœ}|V }dS )a  
    Highlights the source order of the children of the DOM node
    with given id or with the given JavaScript object wrapper.
    Either nodeId or objectId must be specified.
    :param source_order_config:
     A descriptor for the appearance of the overlay drawing.
    :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.
    ZsourceOrderConfigNr«   ró   rô   zOverlay.highlightSourceOrderrÝ   rà   )rþ   rª   rï   rð   rÞ   rØ   r   r   r   r   Úhighlight_source_order¦  s    þrÿ   z typing.Optional[HighlightConfig])Úmoderî   r   c                 c  s:   t ƒ }|  ¡ |d< |dur&| ¡ |d< d|dœ}|V }dS )a}  
    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`.
    r   Nrò   zOverlay.setInspectModerÝ   rà   )r   rî   rÞ   rØ   r   r   r   r   Úset_inspect_modeÇ  s    þr  rP   )Úshowr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zt
    Highlights owner element of all frames detected to be ads.
    :param show: True for showing ad highlights
    r  zOverlay.setShowAdHighlightsrÝ   Nrê   ©r  rÞ   rØ   r   r   r   r   Úset_show_ad_highlightsß  s    þr  )Úmessager   c                 c  s*   t ƒ }| dur| |d< d|dœ}|V }dS )zp
    :param message: *(Optional)*
     The message to display, also triggers resume and step over controls.
    Nr  z"Overlay.setPausedInDebuggerMessagerÝ   rê   )r  rÞ   rØ   r   r   r   r   Úset_paused_in_debugger_messageï  s    þr  c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zm
    Requests that backend shows debug borders on layers
    :param show: True for showing debug borders
    r  zOverlay.setShowDebugBordersrÝ   Nrê   r  r   r   r   Úset_show_debug_borders   s    þr  c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zg
    Requests that backend shows the FPS counter
    :param show: True for showing the FPS counter
    r  zOverlay.setShowFPSCounterrÝ   Nrê   r  r   r   r   Úset_show_fps_counter  s    þr  z$typing.List[GridNodeHighlightConfig])Úgrid_node_highlight_configsr   c                 c  s,   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dS )z¸
    Highlight multiple elements with the CSS Grid overlay.
    :param grid_node_highlight_configs:
     An array of node identifiers and descriptors for the highlight appearance.
    c                 S  s   g | ]}|  ¡ ‘qS r   rã   rä   r   r   r   rç   )  s   z*set_show_grid_overlays.<locals>.<listcomp>ZgridNodeHighlightConfigszOverlay.setShowGridOverlaysrÝ   Nrê   )r	  rÞ   rØ   r   r   r   r   Úset_show_grid_overlays   s    ÿ
þr
  z$typing.List[FlexNodeHighlightConfig])Úflex_node_highlight_configsr   c                 c  s,   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dS )z}
    :param flex_node_highlight_configs:
     An array of node identifiers and descriptors for the highlight appearance.
    c                 S  s   g | ]}|  ¡ ‘qS r   rã   rä   r   r   r   rç   ;  s   z*set_show_flex_overlays.<locals>.<listcomp>ZflexNodeHighlightConfigszOverlay.setShowFlexOverlaysrÝ   Nrê   )r  rÞ   rØ   r   r   r   r   Úset_show_flex_overlays3  s    ÿ
þr  z&typing.List[ScrollSnapHighlightConfig])Úscroll_snap_highlight_configsr   c                 c  s,   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dS )z
    :param scroll_snap_highlight_configs:
     An array of node identifiers and descriptors for the highlight appearance.
    c                 S  s   g | ]}|  ¡ ‘qS r   rã   rä   r   r   r   rç   M  s   z1set_show_scroll_snap_overlays.<locals>.<listcomp>ZscrollSnapHighlightConfigsz!Overlay.setShowScrollSnapOverlaysrÝ   Nrê   )r  rÞ   rØ   r   r   r   r   Úset_show_scroll_snap_overlaysE  s    ÿ
þr  z*typing.List[ContainerQueryHighlightConfig])Ú!container_query_highlight_configsr   c                 c  s,   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dS )zƒ
    :param container_query_highlight_configs:
     An array of node identifiers and descriptors for the highlight appearance.
    c                 S  s   g | ]}|  ¡ ‘qS r   rã   rä   r   r   r   rç   a  s   z5set_show_container_query_overlays.<locals>.<listcomp>ZcontainerQueryHighlightConfigsz%Overlay.setShowContainerQueryOverlaysrÝ   Nrê   )r  rÞ   rØ   r   r   r   r   Ú!set_show_container_query_overlaysW  s    	ÿ
þr  )Úresultr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zk
    Requests that backend shows paint rectangles
    :param result: True for showing paint rectangles
    r  zOverlay.setShowPaintRectsrÝ   Nrê   ©r  rÞ   rØ   r   r   r   r   Úset_show_paint_rectsk  s    þr  c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zs
    Requests that backend shows layout shift regions
    :param result: True for showing layout shift regions
    r  z!Overlay.setShowLayoutShiftRegionsrÝ   Nrê   r  r   r   r   Úset_show_layout_shift_regions{  s    þr  c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zw
    Requests that backend shows scroll bottleneck rects
    :param show: True for showing scroll bottleneck rects
    r  z$Overlay.setShowScrollBottleneckRectsrÝ   Nrê   r  r   r   r   Ú set_show_scroll_bottleneck_rects‹  s    þr  c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zX
    Request that backend shows an overlay with web vital metrics.
    :param show:
    r  zOverlay.setShowWebVitalsrÝ   Nrê   r  r   r   r   Úset_show_web_vitals›  s    þr  c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )ze
    Paints viewport size upon main frame resize.
    :param show: Whether to paint size or not.
    r  z#Overlay.setShowViewportSizeOnResizerÝ   Nrê   r  r   r   r   Ú set_show_viewport_size_on_resize«  s    þr  ztyping.Optional[HingeConfig])Úhinge_configr   c                 c  s.   t ƒ }| dur|  ¡ |d< d|dœ}|V }dS )zo
    Add a dual screen device hinge
    :param hinge_config: *(Optional)* hinge data, null means hideHinge
    NZhingeConfigzOverlay.setShowHingerÝ   rà   )r  rÞ   rØ   r   r   r   r   Úset_show_hinge»  s    þr  z+typing.List[IsolatedElementHighlightConfig])Ú"isolated_element_highlight_configsr   c                 c  s,   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dS )z¶
    Show elements in isolation mode with overlays.
    :param isolated_element_highlight_configs:
    An array of node identifiers and descriptors for the highlight appearance.
    c                 S  s   g | ]}|  ¡ ‘qS r   rã   rä   r   r   r   rç   ×  s   z.set_show_isolated_elements.<locals>.<listcomp>ZisolatedElementHighlightConfigszOverlay.setShowIsolatedElementsrÝ   Nrê   )r  rÞ   rØ   r   r   r   r   Úset_show_isolated_elementsÌ  s    
ÿ
þr  z,typing.Optional[WindowControlsOverlayConfig])Úwindow_controls_overlay_configr   c                 c  s.   t ƒ }| dur|  ¡ |d< d|dœ}|V }dS )z±
    Show Window Controls Overlay for PWA
    :param window_controls_overlay_config: *(Optional)*
     Window Controls Overlay data, null means hide Window Controls Overlay
    NZwindowControlsOverlayConfigz$Overlay.setShowWindowControlsOverlayrÝ   rà   )r  rÞ   rØ   r   r   r   r   Ú set_show_window_controls_overlayá  s    
ÿþr  zOverlay.inspectNodeRequestedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚInspectNodeRequestedz‘
    Fired when the node should be inspected.
    This happens after call to `setInspectMode`
    or when user manually inspects an element.
    zdom.BackendNodeIdrï   r   r   c                 C  s   | t j |d ¡d�S )Nró   )rï   )r   ZBackendNodeIdr   r   r   r   r   r     s    ÿzInspectNodeRequested.from_jsonN©r   r   r    r!   r"   r#   r   r   r   r   r   r  ÷  s   
r  zOverlay.nodeHighlightRequestedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚNodeHighlightRequestedze
    Fired when the node should be highlighted.
    This happens after call to `setInspectMode`.
    r©   rª   r   r   c                 C  s   | t j |d ¡d�S )Nr«   )rª   )r   r¬   r   r   r   r   r   r     s    z NodeHighlightRequested.from_jsonNr  r   r   r   r   r   	  s   
r   zOverlay.screenshotRequestedc                   @  s.   e Zd ZU dZded< edd dœdd„ƒZdS )	ÚScreenshotRequestedzN
    Fired when user asks to capture screenshot of some area on the page.
    zpage.ViewportÚviewportr   r   c                 C  s   | t j |d ¡d�S )Nr"  )r"  )r   ZViewportr   r   r   r   r   r      s    zScreenshotRequested.from_jsonNr  r   r   r   r   r!    s   
r!  zOverlay.inspectModeCanceledc                   @  s$   e Zd ZdZedd dœdd„ƒZdS )ÚInspectModeCanceledz)Fired when user cancels the inspect mode.r   r   c                 C  s   | ƒ S rw   r   r   r   r   r   r   *  s    zInspectModeCanceled.from_jsonN)r   r   r    r!   r#   r   r   r   r   r   r#  %  s   r#  )NNNN)NNNN)NN)NN)NNN)N)N)N)N)AÚ
__future__r   ÚenumÚtypingÚdataclassesr   Úutilr   r   Ú r   r   r	   r
   r$   rQ   rf   rd   re   ÚEnumrv   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>   sÐ    FY( L2# (
    û$
    û%  ý  ú%   ü# þ ÿ ÿ ý