
    ]h                    .   d dl mZ ddlmZmZ d dlmZ d dlZd dlZ G d dej                        Z
 G d d	ej                        Ze G d
 d             Z	 d	 	 	 ddZddZ	 	 	 	 	 	 ddZ	 d	 	 	 	 	 ddZddZ ed      e G d d                    Zy)    )annotations   )event_classT_JSON_DICT)	dataclassNc                  .    e Zd ZdZdZdZd Zed        Zy)
LoginStatez
    Whether this is a sign-up or sign-in action for this account, i.e.
    whether this account has ever been used to sign in to this RP before.
    SignInSignUpc                    | j                   S Nvalueselfs    z/home/totalfocus.sw7ft.com/public_html/venv/lib/python3.12/site-packages/selenium/webdriver/common/devtools/v117/fed_cm.pyto_jsonzLoginState.to_json       zz    c                     | |      S r    clsjsons     r   	from_jsonzLoginState.from_json       4yr   N)	__name__
__module____qualname____doc__SIGN_INSIGN_UPr   classmethodr   r   r   r   r	   r	      s,     GG  r   r	   c                  .    e Zd ZdZdZdZd Zed        Zy)
DialogTypez]
    Whether the dialog shown is an account chooser or an auto re-authentication dialog.
    AccountChooserAutoReauthnc                    | j                   S r   r   r   s    r   r   zDialogType.to_json$   r   r   c                     | |      S r   r   r   s     r   r   zDialogType.from_json'   r   r   N)	r   r   r   r    ACCOUNT_CHOOSERAUTO_REAUTHNr   r#   r   r   r   r   r%   r%      s,     'O L  r   r%   c                      e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded<   ded	<   d
ed<   dZded<   dZded<   d Zed        Z	y)Accountz/
    Corresponds to IdentityRequestAccount
    str
account_idemailname
given_namepicture_urlidp_config_urlidp_signin_urlr	   login_stateNtyping.Optional[str]terms_of_service_urlprivacy_policy_urlc                   t               }| j                  |d<   | j                  |d<   | j                  |d<   | j                  |d<   | j
                  |d<   | j                  |d<   | j                  |d<   | j                  j                         |d<   | j                  | j                  |d	<   | j                  | j                  |d
<   |S )N	accountIdr0   r1   	givenName
pictureUrlidpConfigUrlidpSigninUrl
loginStatetermsOfServiceUrlprivacyPolicyUrl)dictr/   r0   r1   r2   r3   r4   r5   r6   r   r8   r9   )r   r   s     r   r   zAccount.to_jsonF   s    v OO[

WyyV OO[!--\#22^#22^!--557\$$0(,(A(AD$%"".'+'>'>D#$r   c                L    | t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         t        j                  |d         d	|v rt        |d	         nd d
|v rt        |d
         
      S d 
      S )Nr;   r0   r1   r<   r=   r>   r?   r@   rA   rB   )
r/   r0   r1   r2   r3   r4   r5   r6   r8   r9   )r.   r	   r   r   s     r   r   zAccount.from_jsonV   s    4,-d7m$T&\"4,-D./tN34tN34",,T,-?@CVZ^C^T*=%>!?dh@RVZ@Zs4(:#;<
 	
 ae
 	
r   )
r   r   r   r    __annotations__r8   r9   r   r#   r   r   r   r   r-   r-   ,   sh     OJ
IO 26.5/3,3  
 
r   r-   c              #  @   K   t               }| | |d<   d|d}|}yw)z
    :param disable_rejection_delay: *(Optional)* Allows callers to disable the promise rejection delay that would normally happen, if this is unimportant to what's being tested. (step 4 of https://fedidcg.github.io/FedCM/#browser-api-rp-sign-in)
    NdisableRejectionDelayzFedCm.enablemethodparamsrC   )disable_rejection_delayrJ   cmd_dictr   s       r   enablerN   f   s6      &F**A&' H >Ds   c               #     K   ddi} | }y w)NrI   zFedCm.disabler   rM   r   s     r   disablerQ   v   s      	/H >D   
c              #  F   K   t               }| |d<   ||d<   d|d}|}yw)z5
    :param dialog_id:
    :param account_index:
    dialogIdaccountIndexzFedCm.selectAccountrH   NrK   )	dialog_idaccount_indexrJ   rM   r   s        r   select_accountrX   ~   s9      &F"F:*F>'H >Ds   !c              #  J   K   t               }| |d<   |||d<   d|d}|}yw)zE
    :param dialog_id:
    :param trigger_cooldown: *(Optional)*
    rT   NtriggerCooldownzFedCm.dismissDialogrH   rK   )rV   trigger_cooldownrJ   rM   r   s        r   dismiss_dialogr\      s@      &F"F:#$4 !'H >Ds   !#c               #     K   ddi} | }yw)z
    Resets the cooldown time, if any, to allow the next FedCM call to show
    a dialog even if one was recently dismissed by the user.
    rI   zFedCm.resetCooldownNr   rP   s     r   reset_cooldownr^      s      	'H >DrR   zFedCm.dialogShownc                  R    e Zd ZU ded<   ded<   ded<   ded<   ded	<   edd
       Zy)DialogShownr.   rV   r%   dialog_typeztyping.List[Account]accountstitler7   subtitlec           
          | t        |d         t        j                  |d         |d   D cg c]  }t        j                  |       c}t        |d         d|v rt        |d               S d       S c c}w )NrT   
dialogTyperb   rc   rd   )rV   ra   rb   rc   rd   )r.   r%   r   r-   )r   r   is      r   r   zDialogShown.from_json   s    $z*+",,T,-?@484DEqg''*Ed7m$.8D.@Sj)*
 	

 GK
 	
 Fs   A7N)r   r   returnr`   )r   r   r   rE   r#   r   r   r   r   r`   r`      s4     N"" J""
 
r   r`   r   )rL   typing.Optional[bool]rh   0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])rh   rj   )rV   r.   rW   intrh   rj   )rV   r.   r[   ri   rh   rj   )
__future__r   utilr   r   dataclassesr   enumtypingEnumr	   r%   r-   rN   rQ   rX   r\   r^   r`   r   r   r   <module>rr      s    # * !      6
 6
 6
t :>!6	7  
8( 37/ 
8&  !

 
  "
r   