Ë
    bQbj  ã                   ób   — d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ  G d„ de	«      Zy	)
é    )ÚChromiumOptions)ÚChromiumRemoteConnection)ÚChromiumService)ÚDriverFinder)ÚLocalWebDriver)ÚCommandc                   óü   ‡ — e Zd ZdZ	 	 	 ddedededz  dedz  deddfˆ fd	„Zd
„ Z	d„ Z
dd„Zdd„Zdededdfd„Zdedefˆ fd„Zdefd„Zd„ Zed„ «       Zd„ Zdedefd„Zdedefd„Zdedefd„Zdedefd„Zˆ xZS )ÚChromiumDriverzGControl the WebDriver instance of ChromiumDriver and drive the browser.NÚbrowser_nameÚvendor_prefixÚoptionsÚserviceÚ
keep_aliveÚreturnc                 ó   •— |r|n	t        «       | _        |r|n	t        «       | _        t	        | j                  | j                  «      }|j                  «       r0|j                  «       | j                  _        d| j                  _        | j                  j                  «       xs |j                  «       | j                  _
        | j                  j                  «        t        | j                  j                  |||| j                  j                  ¬«      }	 t        ‰| �A  || j                  ¬«       y# t"        $ r | j%                  «        ‚ w xY w)a  Create a new WebDriver instance, start the service, and create new ChromiumDriver instance.

        Args:
            browser_name: Browser name used when matching capabilities.
            vendor_prefix: Company prefix to apply to vendor-specific WebDriver extension commands.
            options: Instance of ChromiumOptions.
            service: Service object for handling the browser driver if you need to pass extra details.
            keep_alive: Whether to configure ChromiumRemoteConnection to use HTTP keep-alive.
        N)Úremote_server_addrr   r   r   Úignore_proxy)Úcommand_executorr   )r   r   r   r   r   Úget_browser_pathÚbinary_locationÚbrowser_versionÚenv_pathÚget_driver_pathÚpathÚstartr   Úservice_urlÚ_ignore_local_proxyÚsuperÚ__init__Ú	ExceptionÚquit)	Úselfr   r   r   r   r   ÚfinderÚexecutorÚ	__class__s	           €úX/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.pyr   zChromiumDriver.__init__   sü   ø€ ñ" #*‘w¬Ó/@ˆŒÙ")‘w¬Ó/@ˆŒä˜dŸl™l¨D¯L©LÓ9ˆØ×"Ñ"Ô$Ø+1×+BÑ+BÓ+DˆD�L‰LÔ(Ø+/ˆD�L‰LÔ(à ŸL™L×1Ñ1Ó3ÒO°v×7MÑ7MÓ7Oˆ�‰ÔØ�‰×ÑÔä+Ø#Ÿ|™|×7Ñ7Ø%Ø'Ø!ØŸ™×9Ñ9ô
ˆð	Ü‰GÑ¨hÀÇÁÐÕMøÜò 	Ø�I‰IŒKØð	ús   ÄD2 Ä2Ec                 ó*   — | j                  dd|i«      S )ztLaunches Chromium app specified by id.

        Args:
            id: The id of the Chromium app to launch.
        Ú	launchAppÚid©Úexecute)r"   r)   s     r&   Ú
launch_appzChromiumDriver.launch_appG   s   € ð �|‰|˜K¨$°¨Ó4Ð4ó    c                 ó*   — | j                  d«      d   S )z¦Gets Chromium network emulation settings.

        Returns:
            A dict. For example: {'latency': 4, 'download_throughput': 2, 'upload_throughput': 2}
        ÚgetNetworkConditionsÚvaluer*   ©r"   s    r&   Úget_network_conditionsz%ChromiumDriver.get_network_conditionsO   s   € ð �|‰|Ð2Ó3°GÑ<Ð<r-   c                 ó,   — | j                  dd|i«       y)a  Sets Chromium network emulation settings.

        Args:
            **network_conditions: A dict with conditions specification.

        Example:
            driver.set_network_conditions(
                offline=False,
                latency=5,  # additional latency (ms)
                download_throughput=500 * 1024,  # maximal throughput
                upload_throughput=500 * 1024,
            )  # maximal throughput

            Note: `throughput` can be used to set both (for download and upload).
        ÚsetNetworkConditionsÚnetwork_conditionsNr*   )r"   r5   s     r&   Úset_network_conditionsz%ChromiumDriver.set_network_conditionsW   s   € ð  	�‰Ð+Ð.BÐDVÐ-WÕXr-   c                 ó&   — | j                  d«       y)z+Resets Chromium network emulation settings.ÚdeleteNetworkConditionsNr*   r1   s    r&   Údelete_network_conditionsz(ChromiumDriver.delete_network_conditionsi   s   € à�‰Ð.Õ/r-   Únamer0   c                 ó2   — | j                  dd|i|dœ«       y)zéSets Applicable Permission.

        Args:
            name: The item to set the permission on.
            value: The value to set on the item

        Example:
            driver.set_permissions("clipboard-read", "denied")
        ÚsetPermissionsr:   )Ú
descriptorÚstateNr*   )r"   r:   r0   s      r&   Úset_permissionszChromiumDriver.set_permissionsm   s   € ð 	�‰Ð%°v¸t°nÈuÑ'UÕVr-   ÚcmdÚcmd_argsc                 ó$   •— t         ‰| �  ||«      S )a²  Execute Chrome Devtools Protocol command and get returned result.

        The command and command args should follow chrome devtools protocol domains/commands

        See:
          - https://chromedevtools.github.io/devtools-protocol/

        Args:
            cmd: A str, command name
            cmd_args: A dict, command args. empty dict {} if there is no command args

        Example:
            `driver.execute_cdp_cmd('Network.getResponseBody', {'requestId': requestId})`

        Returns:
            A dict, empty dict {} if there is no result to return.
            For example to getResponseBody:
            {'base64Encoded': False, 'body': 'response body string'}
        )r   Úexecute_cdp_cmd)r"   r@   rA   r%   s      €r&   rC   zChromiumDriver.execute_cdp_cmdy   s   ø€ ô( ‰wÑ& s¨HÓ5Ð5r-   c                 ó*   — | j                  d«      d   S )z'Get a list of sinks available for Cast.ÚgetSinksr0   r*   r1   s    r&   Ú	get_sinkszChromiumDriver.get_sinks�   s   € à�|‰|˜JÓ'¨Ñ0Ð0r-   c                 ó*   — | j                  d«      d   S )zCReturns an error message when there is any issue in a Cast session.ÚgetIssueMessager0   r*   r1   s    r&   Úget_issue_messagez ChromiumDriver.get_issue_message“   s   € à�|‰|Ð-Ó.¨wÑ7Ð7r-   c                 óF   — | j                  t        j                  «      d   S )zpGets a list of the available log types.

        Example:
        --------
        >>> driver.log_types
        r0   )r+   r   ÚGET_AVAILABLE_LOG_TYPESr1   s    r&   Ú	log_typeszChromiumDriver.log_types—   s   € ð �|‰|œG×;Ñ;Ó<¸WÑEÐEr-   c                 óL   — | j                  t        j                  d|i«      d   S )a/  Gets the log for a given log type.

        Args:
            log_type: Type of log that which will be returned

        Example:
            >>> driver.get_log("browser")
            >>> driver.get_log("driver")
            >>> driver.get_log("client")
            >>> driver.get_log("server")
        Útyper0   )r+   r   ÚGET_LOG)r"   Úlog_types     r&   Úget_logzChromiumDriver.get_log¡   s#   € ð �|‰|œGŸO™O¨f°hÐ-?Ó@ÀÑIÐIr-   Ú	sink_namec                 ó*   — | j                  dd|i«      S )zŒSet a specific sink as a Cast session receiver target.

        Args:
            sink_name: Name of the sink to use as the target.
        ÚsetSinkToUseÚsinkNamer*   ©r"   rR   s     r&   Úset_sink_to_usezChromiumDriver.set_sink_to_use¯   s   € ð �|‰|˜N¨Z¸Ð,CÓDÐDr-   c                 ó*   — | j                  dd|i«      S )z—Starts a desktop mirroring session on a specific receiver target.

        Args:
            sink_name: Name of the sink to use as the target.
        ÚstartDesktopMirroringrU   r*   rV   s     r&   Ústart_desktop_mirroringz&ChromiumDriver.start_desktop_mirroring·   s   € ð �|‰|Ð3°jÀ)Ð5LÓMÐMr-   c                 ó*   — | j                  dd|i«      S )z“Starts a tab mirroring session on a specific receiver target.

        Args:
            sink_name: Name of the sink to use as the target.
        ÚstartTabMirroringrU   r*   rV   s     r&   Ústart_tab_mirroringz"ChromiumDriver.start_tab_mirroring¿   s   € ð �|‰|Ð/°*¸iÐ1HÓIÐIr-   c                 ó*   — | j                  dd|i«      S )z˜Stops the existing Cast session on a specific receiver target.

        Args:
            sink_name: Name of the sink to stop the Cast session.
        ÚstopCastingrU   r*   rV   s     r&   Ústop_castingzChromiumDriver.stop_castingÇ   s   € ð �|‰|˜M¨J¸	Ð+BÓCÐCr-   )NNT)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   r   Úboolr   r,   r2   r6   r9   r?   ÚdictrC   ÚlistrF   rI   ÚpropertyrL   rQ   rW   rZ   r]   r`   Ú__classcell__)r%   s   @r&   r
   r
      s&  ø„ ÙQð +/Ø*.Øñ(àð(ð ð(ð ! 4Ñ'ð	(ð
 ! 4Ñ'ð(ð ð(ð 
õ(òT5ò=óYó$0ð
W Cð 
W°ð 
W¸ó 
Wð6 3ð 6°$õ 6ð,1˜4ó 1ò8ð ñFó ðFòJðE¨ð E°ó EðN°ð N¸ó NðJ¨Sð J°Tó JðD cð D¨d÷ Dr-   r
   N)Ú#selenium.webdriver.chromium.optionsr   Ú-selenium.webdriver.chromium.remote_connectionr   Ú#selenium.webdriver.chromium.servicer   Ú'selenium.webdriver.common.driver_finderr   Ú#selenium.webdriver.common.webdriverr   Ú!selenium.webdriver.remote.commandr   r
   © r-   r&   ú<module>rr      s*   ðõ$ @Ý RÝ ?Ý @Ý >Ý 5ôsD�^õ sDr-   