Ë
    `§1h—   ã                   ón   — 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 d dlmZ  G d„ d	e«      Zy
)é    )ÚOptional)ÚChromiumRemoteConnection)ÚDriverFinder)Ú
ArgOptions)ÚService)ÚCommand)Ú	WebDriverc                   ó(  ‡ — e Zd ZdZdd e«       ddfdee   dee   dedee   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d!ˆ fd„Zd„ Zd „ Zˆ xZS )"ÚChromiumDriverzZControls the WebDriver instance of ChromiumDriver and allows you to
    drive the browser.NTÚbrowser_nameÚvendor_prefixÚoptionsÚserviceÚ
keep_aliveÚreturnc                 ó  •— || _         t        | j                   |«      }|j                  «       r|j                  «       |_        d|_        | j                   j                  «       xs |j                  «       | j                   _        | j                   j                  «        t        | j                   j                  ||||j                  ¬«      }	 t        ‰| �5  ||¬«       d| _        y# t        $ r | j                  «        ‚ w xY w)aU  Creates a new WebDriver instance of the ChromiumDriver. Starts the
        service and then creates new WebDriver instance of ChromiumDriver.

        :Args:
         - browser_name - Browser name used when matching capabilities.
         - vendor_prefix - Company prefix to apply to vendor-specific WebDriver extension commands.
         - options - this takes an 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   F)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Ú
_is_remote)	Úselfr   r   r   r   r   ÚfinderÚexecutorÚ	__class__s	           €úc/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.pyr    zChromiumDriver.__init__    sÞ   ø€ ð$ ˆŒä˜dŸl™l¨GÓ4ˆØ×"Ñ"Ô$Ø&,×&=Ñ&=Ó&?ˆGÔ#Ø&*ˆGÔ#à ŸL™L×1Ñ1Ó3ÒO°v×7MÑ7MÓ7Oˆ�‰ÔØ�‰×ÑÔä+Ø#Ÿ|™|×7Ñ7Ø%Ø'Ø!Ø ×4Ñ4ô
ˆð	Ü‰GÑ¨hÀÐÔHð
  ˆ�øô	 ò 	Ø�I‰IŒKØð	ús   ÃC( Ã(Dc                 ó*   — | j                  dd|i«      S )z&Launches Chromium app specified by id.Ú	launchAppÚid©Úexecute)r$   r+   s     r(   Ú
launch_appzChromiumDriver.launch_appL   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, 'offline': False}
        ÚgetNetworkConditionsÚvaluer,   ©r$   s    r(   Úget_network_conditionsz%ChromiumDriver.get_network_conditionsP   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.

        :Usage:
            ::

                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$   r7   s     r(   Úset_network_conditionsz%ChromiumDriver.set_network_conditionsY   s   € ð$ 	�‰Ð+Ð.BÐDVÐ-WÕXr/   c                 ó&   — | j                  d«       y)z+Resets Chromium network emulation settings.ÚdeleteNetworkConditionsNr,   r3   s    r(   Údelete_network_conditionsz(ChromiumDriver.delete_network_conditionsm   s   € à�‰Ð.Õ/r/   Únamer2   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

        :Usage:
            ::

                driver.set_permissions("clipboard-read", "denied")
        ÚsetPermissionsr<   )Ú
descriptorÚstateNr,   )r$   r<   r2   s      r(   Úset_permissionszChromiumDriver.set_permissionsq   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, refer to link
        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
        :Usage:
            ::

                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$   rB   rC   r'   s      €r(   rE   zChromiumDriver.execute_cdp_cmd   s   ø€ ô$ ‰wÑ& s¨HÓ5Ð5r/   c                 ó*   — | j                  d«      d   S )z-:Returns: A list of sinks available for Cast.ÚgetSinksr2   r,   r3   s    r(   Ú	get_sinkszChromiumDriver.get_sinks“   s   € à�|‰|˜JÓ'¨Ñ0Ð0r/   c                 ó*   — | j                  d«      d   S )zM:Returns: An error message when there is any issue in a Cast
        session.ÚgetIssueMessager2   r,   r3   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
        r2   )r-   r   ÚGET_AVAILABLE_LOG_TYPESr3   s    r(   Ú	log_typeszChromiumDriver.log_typesœ   s   € ð �|‰|œG×;Ñ;Ó<¸WÑEÐEr/   c                 óL   — | j                  t        j                  d|i«      d   S )aY  Gets the log for a given log type.

        Parameters:
        -----------
        log_type : str
            - 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")
        Útyper2   )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¦Sets a specific sink, using its name, as a Cast session receiver
        target.

        :Args:
         - sink_name: Name of the sink to use as the target.
        ÚsetSinkToUseÚsinkNamer,   ©r$   rT   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.
        ÚstartDesktopMirroringrW   r,   rX   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.
        ÚstartTabMirroringrW   r,   rX   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.
        ÚstopCastingrW   r,   rX   s     r(   Ústop_castingzChromiumDriver.stop_castingÐ   s   € ð �|‰|˜M¨J¸	Ð+BÓCÐCr/   c                 ó´   •— 	 t         ‰| �  «        | j                  j	                  «        y# t        $ r Y Œ&w xY w# | j                  j	                  «        w xY w)z@Closes the browser and shuts down the ChromiumDriver executable.N)r   r"   r!   r   Ústop)r$   r'   s    €r(   r"   zChromiumDriver.quitØ   sJ   ø€ ð	 Ü‰G‰LŒNð
 �L‰L×ÑÕøô	 ò 	áð	ûð �L‰L×ÑÕús   ƒ, ¬	8µ; ·8¸; »Ac                 ó   — t         ‚©N©ÚNotImplementedError©r$   ÚargsÚkwargss      r(   Údownload_filezChromiumDriver.download_fileâ   ó   € Ü!Ð!r/   c                 ó   — t         ‚rf   rg   ri   s      r(   Úget_downloadable_filesz%ChromiumDriver.get_downloadable_fileså   rm   r/   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ústrr   Úboolr    r.   r4   r8   r;   rA   ÚdictrE   ÚlistrH   rK   ÚpropertyrN   rS   rY   r\   r_   rb   r"   rl   ro   Ú__classcell__)r'   s   @r(   r   r      sB  ø„ ñð
 '+Ø'+Ù(›lØ%)Øñ* à˜s‘mð* ð   ‘}ð* ð ð	* ð
 ˜'Ñ"ð* ð ð* ð 
õ* òX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)Útypingr   Ú-selenium.webdriver.chromium.remote_connectionr   Ú'selenium.webdriver.common.driver_finderr   Ú!selenium.webdriver.common.optionsr   Ú!selenium.webdriver.common.servicer   Ú!selenium.webdriver.remote.commandr   Ú#selenium.webdriver.remote.webdriverr	   ÚRemoteWebDriverr   © r/   r(   ú<module>rƒ      s*   ðõ$ å RÝ @Ý 8Ý 5Ý 5Ý LôJ"�_õ J"r/   