Ë
    `§1h  ã                   ó^   — d dl Z d dlZd dlmZmZmZmZmZ d dlm	Z	 d dl
mZ  G d„ de«      Zy)é    N)ÚBinaryIOÚDictÚListÚOptionalÚUnion)ÚDesiredCapabilities)Ú
ArgOptionsc            	       óN  ‡ — e Zd ZdZdˆ fd„Zedefd„«       Zej                  deddfd„«       Zede	e   fd„«       Z
e
j                  deddfd	„«       Z
edee   fd
„«       Zdeddfd„Zdeddfd„Zedefd„«       Zdedeeeeee   f   ddfd„Zdefd„Zedefd„«       Zˆ xZS )ÚChromiumOptionszgoog:chromeOptionsÚreturnNc                 óh   •— t         ‰| �  «        d| _        g | _        g | _        i | _        d | _        y )NÚ )ÚsuperÚ__init__Ú_binary_locationÚ_extension_filesÚ_extensionsÚ_experimental_optionsÚ_debugger_address)ÚselfÚ	__class__s    €úa/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/selenium/webdriver/chromium/options.pyr   zChromiumOptions.__init__   s6   ø€ Ü‰ÑÔØ%'ˆÔØ+-ˆÔØ&(ˆÔØRTˆÔ"Ø04ˆÕó    c                 ó   — | j                   S )z@:Returns: The location of the binary, otherwise an empty string.)r   ©r   s    r   Úbinary_locationzChromiumOptions.binary_location%   s   € ð ×$Ñ$Ð$r   Úvaluec                 ó\   — t        |t        «      st        | j                  «      ‚|| _        y)zyAllows you to set where the chromium binary lives.

        :Args:
         - value: path to the Chromium binary
        N)Ú
isinstanceÚstrÚ	TypeErrorÚBINARY_LOCATION_ERRORr   ©r   r   s     r   r   zChromiumOptions.binary_location*   s'   € ô ˜%¤Ô%Ü˜D×6Ñ6Ó7Ð7Ø %ˆÕr   c                 ó   — | j                   S )z6:Returns: The address of the remote devtools instance.)r   r   s    r   Údebugger_addressz ChromiumOptions.debugger_address5   s   € ð ×%Ñ%Ð%r   c                 óH   — t        |t        «      st        d«      ‚|| _        y)zúAllows you to set the address of the remote devtools instance that
        the ChromeDriver instance will try to connect to during an active wait.

        :Args:
         - value: address of remote devtools instance if any (hostname[:port])
        z!Debugger Address must be a stringN)r   r    r!   r   r#   s     r   r%   z ChromiumOptions.debugger_address:   s"   € ô ˜%¤Ô%ÜÐ?Ó@Ð@Ø!&ˆÕr   c                 óÖ   — dt         dt        fd„}g }| j                  D ].  }t        |d«      5 }|j	                   ||«      «       ddd«       Œ0 || j
                  z   S # 1 sw Y   ŒIxY w)z;:Returns: A list of encoded extensions that will be loaded.Ú	file_datar   c                 óf   — t        j                  | j                  «       «      j                  d«      S )Nzutf-8)Úbase64Ú	b64encodeÚreadÚdecode)r(   s    r   Ú_decodez+ChromiumOptions.extensions.<locals>._decodeJ   s'   € ô ×#Ñ# I§N¡NÓ$4Ó5×<Ñ<¸WÓEÐEr   ÚrbN)r   r    r   ÚopenÚappendr   )r   r.   Úencoded_extensionsÚ	extensionÚfs        r   Ú
extensionszChromiumOptions.extensionsF   s€   € ð	Fœxð 	F¬Có 	Fð  ÐØ×.Ñ.ò 	6ˆIÜ�i Ó&ð 6¨!Ø"×)Ñ)©'°!«*Ô5÷6ð 6ð	6ð " D×$4Ñ$4Ñ4Ð4÷6ð 6ús   ®AÁA(	r3   c                 ó   — |r‚t         j                  j                  t         j                  j                  |«      «      }t         j                  j	                  |«      r| j
                  j                  |«       yt        d«      ‚t        d«      ‚)z¬Adds the path to the extension to a list that will be used to
        extract it to the ChromeDriver.

        :Args:
         - extension: path to the \*.crx file
        z#Path to the extension doesn't existúargument can not be nullN)	ÚosÚpathÚabspathÚ
expanduserÚexistsr   r1   ÚOSErrorÚ
ValueError)r   r3   Úextension_to_adds      r   Úadd_extensionzChromiumOptions.add_extensionW   sg   € ñ Ü!Ÿw™wŸ™¬r¯w©w×/AÑ/AÀ)Ó/LÓMÐÜ�w‰w�~‰~Ð.Ô/Ø×%Ñ%×,Ñ,Ð-=Õ>äÐCÓDÐDäÐ7Ó8Ð8r   c                 óT   — |r| j                   j                  |«       yt        d«      ‚)zÎAdds Base64 encoded string with extension data to a list that will
        be used to extract it to the ChromeDriver.

        :Args:
         - extension: Base64 encoded string with extension data
        r7   N)r   r1   r>   )r   r3   s     r   Úadd_encoded_extensionz%ChromiumOptions.add_encoded_extensiong   s'   € ñ Ø×Ñ×#Ñ# IÕ.äÐ7Ó8Ð8r   c                 ó   — | j                   S )z<:Returns: A dictionary of experimental options for chromium.©r   r   s    r   Úexperimental_optionsz$ChromiumOptions.experimental_optionss   s   € ð ×)Ñ)Ð)r   Únamec                 ó"   — || j                   |<   y)z¢Adds an experimental option which is passed to chromium.

        :Args:
          name: The experimental option name.
          value: The option value.
        NrD   )r   rF   r   s      r   Úadd_experimental_optionz'ChromiumOptions.add_experimental_optionx   s   € ð ,1ˆ×"Ñ" 4Ò(r   c                 óf  — | j                   }| j                  j                  «       }| j                  r|j	                  | j                  «       | j
                  |d<   | j                  r| j                  |d<   | j                  |d<   | j                  r| j                  |d<   ||| j                  <   |S )znCreates a capabilities with all the options that have been set
        :Returns: A dictionary with everything.r5   ÚbinaryÚargsÚdebuggerAddress)
Ú_capsrE   ÚcopyÚmobile_optionsÚupdater5   r   Ú
_argumentsr%   ÚKEY)r   ÚcapsÚchrome_optionss      r   Úto_capabilitieszChromiumOptions.to_capabilities�   sŸ   € ð �z‰zˆØ×2Ñ2×7Ñ7Ó9ˆØ×ÒØ×!Ñ! $×"5Ñ"5Ô6Ø'+§¡ˆ�|Ñ$Ø×ÒØ'+×';Ñ';ˆN˜8Ñ$Ø!%§¡ˆ�vÑØ× Ò Ø04×0EÑ0EˆNÐ,Ñ-à'ˆˆT�X‰X‰àˆr   c                 ó>   — t         j                  j                  «       S )N)r   ÚCHROMErN   r   s    r   Údefault_capabilitiesz$ChromiumOptions.default_capabilities“   s   € ä"×)Ñ)×.Ñ.Ó0Ð0r   )r   N)Ú__name__Ú
__module__Ú__qualname__rR   r   Úpropertyr    r   Úsetterr   r%   r   r5   r@   rB   ÚdictrE   r   ÚintrH   rU   rX   Ú__classcell__)r   s   @r   r   r      sL  ø„ Ø
€Cõ5ð ð% ò %ó ð%ð ×Ñð& Sð &¨Tò &ó ð&ð ð& (¨3¡-ò &ó ð&ð ×Ñð	' cð 	'¨dò 	'ó ð	'ð ð5˜D ™Iò 5ó ð5ð 9 sð 9¨tó 9ð 
9¨sð 
9°tó 
9ð ð* dò *ó ð*ð1¨Cð 1¸¸cÀ3ÈÈdÐSVÉiÐ>WÑ8Xð 1Ð]aó 1ð ó ð$ ð1 dò 1ó ô1r   r   )r*   r8   Útypingr   r   r   r   r   Ú.selenium.webdriver.common.desired_capabilitiesr   Ú!selenium.webdriver.common.optionsr	   r   © r   r   ú<module>re      s'   ðó$ Û 	ß 8Õ 8å NÝ 8ô{1�jõ {1r   