
    ,hJ                     d    d dl mZ d dl mZ d dlmZ  G d d      Z G d d      Z G d d	      Zy
)    )Dict)List)command_builderc                        e Zd ZdZdZdZdZdZy)ClientWindowStatezRepresents a window state.
fullscreen	maximized	minimizednormalN)__name__
__module____qualname____doc__
FULLSCREEN	MAXIMIZED	MINIMIZEDNORMAL     h/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/selenium/webdriver/common/bidi/browser.pyr   r      s    $JIIFr   r   c                       e Zd ZdZdededededededefd	Zd
efdZd
efdZ	d
efdZ
d
efdZd
efdZd
efdZd
efdZeded
d fd       Zy)ClientWindowInfoz'Represents a client window information.client_windowstatewidthheightxyactivec                 f    || _         || _        || _        || _        || _        || _        || _        y Nr   r   r   r   r   r   r   )selfr   r   r   r   r   r   r   s           r   __init__zClientWindowInfo.__init__$   s6     +

r   returnc                     | j                   S )zGets the state of the client window.

        Returns:
        -------
            str: The state of the client window (one of the ClientWindowState constants).
        )r   r#   s    r   	get_statezClientWindowInfo.get_state6        zzr   c                     | j                   S )z|Gets the client window identifier.

        Returns:
        -------
            str: The client window identifier.
        )r   r'   s    r   get_client_windowz"ClientWindowInfo.get_client_window?   s     !!!r   c                     | j                   S )zGets the width of the client window.

        Returns:
        -------
            int: The width of the client window.
        )r   r'   s    r   	get_widthzClientWindowInfo.get_widthH   r)   r   c                     | j                   S )zGets the height of the client window.

        Returns:
        -------
            int: The height of the client window.
        )r   r'   s    r   
get_heightzClientWindowInfo.get_heightQ        {{r   c                     | j                   S )zGets the x coordinate of the client window.

        Returns:
        -------
            int: The x coordinate of the client window.
        )r   r'   s    r   get_xzClientWindowInfo.get_xZ        vvr   c                     | j                   S )zGets the y coordinate of the client window.

        Returns:
        -------
            int: The y coordinate of the client window.
        )r   r'   s    r   get_yzClientWindowInfo.get_yc   r3   r   c                     | j                   S )zChecks if the client window is active.

        Returns:
        -------
            bool: True if the client window is active, False otherwise.
        )r   r'   s    r   	is_activezClientWindowInfo.is_activel   r0   r   datac                      | |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d      |j                  d            S )	a  Creates a ClientWindowInfo instance from a dictionary.

        Parameters:
        -----------
            data: A dictionary containing the client window information.

        Returns:
        -------
            ClientWindowInfo: A new instance of ClientWindowInfo.
        clientWindowr   r   r   r   r   r   r"   )get)clsr8   s     r   	from_dictzClientWindowInfo.from_dictu   sc     ((>2((7#((7#88H%hhsmhhsm88H%
 	
r   N)r   r   r   r   strintboolr$   r(   r+   r-   r/   r2   r5   r7   classmethodr   r=   r   r   r   r   r   !   s    1  	
    $3 "3 "3 C s s 4  
T 
&8 
 
r   r   c                   V    e Zd ZdZd ZdefdZdee   fdZdeddfdZ	dee
   fd	Zy)
Browserz4
    BiDi implementation of the browser module.
    c                     || _         y r!   )conn)r#   rE   s     r   r$   zBrowser.__init__   s	    	r   r%   c                 V    | j                   j                  t        di             }|d   S )z{Creates a new user context.

        Returns:
        -------
            str: The ID of the created user context.
        zbrowser.createUserContextuserContextrE   executer   )r#   results     r   create_user_contextzBrowser.create_user_context   s,     ""?3NPR#STm$$r   c                     | j                   j                  t        di             }|d   D cg c]  }|d   	 c}S c c}w )zuGets all user contexts.

        Returns:
        -------
            List[str]: A list of user context IDs.
        zbrowser.getUserContextsuserContextsrG   rH   )r#   rJ   context_infos      r   get_user_contextszBrowser.get_user_contexts   s>     ""?3Lb#QR@F~@VW]+WWWs   <user_context_idNc                 v    |dk(  rt        d      d|i}| j                  j                  t        d|             y)zRemoves a user context.

        Parameters:
        -----------
            user_context_id: The ID of the user context to remove.

        Raises:
        ------
            Exception: If the user context ID is "default" or does not exist.
        defaultz&Cannot remove the default user contextrG   zbrowser.removeUserContextN)	ExceptionrE   rI   r   )r#   rP   paramss      r   remove_user_contextzBrowser.remove_user_context   s<     i'DEE1		/*EvNOr   c                     | j                   j                  t        di             }|d   D cg c]  }t        j	                  |       c}S c c}w )zGets all client windows.

        Returns:
        -------
            List[ClientWindowInfo]: A list of client window information.
        zbrowser.getClientWindowsclientWindows)rE   rI   r   r   r=   )r#   rJ   windows      r   get_client_windowszBrowser.get_client_windows   sE     ""?3Mr#RSAGAXYv **62YYYs   A)r   r   r   r   r$   r>   rK   r   rO   rU   r   rY   r   r   r   rC   rC      sT    %S %X49 XP3 P4 P"ZD)9$: Zr   rC   N)typingr   r   %selenium.webdriver.common.bidi.commonr   r   r   rC   r   r   r   <module>r\      s3   $   A h
 h
V5Z 5Zr   