Ë
    $åhi'  ã                   ó\   — d dl mZmZ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«      Zy)	é    )ÚNoSuchElementExceptionÚNoSuchFrameExceptionÚNoSuchWindowException)ÚAlert)ÚBy)ÚCommand)Ú
WebElementc                   ó¤   — e Zd Zdd„Zedefd„«       Zedefd„«       Zdd„Z	de
ez  ez  ddfd„Zdd	e
dz  ddfd
„Zdd„Zde
ddfd„Zde
ddfd„Zy)ÚSwitchToÚreturnNc                 ó8   — dd l }|j                  |«      | _        y )Nr   )ÚweakrefÚproxyÚ_driver)ÚselfÚdriverr   s      úOC:\des-py\Monitor\venv\Lib\site-packages\selenium/webdriver/remote/switch_to.pyÚ__init__zSwitchTo.__init__   s   € Ûà—}‘} VÓ,ˆ�ó    c                 óZ   — | j                   j                  t        j                  «      d   S )zŽReturns the element with focus, or BODY if nothing has focus.

        Example:
            element = driver.switch_to.active_element
        Úvalue)r   Úexecuter   ÚW3C_GET_ACTIVE_ELEMENT©r   s    r   Úactive_elementzSwitchTo.active_element    s$   € ð �|‰|×#Ñ#¤G×$BÑ$BÓCÀGÑLÐLr   c                 óH   — t        | j                  «      }|j                  }|S )zmSwitches focus to an alert on the page.

        Example:
            alert = driver.switch_to.alert
        )r   r   Útext)r   ÚalertÚ_s      r   r   zSwitchTo.alert)   s    € ô �d—l‘lÓ#ˆØ�J‰JˆØˆr   c                 ó\   — | j                   j                  t        j                  ddi«       y)zlSwitch focus to the default frame.

        Example:
            driver.switch_to.default_content()
        ÚidN)r   r   r   ÚSWITCH_TO_FRAMEr   s    r   Údefault_contentzSwitchTo.default_content4   s"   € ð 	�‰×ÑœW×4Ñ4°t¸T°lÕCr   Úframe_referencec                 ó‚  — t        |t        «      r+	 | j                  j                  t        j
                  |«      }| j                  j                  t        j                  d|i«       y# t        $ rL 	 | j                  j                  t        j                  |«      }n# t        $ r}t        |«      |‚d}~ww xY wY Œ�w xY w)aÅ  Switch focus to the specified frame by index, name, or element.

        Args:
            frame_reference: The name of the frame to switch to, an integer representing the index,
                or a WebElement that is an (i)frame to switch to.

        Example:
                driver.switch_to.frame("frame_name")
                driver.switch_to.frame(1)
                driver.switch_to.frame(driver.find_elements(By.TAG_NAME, "iframe")[0])
        Nr!   )Ú
isinstanceÚstrr   Úfind_elementr   ÚIDr   ÚNAMEr   r   r   r"   )r   r$   Úexcs      r   ÚframezSwitchTo.frame<   s¦   € ô �o¤sÔ+ðIØ"&§,¡,×";Ñ";¼B¿E¹EÀ?Ó"S�ð 	�‰×ÑœW×4Ñ4°t¸_Ð6MÕNøô *ò IðIØ&*§l¡l×&?Ñ&?ÄÇÁÈÓ&Y‘OøÜ-ò IÜ.¨Ó?ÀSÐHûðIúñ $ðIús5   ’*A) Á)	B>Á3*BÂB>Â	B8Â'B3Â3B8Â8B>Â=B>Ú	type_hintc                 óŠ   — | j                   j                  t        j                  d|i«      d   }| j	                  |d   «       y)zöSwitches to a new top-level browsing context.

        The type hint can be one of "tab" or "window". If not specified the
        browser will automatically select it.

        Example:
                driver.switch_to.new_window("tab")
        Útyper   ÚhandleN)r   r   r   Ú
NEW_WINDOWÚ_w3c_window)r   r-   r   s      r   Ú
new_windowzSwitchTo.new_windowS   s<   € ð —‘×$Ñ$¤W×%7Ñ%7¸&À)Ð9LÓMÈgÑVˆØ×Ñ˜˜x™Õ)r   c                 óV   — | j                   j                  t        j                  «       y)zØSwitch focus to the parent browsing context.

        If the current context is already the top level browsing context, it remains unchanged.

        Example:
                driver.switch_to.parent_frame()
        N)r   r   r   ÚSWITCH_TO_PARENT_FRAMEr   s    r   Úparent_framezSwitchTo.parent_frame_   s   € ð 	�‰×ÑœW×;Ñ;Õ<r   Úwindow_namec                 ó&   — | j                  |«       y)zÌSwitches focus to the specified window.

        Args:
            window_name: The name or window handle of the window to switch to.

        Example:
            driver.switch_to.window("main")
        N)r2   )r   r7   s     r   ÚwindowzSwitchTo.windowi   s   € ð 	×Ñ˜Õ%r   c                 ó
  ‡ — ˆ fd„}	  ||«       y # t         $ rh ‰ j                  j                  }‰ j                  j                  }|D ]-  } ||«       ‰ j                  j	                  d«      }||k(  sŒ, Y y   ||«       ‚ w xY w)Nc                 ó^   •— ‰j                   j                  t        j                  d| i«       y )Nr0   )r   r   r   ÚSWITCH_TO_WINDOW)Úhr   s    €r   Úsend_handlez)SwitchTo._w3c_window.<locals>.send_handleu   s!   ø€ Ø�L‰L× Ñ ¤×!9Ñ!9¸HÀa¸=ÕIr   zreturn window.name)r   r   Úcurrent_window_handleÚwindow_handlesÚexecute_script)r   r7   r>   Úoriginal_handleÚhandlesr0   Úcurrent_names   `      r   r2   zSwitchTo._w3c_windowt   s‡   ø€ ô	Jð	á˜Õ$øÜ$ò 
	à"Ÿl™l×@Ñ@ˆOØ—l‘l×1Ñ1ˆGØ!ò �Ù˜FÔ#Ø#Ÿ|™|×:Ñ:Ð;OÓP�Ø ,Ó.Úð	ñ
 ˜Ô(Øð
	ús   ˆ ‘A"BÁ4BÁ7B)r   N)N)Ú__name__Ú
__module__Ú__qualname__r   Úpropertyr	   r   r   r   r#   r'   Úintr,   r3   r6   r9   r2   © r   r   r   r      s§   „ ó-ð
 ðM 
ò Mó ðMð ð�uò ó ðóDðO S¨3¡Y°Ñ%;ð OÀó Oñ.
* C¨$¡Jð 
*¸$ó 
*ó=ð	& #ð 	&¨$ó 	&ð sð ¨tô r   r   N)Úselenium.common.exceptionsr   r   r   Úselenium.webdriver.common.alertr   Úselenium.webdriver.common.byr   Ú!selenium.webdriver.remote.commandr   Ú$selenium.webdriver.remote.webelementr	   r   rJ   r   r   ú<module>rP      s&   ð÷& kÑ jÝ 1Ý +Ý 5Ý ;÷kò kr   