Ë
    úmxi`  ã                  óä   — U d dl mZ d dlZd dlmZmZmZmZ d dlm	Z	 d dl
mZ erd dlmZ eZded<   eZded	<   eZded
<   eZded<    G d„ de«      Zdd„Z ej,                  d«      Zdd„Zdd„Zy)é    )ÚannotationsN)ÚTYPE_CHECKINGÚTextIOÚ	TypeAliasÚ	TypedDict)ÚNotRequired)Úextract_leading_emoji)ÚPathr   ÚPageHashÚPageNameÚ
ScriptPathÚIconc                  ó@   — e Zd ZU ded<   ded<   ded<   ded<   d	ed
<   y)ÚPageInfor   Úscript_pathr   Úpage_script_hashzNotRequired[Icon]ÚiconzNotRequired[PageName]Ú	page_namezNotRequired[str]Úurl_pathnameN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© ó    úL/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/source_util.pyr   r   !   s    … ØÓØÓØ
ÓØ$Ó$Ø"Ô"r   r   c                ó^   — ddl }t        |d«      r|j                  | «      S t        | d¬«      S )a8  Open a read-only Python file taking proper care of its encoding.

    In Python 3, we would like all files to be opened with utf-8 encoding.
    However, some author like to specify PEP263 headers in their source files
    with their own encodings. In that case, we should respect the author's
    encoding.
    r   NÚopenzutf-8)Úencoding)ÚtokenizeÚhasattrr   )Úfilenamer    s     r   Úopen_python_filer#   )   s/   € ó äˆx˜Ô ð �}‰}˜XÓ&Ð&Ü� 7Ô+Ð+r   z([0-9]*)[_ -]*(.*)\.pyc                óî   — t        j                  t        | j                  «      }t	        |«      dk(  rt        | › d�«      ‚|\  \  }}|j                  «       }|dk(  rt        d«      |fS t        |«      |fS )Nr   z0 is not a Python file. This should never happen.Ú Úinf)ÚreÚfindallÚPAGE_FILENAME_REGEXÚnameÚlenÚ
ValueErrorÚlowerÚfloat)r   ÚmatchesÚnumberÚlabels       r   Úpage_sort_keyr2   =   s}   € Ü�j‰jÔ,¨k×.>Ñ.>Ó?€Gô ˆ7ƒ|�qÒÜØˆmÐKÐLó
ð 	
ð  Ñ�_€fˆeØ�K‰K‹M€Eà�‚|Ü�e“˜eÐ$Ð$ä�&‹M˜5Ð!Ð!r   c                óô   — t        j                  t        | j                  «      }|€yt        j                  dd|j                  d«      «      j                  «       xs |j                  d«      }t        |«      S )a’  Compute the icon and name of a page from its script path.

    This is *almost* the page name displayed in the nav UI, but it has
    underscores instead of spaces. The reason we do this is because having
    spaces in URLs both looks bad and is hard to deal with due to the need to
    URL-encode them. To solve this, we only swap the underscores for spaces
    right before we render page names.
    )r%   r%   z[_ ]+Ú_é   é   )r'   Úsearchr)   r*   ÚsubÚgroupÚstripr	   )r   Ú
extractionÚicon_and_names      r   Úpage_icon_and_namer=   P   sn   € ô (*§y¡yÔ1DÀk×FVÑFVÓ'W€JØÐØä—F‘FØ�#�z×'Ñ'¨Ó*óç�eƒgò%à×!Ñ! !Ó$ð ô ! Ó/Ð/r   )r"   ÚstrÚreturnr   )r   r
   r?   ztuple[float, str])r   r
   r?   ztuple[str, str])Ú
__future__r   r'   Útypingr   r   r   r   Útyping_extensionsr   Ústreamlit.string_utilr	   Úpathlibr
   r>   r   r   r   r   r   r   r#   Úcompiler)   r2   r=   r   r   r   ú<module>rF      sv   ðö #ã 	ß >Ó >å )å 7áÝà€ˆ)Ó Ø€ˆ)Ó Ø€
ˆIÓ Ø€€iÓ ô#ˆyô #ó,ð" !�b—j‘jÐ!:Ó;Ð ó"ô&0r   