o
    äeÛ  ã                   @  s„   d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZ e	dƒ eƒ G d	d
„ d
eeƒƒZG dd„ deƒZdS )zgr.State() component.é    )Úannotations)Údeepcopy)ÚAny)ÚdocumentÚset_documentation_group)ÚSimpleSerializable)ÚIOComponentÚ	componentc                   @  s"   e Zd ZdZdZ	dd	dd„ZdS )
ÚStateaf  
    Special hidden component that stores session state across runs of the demo by the
    same user. The value of the State variable is cleared when the user refreshes the page.

    Preprocessing: No preprocessing is performed
    Postprocessing: No postprocessing is performed
    Demos: blocks_simple_squares
    Guides: real-time-speech-recognition
    FNÚvaluer   c                 K  s$   d| _ tj| fdt|ƒi|¤Ž dS )zþ
        Parameters:
            value: the initial value (of arbitrary type) of the state. The provided argument is deepcopied. If a callable is provided, the function will be called whenever the app loads to set the initial value of the state.
        Tr   N)Zstatefulr   Ú__init__r   )Úselfr   Úkwargs© r   úGD:\Projects\ConvertPro\env\Lib\site-packages\gradio/components/state.pyr      s   	zState.__init__©N)r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Zallow_string_shortcutr   r   r   r   r   r
      s
    
þr
   c                      s(   e Zd ZdZ‡ fdd„Zdd„ Z‡  ZS )ÚVariablezNVariable was renamed to State. This class is kept for backwards compatibility.c                   s   t ƒ j|i |¤Ž d S r   )Úsuperr   )r   Úargsr   ©Ú	__class__r   r   r   .   s   zVariable.__init__c                 C  s   dS )NÚstater   )r   r   r   r   Úget_block_name1   s   zVariable.get_block_name)r   r   r   r   r   r   Ú__classcell__r   r   r   r   r   +   s    r   N)r   Ú
__future__r   Úcopyr   Útypingr   Zgradio_client.documentationr   r   Zgradio_client.serializingr   Zgradio.components.baser   r
   r   r   r   r   r   Ú<module>   s    