
    {h
                     j    d dl 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  G d d	e      Zy)
    N)ModalScreen)Static)Vertical)ComposeResult)PRIMARY_COLOR)Callablec                        e Zd ZdZddedeegdf   def fdZddgZd	e	fd
Z
ddZddZd ZddZde de dZ xZS )ConfirmationModalz-A modal widget for confirming file selection.messagecallbackNmodec                     t         |           || _        || _        || _        t        j                  d| d|        y )Nz,ConfirmationModal initialized with message: z and mode: )super__init__r   r   r   logginginfo)selfr   r   r   	__class__s       l/var/www/html/hubwallet-dev/venv/lib/python3.12/site-packages/atomic_assembler/widgets/confirmation_modal.pyr   zConfirmationModal.__init__   s?     	CG9KX\W]^_    )yconfirmYes)ndismissNoreturnc              #   6  K   t        j                  d       | j                  dk(  r1t        t	        | j
                  d      t	        dd      d       y | j                  dk(  r1t        t	        | j
                  d      t	        d	d      d       y y w)
NzComposing ConfirmationModalyes_nozmodal-content)idz[Y]es / [N]ooptionsdialogcontinuezPress any key to continue)r   debugr   r   r   r   r   s    r   composezConfirmationModal.compose   s     3499 t||8~)4 
 YY*$t||82yA  %s   BBc                     t        j                  d       | j                  j                          | j	                  d       y )NzConfirmation action triggeredTr   r   app
pop_screenr   r%   s    r   action_confirmz ConfirmationModal.action_confirm(   s+    45dr   c                     t        j                  d       | j                  j                          | j	                  d       y )NzDismissal action triggeredFr(   r%   s    r   action_dismissz ConfirmationModal.action_dismiss-   s+    12er   c                 .    t        j                  d       y )NzConfirmationModal mounted)r   r$   r%   s    r   on_mountzConfirmationModal.on_mount2   s    12r   c                     | j                   dk(  rOt        j                  d|j                   d       | j                  j                          | j                  d       y y )Nr#   zKey 'z' pressed in continue modeT)r   r   r   keyr)   r*   r   )r   events     r   on_keyzConfirmationModal.on_key5   sI    99
"LL5+EFGHH!MM$ #r   z
    ModalScreen {
        align: center middle;
    }

    #dialog {
        width: 40%;
        height: auto;
        border: solid a$  ;
        background: $surface;
    }

    Vertical {
        align: center middle;
        background: $surface;
        padding: 1 2;
    }

    #modal-content {
        content-align: center middle;
        width: 100%;
        margin-bottom: 1;
        text-align: center;
        color: z;
        text-style: bold;
    }

    #options {
        text-align: center;
        color: $text;
    }

    Static {
        width: 100%;
    }
    )r   )r   N)__name__
__module____qualname____doc__strr   boolr   BINDINGSr   r&   r+   r-   r/   r3   r   CSS__classcell__)r   s   @r   r
   r
   
   s    7` `x/E `S ` 	 H
 

3  %o &  /#Cr   r
   )r   textual.screenr   textual.widgetsr   textual.containersr   textual.appr   atomic_assembler.constantsr   typingr   r
    r   r   <module>rD      s(     & " ' % 4 U Ur   