
    AF[i                        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  e        G d dee	             Z e        G d
 dee	             Zy)    )annotations)document)BlockContext)ComponentMeta)Events)I18nDatac                  z    e Zd ZdZej
                  ej                  gZdddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 ddZd Z	y)Walkthrougha"  
    Walkthrough is a layout element within Blocks that can contain multiple "Step" Components, which can be used to create a step-by-step workflow.
    Example:
        with gr.Walkthrough(selected=1) as walkthrough:
            with gr.Step("Step 1", id=1):
                btn = gr.Button("go to Step 2")
                btn.click(lambda: gr.Walkthrough(selected=2), outputs=walkthrough)
            with gr.Step("Step 2", id=2):
                txt = gr.Textbox("Welcome to Step 2")

    Guides: controlling-layout
    Demos: walkthrough
    NT)selectedvisibleelem_idelem_classesrenderkeypreserved_by_keyc          	     J    t        j                  | ||||||       || _        y)a  
        Parameters:
            selected: The currently selected step. Must be a number corresponding to the step number. Defaults to the first step.
            visible: If False, Walkthrough will be hidden.
            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
            elem_classes: An optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.
            render: If False, this layout will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
            key: in a gr.render, Components with the same key across re-renders are treated as the same component, not a new component. Properties set in 'preserved_by_key' are not reset across a re-render.
            preserved_by_key: A list of parameters from this component's constructor. Inside a gr.render() function, if a component is re-rendered with the same key, these (and only these) parameters will be preserved in the UI (if they have been changed by the user or an event listener) instead of re-rendered based on the values provided during constructor.
        )r   r   r   r   r   r   N)r   __init__r   )selfr   r   r   r   r   r   r   s           c/var/www/html/chatbot/moweb-chatbot/venv/lib/python3.12/site-packages/gradio/layouts/walkthrough.pyr   zWalkthrough.__init__   s0    * 	%-	
 !    c                     y)Nwalkthrough r   s    r   get_block_namezWalkthrough.get_block_name=   s    r   )r   
int | Noner   boolr   
str | Noner   list[str] | str | Noner   r   r   (int | str | tuple[int | str, ...] | Noner   r   )
__name__
__module____qualname____doc__r   changeselectEVENTSr   r   r   r   r   r
   r
      s     mmV]]+F
  $"/38<37! ! 	!
 ! -! ! 6! 1!@r   r
   )	metaclassc            	          e Zd ZdZej
                  gZ	 	 	 ddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	dZd
dZd Z	y)StepzW
    Step is a layout element. A step is a single step in a step-by-step workflow.
    NT)idr   r   scaler   r   r   c                   t        j                  | ||||	|
       || _        || _        || _        || _        || _        y)a  
        Parameters:
            label: The visual label for the step
            id: An optional numeric identifier for the step, required if you wish to control the selected step from a predict function. Must be a number.
            elem_id: An optional string that is assigned as the id of the <div> containing the contents of the Step layout. The same string followed by "-button" is attached to the Step button. Can be used for targeting CSS styles.
            elem_classes: An optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles.
            render: If False, this layout will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
            scale: relative size compared to adjacent elements. 1 or greater indicates the Step will expand in size.
            visible: If False, Step will be hidden.
            interactive: If False, Step will not be clickable.
        )r   r   r   r   r   N)r   r   labelr+   r   r,   interactive)r   r.   r   r/   r+   r   r   r,   r   r   r   s              r   r   zStep.__init__I   sJ    2 	%-	
 

&r   c                    t         S )N)r
   r   s    r   get_expected_parentzStep.get_expected_parentp   s    r   c                     y)Nwalkthroughstepr   r   s    r   r   zStep.get_block_names   s     r   )NTT)r.   zstr | I18nData | Noner   r   r/   r   r+   r   r   r   r   r   r,   r   r   r   r   r    r   r   )returnztype[Walkthrough])
r!   r"   r#   r$   r   r&   r'   r   r1   r   r   r   r   r*   r*   A   s     mm_F (, 	%' "/3 8<37%'$%' %' 	%' %' %' -%' %' %' 6%' 1%'N!r   r*   N)
__future__r   gradio_client.documentationr   gradio.blocksr   gradio.component_metar   gradio.eventsr   gradio.i18nr   r
   r*   r   r   r   <module>r;      sV    " 0 & /     
2,- 2 2j 
2!<= 2! 2!r   