
    X jK                        S SK Jr  S SKJr  S SKJrJrJr  S SKJ	r	  \(       a  S SK
Jr   " S S\5      r " S S	\5      r\" S
\\5      rSS jr " S S5      r " S S5      r " S S5      r " S S5      rg)    )annotations)Enum)TYPE_CHECKINGAnyTypeVar)command_builder)WebSocketConnectionc                       \ rS rSrSrSrSrSrg)ScreenOrientationNatural   zNatural screen orientation.portrait	landscape N)__name__
__module____qualname____firstlineno____doc__PORTRAIT	LANDSCAPE__static_attributes__r       y/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/selenium/webdriver/common/bidi/emulation.pyr   r      s    %HIr   r   c                  (    \ rS rSrSrSrSrSrSrSr	g)	ScreenOrientationType#   zScreen orientation type.zportrait-primaryzportrait-secondaryzlandscape-primaryzlandscape-secondaryr   N)
r   r   r   r   r   PORTRAIT_PRIMARYPORTRAIT_SECONDARYLANDSCAPE_PRIMARYLANDSCAPE_SECONDARYr   r   r   r   r   r   #   s    ")-+/r   r   Ec                    [        X5      (       a  U $ [        U [        5      (       d   e U" U R                  5       5      $ ! [         a    [        SU  35      ef = f)NzInvalid orientation: )
isinstancestrlower
ValueError)value
enum_classs     r   _convert_to_enumr)   /   s]    %$$eS!!!!:%++-(( :0899:s   A Ac                  4    \ rS rSrSr    SS jrSS jrSrg)	ScreenOrientation9   z,Represents screen orientation configuration.c                X    [        U[        5      U l        [        U[        5      U l        g)a/  Initialize ScreenOrientation.

Args:
    natural: Natural screen orientation ("portrait" or "landscape").
    type: Screen orientation type ("portrait-primary", "portrait-secondary",
        "landscape-primary", or "landscape-secondary").

Raises:
    ValueError: If natural or type values are invalid.
N)r)   r   naturalr   type)selfr.   r/   s      r   __init__ScreenOrientation.__init__<   s"      (1IJ$T+@A	r   c                \    U R                   R                  U R                  R                  S.$ )Nr.   r/   )r.   r'   r/   r0   s    r   to_dictScreenOrientation.to_dictO   s$    ||))IIOO
 	
r   r4   N)r.   zScreenOrientationNatural | strr/   zScreenOrientationType | strreturnzdict[str, str])r   r   r   r   r   r1   r6   r   r   r   r   r+   r+   9   s$    6B/B *B&
r   r+   c                     \ rS rSrSr     S             SS jjr\SS j5       r\R                  SS j5       r\SS j5       r	\	R                  SS j5       r	\SS	 j5       r
\
R                  SS
 j5       r
\SS j5       r\R                  SS j5       r\SS j5       r\R                  SS j5       r\SS j5       r\R                  SS j5       r\SS j5       r\R                  SS j5       rSS jrSrg)GeolocationCoordinatesV   z#Represents geolocation coordinates.Nc                X    Xl         X l        X0l        X@l        XPl        X`l        Xpl        g)al  Initialize GeolocationCoordinates.

Args:
    latitude: Latitude coordinate (-90.0 to 90.0).
    longitude: Longitude coordinate (-180.0 to 180.0).
    accuracy: Accuracy in meters (>= 0.0), defaults to 1.0.
    altitude: Altitude in meters or None, defaults to None.
    altitude_accuracy: Altitude accuracy in meters (>= 0.0) or None, defaults to None.
    heading: Heading in degrees (0.0 to 360.0) or None, defaults to None.
    speed: Speed in meters per second (>= 0.0) or None, defaults to None.

Raises:
    ValueError: If coordinates are out of valid range or if altitude_accuracy is provided without altitude.
Nlatitude	longitudeaccuracyaltitudealtitude_accuracyheadingspeed)r0   r?   r@   rA   rB   rC   rD   rE   s           r   r1   GeolocationCoordinates.__init__Y   s(    0 !"  !2
r   c                    U R                   $ N)	_latituder5   s    r   r?   GeolocationCoordinates.latitudey       ~~r   c                D    SUs=::  a  S::  d  O  [        S5      eXl        g )Ng     Vg     V@z'latitude must be between -90.0 and 90.0)r&   rI   r0   r'   s     r   r?   rJ   }   s     &$&FGGr   c                    U R                   $ rH   )
_longituder5   s    r   r@    GeolocationCoordinates.longitude   s    r   c                D    SUs=::  a  S::  d  O  [        S5      eXl        g )Ng     fg     f@z*longitude must be between -180.0 and 180.0)r&   rO   rM   s     r   r@   rP      s     %(5(IJJr   c                    U R                   $ rH   )	_accuracyr5   s    r   rA   GeolocationCoordinates.accuracy   rK   r   c                2    US:  a  [        S5      eXl        g )N        zaccuracy must be >= 0.0)r&   rS   rM   s     r   rA   rT      s    3;677r   c                    U R                   $ rH   	_altituder5   s    r   rB   GeolocationCoordinates.altitude   rK   r   c                    Xl         g rH   rX   rM   s     r   rB   rZ      s    r   c                    U R                   $ rH   )_altitude_accuracyr5   s    r   rC   (GeolocationCoordinates.altitude_accuracy   s    &&&r   c                n    Ub  U R                   c  [        S5      eUb  US:  a  [        S5      eXl        g )Nz0altitude_accuracy cannot be set without altituderV   z altitude_accuracy must be >= 0.0)rB   r&   r]   rM   s     r   rC   r^      s;    !6OPP?@@"'r   c                    U R                   $ rH   )_headingr5   s    r   rD   GeolocationCoordinates.heading   s    }}r   c                J    Ub  SUs=::  a  S:  d  O  [        S5      eXl        g )NrV   g     v@z%heading must be between 0.0 and 360.0)r&   ra   rM   s     r   rD   rb      s%    cU&:U&:DEEr   c                    U R                   $ rH   )_speedr5   s    r   rE   GeolocationCoordinates.speed   s    {{r   c                8    Ub  US:  a  [        S5      eXl        g )NrV   zspeed must be >= 0.0)r&   re   rM   s     r   rE   rf      s    344r   c                .   U R                   U R                  U R                  S.nU R                  b  U R                  US'   U R                  b  U R                  US'   U R
                  b  U R
                  US'   U R                  b  U R                  US'   U$ )N)r?   r@   rA   rB   altitudeAccuracyrD   rE   r>   )r0   results     r   r6   GeolocationCoordinates.to_dict   s    +
 ==$!%F:!!-)-)?)?F%&<<# $F9::!"jjF7Or   )rS   rY   r]   ra   rI   rO   re   rA   rB   rC   rD   r?   r@   rE   )g      ?NNNN)r?   floatr@   rl   rA   rl   rB   float | NonerC   rm   rD   rm   rE   rm   )r9   rl   )r'   rl   r9   None)r9   rm   )r'   rm   r9   rn   )r9   zdict[str, float | None])r   r   r   r   r   r1   propertyr?   setterr@   rA   rB   rC   rD   rE   r6   r   r   r   r   r;   r;   V   s   - !%*. $"  	
  (  @   __ 
      
   __ 
   __  ' ' ( (   ^^ 
   \\ 
r   r;   c                  6    \ rS rSrSrSr\4SS jjrS	S jrSrg)
GeolocationPositionError   z(Represents a geolocation position error.positionUnavailablec                `    XR                   :w  a  [        SU R                    S35      eXl        g )Nztype must be "")TYPE_POSITION_UNAVAILABLEr&   r/   )r0   r/   s     r   r1   !GeolocationPositionError.__init__   s.    111~d.L.L-MQOPP	r   c                    SU R                   0$ )Nr/   r/   r5   s    r   r6    GeolocationPositionError.to_dict   s    		""r   rz   N)r/   r$   r8   )	r   r   r   r   r   rw   r1   r6   r   r   r   r   rr   rr      s    2 5#< 
#r   rr   c                  >   \ rS rSrSrSS jr    S         SS jjr   S       SS jjr   S       SS jjr   S       SS jjr	   S       SS	 jjr
   S       SS
 jjr   S       SS jjr    S         SS jjrSrg)	Emulation   z,BiDi implementation of the emulation module.c                    Xl         g rH   conn)r0   r   s     r   r1   Emulation.__init__   s    	r   Nc                0   Ub  Ub  [        S5      eUb  Ub  [        S5      eUc  Uc  [        S5      e0 nUb  UR                  5       US'   OUb  UR                  5       US'   Ub  X5S'   OUb  XES'   U R                  R                  [	        S	U5      5        g)
a  Set geolocation override for the given contexts or user contexts.

Args:
    coordinates: Geolocation coordinates to emulate, or None.
    error: Geolocation error to emulate, or None.
    contexts: List of browsing context IDs to apply the override to.
    user_contexts: List of user context IDs to apply the override to.

Raises:
    ValueError: If both coordinates and error are provided, or if both contexts
        and user_contexts are provided, or if neither contexts nor
        user_contexts are provided.
Nz)Cannot specify both coordinates and error-Cannot specify both contexts and userContexts,Must specify either contexts or userContextscoordinateserrorcontextsuserContextsz emulation.setGeolocationOverrider&   r6   r   executer   )r0   r   r   r   user_contextsparamss         r   set_geolocation_override"Emulation.set_geolocation_override   s    ( "u'8HIIM$=LMM 5KLL!#"$/$7$7$9F=!#mmoF7O!):&%2>"		/*LfUVr   c                    Ub  Ub  [        S5      eUc  Uc  [        S5      eSU0nUb  X$S'   OUb  X4S'   U R                  R                  [        SU5      5        g)a  Set timezone override for the given contexts or user contexts.

Args:
    timezone: Timezone identifier (IANA timezone name or offset string like '+01:00'),
        or None to clear the override.
    contexts: List of browsing context IDs to apply the override to.
    user_contexts: List of user context IDs to apply the override to.

Raises:
    ValueError: If both contexts and user_contexts are provided, or if neither
        contexts nor user_contexts are provided.
N.Cannot specify both contexts and user_contexts-Must specify either contexts or user_contextstimezoner   r   zemulation.setTimezoneOverrider&   r   r   r   )r0   r   r   r   r   s        r   set_timezone_overrideEmulation.set_timezone_override  sr    $ M$=MNN 5LMM",h!7!):&%2>"		/*I6RSr   c                    Ub  Ub  [        S5      eUc  Uc  [        S5      eSU0nUb  X$S'   OUb  X4S'   U R                  R                  [        SU5      5        g)a  Set locale override for the given contexts or user contexts.

Args:
    locale: Locale string as per BCP 47, or None to clear override.
    contexts: List of browsing context IDs to apply the override to.
    user_contexts: List of user context IDs to apply the override to.

Raises:
    ValueError: If both contexts and user_contexts are provided, or if neither
        contexts nor user_contexts are provided, or if locale is invalid.
Nr   r   localer   r   zemulation.setLocaleOverrider   )r0   r   r   r   r   s        r   set_locale_overrideEmulation.set_locale_override5  sr    " M$=LMM 5KLL"*F!3!):&%2>"		/*GPQr   c                    U(       a  [        S5      eUb  Ub  [        S5      eUc  Uc  [        S5      eSU0nUb  X$S'   OUb  X4S'   U R                  R                  [        SU5      5        g)	a  Set scripting enabled override for the given contexts or user contexts.

Args:
    enabled: False to disable scripting, None to clear the override.
        Note: Only emulation of disabled JavaScript is supported.
    contexts: List of browsing context IDs to apply the override to.
    user_contexts: List of user context IDs to apply the override to.

Raises:
    ValueError: If both contexts and user_contexts are provided, or if neither
        contexts nor user_contexts are provided, or if enabled is True.
zROnly emulation of disabled JavaScript is supported (enabled must be False or None)Nr   r   enabledr   r   zemulation.setScriptingEnabledr   )r0   r   r   r   r   s        r   set_scripting_enabledEmulation.set_scripting_enabledU  s    $ qrrM$=LMM 5KLL"+W!5!):&%2>"		/*I6RSr   c                    Ub  Ub  [        S5      eUc  Uc  [        S5      eSUb  UR                  5       OS0nUb  X$S'   OUb  X4S'   U R                  R                  [	        SU5      5        g)a  Set screen orientation override for the given contexts or user contexts.

Args:
    screen_orientation: ScreenOrientation object to emulate, or None to clear the override.
    contexts: List of browsing context IDs to apply the override to.
    user_contexts: List of user context IDs to apply the override to.

Raises:
    ValueError: If both contexts and user_contexts are provided, or if neither
        contexts nor user_contexts are provided.
Nr   r   screenOrientationr   r   z&emulation.setScreenOrientationOverrider   )r0   screen_orientationr   r   r   s        r   set_screen_orientation_override)Emulation.set_screen_orientation_overridey  s    " M$=LMM 5KLL  ASA_!3!;!;!=ei"
 !):&%2>"		/*RTZ[\r   c                    Ub  Ub  [        S5      eUc  Uc  [        S5      eSU0nUb  X$S'   OUb  X4S'   U R                  R                  [        SU5      5        g)a  Set user agent override for the given contexts or user contexts.

Args:
    user_agent: User agent string to emulate, or None to clear the override.
    contexts: List of browsing context IDs to apply the override to.
    user_contexts: List of user context IDs to apply the override to.

Raises:
    ValueError: If both contexts and user_contexts are provided, or if neither
        contexts nor user_contexts are provided.
Nr   r   	userAgentr   r   zemulation.setUserAgentOverrider   )r0   
user_agentr   r   r   s        r   set_user_agent_override!Emulation.set_user_agent_override  sr    " M$=MNN 5LMM"-z!:!):&%2>"		/*JFSTr   c                    Ub  Ub  [        S5      eUc  Uc  [        S5      e0 nU(       a  SS0US'   OSUS'   Ub  X$S'   OUb  X4S'   U R                  R                  [        S	U5      5        g)
a  Set network conditions for the given contexts or user contexts.

Args:
    offline: True to emulate offline network conditions, False to clear the override.
    contexts: List of browsing context IDs to apply the conditions to.
    user_contexts: List of user context IDs to apply the conditions to.

Raises:
    ValueError: If both contexts and user_contexts are provided, or if neither
        contexts nor user_contexts are provided.
Nr   r   r/   offlinenetworkConditionsr   r   zemulation.setNetworkConditionsr   )r0   r   r   r   r   s        r   set_network_conditions Emulation.set_network_conditions  s    " M$=MNN 5LMM!#+19*=F&' +/F&'!):&%2>"		/*JFSTr   c                   USL USL :w  a  [        S5      eUb  Ub  [        S5      eUc  Uc  [        S5      eSnUbS  UbP  [        U[        5      (       a  [        U[        5      (       d  [        S5      eUS:  d  US:  a  [        S5      eXS.nS	U0nUb  X6S
'   OUb  XFS'   U R                  R	                  [        SU5      5        g)a  Set screen settings override for the given contexts or user contexts.

Args:
    width: Screen width in pixels (>= 0). None to clear the override.
    height: Screen height in pixels (>= 0). None to clear the override.
    contexts: List of browsing context IDs to apply the override to.
    user_contexts: List of user context IDs to apply the override to.

Raises:
    ValueError: If only one of width/height is provided, or if both contexts
        and user_contexts are provided, or if neither is provided.
NzDMust provide both width and height, or neither to clear the overrider   r   z!width and height must be integersr   zwidth and height must be >= 0)widthheight
screenArear   r   z#emulation.setScreenSettingsOverride)r&   r#   intr   r   r   )r0   r   r   r   r   screen_arear   s          r   set_screen_settings_override&Emulation.set_screen_settings_override  s    & TMv~.cddM$=MNN 5LMM!3eS))FC1H1H !DEEqyFQJ !@AA$)<K".!<!):&%2>"		/*OQWXYr   r   )r   r	   r9   rn   )NNNN)
r   zGeolocationCoordinates | Noner   zGeolocationPositionError | Noner   list[str] | Noner   r   r9   rn   )NNN)r   
str | Noner   r   r   r   r9   rn   )r   r   r   r   r   r   r9   rn   )FNN)r   zbool | Noner   r   r   r   r9   rn   )r   zScreenOrientation | Noner   r   r   r   r9   rn   )r   r   r   r   r   r   r9   rn   )r   boolr   r   r   r   r9   rn   )
r   
int | Noner   r   r   r   r   r   r9   rn   )r   r   r   r   r   r1   r   r   r   r   r   r   r   r   r   r   r   r   r}   r}      s   6
 6:15%)*.)W2)W /)W #	)W
 ()W 
)WZ  $%)*.	TT #T (	T
 
TF "%)*.	RR #R (	R
 
RD  %%)*.	"T"T #"T (	"T
 
"TL 8<%)*.	 ]4 ] # ] (	 ]
 
 ]H "&%)*.	UU #U (	U
 
UD %)*.	$U$U #$U (	$U
 
$UP !!%)*.+Z+Z +Z #	+Z
 (+Z 
+Z +Zr   r}   N)r'   zE | strr(   ztype[E]r9   r!   )
__future__r   enumr   typingr   r   r   %selenium.webdriver.common.bidi.commonr   .selenium.webdriver.remote.websocket_connectionr	   r   r   r!   r)   r+   r;   rr   r}   r   r   r   <module>r      sz   " #  . . ARt 0D 0 C)+@A:
 
:| |~# #iZ iZr   