
    soj2              
           d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZmZmZ d dlmZ dedej        dededdf
dZdS )    )Update)ContextTypesN)User)!CrewFirstMateDemotionNotification)ReservedKeyboardKeys)CrewValidationException)Keyboard)get_crew)&get_remaining_time_to_next_leaderboard)full_message_sendget_yes_no_keyboardmention_markdown_user)send_notificationupdatecontextinbound_keyboarduserreturnc                 j  K   t          j        |j        t          j                           }	 t          ||j                   |                                st          t          j
                  n6# t          $ r)}t          ||j        | |           d{V  Y d}~dS d}~ww xY wt          j        |j        vrtt          j                            t!          |          t#                                }t%          ||j        |j        |d          g}t          ||| ||           d{V  dS d|_        |                                 t          j                            t!          |                    }t          ||| |           d{V  t1          ||t3                      |            d{V  dS )z
    Manage the Crew First Mate demote screen
    :param update: The update object
    :param context: The context object
    :param user: The user object
    :param inbound_keyboard: The keyboard object
    :return: None
    )r   validate_against_crew)r   r   NT)screenprimary_keyr   no_is_back_button)r   keyboardr   )r   )r   	get_by_idinfor   DEFAULT_PRIMARY_KEYr
   crewis_crew_first_mater   phrases-CREW_DEMOTE_FROM_FIRST_MATE_IS_NOT_FIRST_MATEr   messageCONFIRM(CREW_DEMOTE_FROM_FIRST_MATE_CONFIRMATIONformatr   r   r   r   id	crew_rolesave#CREW_DEMOTE_FROM_FIRST_MATE_SUCCESSr   r   )r   r   r   r   membercveot_textinline_keyboards           L/app/src/chat/private/screens/screen_crew_member_detail_first_mate_demote.pymanager/      s5      >"2"78L8`"abbFfDI>>>> ((** 	a)'*_```	a #   S[BR
 
 
 	
 	
 	
 	
 	
 	
 	
 		 #+;+@@@BII!&))+Q+S+S
 
  '."I!1"&  1
  $-
 
 
 	
 	
 	
 	
 	
 	
 	
 	 F
KKMMM 9@@AVW]A^A^__G
GWVN^
_
_
________ GV-N-P-PY_
`
`
``````````s   AA1 1
B$;BB$)src.tg_compatr   src.tg_compat.extr   resources.phrasesr    src.model.Userr   src.model.enums.Notificationr   $src.model.enums.ReservedKeyboardKeysr   src.model.error.CustomExceptionr   src.model.pojo.Keyboardr	   src.service.crew_servicer
   src.service.leaderboard_servicer   src.service.message_servicer   r   r    src.service.notification_servicer   DEFAULT_TYPEr/        r.   <module>r?      sS               * * * * * * # # # # # #       J J J J J J E E E E E E C C C C C C , , , , , , - - - - - - R R R R R R         
 ? > > > > >=a=a)6=aJR=aZ^=a	=a =a =a =a =a =ar>   