Ë
    cQbj1  ã                   óê   — d dl Z d dlmZmZ d dlmZ d dlmZ d dlm	Z	  G d„ de
e«      Z G d„ d	«      Z G d
„ d«      Z G d„ d«      Z G d„ d«      Z G d„ d«      Z G d„ de¬«      Z G d„ de«      Zy)é    N)ÚABCMetaÚabstractmethod)ÚEnum)ÚInvalidArgumentException)ÚProxyc                   ó   — e Zd ZdZdZdZdZy)ÚPageLoadStrategya†  Enum of possible page load strategies.

    Selenium support following strategies:
        * normal (default) - waits for all resources to download
        * eager - DOM access is ready, but other resources like images may still be loading
        * none - does not block `WebDriver` at all

    Docs: https://www.selenium.dev/documentation/webdriver/drivers/options/#pageloadstrategy.
    ÚnormalÚeagerÚnoneN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   © ó    úT/var/www/html/venv/lib/python3.12/site-packages/selenium/webdriver/common/options.pyr	   r	      s   „ ñð €FØ€EØ�Dr   r	   c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)Ú_BaseOptionsDescriptorc                 ó   — || _         y ©N©Úname©Úselfr   s     r   Ú__init__z_BaseOptionsDescriptor.__init__+   ó	   € Øˆ�	r   c                 óÄ  — | j                   dk(  r1|j                  j                  d«      }|du xs t        |t        «      S | j                   dk(  r9|j                  j                  | j                   «      }t        |t        «      sd S |S | j                   dv r&|j                  j                  | j                   d«      S |j                  j                  | j                   «      S )NÚ
enableBidiÚwebSocketUrlT)ÚacceptInsecureCertsÚstrictFileInteractabilityÚsetWindowRectúse:downloadsEnabledF)r   Ú_capsÚgetÚ
isinstanceÚstr)r   ÚobjÚclsÚvalues       r   Ú__get__z_BaseOptionsDescriptor.__get__.   s©   € Ø�9‰9˜Ò$à—I‘I—M‘M .Ó1ˆEØ˜D�=Ò:¤J¨u´cÓ$:Ð:Ø�9‰9˜Ò&à—I‘I—M‘M $§)¡)Ó,ˆEÜ)¨%´Ô5�4Ð@¸5Ð@Ø�9‰9ÐtÑtØ—9‘9—=‘= §¡¨EÓ2Ð2Ø�y‰y�}‰}˜TŸY™YÓ'Ð'r   c                 ó€   — | j                   dk(  r|j                  d|«       y |j                  | j                   |«       y )Nr   r    )r   Úset_capability©r   r)   r+   s      r   Ú__set__z_BaseOptionsDescriptor.__set__;   s2   € Ø�9‰9˜Ò$Ø×Ñ˜~¨uÕ5à×Ñ˜tŸy™y¨%Õ0r   N)r   r   r   r   r,   r0   r   r   r   r   r   *   s   „ òò(ó1r   r   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_PageLoadStrategyDescriptorzðDetermines the point at which a navigation command is returned.

    See:
      - https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies.

    Args:
        strategy: the strategy corresponding to a document readiness state
    c                 ó   — || _         y r   r   r   s     r   r   z$_PageLoadStrategyDescriptor.__init__L   r   r   c                 óL   — |j                   j                  | j                  «      S r   ©r%   r&   r   ©r   r)   r*   s      r   r,   z#_PageLoadStrategyDescriptor.__get__O   ó   € Ø�y‰y�}‰}˜TŸY™YÓ'Ð'r   c                 óZ   — |dv r|j                  | j                  |«       y t        d«      ‚)N)r
   r   r   z>Strategy can only be one of the following: normal, eager, none©r.   r   Ú
ValueErrorr/   s      r   r0   z#_PageLoadStrategyDescriptor.__set__R   s+   € ØÐ/Ñ/Ø×Ñ˜tŸy™y¨%Õ0äÐ]Ó^Ð^r   N©r   r   r   r   r   r,   r0   r   r   r   r2   r2   B   s   „ ñòò(ó_r   r2   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú"_UnHandledPromptBehaviorDescriptora{  How the driver should respond when an alert is present and the command sent is not handling the alert.

    See:
      - https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies:

    Args:
        behavior: behavior to use when an alert is encountered

    Returns:
        Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)
    c                 ó   — || _         y r   r   r   s     r   r   z+_UnHandledPromptBehaviorDescriptor.__init__f   r   r   c                 óL   — |j                   j                  | j                  «      S r   r5   r6   s      r   r,   z*_UnHandledPromptBehaviorDescriptor.__get__i   r7   r   c                 óZ   — |dv r|j                  | j                  |«       y t        d«      ‚)N)ÚdismissÚacceptzdismiss and notifyzaccept and notifyÚignoreziBehavior can only be one of the following: dismiss, accept, dismiss and notify, accept and notify, ignorer9   r/   s      r   r0   z*_UnHandledPromptBehaviorDescriptor.__set__l   s1   € ØÐ^Ñ^Ø×Ñ˜tŸy™y¨%Õ0äð,óð r   Nr;   r   r   r   r=   r=   Y   s   „ ñ
òò(ór   r=   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_TimeoutsDescriptorag  How long the driver should wait for actions to complete before returning an error.

    See:
      - https://w3c.github.io/webdriver/#timeouts

    Args:
        timeouts: values in milliseconds for implicit wait, page load and script timeout

    Returns:
        Values for implicit timeout, pageLoad timeout and script timeout if set (in milliseconds)
    c                 ó   — || _         y r   r   r   s     r   r   z_TimeoutsDescriptor.__init__ƒ   r   r   c                 óL   — |j                   j                  | j                  «      S r   r5   r6   s      r   r,   z_TimeoutsDescriptor.__get__†   r7   r   c                 ó’   — t        d„ |j                  «       D «       «      r|j                  | j                  |«       y t	        d«      ‚)Nc              3   ó$   K  — | ]  }|d v –— Œ
 y­w))ÚimplicitÚpageLoadÚscriptNr   )Ú.0Úxs     r   ú	<genexpr>z._TimeoutsDescriptor.__set__.<locals>.<genexpr>Š   s   è ø€ ÒM¸1ˆqÐ6Ô6ÑMùs   ‚zITimeout keys can only be one of the following: implicit, pageLoad, script)ÚallÚkeysr.   r   r:   r/   s      r   r0   z_TimeoutsDescriptor.__set__‰   s6   € ÜÑMÀÇ
Á
ÃÔMÔMØ×Ñ˜tŸy™y¨%Õ0äÐhÓiÐir   Nr;   r   r   r   rE   rE   v   s   „ ñ
òò(ójr   rE   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)Ú_ProxyDescriptorz^Descriptor for proxy property access.

    Returns:
        Proxy if set, otherwise None.
    c                 ó   — || _         y r   r   r   s     r   r   z_ProxyDescriptor.__init__—   r   r   c                 ó   — |j                   S r   )Ú_proxyr6   s      r   r,   z_ProxyDescriptor.__get__š   s   € Ø�z‰zÐr   c                 ó–   — t        |t        «      st        d«      ‚||_        |j	                  «       |j
                  | j                  <   y )Nz$Only Proxy objects can be passed in.)r'   r   r   rV   Úto_capabilitiesr%   r   r/   s      r   r0   z_ProxyDescriptor.__set__�   s:   € Ü˜%¤Ô'Ü*Ð+QÓRÐRØˆŒ
Ø$×4Ñ4Ó6ˆ�	‰	�$—)‘)Òr   Nr;   r   r   r   rS   rS   �   s   „ ñòòó7r   rS   c            	       óx  ‡ — e Zd ZdZ ed«      Z	  ed«      Z	  ed«      Z	  ed«      Z	  ed«      Z		  ed«      Z
	  ed«      Z	  ed	«      Z	  ed
«      Z	  ed«      Z	  ed«      Z	  ed«      Z	 dˆ fd„Zed„ «       Zdd„Z	 	 	 ddedz  dedz  dedz  ddfd„Zed„ «       Zeed„ «       «       Zdd„Zˆ xZS )ÚBaseOptionsz*Base class for individual browser options.ÚbrowserVersionÚplatformNamer!   r"   r#   r   ÚpageLoadStrategyÚunhandledPromptBehaviorÚtimeoutsÚproxyr$   r    ÚreturnNc                 ó®   •— t         ‰| �  «        | j                  | _        d | _        | j                  dt        j                  «       d | _        d| _	        y )Nr]   F)
Úsuperr   Údefault_capabilitiesr%   rV   r.   r	   r
   Úmobile_optionsÚ_ignore_local_proxy©r   Ú	__class__s    €r   r   zBaseOptions.__init__O  sJ   ø€ Ü‰ÑÔØ×.Ñ.ˆŒ
ØˆŒØ×ÑÐ.Ô0@×0GÑ0GÔHØ59ˆÔØ#(ˆÕ r   c                 ó   — | j                   S r   ©r%   ©r   s    r   ÚcapabilitieszBaseOptions.capabilitiesW  s   € à�z‰zÐr   c                 ó"   — || j                   |<   y)zSets a capability.Nrj   )r   r   r+   s      r   r.   zBaseOptions.set_capability[  s   € à ˆ�
‰
�4Òr   Úandroid_packageÚandroid_activityÚdevice_serialc                 óv   — |st        d«      ‚d|i| _        |r|| j                  d<   |r|| j                  d<   yy)a	  Enables mobile browser use for browsers that support it.

        Args:
            android_package: The name of the android package to start
            android_activity: The name of the android activity
            device_serial: The device serial number
        z!android_package must be passed inÚandroidPackageÚandroidActivityÚandroidDeviceSerialN)ÚAttributeErrorre   )r   rn   ro   rp   s       r   Úenable_mobilezBaseOptions.enable_mobile_  sM   € ñ Ü Ð!DÓEÐEØ/°ÐAˆÔÙØ5EˆD×ÑÐ 1Ñ2ÙØ9FˆD×ÑÐ 5Ò6ð r   c                  ó   — y)z-Convert options into capabilities dictionary.Nr   rk   s    r   rX   zBaseOptions.to_capabilitiest  ó   � r   c                  ó   — y)z6Return minimal capabilities necessary as a dictionary.Nr   rk   s    r   rd   z BaseOptions.default_capabilitiesx  rx   r   c                 ó   — d| _         y)z8Ignore HTTP_PROXY and HTTPS_PROXY environment variables.TN)rf   rk   s    r   Ú(ignore_local_proxy_environment_variablesz4BaseOptions.ignore_local_proxy_environment_variables}  s
   € à#'ˆÕ r   ©ra   N)NNN) r   r   r   r   r   Úbrowser_versionÚplatform_nameÚaccept_insecure_certsÚstrict_file_interactabilityÚset_window_rectÚenable_bidir2   Úpage_load_strategyr=   Úunhandled_prompt_behaviorrE   r_   rS   r`   Úenable_downloadsÚweb_socket_urlr   Úpropertyrl   r.   r(   rv   r   rX   rd   r{   Ú__classcell__©rh   s   @r   rZ   rZ   ¤   sx  ø„ Ù4á,Ð-=Ó>€Oðñ +¨>Ó:€Mðñ 3Ð3HÓIÐðñ #9Ð9TÓ"UÐðñ -¨_Ó=€Oðñ )¨Ó6€Kðñ 5Ð5GÓHÐðñ !CÐC\Ó ]Ððñ # :Ó.€Hðñ ˜WÓ%€Eðñ .Ð.CÓDÐðñ ,¨NÓ;€Nðõ)ð ñó ðó!ð '+Ø'+Ø$(ñ	Gà˜t™ðGð  ™*ðGð ˜T‘zð	Gð
 
óGð* ñ<ó ð<ð ØñEó ó ðE÷(r   rZ   )Ú	metaclassc                   ój   ‡ — e Zd ZdZdZdˆ fd„Zed„ «       Zdeddfd„Z	dˆ fd	„Z
d
„ Zed„ «       Zˆ xZS )Ú
ArgOptionsz Binary Location Must be a Stringzfedcm:accountsra   Nc                 ó0   •— t         ‰| �  «        g | _        y r   )rc   r   Ú
_argumentsrg   s    €r   r   zArgOptions.__init__‡  s   ø€ Ü‰ÑÔØ%'ˆ�r   c                 ó   — | j                   S )z3Returns a list of arguments needed for the browser.)rŽ   rk   s    r   Ú	argumentszArgOptions.arguments‹  s   € ð �‰Ðr   Úargumentc                 óT   — |r| j                   j                  |«       yt        d«      ‚)z^Adds an argument to the list.

        Args:
            argument: Sets the arguments
        zargument can not be nullN)rŽ   Úappendr:   )r   r‘   s     r   Úadd_argumentzArgOptions.add_argument�  s%   € ñ Ø�O‰O×"Ñ" 8Õ,äÐ7Ó8Ð8r   c                 óZ   •— t        j                  dt        d¬«       t        ‰| �  «        y)z™Ignore HTTP_PROXY and HTTPS_PROXY environment variables.

        This method is deprecated; use a Proxy instance with ProxyType.DIRECT instead.
        a  using ignore_local_proxy_environment_variables in Options has been deprecated, instead, create a Proxy instance with ProxyType.DIRECT to ignore proxy settings, pass the proxy instance into a ClientConfig constructor, pass the client config instance into the Webdriver constructoré   )Ú
stacklevelN)ÚwarningsÚwarnÚDeprecationWarningrc   r{   rg   s    €r   r{   z3ArgOptions.ignore_local_proxy_environment_variables›  s,   ø€ ô
 	�‰ðMô Øõ	
ô 	‰Ñ8Õ:r   c                 ó   — | j                   S r   rj   rk   s    r   rX   zArgOptions.to_capabilities«  s   € Ø�z‰zÐr   c                 ó   — i S r   r   rk   s    r   rd   zArgOptions.default_capabilities®  s   € àˆ	r   r|   )r   r   r   ÚBINARY_LOCATION_ERRORÚFEDCM_CAPABILITYr   r‡   r�   r(   r”   r{   rX   rd   rˆ   r‰   s   @r   rŒ   rŒ   ‚  sY   ø„ Ø>Ðà'Ðõ(ð ñó ðð	9 Sð 	9¨Tó 	9õ;ò ð ñó ôr   rŒ   )r˜   Úabcr   r   Úenumr   Úselenium.common.exceptionsr   Úselenium.webdriver.common.proxyr   r(   r	   r   r2   r=   rE   rS   rZ   rŒ   r   r   r   ú<module>r£      su   ðó$ ß 'Ý å ?Ý 1ô�s˜Dô ÷ 1ñ 1÷0_ñ _÷.ñ ÷:jñ j÷47ñ 7ô([(˜Gõ [(ô|.�õ .r   