U
    g                     @   s6   d dl mZ d dl mZ ddlmZ G dd dZdS )    )List)Optional   Accountc                   @   s   e Zd ZdZdZdZddddZeee	 ddd	Z
ee	dd
dZeee	 dddZee dddZeddddZddddZddddZdS )Dialogz6Represents a FedCM dialog that can be interacted with.ZAccountChooserZAutoReauthnN)returnc                 C   s
   || _ d S )N)_driver)selfZdriver r   J/tmp/pip-unpacked-wheel-3ysq0mf8/selenium/webdriver/common/fedcm/dialog.py__init__   s    zDialog.__init__c                 C   s
   | j jjS )z2Gets the type of the dialog currently being shown.)r	   fedcmZdialog_typer
   r   r   r   type!   s    zDialog.typec                 C   s
   | j jjS )zGets the title of the dialog.)r	   r   titler   r   r   r   r   &   s    zDialog.titlec                 C   s   | j jj}|r|dS dS )z Gets the subtitle of the dialog.subtitleN)r	   r   r   get)r
   resultr   r   r   r   +   s    
zDialog.subtitlec                 C   s   | j jj}dd |D S )z.Gets the list of accounts shown in the dialog.c                 S   s   g | ]}t |qS r   r   ).0accountr   r   r   
<listcomp>4   s     z'Dialog.get_accounts.<locals>.<listcomp>)r	   r   Zaccount_list)r
   Zaccountsr   r   r   get_accounts1   s    
zDialog.get_accounts)indexr   c                 C   s   | j j| dS )z,Selects an account from the dialog by index.N)r	   r   select_account)r
   r   r   r   r   r   6   s    zDialog.select_accountc                 C   s   | j j  dS )z)Clicks the continue button in the dialog.N)r	   r   acceptr   r   r   r   r   :   s    zDialog.acceptc                 C   s   | j j  dS )zCancels/dismisses the dialog.N)r	   r   dismissr   r   r   r   r   >   s    zDialog.dismiss)__name__
__module____qualname____doc__ZDIALOG_TYPE_ACCOUNT_LISTZDIALOG_TYPE_AUTO_REAUTHr   propertyr   strr   r   r   r   r   r   intr   r   r   r   r   r   r   r      s   r   N)typingr   r   r   r   r   r   r   r   r   <module>   s   