Ë
    Eêñi C  ã                  ó  — 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mZ d dlmZmZ d dlmZmZmZmZmZ d d	lmZ d d
lmZ d dlmZmZ d dlm Z m!Z!m"Z"m#Z#m$Z$ erd dl%m&Z& e G d„ d«      «       Z' G d„ d«      Z(y)é    )Úannotations)Ú	dataclass)Údedent)ÚTYPE_CHECKINGÚcast)Úcurrent_form_id)ÚWidthÚcreate_layout_config)Úcheck_widget_policiesÚmaybe_raise_label_warnings)ÚKeyÚLabelVisibilityÚcompute_and_register_element_idÚ get_label_visibility_proto_valueÚto_key)ÚCheckbox)Úgather_metrics)ÚScriptRunContextÚget_script_run_ctx)Ú
BindOptionÚ
WidgetArgsÚWidgetCallbackÚWidgetKwargsÚregister_widget)ÚDeltaGeneratorc                  ó(   — e Zd ZU ded<   dd„Zdd„Zy)ÚCheckboxSerdeÚboolÚvaluec                ó   — t        |«      S ©N)r   )ÚselfÚvs     úe/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/streamlit/elements/widgets/checkbox.pyÚ	serializezCheckboxSerde.serialize8   s   € Ü�A‹wˆó    c                ó<   — t        |�|«      S | j                  «      S r!   )r   r   )r"   Úui_values     r$   ÚdeserializezCheckboxSerde.deserialize;   s   € Ü Ð 4�HÓEÐE¸$¿*¹*ÓEÐEr&   N)r#   r   Úreturnr   )r(   zbool | Noner*   r   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__r%   r)   © r&   r$   r   r   4   s   … àƒKóôFr&   r   c                  ón  — e Zd Z ed«      	 	 	 	 	 	 ddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z ed«      	 	 	 	 	 	 ddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	„«       Z	 	 	 	 	 	 dddej                  j                  dddd
œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z	e
dd„«       Zy)ÚCheckboxMixinÚcheckboxFNÚvisibleÚcontent)ÚdisabledÚlabel_visibilityÚwidthÚbindc               ó‚   — t        «       }| j                  |||||||||	t        j                  j                  ||
|¬«      S )a¡  Display a checkbox widget.

        Parameters
        ----------
        label : str
            A short label explaining to the user what this checkbox is for.
            The label can optionally contain GitHub-flavored Markdown of the
            following types: Bold, Italics, Strikethroughs, Inline Code, Links,
            and Images. Images display like icons, with a max height equal to
            the font height.

            Unsupported Markdown elements are unwrapped so only their children
            (text contents) render. Common block-level Markdown (headings,
            lists, blockquotes) is automatically escaped and displays as
            literal text in labels.

            See the ``body`` parameter of |st.markdown|_ for additional,
            supported Markdown directives.

            For accessibility reasons, you should never set an empty label, but
            you can hide it with ``label_visibility`` if needed. In the future,
            we may disallow empty labels by raising an exception.

            .. |st.markdown| replace:: ``st.markdown``
            .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown

        value : bool
            Preselect the checkbox when it first renders. This will be
            cast to bool internally.

        key : str, int, or None
            An optional string or integer to use as the unique key for
            the widget. If this is ``None`` (default), a key will be
            generated for the widget based on the values of the other
            parameters. No two widgets may have the same key. Assigning
            a key stabilizes the widget's identity and preserves its
            state across reruns even when other parameters change.

            A key lets you read or update the widget's value via
            ``st.session_state[key]``. For more details, see `Widget
            behavior <https://docs.streamlit.io/develop/concepts/architecture/widget-behavior>`_.

            Additionally, if ``key`` is provided, it will be used as a
            CSS class name prefixed with ``st-key-``.

        help : str or None
            A tooltip that gets displayed next to the widget label. Streamlit
            only displays the tooltip when ``label_visibility="visible"``. If
            this is ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        on_change : callable
            An optional callback invoked when this checkbox's value changes.

        args : list or tuple
            An optional list or tuple of args to pass to the callback.

        kwargs : dict
            An optional dict of kwargs to pass to the callback.

        disabled : bool
            An optional boolean that disables the checkbox if set to ``True``.
            The default is ``False``.

        label_visibility : "visible", "hidden", or "collapsed"
            The visibility of the label. The default is ``"visible"``. If this
            is ``"hidden"``, Streamlit displays an empty spacer instead of the
            label, which can help keep the widget aligned with other widgets.
            If this is ``"collapsed"``, Streamlit displays no label or spacer.

        width : "content", "stretch", or int
            The width of the checkbox widget. This can be one of the following:

            - ``"content"`` (default): The width of the widget matches the
              width of its content, but doesn't exceed the width of the parent
              container.
            - ``"stretch"``: The width of the widget matches the width of the
              parent container.
            - An integer specifying the width in pixels: The widget has a
              fixed width. If the specified width is greater than the width of
              the parent container, the width of the widget matches the width
              of the parent container.

        bind : "query-params" or None
            Binding mode for syncing the widget's value with a URL query
            parameter. If this is ``None`` (default), the widget's value
            is not synced to the URL. When this is set to
            ``"query-params"``, changes to the widget update the URL, and
            the widget can be initialized or updated through a query
            parameter in the URL. This requires ``key`` to be set. The
            key is used as the query parameter name.

            When the widget's value equals its default, the query
            parameter is removed from the URL to keep it clean. A bound
            query parameter can't be set or deleted through
            ``st.query_params``; it can only be programmatically changed
            through ``st.session_state``.

        Returns
        -------
        bool
            Whether or not the checkbox is checked.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> agree = st.checkbox("I agree")
        >>>
        >>> if agree:
        ...     st.write("Great!")

        .. output::
           https://doc-checkbox.streamlit.app/
           height: 220px

        ©Úlabelr   ÚkeyÚhelpÚ	on_changeÚargsÚkwargsr5   r6   ÚtypeÚctxr7   r8   )r   Ú	_checkboxÚCheckboxProtoÚ	StyleTypeÚDEFAULT©r"   r;   r   r<   r=   r>   r?   r@   r5   r6   r7   r8   rB   s                r$   r2   zCheckboxMixin.checkbox@   sV   € ôP !Ó"ˆØ�~‰~ØØØØØØØØØ-Ü×(Ñ(×0Ñ0ØØØð ó 
ð 	
r&   Útogglec               ó‚   — t        «       }| j                  |||||||||	t        j                  j                  ||
|¬«      S )až  Display a toggle widget.

        Parameters
        ----------
        label : str
            A short label explaining to the user what this toggle is for.
            The label can optionally contain GitHub-flavored Markdown of the
            following types: Bold, Italics, Strikethroughs, Inline Code, Links,
            and Images. Images display like icons, with a max height equal to
            the font height.

            Unsupported Markdown elements are unwrapped so only their children
            (text contents) render. Common block-level Markdown (headings,
            lists, blockquotes) is automatically escaped and displays as
            literal text in labels.

            See the ``body`` parameter of |st.markdown|_ for additional,
            supported Markdown directives.

            For accessibility reasons, you should never set an empty label, but
            you can hide it with ``label_visibility`` if needed. In the future,
            we may disallow empty labels by raising an exception.

            .. |st.markdown| replace:: ``st.markdown``
            .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown

        value : bool
            Preselect the toggle when it first renders. This will be
            cast to bool internally.

        key : str, int, or None
            An optional string or integer to use as the unique key for
            the widget. If this is ``None`` (default), a key will be
            generated for the widget based on the values of the other
            parameters. No two widgets may have the same key. Assigning
            a key stabilizes the widget's identity and preserves its
            state across reruns even when other parameters change.

            A key lets you read or update the widget's value via
            ``st.session_state[key]``. For more details, see `Widget
            behavior <https://docs.streamlit.io/develop/concepts/architecture/widget-behavior>`_.

            Additionally, if ``key`` is provided, it will be used as a
            CSS class name prefixed with ``st-key-``.

        help : str or None
            A tooltip that gets displayed next to the widget label. Streamlit
            only displays the tooltip when ``label_visibility="visible"``. If
            this is ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        on_change : callable
            An optional callback invoked when this toggle's value changes.

        args : list or tuple
            An optional list or tuple of args to pass to the callback.

        kwargs : dict
            An optional dict of kwargs to pass to the callback.

        disabled : bool
            An optional boolean that disables the toggle if set to ``True``.
            The default is ``False``.

        label_visibility : "visible", "hidden", or "collapsed"
            The visibility of the label. The default is ``"visible"``. If this
            is ``"hidden"``, Streamlit displays an empty spacer instead of the
            label, which can help keep the widget aligned with other widgets.
            If this is ``"collapsed"``, Streamlit displays no label or spacer.

        width : "content", "stretch", or int
            The width of the toggle widget. This can be one of the following:

            - ``"content"`` (default): The width of the widget matches the
              width of its content, but doesn't exceed the width of the parent
              container.
            - ``"stretch"``: The width of the widget matches the width of the
              parent container.
            - An integer specifying the width in pixels: The widget has a
              fixed width. If the specified width is greater than the width of
              the parent container, the width of the widget matches the width
              of the parent container.

        bind : "query-params" or None
            Binding mode for syncing the widget's value with a URL query
            parameter. If this is ``None`` (default), the widget's value
            is not synced to the URL. When this is set to
            ``"query-params"``, changes to the widget update the URL, and
            the widget can be initialized or updated through a query
            parameter in the URL. This requires ``key`` to be set. The
            key is used as the query parameter name.

            When the widget's value equals its default, the query
            parameter is removed from the URL to keep it clean. A bound
            query parameter can't be set or deleted through
            ``st.query_params``; it can only be programmatically changed
            through ``st.session_state``.

        Returns
        -------
        bool
            Whether or not the toggle is checked.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> on = st.toggle("Activate feature")
        >>>
        >>> if on:
        ...     st.write("Feature activated!")

        .. output::
           https://doc-toggle.streamlit.app/
           height: 220px

        r:   )r   rC   rD   rE   ÚTOGGLErG   s                r$   rH   zCheckboxMixin.toggleÙ   sV   € ôP !Ó"ˆØ�~‰~ØØØØØØØØØ-Ü×(Ñ(×/Ñ/ØØØð ó 
ð 	
r&   )r5   r6   rA   rB   r7   r8   c               óP  — t        |«      }t        | j                  |||du rd n|¬«       t        ||	«       t	        |
t
        j                  j                  k(  rdnd|d| j                  |t        |«      ||¬«      }t        «       }||_	        ||_
        t        |«      |_        |
|_        t        | j                  «      |_        ||_        t!        |	«      |j"                  _        |�t'        |«      |_        |dk(  r|�t+        |«      |_        t/        |d¬«      }t1        |«      }t3        |j                  ||||j4                  |j6                  |d	|d¬
«
      }|j8                  r|j$                  |_        d|_        | j                  j=                  d||¬«       |j$                  S )NF)Údefault_valuerH   r2   T)Úuser_keyÚkey_as_main_identityÚdgr;   r   r=   r7   zquery-params)r7   Úallow_content_widthÚ
bool_value)	Úon_change_handlerr?   r@   ÚdeserializerÚ
serializerrB   Ú
value_typer8   Ú	clearable)Úlayout_config)r   r   rO   r   r   rD   rE   rJ   r   Úidr;   ÚdefaultrA   r   Úform_idr5   r   r6   r   r   r=   ÚstrÚquery_param_keyr
   r   r   r)   r%   Úvalue_changedÚ	set_valueÚ_enqueue)r"   r;   r   r<   r=   r>   r?   r@   r5   r6   rA   rB   r7   r8   Ú
element_idÚcheckbox_protorW   ÚserdeÚcheckbox_states                      r$   rC   zCheckboxMixin._checkboxr  s—  € ô" �S‹kˆäØ�G‰GØØØ"'¨5¡.™$°eõ		
ô 	# 5Ð*:Ô;ä4Ø¤× 7Ñ 7× >Ñ >Ò>‰HÀJØØ!%Ø�w‰wØÜ�u“+ØØô	
ˆ
ô '›ˆØ&ˆÔØ$ˆÔÜ!% e£ˆÔØ"ˆÔÜ!0°·±Ó!9ˆÔØ"*ˆÔÜ0PØó1
ˆ×'Ñ'Ô-ð ÐÜ"(¨£,ˆNÔð �>Ò! c oÜ-0°«XˆNÔ*ä,°5ÈdÔSˆä˜eÓ$ˆä(Ø×ÑØ'ØØØ×*Ñ*Ø—‘ØØ#Øàô
ˆð ×'Ò'Ø#1×#7Ñ#7ˆNÔ Ø'+ˆNÔ$à�‰×Ñ˜ ^À=ÐÔQØ×#Ñ#Ð#r&   c                ó   — t        d| «      S )zGet our DeltaGenerator.r   )r   )r"   s    r$   rO   zCheckboxMixin.dgÃ  s   € ô Ð$ dÓ+Ð+r&   )FNNNNN)r;   r[   r   r   r<   ú
Key | Noner=   ú
str | Noner>   úWidgetCallback | Noner?   úWidgetArgs | Noner@   úWidgetKwargs | Noner5   r   r6   r   r7   r	   r8   r   r*   r   )r;   r[   r   r   r<   re   r=   rf   r>   rg   r?   rh   r@   ri   r5   r   r6   r   rA   z!CheckboxProto.StyleType.ValueTyperB   zScriptRunContext | Noner7   r	   r8   r   r*   r   )r*   r   )r+   r,   r-   r   r2   rH   rD   rE   rF   rC   ÚpropertyrO   r/   r&   r$   r1   r1   ?   sy  „ Ù�JÓð ØØØ+/Ø"&Ø&*ðV
ð Ø,5Ø ØñV
àðV
ð ðV
ð ð	V
ð
 ðV
ð )ðV
ð  ðV
ð $ðV
ð ðV
ð *ðV
ð ðV
ð ðV
ð 
òV
ó  ðV
ñp �HÓð ØØØ+/Ø"&Ø&*ðV
ð Ø,5Ø ØñV
àðV
ð ðV
ð ð	V
ð
 ðV
ð )ðV
ð  ðV
ð $ðV
ð ðV
ð *ðV
ð ðV
ð ðV
ð 
òV
ó ðV
ðv ØØØ+/Ø"&Ø&*ðO$ð Ø,5Ø2?×2IÑ2I×2QÑ2QØ'+Ø ØñO$àðO$ð ðO$ð ð	O$ð
 ðO$ð )ðO$ð  ðO$ð $ðO$ð ðO$ð *ðO$ð 0ðO$ð %ðO$ð ðO$ð ðO$ð  
ó!O$ðb ò,ó ñ,r&   r1   N))Ú
__future__r   Údataclassesr   Útextwrapr   Útypingr   r   Ú!streamlit.elements.lib.form_utilsr   Ú#streamlit.elements.lib.layout_utilsr	   r
   Ústreamlit.elements.lib.policiesr   r   Ústreamlit.elements.lib.utilsr   r   r   r   r   Ústreamlit.proto.Checkbox_pb2r   rD   Ústreamlit.runtime.metrics_utilr   Ústreamlit.runtime.scriptrunnerr   r   Ústreamlit.runtime.stater   r   r   r   r   Ústreamlit.delta_generatorr   r   r1   r/   r&   r$   ú<module>rx      sp   ðõ #å !Ý ß &å =÷÷÷õ õ CÝ 9ß O÷õ ñ Ý8ð ÷Fð Fó ðF÷G,ò G,r&   