Ë
    úmxiÑ  ã                  ó   — U 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 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
j,                  e«      Zded<   daded<   daded<   dd„Z G d„ deeef   «      Zdd„Zy)é    )Úannotations)ÚIteratorÚMutableMapping)ÚAnyÚFinal)Úlogger)Úruntime)ÚKey)Úgather_metrics)Úrequire_valid_user_key)ÚSafeSessionState)ÚSessionStater   Ú_LOGGERFÚboolÚ$_state_use_warning_already_displayedNzSafeSessionState | NoneÚ_mock_session_statec                 óÜ   — ddl m}   | «       }|€Rt        s+dat        j                  «       st
        j                  d«       t        €t        t        «       d„ «      at        S |j                  S )zÚGet the SessionState object for the current session.

    Note that in streamlit scripts, this function should not be called
    directly. Instead, SessionState objects should be accessed via
    st.session_state.
    r   )Úget_script_run_ctxTzMSession state does not function when running a script without `streamlit run`c                  ó   — y ©N© r   ó    úb/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/runtime/state/session_state_proxy.pyú<lambda>z#get_session_state.<locals>.<lambda>@   s   � r   )Ú7streamlit.runtime.scriptrunner_utils.script_run_contextr   r   r	   Úexistsr   Úwarningr   r   r   Úsession_state)r   Úctxs     r   Úget_session_stater    $   sc   € õñ Ó
€Cð €{Ý3Ø37Ð0Ü—>‘>Ô#Ü—‘Øcôô Ð&ä"2´<³>Á<Ó"PÐÜ"Ð"Ø×ÑÐr   c                  óŒ   — e Zd ZdZdd„Zdd„Zdd„Zdd„Z ed«      dd„«       Z	dd„Z
dd	„Z ed
«      dd„«       Zdd„Zdd„Zy)ÚSessionStateProxya_  A stateless singleton that proxies `st.session_state` interactions
    to the current script thread's SessionState instance.

    The proxy API differs slightly from SessionState: it does not allow
    callers to get, set, or iterate over "keyless" widgets (that is, widgets
    that were created without a user_key, and have autogenerated keys).
    c                ó<   — t        t        «       j                  «      S )z1Iterator over user state and keyed widget values.)Úiterr    Úfiltered_state©Úselfs    r   Ú__iter__zSessionStateProxy.__iter__N   s   € ô Ô%Ó'×6Ñ6Ó7Ð7r   c                ó<   — t        t        «       j                  «      S )z>Number of user state and keyed widget values in session_state.)Úlenr    r%   r&   s    r   Ú__len__zSessionStateProxy.__len__S   ó   € äÔ$Ó&×5Ñ5Ó6Ð6r   c                ó<   — t        t        «       j                  «      S )z<String representation of user state and keyed widget values.)Ústrr    r%   r&   s    r   Ú__str__zSessionStateProxy.__str__W   r,   r   c                óH   — t        |«      }t        |«       t        «       |   S )z·Return the state or widget value with the given key.

        Raises
        ------
        StreamlitAPIException
            If the key is not a valid SessionState user key.
        ©r.   r   r    ©r'   Úkeys     r   Ú__getitem__zSessionStateProxy.__getitem__[   s#   € ô �#‹hˆÜ˜sÔ#Ü Ó" 3Ñ'Ð'r   zsession_state.set_itemc                óJ   — t        |«      }t        |«       |t        «       |<   y)z¢Set the value of the given key.

        Raises
        ------
        StreamlitAPIException
            If the key is not a valid SessionState user key.
        Nr1   ©r'   r3   Úvalues      r   Ú__setitem__zSessionStateProxy.__setitem__g   s#   € ô �#‹hˆÜ˜sÔ#Ø#(ÔÓ˜CÒ r   c                óF   — t        |«      }t        |«       t        «       |= y)z§Delete the value with the given key.

        Raises
        ------
        StreamlitAPIException
            If the key is not a valid SessionState user key.
        Nr1   r2   s     r   Ú__delitem__zSessionStateProxy.__delitem__t   s    € ô �#‹hˆÜ˜sÔ#ÜÓ Ñ$r   c                óP   — 	 | |   S # t         $ r t        t        |«      «      ‚w xY wr   ©ÚKeyErrorÚAttributeErrorÚ_missing_attr_error_messager2   s     r   Ú__getattr__zSessionStateProxy.__getattr__€   s4   € ð	CØ˜‘9ÐøÜò 	CÜ Ô!<¸SÓ!AÓBÐBð	Cús   ‚ ‡%zsession_state.set_attrc                ó   — || |<   y r   r   r6   s      r   Ú__setattr__zSessionStateProxy.__setattr__†   s   € àˆˆSŠ	r   c                óN   — 	 | |= y # t         $ r t        t        |«      «      ‚w xY wr   r<   r2   s     r   Ú__delattr__zSessionStateProxy.__delattr__Š   s1   € ð	CØ�S‘	øÜò 	CÜ Ô!<¸SÓ!AÓBÐBð	Cús   ‚ †$c                ó*   — t        «       j                  S )zCReturn a dict containing all session_state and keyed widget values.)r    r%   r&   s    r   Úto_dictzSessionStateProxy.to_dict�   s   € ä Ó"×1Ñ1Ð1r   N)ÚreturnzIterator[Any])rG   Úint)rG   r.   )r3   r
   rG   r   )r3   r
   r7   r   rG   ÚNone)r3   r
   rG   rI   )r3   r.   rG   r   )r3   r.   r7   r   rG   rI   )r3   r.   rG   rI   )rG   zdict[str, Any])Ú__name__Ú
__module__Ú__qualname__Ú__doc__r(   r+   r/   r4   r   r8   r:   r@   rB   rD   rF   r   r   r   r"   r"   E   se   „ ñó8ó
7ó7ó
(ñ Ð,Ó-ò
)ó .ð
)ó
%óCñ Ð,Ó-òó .ðóCô2r   r"   c                ó   — d| › d�S )Nz#st.session_state has no attribute "zƒ". Did you forget to initialize it? More info: https://docs.streamlit.io/develop/concepts/architecture/session-state#initializationr   )Ú	attr_names    r   r?   r?   •   s   € à
-¨i¨[ð 9jð 	kðr   )rG   r   )rO   r.   rG   r.   )Ú
__future__r   Úcollections.abcr   r   Útypingr   r   Ú	streamlitr   Ú_loggerr	   Ústreamlit.elements.lib.utilsr
   Ústreamlit.runtime.metrics_utilr   Ústreamlit.runtime.state.commonr   Ú*streamlit.runtime.state.safe_session_stater   Ú%streamlit.runtime.state.session_stater   Ú
get_loggerrJ   r   Ú__annotations__r   r   r    r"   r?   r   r   r   ú<module>r\      sx   ðö #ç 4ß å 'Ý Ý ,Ý 9Ý AÝ GÝ >à#�×#Ñ# HÓ-€ˆÓ -ð .3Ð $ dÓ 2à/3Ð Ð,Ó 3óôBM2˜ s¨C xÑ0ô M2ô`r   