
    5id                    p    U 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e      Zded<   ddZdd	Zy
)    )annotations)Final)configutil)
get_logger)
ForwardMsgr   _LOGGERc                   | j                   dk(  r| j                  d      dvr| j                  }| j                  d       | j	                  d      }t        j                  |      | _         | j                  j                  |       t        |      t        t        j                  d            k\  xr4 | j                  d      dk(  xr | j                  j                  d      d	k(  | j                  _        y
y
y
)zComputes and assigns the unique hash for a ForwardMsg.

    If the ForwardMsg already has a hash, this is a no-op.

    Parameters
    ----------
    msg : ForwardMsg

     type>   ref_hash
initializemetadataT)deterministiczglobal.minCachedMessageSizedeltanew_elementN)hash
WhichOneofr   
ClearFieldSerializeToStringr   calc_md5CopyFromlenintr   
get_optionr   	cacheable)msgr   serialized_msgs      m/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/streamlit/runtime/forward_msg_cache.pypopulate_hash_if_neededr       s     xx2~#..08RR <<z" ..T.B ==0 	h' 3v'8'89V'W#XX >v&'1>		$$V,= 	5 S~    c                    | j                   st        j                  d       | S t               }| j                   |_        |j
                  j                  | j
                         d|j
                  _        |S )a  Create a ForwardMsg that refers to the given message via its hash.

    The reference message will also get a copy of the source message's
    metadata.

    Parameters
    ----------
    msg : ForwardMsg
        The ForwardMsg to create the reference to.

    Returns
    -------
    ForwardMsg
        A new ForwardMsg that "points" to the original message via the
        ref_hash field.

    zFailed to create a reference message for a ForwardMsg since the message does not have a hash. This is not expected to happen, please report this as a bug. Falling back to the original message.F)r   r	   warningr   r   r   r   r   )r   ref_msgs     r   create_reference_msgr%   E   sb    $ 88Q	
 
lGxxGcll+!&GNr!   N)r   r   returnNone)r   r   r&   r   )
__future__r   typingr   	streamlitr   r   streamlit.loggerr   streamlit.proto.ForwardMsg_pb2r   __name__r	   __annotations__r    r%    r!   r   <module>r0      s0    #  " ' 5H% %(
V r!   