o
    äe$  ã                   @  s¢   d Z ddlmZ ddlmZmZ ddlmZmZ ddl	m
Z
 ddlmZmZmZ ddlmZmZmZmZ ddlmZ ed	ƒ eƒ G d
d„ deeeeee
eƒ	ƒZdS )zgr.Checkbox() component.é    )Úannotations)ÚCallableÚLiteral)ÚdocumentÚset_documentation_group)ÚBooleanSerializable)ÚFormComponentÚIOComponentÚ	_Keywords)Ú
ChangeableÚEventListenerMethodÚ	InputableÚ
Selectable)ÚNeighborInterpretableÚ	componentc                   @  st   e Zd ZdZ	d&ddddddddddddœd'dd„Zdd„ Zeejddddddddf	d(d d!„ƒZ	d"d#„ Z
d$d%„ ZdS ))ÚCheckboxau  
    Creates a checkbox that can be set to `True` or `False`.

    Preprocessing: passes the status of the checkbox as a {bool} into the function.
    Postprocessing: expects a {bool} returned from the function and, if it is True, checks the checkbox.
    Examples-format: a {bool} representing whether the box is checked.
    Demos: sentence_builder, titanic_survival
    FNTé    )ÚlabelÚinfoÚeveryÚ
show_labelÚ	containerÚscaleÚ	min_widthÚinteractiveÚvisibleÚelem_idÚelem_classesÚvalueúbool | Callabler   ú
str | Noner   r   úfloat | Noner   úbool | Noner   Úboolr   ú
int | Noner   Úintr   r   r   r   úlist[str] | str | Nonec                K  s@   |  	 t j| f||||||||	|
|||dœ|¤Ž t | ¡ dS )a±  
        Parameters:
            value: if True, checked by default. If callable, the function will be called whenever the app loads to set the initial value of the component.
            label: component name in interface.
            info: additional component description.
            every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. Queue must be enabled. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.
            show_label: if True, will display label.
            container: If True, will place the component in a container - providing some extra padding around the border.
            scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
            min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
            interactive: if True, this checkbox can be checked; if False, checking will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
            visible: If False, component 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 list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
        )r   r   r   r   r   r   r   r   r   r   r   r   N)r	   Ú__init__r   )Úselfr   r   r   r   r   r   r   r   r   r   r   r   Úkwargs© r*   úJD:\Projects\ConvertPro\env\Lib\site-packages\gradio/components/checkbox.pyr'   $   s*    ÿóòzCheckbox.__init__c                 C  s   d| j it | ¡¥S )Nr   )r   r	   Ú
get_config)r(   r*   r*   r+   r,   \   s   ÿþzCheckbox.get_configú)bool | Literal[_Keywords.NO_VALUE] | Nonec	           	      C  s   ||||||||| ddœ
S )NÚupdate)
r   r   r   r   r   r   r   r   r   Z__type__r*   )	r   r   r   r   r   r   r   r   r   r*   r*   r+   r.   b   s   özCheckbox.updatec                 C  s   | gi fS )Nr*   )r(   Úxr*   r*   r+   Úget_interpretation_neighbors{   s   z%Checkbox.get_interpretation_neighborsc                 K  s   |r|d dfS d|d fS )z–
        Returns:
            The first value represents the interpretation score if the input is False, and the second if the input is True.
        r   Nr*   )r(   r/   Z	neighborsZscoresr)   r*   r*   r+   Úget_interpretation_scores~   s   z"Checkbox.get_interpretation_scores)F)r   r   r   r    r   r    r   r!   r   r"   r   r#   r   r$   r   r%   r   r"   r   r#   r   r    r   r&   )r   r-   r   r    r   r    r   r"   r   r"   r   r$   r   r$   r   r"   r   r"   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r'   r,   Ústaticmethodr
   ZNO_VALUEr.   r0   r1   r*   r*   r*   r+   r      s<    
þò8÷r   N)r5   Ú
__future__r   Útypingr   r   Zgradio_client.documentationr   r   Zgradio_client.serializingr   Zgradio.components.baser   r	   r
   Zgradio.eventsr   r   r   r   Zgradio.interpretationr   r   r*   r*   r*   r+   Ú<module>   s&    

ù