Ë
    úmxi)  ã                  ó¤   — d Z ddlmZ ddlZddlZddlZddlmZmZ ddl	m
Z
 erddlmZ ddlmZ dd„Zdd	„Zdd
„Z G d„ deeef   «      Zdd„Zy)zA bunch of useful utilities.é    )ÚannotationsN)ÚTYPE_CHECKINGÚAny)ÚRootContainer)ÚCallable)ÚDeltaGeneratorc                óL   ‡ ‡— g Št        j                  ‰ «      dˆ ˆfd„«       }|S )z2Decorator to memoize the result of a no-args func.c                 ó>   •— ‰s‰j                   ‰ «       «       ‰d   S )Nr   )Úappend)ÚfuncÚresults   €€úE/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/util.pyÚwrapped_funczmemoize.<locals>.wrapped_func$   s   ø€ áØ�M‰M™$›&Ô!Ø�a‰yÐó    )Úreturnr   )Ú	functoolsÚwraps)r   r   r   s   ` @r   Úmemoizer       s+   ù€ à€Fä‡_�_�TÓõó ðð
 Ðr   c                óB  ‡ ‡— ‰ j                   j                  }dddg t        «       i gŠt        j                  ‰ «      r ˆˆ fd„t        j
                  ‰ «      D «       }n#ˆfd„‰ j                  j                  «       D «       }dj                  d„ |D «       «      }|› d|› d	�S )
z€A clean repr for a class, excluding both values that are likely defaults,
    and those explicitly default for dataclasses.
    NÚ Fc              3  óð   •K  — | ]m  }|j                   r_t        ‰|j                  «      |j                  k7  r<t        ‰|j                  «      ‰vr$|j                  t        ‰|j                  «      f–— Œo y ­w©N)ÚreprÚgetattrÚnameÚdefault)Ú.0ÚfÚdefaultsÚselfs     €€r   ú	<genexpr>zrepr_.<locals>.<genexpr>6   s^   øè ø€ ò 
àØ�vŠvÜ˜˜aŸf™fÓ%¨¯©Ò2Ü˜˜aŸf™fÓ%¨XÑ5ð	 �V‰V”W˜T 1§6¡6Ó*Ô+ñ
ùs   ƒA3A6c              3  ó6   •K  — | ]  \  }}|‰vsŒ||f–— Œ y ­wr   © )r   r   Úvr   s      €r   r!   zrepr_.<locals>.<genexpr>>   s    øè ø€ ÒW¡& 1 aÀQÈhÒEV˜˜1”vÑWùs   ƒ�	z, c              3  ó0   K  — | ]  \  }}|› d |›�–— Œ y­w)ú=Nr#   )r   ÚfieldÚvalues      r   r!   zrepr_.<locals>.<genexpr>@   s   è ø€ ÒQ±\°U¸E˜u˜g Q u iÔ0ÑQùs   ‚ú(ú))	Ú	__class__Ú__name__ÚsetÚdataclassesÚis_dataclassÚfieldsÚ__dict__ÚitemsÚjoin)r    Ú	classnameÚfields_valsÚfield_reprsr   s   `   @r   Úrepr_r7   -   s“   ù€ ð —‘×'Ñ'€Ið    U¨B´³°rÐ:€HÜ×Ñ Ô%ô
ä ×'Ñ'¨Ó-ô
‰ó X¨D¯M©M×,?Ñ,?Ó,AÔWˆà—)‘)ÑQÀ[ÔQÓQ€KØˆ[˜˜+˜ aÐ(Ð(r   c                ó¸   — t        j                  dd¬«      }t        | t        «      r| j	                  d«      n| }|j                  |«       |j                  «       S )ziReturn the md5 hash of the given string.

    This should not be used for security-related purposes.
    Úmd5F)Úusedforsecurityzutf-8)ÚhashlibÚnewÚ
isinstanceÚstrÚencodeÚupdateÚ	hexdigest)ÚsÚhÚbs      r   Úcalc_md5rE   D   sD   € ô 	�‰�E¨5Ô1€Aä'¨¬3Ô/ˆ�‰�Ô°Q€Aà‡H�HˆQ„KØ�;‰;‹=Ðr   c                  ó    — e Zd ZdZdd„Zdd„Zy)ÚAttributeDictionarya®  
    A dictionary subclass that supports attribute-style access.

    This class extends the functionality of a standard dictionary to allow items
    to be accessed via attribute-style dot notation in addition to the traditional
    key-based access. If a dictionary item is accessed and is itself a dictionary,
    it is automatically wrapped in another `AttributeDictionary`, enabling recursive
    attribute-style access.
    c                óÎ   — 	 | j                  |«      }t        |t        «      rt        |«      S |S # t        $ r+}t        dt        | «      j                  › d|› d�«      |‚d }~ww xY w)Nú'z' object has no attribute ')Ú__getitem__r=   ÚdictrG   ÚKeyErrorÚAttributeErrorÚtyper,   )r    ÚkeyÚitemÚerrs       r   Ú__getattr__zAttributeDictionary.__getattr__]   so   € ð	Ø×#Ñ# CÓ(ˆDÜ0:¸4ÄÔ0FÔ& tÓ,ÐPÈDÐPøÜò 	Ü Ø”D˜“J×'Ñ'Ð(Ð(CÀCÀ5ÈÐJóàðûð	ús   ‚+0 ®0 °	A$¹&AÁA$c                ó   — || |<   y r   r#   )r    r   r(   s      r   Ú__setattr__zAttributeDictionary.__setattr__f   s   € ØˆˆTŠ
r   N)rO   r>   r   r   )r   r>   r(   r   r   ÚNone)r,   Ú
__module__Ú__qualname__Ú__doc__rR   rT   r#   r   r   rG   rG   R   s   „ ñóôr   rG   c                óP   — | j                   j                  t        j                  k(  S )z.Check if the DeltaGenerator is in the sidebar.)Ú
_active_dgÚ_root_containerr   ÚSIDEBAR)Údgs    r   Ú
in_sidebarr^   j   s   € à�=‰=×(Ñ(¬M×,AÑ,AÑAÐAr   )r   úCallable[..., Any]r   r_   )r    r   r   r>   )rB   zbytes | strr   r>   )r]   r   r   Úbool)rX   Ú
__future__r   r.   r   r;   Útypingr   r   Ú!streamlit.proto.RootContainer_pb2r   Úcollections.abcr   Ústreamlit.delta_generatorr   r   r7   rE   rK   rG   r^   r#   r   r   ú<module>rf      sN   ðñ #å "ã Û Û ß %å ;áÝ(å8ó
ó)ó.ô˜$˜s C˜x™.ô ô0Br   