
    aDgC                       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 d d	lmZ e G d
 d             Z G d dej                         Zd(dZd)dZd)dZd)dZ	 	 	 	 d*dZ	 	 	 	 d+dZ	 d,	 	 	 d-dZ	 	 	 	 	 	 	 	 d.	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d/dZ	 	 	 	 d0dZ	 	 	 	 d1dZ	 d,	 	 	 	 	 d2dZ	 	 	 	 d3dZ	 	 	 d4	 	 	 	 	 	 	 d5dZ ed      	 	 	 	 d6d       Z	 	 	 	 d7dZ 	 	 	 	 d8dZ!	 d,	 	 	 	 	 d9d Z"	 	 	 	 d:	 	 	 	 	 	 	 	 	 	 	 d;d!Z#	 	 	 	 d<d"Z$ ed      	 	 	 	 	 	 d=d#       Z%	 	 d>	 	 	 	 	 	 	 d?d$Z& ed%      e G d& d'                    Z'y)@    )annotations)event_classT_JSON_DICT)	dataclassN   )dom)network)page)
deprecatedc                  @    e Zd ZU dZded<   ded<   d	dZed
d       Zy)ScreenOrientationz
    Screen orientation.
    strtype_intanglec                V    t               }| j                  |d<   | j                  |d<   |S )Ntyper   )dictr   r   )selfjsons     M/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/cdp/emulation.pyto_jsonzScreenOrientation.to_json   s(     FzzV

W    c                F     | t        |d         t        |d               S )Nr   r   )r   r   )r   r   clsr   s     r   	from_jsonzScreenOrientation.from_json%   s'    d6l#d7m$
 	
r   N)returnr   )r   r   r   r   )__name__
__module____qualname____doc____annotations__r   classmethodr    r   r   r   r      s.     J J 
 
r   r   c                  6    e Zd ZdZdZdZdZddZed	d       Z	y)
VirtualTimePolicya?  
    advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to
    allow the next delayed task (if any) to run; pause: The virtual time base may not advance;
    pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending
    resource fetches.
    advancepausepauseIfNetworkFetchesPendingc                    | j                   S N)value)r   s    r   r   zVirtualTimePolicy.to_json8   s    zzr   c                     | |      S r,   r%   r   s     r   r   zVirtualTimePolicy.from_json;   s    4yr   N)r   r   )r   r   r   r'   )
r   r    r!   r"   ADVANCEPAUSE PAUSE_IF_NETWORK_FETCHES_PENDINGr   r$   r   r%   r   r   r'   r'   -   s2     GE'E$  r   r'   c               #  6   K   ddi} | }t        |d         S w)z^
    Tells whether emulation is supported.

    :returns: True if emulation is supported.
    methodzEmulation.canEmulateresult)boolcmd_dictr   s     r   can_emulater8   @   s-      	(H >DXs   c               #     K   ddi} | }yw)z.
    Clears the overriden device metrics.
    r3   z$Emulation.clearDeviceMetricsOverrideNr%   r6   s     r   clear_device_metrics_overrider:   M   s     
 	8H >D   
c               #     K   ddi} | }yw)z>
    Clears the overriden Geolocation Position and Error.
    r3   z"Emulation.clearGeolocationOverrideNr%   r6   s     r   clear_geolocation_overrider=   W   s     
 	6H >Dr;   c               #     K   ddi} | }yw)z[
    Requests that page scale factor is reset to initial values.

    **EXPERIMENTAL**
    r3   zEmulation.resetPageScaleFactorNr%   r6   s     r   reset_page_scale_factorr?   a   s      	2H >Dr;   c              #  <   K   t               }| |d<   d|d}|}yw)z
    Enables or disables simulating a focused and active page.

    **EXPERIMENTAL**

    :param enabled: Whether to enable to disable focus emulation.
    enabledz"Emulation.setFocusEmulationEnabledr3   paramsNr   )rA   rC   r7   r   s       r   set_focus_emulation_enabledrE   m   s/      &FF96H >D   c              #  <   K   t               }| |d<   d|d}|}yw)z
    Enables CPU throttling to emulate slow CPUs.

    **EXPERIMENTAL**

    :param rate: Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).
    ratezEmulation.setCPUThrottlingRaterB   NrD   )rH   rC   r7   r   s       r   set_cpu_throttling_raterI      s.      &FF6N2H >DrF   c              #  \   K   t               }| | j                         |d<   d|d}|}yw)a  
    Sets or clears an override of the default background color of the frame. This override is used
    if the content does not specify one.

    :param color: *(Optional)* RGBA of the default background color. If not specified, any existing override will be cleared.
    Ncolorz+Emulation.setDefaultBackgroundColorOverriderB   r   r   )rK   rC   r7   r   s       r   %set_default_background_color_overriderM      s:      &F--/w?H >D   *,c              #    K   t               }| |d<   ||d<   ||d<   ||d<   |||d<   |||d<   |||d<   |||d	<   |||d
<   |	|	|d<   |
|
j                         |d<   ||j                         |d<   d|d}|}yw)a  
    Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
    window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
    query results).

    :param width: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param height: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
    :param device_scale_factor: Overriding device scale factor value. 0 disables the override.
    :param mobile: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
    :param scale: **(EXPERIMENTAL)** *(Optional)* Scale to apply to resulting view image.
    :param screen_width: **(EXPERIMENTAL)** *(Optional)* Overriding screen width value in pixels (minimum 0, maximum 10000000).
    :param screen_height: **(EXPERIMENTAL)** *(Optional)* Overriding screen height value in pixels (minimum 0, maximum 10000000).
    :param position_x: **(EXPERIMENTAL)** *(Optional)* Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
    :param position_y: **(EXPERIMENTAL)** *(Optional)* Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
    :param dont_set_visible_size: **(EXPERIMENTAL)** *(Optional)* Do not set visible view size, rely upon explicit setVisibleSize call.
    :param screen_orientation: *(Optional)* Screen orientation override.
    :param viewport: **(EXPERIMENTAL)** *(Optional)* If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.
    widthheightdeviceScaleFactormobileNscalescreenWidthscreenHeight	positionX	positionYdontSetVisibleSizescreenOrientationviewportz"Emulation.setDeviceMetricsOverriderB   rL   )rP   rQ   device_scale_factorrS   rT   screen_widthscreen_height
position_x
position_ydont_set_visible_sizescreen_orientationr[   rC   r7   r   s                  r   set_device_metrics_overriderc      s     @ &FF7OF8"5FF8w ,} !.~({({('<#$%&8&@&@&B"#%--/z6H >Ds   A=A?c              #  <   K   t               }| |d<   d|d}|}yw)z\


    **EXPERIMENTAL**

    :param hidden: Whether scrollbars should be always hidden.
    hiddenzEmulation.setScrollbarsHiddenrB   NrD   )re   rC   r7   r   s       r   set_scrollbars_hiddenrf      s/      &FF81H >DrF   c              #  <   K   t               }| |d<   d|d}|}yw)zc


    **EXPERIMENTAL**

    :param disabled: Whether document.coookie API should be disabled.
    disabledz#Emulation.setDocumentCookieDisabledrB   NrD   )rh   rC   r7   r   s       r   set_document_cookie_disabledri      s/      &F!F:7H >DrF   c              #  J   K   t               }| |d<   |||d<   d|d}|}yw)z


    **EXPERIMENTAL**

    :param enabled: Whether touch emulation based on mouse input should be enabled.
    :param configuration: *(Optional)* Touch/gesture events configuration. Default: current platform.
    rA   Nconfigurationz$Emulation.setEmitTouchEventsForMouserB   rD   )rA   rk   rC   r7   r   s        r   set_emit_touch_events_for_mouserl     s?      &FF9 "/8H >D   !#c              #  <   K   t               }| |d<   d|d}|}yw)z
    Emulates the given media for CSS media queries.

    :param media: Media type to emulate. Empty string disables the override.
    mediazEmulation.setEmulatedMediarB   NrD   )ro   rC   r7   r   s       r   set_emulated_mediarp     s.      &FF7O.H >DrF   c              #  \   K   t               }| | |d<   |||d<   |||d<   d|d}|}yw)a  
    Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
    unavailable.

    :param latitude: *(Optional)* Mock latitude
    :param longitude: *(Optional)* Mock longitude
    :param accuracy: *(Optional)* Mock accuracy
    Nlatitude	longitudeaccuracyz Emulation.setGeolocationOverriderB   rD   )rr   rs   rt   rC   r7   r   s         r   set_geolocation_overrideru   0  sU      &F%z'{%z4H >DrN   z1.3)versionc              #  <   K   t               }| |d<   d|d}|}yw)z
    Overrides value returned by the javascript navigator object.

    .. deprecated:: 1.3

    **EXPERIMENTAL**

    :param platform: The platform navigator.platform should return.
    platformzEmulation.setNavigatorOverridesrB   NrD   )rx   rC   r7   r   s       r   set_navigator_overridesry   K  s/      &F!F:3H >DrF   c              #  <   K   t               }| |d<   d|d}|}yw)zu
    Sets a specified page scale factor.

    **EXPERIMENTAL**

    :param page_scale_factor: Page scale factor.
    pageScaleFactorzEmulation.setPageScaleFactorrB   NrD   )page_scale_factorrC   r7   r   s       r   set_page_scale_factorr}   a  s0      &F 1F0H >DrF   c              #  <   K   t               }| |d<   d|d}|}yw)z|
    Switches script execution in the page.

    :param value: Whether script execution should be disabled in the page.
    r-   z$Emulation.setScriptExecutionDisabledrB   NrD   )r-   rC   r7   r   s       r   set_script_execution_disabledr   t  s.      &FF7O8H >DrF   c              #  J   K   t               }| |d<   |||d<   d|d}|}yw)z
    Enables touch on platforms which do not support them.

    :param enabled: Whether the touch event emulation should be enabled.
    :param max_touch_points: *(Optional)* Maximum touch points supported. Defaults to one.
    rA   NmaxTouchPointsz"Emulation.setTouchEmulationEnabledrB   rD   )rA   max_touch_pointsrC   r7   r   s        r   set_touch_emulation_enabledr     s@      &FF9##3 6H >Drm   c              #     K   t               }| j                         |d<   |||d<   |||d<   |||d<   ||j                         |d<   d|d}|}t        |d         S w)	a  
    Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets
    the current virtual time policy.  Note this supersedes any previous time budget.

    **EXPERIMENTAL**

    :param policy:
    :param budget: *(Optional)* If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
    :param max_virtual_time_task_starvation_count: *(Optional)* If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
    :param wait_for_navigation: *(Optional)* If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded.
    :param initial_virtual_time: *(Optional)* If set, base::Time::Now will be overriden to initially return this value.
    :returns: Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
    policybudget!maxVirtualTimeTaskStarvationCountwaitForNavigationinitialVirtualTimezEmulation.setVirtualTimePolicyrB   virtualTimeTicksBase)r   r   float)r   r   &max_virtual_time_task_starvation_countwait_for_navigationinitial_virtual_timerC   r7   r   s           r   set_virtual_time_policyr     s     ( &F~~'F8!x-96\23&&9"#'';'C'C'E#$2H >D,-..s   AA!c              #  <   K   t               }| |d<   d|d}|}yw)z
    Overrides default host system timezone with the specified one.

    **EXPERIMENTAL**

    :param timezone_id: The timezone identifier. If empty, disables the override and restores default host system timezone.
    
timezoneIdzEmulation.setTimezoneOverriderB   NrD   )timezone_idrC   r7   r   s       r   set_timezone_overrider     s/      &F&F<1H >DrF   c              #  F   K   t               }| |d<   ||d<   d|d}|}yw)aU  
    Resizes the frame/viewport of the page. Note that this does not affect the frame's container
    (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported
    on Android.

    .. deprecated:: 1.3

    **EXPERIMENTAL**

    :param width: Frame width (DIP).
    :param height: Frame height (DIP).
    rP   rQ   zEmulation.setVisibleSizerB   NrD   )rP   rQ   rC   r7   r   s        r   set_visible_sizer     s8     " &FF7OF8,H >Ds   !c              #  X   K   t               }| |d<   |||d<   |||d<   d|d}|}yw)a   
    Allows overriding user agent with the given string.

    :param user_agent: User agent to use.
    :param accept_language: *(Optional)* Browser langugage to emulate.
    :param platform: *(Optional)* The platform navigator.platform should return.
    	userAgentNacceptLanguagerx   zEmulation.setUserAgentOverriderB   rD   )
user_agentaccept_languagerx   rC   r7   r   s         r   set_user_agent_overrider     sP      &F$F;"#2 %z2H >Ds   (*z"Emulation.virtualTimeBudgetExpiredc                  "    e Zd ZdZedd       Zy)VirtualTimeBudgetExpiredz~
    **EXPERIMENTAL**

    Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
    c                     |        S r,   r%   r   s     r   r   z"VirtualTimeBudgetExpired.from_json  s     
 	
r   N)r   r   r   r   )r   r    r!   r"   r$   r   r%   r   r   r   r     s     
 
r   r   )r   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, bool])r   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])rA   r5   r   r   )rH   r   r   r   r,   )rK   ztyping.Optional[dom.RGBA]r   r   )NNNNNNNN)rP   r   rQ   r   r\   r   rS   r5   rT   typing.Optional[float]r]   typing.Optional[int]r^   r   r_   r   r`   r   ra   typing.Optional[bool]rb   z"typing.Optional[ScreenOrientation]r[   ztyping.Optional[page.Viewport]r   r   )re   r5   r   r   )rh   r5   r   r   )rA   r5   rk   typing.Optional[str]r   r   )ro   r   r   r   )NNN)rr   r   rs   r   rt   r   r   r   )rx   r   r   r   )r|   r   r   r   )r-   r5   r   r   )rA   r5   r   r   r   r   )NNNN)r   r'   r   r   r   r   r   r   r   z'typing.Optional[network.TimeSinceEpoch]r   z1typing.Generator[T_JSON_DICT, T_JSON_DICT, float])r   r   r   r   )rP   r   rQ   r   r   r   )NN)r   r   r   r   rx   r   r   r   )(
__future__r   cdp.utilr   r   dataclassesr   enumtyping r   r	   r
   deprecated.sphinxr   r   Enumr'   r8   r:   r=   r?   rE   rI   rM   rc   rf   ri   rl   rp   ru   ry   r}   r   r   r   r   r   r   r   r%   r   r   <module>r      s=   # - !      ( 
 
 
0		 &
 		7&	7( ,0(	70 )--1.2+/+/7;AE37999 #9 	9
 &9 +9 ,9 )9 )9  59 ?9 19 
89x	7&	7* /3+ 
8.	7$ ,0,0+/() ) 
8	6 E	7 * 	7&	7& 26. 
8. *.GK59HL#/!#/&#/ 1E#/ 3	#/
 F#/ 
9#/L	7& E 
8 8 15)-- ' 
8	2 12

 
  3
r   