Ë
    úmxiZS  ã                  óÖ  — U d Z ddlmZ ddlZddlZddlmZ ddl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 dd
lmZ ddlmZ ddlmZmZmZ ddlmZmZmZ ddl m!Z! ddl"m#Z#m$Z$m%Z%m&Z& er&ddl'm(Z(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3  ee4«      Z5de6d<   dZ7de6d<   	 	 	 	 d&d„Z8d'd„Z9d(d„Z:d)d„Z;d*d„Z<	 	 	 	 	 	 d+d„Z= G d „ d!e«      Z> G d"„ d#e«      Z?d,d$„Z@d-d%„ZAy).z,WebSocket handling for the Starlette server.é    )ÚannotationsN)Úsuppress)ÚTYPE_CHECKINGÚAnyÚFinal)Úurlparse)Úconfig)Úget_cookie_with_chunksÚget_expose_tokens_config)Ú
get_logger)ÚBackMsg)Úserialize_forward_msg)ÚClientContextÚSessionClientÚSessionClientDisconnectedError)Úget_cookie_secretÚis_url_from_allowed_originsÚis_xsrf_enabled)Ústarlette_app_utils)ÚTOKENS_COOKIE_NAMEÚUSER_COOKIE_NAMEÚWEBSOCKET_MAX_SEND_QUEUE_SIZEÚXSRF_COOKIE_NAME)ÚIterableÚMapping)ÚHeaders)Ú	BaseRoute)Ú	WebSocket)Ú
ForwardMsg)ÚRuntimer   Ú_LOGGERz_stcore/streamÚ_ROUTE_WEBSOCKET_STREAMc                ó  — | j                  d«      }|sy|j                  d«      D �cg c]  }|j                  «       ‘Œ }}|r
|d   r|d   nd}t        |«      dk\  r
|d   r|d   nd}t        |«      dk\  r
|d   r|d   nd}|||fS c c}w )	a  Parse the Sec-WebSocket-Protocol header.

    Returns a tuple of (selected_subprotocol, xsrf_token, existing_session_id).

    The subprotocol header is repurposed to pass tokens from client to server:
    - First entry: subprotocol to select (e.g., "streamlit")
    - Second entry: XSRF token for authentication validation
    - Third entry: existing session ID for reconnection

    Positional semantics are preserved: empty/whitespace entries are treated as
    None rather than being filtered out (which would shift positions).
    zsec-websocket-protocol)NNNú,r   Né   é   é   )ÚgetÚsplitÚstripÚlen)ÚheadersÚrawÚvalueÚentriesÚselectedÚ
xsrf_tokenÚexisting_sessions          úi/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/web/server/starlette/starlette_websocket.pyÚ_parse_subprotocolsr4   @   s›   € ð �+‰+Ð.Ó
/€CÙØð +.¯)©)°C«.Ö9 ˆu�{‰{�}Ð9€GÐ9Ù$¨°ªˆw�qŠz¸€HÜ" 7›|¨qÒ0°W¸Q²Z�˜’ÀT€JÜ%(¨£\°QÒ%6¸7À1º:�w˜q’zÈ4ÐØ�ZÐ!1Ð1Ð1ùò	 :s   ¨Bc                óÂ   — i }t        j                  d«      }t        |t        «      s|S |j	                  «       D ]"  \  }}| j                  |«      }|r|d   nd||<   Œ$ |S )z'Extract user info from trusted headers.zserver.trustedUserHeadersr   N)r	   Ú
get_optionÚ
isinstanceÚdictÚitemsÚgetlist)r,   Ú	user_infoÚmappingÚheader_nameÚuser_keyÚvaluess         r3   Ú_gather_user_infor@   [   sj   € à.0€IÜ×ÑÐ ;Ó<€GÜ�gœtÔ$ØÐà!(§¡£ò <Ñˆ�XØ—‘ Ó-ˆÙ+1˜f Qši°tˆ	�(Òð<ð Ðó    c                óX   — | €yt        | «      }|j                  }||k(  ryt        | «      S )a·  Check if the WebSocket Origin header is allowed.

    This mirrors Tornado's WebSocketHandler.check_origin behavior, which allows
    same-origin connections by default and delegates to is_url_from_allowed_origins
    for cross-origin requests.

    Parameters
    ----------
    origin: str | None
        The origin of the WebSocket connection.

    host: str | None
        The host of the WebSocket connection.

    Returns
    -------
    bool
        True if:
        - The origin is None (browser didn't send Origin header, allowed per spec)
        - The origin matches the host (same-origin request)
        - The origin is in the allowed origins list (is_url_from_allowed_origins)
    T)r   Únetlocr   )ÚoriginÚhostÚparsed_originÚorigin_hosts       r3   Ú_is_origin_allowedrH   h   s=   € ð4 €~Øô ˜VÓ$€MØ×&Ñ&€Kð �dÒØô ' vÓ.Ð.rA   c                ó²   — t        «       }| }t        |t        «      r|j                  d«      }t	        j
                  |t        |«      }|€i S t        ||«      S )ar  Parse and validate a signed user cookie.

    Note: This only understands cookies signed with itsdangerous (Starlette).
    Cookies signed by Tornado's set_secure_cookie will fail to decode and
    return an empty dict, requiring users to re-authenticate after switching
    backends. This is expected behavior when switching between Tornado and Starlette backends.
    úlatin-1)r   r7   ÚstrÚencoder   Údecode_signed_valuer   Ú_parse_decoded_user_cookie)Úcookie_valuerD   ÚsecretÚsigned_valueÚdecodeds        r3   Ú_parse_user_cookie_signedrS   ‘   s^   € ô Ó €FØ€LÜ�,¤Ô$ð $×*Ñ*¨9Ó5ˆä!×5Ñ5ØÔ  ,ó€Gð €Øˆ	ä% g¨vÓ6Ð6rA   c                ó(  — 	 t        j                  | j                  d«      «      }t        |«      }|j                  r|j                  si S |j                  › d|j                  › �}|j                  d«      }||k7  rt
        j                  d«       i S d|j                  dd«      i}|j                  dd«       |j                  dd«       |j                  |«       |S # t        t         j                  f$ r t
        j                  d«       i cY S w xY w)	zæParse an already-decoded user cookie and validate the origin.

    This is used when the cookie has already been decoded (e.g., from chunked cookie
    retrieval). Validates the origin against the request origin for security.
    zutf-8z"Error decoding auth cookie payloadz://rD   zgOrigin mismatch, the origin of websocket request is not the same origin of redirect_uri in secrets.tomlÚis_logged_inFN)ÚjsonÚloadsÚdecodeÚUnicodeDecodeErrorÚJSONDecodeErrorr!   Ú	exceptionr   ÚschemerC   r(   ÚerrorÚpopÚupdate)Údecoded_cookierD   ÚpayloadrF   Úexpected_originÚcookie_originr;   s          r3   rN   rN   ª   s  € ðÜ—*‘*˜^×2Ñ2°7Ó;Ó<ˆô
 ˜VÓ$€MØ×Ò }×';Ò';Øˆ	Ø&×-Ñ-Ð.¨c°-×2FÑ2FÐ1GÐH€OØ—K‘K Ó)€MØ˜Ò'Ü�‰ð:ô	
ð ˆ	Ø!/°·±¸^ÈUÓ1SÐ T€IØ‡K�K�˜$ÔØ‡K�K� Ô%Ø×Ñ�WÔØÐøô' ¤× 4Ñ 4Ð5ò Ü×ÑÐ>Ô?ØŠ	ðús   ‚$C Ã0DÄDc                ó@   ‡ ‡— t        «       Šdˆ ˆfd„}t        ||«      S )a  Get a signed cookie value, reconstructing from chunks if necessary.

    Large cookies may be split into multiple chunks (e.g., `_streamlit_user`,
    `_streamlit_user__1`, `_streamlit_user__2`) due to browser cookie size limits.
    This function handles both single and chunked cookies transparently.

    Parameters
    ----------
    cookies
        Dictionary of cookie names to their string values.
    cookie_name
        The base name of the cookie to retrieve.

    Returns
    -------
    bytes | None
        The decoded (unsigned) cookie value, or None if the cookie doesn't exist
        or has an invalid signature.

    Notes
    -----
    Uses itsdangerous signing which is NOT compatible with Tornado's format.
    Cookies signed by Tornado will fail to decode.
    c                ó|   •— ‰j                  | «      }|€y |j                  d«      }t        j                  ‰| |«      S )NrJ   )r(   rL   r   rM   )ÚnameÚ	raw_valuerQ   ÚcookiesrP   s      €€r3   Úget_single_cookiez9_get_signed_cookie_with_chunks.<locals>.get_single_cookieå   s?   ø€ Ø—K‘K Ó%ˆ	ØÐØà ×'Ñ'¨	Ó2ˆÜ"×6Ñ6°v¸tÀ\ÓRÐRrA   )rf   rK   Úreturnúbytes | None)r   r
   )rh   Úcookie_nameri   rP   s   `  @r3   Ú_get_signed_cookie_with_chunksrm   È   s#   ù€ ô6 Ó €FöSô "Ð"3°[ÓAÐArA   c                  óN   — e Zd ZdZdd„Zedd„«       Zed	d„«       Zed
d„«       Zy)ÚStarletteClientContexta$  Starlette-specific implementation of ClientContext.

    Captures headers, cookies, and client info from the initial WebSocket handshake.
    Values are cached at construction time since they represent the initial request
    context and should not change during the connection lifetime.
    c                óÖ   — t        |j                  j                  «       «      | _        t	        |j
                  «      | _        |j                  }|r|j                  | _	        y d | _	        y )N)
Úlistr,   r9   Ú_headersr8   rh   Ú_cookiesÚclientrE   Ú
_remote_ip)ÚselfÚ	websocketrt   s      r3   Ú__init__zStarletteClientContext.__init__ø   sM   € Ü/3°I×4EÑ4E×4KÑ4KÓ4MÓ/NˆŒÜ(,¨Y×->Ñ->Ó(?ˆŒØ×!Ñ!ˆÙ5; f§k¡kˆ�Àˆ�rA   c                ó   — | j                   S )z$All headers as (name, value) tuples.)rr   ©rv   s    r3   r,   zStarletteClientContext.headersþ   ó   € ð �}‰}ÐrA   c                ó   — | j                   S )z#Cookies as a name-to-value mapping.)rs   rz   s    r3   rh   zStarletteClientContext.cookies  r{   rA   c                ó   — | j                   S )zThe client's remote IP address.)ru   rz   s    r3   Ú	remote_ipz StarletteClientContext.remote_ip  s   € ð �‰ÐrA   N©rw   r   rj   ÚNone)rj   zIterable[tuple[str, str]])rj   zMapping[str, str])rj   ú
str | None)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__rx   Úpropertyr,   rh   r~   © rA   r3   ro   ro   ð   sI   „ ñóFð òó ðð òó ðð òó ñrA   ro   c                  óB   — e Zd ZdZdd„Zd	d„Zd
d„Zedd„«       Zd	d„Z	y)ÚStarletteSessionClienta³  WebSocket client for Starlette that implements the SessionClient interface.

    This class bridges the synchronous `write_forward_msg` calls from the Streamlit
    runtime to the asynchronous WebSocket send operations. It uses an internal
    queue and a background sender task to avoid blocking the calling thread.

    Parameters
    ----------
    websocket
        The Starlette WebSocket connection to send messages through.
    c                óö   — || _         t        |«      | _        t        j                  t
        ¬«      | _        t        j                  | j                  «       d¬«      | _	        t        j                  «       | _        y )N)Úmaxsizezstarlette-ws-send)rf   )Ú
_websocketro   Ú_client_contextÚasyncioÚQueuer   Ú_send_queueÚcreate_taskÚ_senderÚ_sender_taskÚEventÚ_closed)rv   rw   s     r3   rx   zStarletteSessionClient.__init__  s\   € Ø#ˆŒÜ5°iÓ@ˆÔô 29·±Ü1ô2
ˆÔô $×/Ñ/Ø�L‰L‹NÐ!4ô
ˆÔô —}‘}“ˆ�rA   c              ƒ  óv  K  — ddl m} 	 	 | j                  j                  «       ƒ d{  –—† }| j                  j                  |«      ƒ d{  –—†  ŒF7 Œ(7 Œ# |$ r Y n#t        $ r t        j                  d«       Y nw xY w| j                  j                  «        y# | j                  j                  «        w xY w­w)aò  Background task that drains the send queue and writes to the WebSocket.

        This task runs continuously, waiting for messages on the queue and sending
        them to the WebSocket. It decouples message generation (sync) from network
        I/O (async), allowing non-blocking sends from the runtime thread.

        The task terminates when the WebSocket disconnects or an error occurs,
        at which point it sets the closed flag to signal the client is no longer
        usable.
        r   ©ÚWebSocketDisconnectNzError sending websocket payload)Ústarlette.websocketsr˜   r�   r(   rŒ   Ú
send_bytesÚ	Exceptionr!   r[   r•   Úset)rv   r˜   ra   s      r3   r’   zStarletteSessionClient._sender(  s›   è ø€ õ 	=ð		ØØ $× 0Ñ 0× 4Ñ 4Ó 6×6�Ø—o‘o×0Ñ0°Ó9×9Ð9ð Ø6øØ9ùØ"ò 	ÙÜò 	AÜ×ÑÐ?Ö@ð	Aúð �L‰L×ÑÕøˆD�L‰L×ÑÕüs\   ‚B9ŠA ¨A©"A ÁAÁA ÁA ÁA<ÁB ÁA<Á9B Á;A<Á<B Á?B9ÂB6Â6B9c                ó
  — | j                   j                  «       rt        ‚t        |«      }	 | j                  j                  |«       y# t        j                  $ r&}| j                   j                  «        t        |‚d}~ww xY w)a0  Send a ForwardMsg to the browser via the WebSocket.

        This method is called synchronously from the Streamlit runtime. The message
        is serialized and queued for asynchronous sending by the background sender task.

        Parameters
        ----------
        msg
            The ForwardMsg protobuf to send to the client.

        Raises
        ------
        SessionClientDisconnectedError
            If the client is already closed or the send queue is full (client
            is overwhelmed and not consuming messages fast enough).
        N)	r•   Úis_setr   r   r�   Ú
put_nowaitrŽ   Ú	QueueFullrœ   )rv   Úmsgra   Úexcs       r3   Úwrite_forward_msgz(StarletteSessionClient.write_forward_msg@  sk   € ð" �<‰<×ÑÔ Ü0Ð0ä'¨Ó,ˆð	:Ø×Ñ×'Ñ'¨Õ0øÜ× Ñ ò 	:Ø�L‰L×ÑÔÜ0°cÐ9ûð	:ús   ­A	 Á	BÁ!A=Á=Bc                ó   — | j                   S )z'Return the client's connection context.)r�   rz   s    r3   Úclient_contextz%StarletteSessionClient.client_context[  s   € ð ×#Ñ#Ð#rA   c              ƒ  óü   K  — | j                   j                  «        | j                  j                  «        t	        t
        j                  «      5  | j                  ƒ d{  –—†  ddd«       y7 Œ# 1 sw Y   yxY w­w)zÂClose the client and release resources.

        Sets the closed flag to prevent further message sends, cancels the
        background sender task, and waits for it to complete cleanup.
        N)r•   rœ   r“   Úcancelr   rŽ   ÚCancelledErrorrz   s    r3   ÚaclosezStarletteSessionClient.aclose`  sd   è ø€ ð 	�‰×ÑÔØ×Ñ× Ñ Ô"Ü”g×,Ñ,Ó-ñ 	$Ø×#Ñ#×#Ð#÷	$ð 	$Ø#ø÷	$ð 	$üs0   ‚AA<ÁA0Á A.Á!A0Á%	A<Á.A0Á0A9Á5A<Nr   )rj   r€   )r¡   r   rj   r€   )rj   r   )
r‚   rƒ   r„   r…   rx   r’   r£   r†   r¥   r©   r‡   rA   r3   r‰   r‰     s/   „ ñ
ó'óó0:ð6 ò$ó ð$ô	$rA   r‰   c                ó<   ‡ ‡‡— ddl mŠ t        «       Šdˆˆˆ fd„}|S )a
  Create the WebSocket endpoint handler for client-server communication.

    This factory function creates a Starlette WebSocket handler that manages the
    bidirectional communication between the browser and the Streamlit runtime.
    The handler performs:
    - Origin validation (CORS/XSRF protection)
    - Subprotocol negotiation
    - Session management (connect/disconnect)
    - User authentication via cookies and trusted headers
    - BackMsg processing from the client
    - ForwardMsg sending to the client (via StarletteSessionClient)

    Parameters
    ----------
    runtime
        The Streamlit runtime instance that manages sessions and script execution.

    Returns
    -------
    Callable
        An async function that handles WebSocket connections.
    r   r—   c              “  óp  •K  — | j                   j                  d«      }| j                   j                  d«      }t        ||«      s1t        j	                  d|«       | j                  d¬«      ƒ d {  –—†  y t        | j                   «      \  }}}| j                  |¬«      ƒ d {  –—†  t        | «      }d }	 i }t        «       rÛ| j                  j                  t        «      }	| j                   j                  d«      }
|
rŸt        j                  ||	«      r‰	 t        | j                  t        «      }|rl|j!                  t#        ||
«      «       t        | j                  t$        «      }|r5t'        j(                  |«      }i }‰D ]  }|› d�}||v sŒ||   ||<   Œ ||d<   |j!                  t/        | j                   «      «       ‰j1                  |||¬
«      }	 	 | j3                  «       ƒ d {  –—† }t9        «       }	 |j;                  |«       |j?                  d«      }|dk(  rYtA        jB                  d«      stA        jB                  d«      r| j                  «       ƒ d {  –—†  n€t        j	                  d«       Œ¥|dk(  rQtA        jB                  d«      stA        jB                  d«      r‰jE                  «        n*t        j	                  d«       Œû‰jG                  ||«       �Œ	 |�‰jI                  |«       |jK                  «       ƒ d {  –—†  y 7 �Œ¢7 �Œq# t*        $ r t        j-                  d	«       Y �Œ›w xY w7 �ŒR# ‰$ r Y Œbt4        $ r% | j                  «       ƒ d {  –—†7   t7        d«      ‚w xY w# t*        $ r4}t        j-                  d«       |�‰j=                  ||«       Y d }~�ŒÙd }~ww xY w7 �ŒX# ‰$ r Y ŒÜw xY w7 Œ¸# |jK                  «       ƒ d {  –—†7   w xY w# 	 |�‰jI                  |«       |jK                  «       ƒ d {  –—†7   w # |jK                  «       ƒ d {  –—†7   w xY wxY w­w)NÚOriginÚHostz9Rejecting WebSocket connection from disallowed origin: %sið  )Úcode)ÚsubprotocolÚ_tokenÚtokensz'Error parsing auth cookie for websocket)rt   r;   Úexisting_session_idzVWebSocket text frames are not supported; connection closed. Expected binary protobufs.z Error deserializing back messageÚtypeÚdebug_disconnect_websocketzglobal.developmentModezglobal.e2eTestzQClient tried to disconnect websocket when not in development mode or e2e testing.Údebug_shutdown_runtimezNClient tried to shut down runtime when not in development mode or e2e testing.)&r,   r(   rH   r!   ÚwarningÚcloser4   Úacceptr‰   r   rh   r   r   Úvalidate_xsrf_tokenrm   r   r_   rN   r   rV   rW   r›   r[   r@   Úconnect_sessionÚreceive_bytesÚRuntimeErrorÚ	TypeErrorr   ÚParseFromStringÚ(handle_backmsg_deserialization_exceptionÚ
WhichOneofr	   r6   ÚstopÚhandle_backmsgÚdisconnect_sessionr©   )rw   rD   rE   r¯   r1   r²   rt   Ú
session_idr;   Úxsrf_cookieÚorigin_headerÚraw_auth_cookieÚraw_token_cookieÚ
all_tokensÚfiltered_tokensÚ
token_typeÚ	token_keyÚdataÚback_msgr¢   Úmsg_typer˜   Úexpose_tokensÚruntimes                        €€€r3   Ú_websocket_endpointz5create_websocket_handler.<locals>._websocket_endpoint‡  s4  øè ø€ ð ×"Ñ"×&Ñ& xÓ0ˆØ× Ñ ×$Ñ$ VÓ,ˆÜ! &¨$Ô/Ü�O‰OØKÈVôð —/‘/ t�/Ó,×,Ð,Øä7JØ×Ñó8
Ñ4ˆ�ZÐ!4ð ×Ñ¨;ÐÓ7×7Ð7ä'¨	Ó2ˆØ!%ˆ
ðt	&Ø(*ˆIÜÔ Ø'×/Ñ/×3Ñ3Ô4DÓE�Ø )× 1Ñ 1× 5Ñ 5°hÓ ?�ñ !Ô%8×%LÑ%LØ ô&ðUÜ*HØ%×-Ñ-Ô/?ó+˜ñ +Ø%×,Ñ,Ü :Ø$3°]ó!"ôô 0NØ )× 1Ñ 1Ô3Eó0Ð,ñ  0Ü-1¯Z©ZÐ8HÓ-I 
àBD Ø2?ò !* JØ3=°,¸fÐ0E IØ'0°JÒ'>ØFPØ,5ñG*¨¸
Ò(Cð!*ð 7F 	¨(Ñ 3ð ×ÑÔ.¨y×/@Ñ/@ÓAÔBà ×0Ñ0ØØ#Ø$7ð 1ó ˆJð ðØ!*×!8Ñ!8Ó!:×:�Dô #›9�ðØ×,Ñ,¨TÔ2ð $×.Ñ.¨vÓ6�ð
 Ð;Ò;Ü×(Ñ(Ð)AÔBÄf×FWÑFWØ(ôGð (Ÿo™oÓ/×/Ð/ØÜ—O‘Oð;ôð ØÐ7Ò7Ü×(Ñ(Ð)AÔBÄf×FWÑFWØ(ôGð  Ÿ™œØÜ—O‘Oð;ôð à×&Ñ& z°8Ô<ño ð|&ØÐ)Ø×.Ñ.¨zÔ:ð —m‘m“o×%Ñ%ð -ùð 	8úôR %ò UÜ×)Ñ)Ð*S×TðUúð ;úØ*ò ÙÜ#ò 	ð
 $Ÿ/™/Ó+×+Ñ+Ü#ð5óð ð	ûô !ò Ü×%Ñ%Ð&HÔIØ!Ð-Ø×HÑHØ&¨ôõ ûðúð" 0úð* #ò 	ñ ð	úð &ù�f—m‘m“o×%Ò%ûð&ØÐ)Ø×.Ñ.¨zÔ:ð —m‘m“o×%Ò%ø�f—m‘m“o×%Ò%ÿsZ  ƒA.P6Á1LÁ23P6Â%LÂ&P6Â8AN; ÄA8L ÆL Æ9N; ÇM Ç,L>Ç-M Ç1
N; Ç<M8 ÈAN; É N8É!BN; Ë'O Ë:P6ÌOÌP6ÌP6ÌL;Ì7N; Ì:L;Ì;N; Ì>M ÍM5ÍN; ÍM5Í#M&Í$M5Í5N; Í8	N5Î)N0Î*N; Î0N5Î5N; Î;OÏ O& ÏOÏO& ÏP6ÏO#ÏOÏO#Ï#P6Ï&P3Ï(PÏ;P3ÐPÐP3ÐP0Ð)P,Ð*P0Ð0P3Ð3P6r   )r™   r˜   r   )rÑ   rÒ   r˜   rÐ   s   ` @@r3   Úcreate_websocket_handlerrÓ   l  s   ú€ õ. 9ä,Ó.€M÷H&ðT ÐrA   c                ó^   — ddl m} ddlm}  | ||xs dt        «      t        | «      «      gS )ab  Create the WebSocket route for client-server communication.

    Creates a route at `/_stcore/stream` (with optional base URL prefix) that handles
    the bidirectional WebSocket connection between the browser and Streamlit runtime.

    Parameters
    ----------
    runtime
        The Streamlit runtime instance that manages sessions and script execution.
    base_url
        Optional base URL path prefix for the route (e.g., "myapp" results in
        "/myapp/_stcore/stream").

    Returns
    -------
    list[BaseRoute]
        A list containing the single WebSocketRoute for the stream endpoint.
    r   )ÚWebSocketRoute)Úmake_url_pathÚ )Ústarlette.routingrÕ   Ústreamlit.url_utilrÖ   r"   rÓ   )rÑ   Úbase_urlrÕ   rÖ   s       r3   Úcreate_websocket_routesrÛ     s5   € õ& 1å0ñ 	Ù˜(š. bÔ*AÓBÜ$ WÓ-ó	
ðð rA   )r,   r   rj   z)tuple[str | None, str | None, str | None])r,   r   rj   zdict[str, str | bool | None])rD   r�   rE   r�   rj   Úbool)rO   zstr | bytesrD   rK   rj   údict[str, Any])r`   ÚbytesrD   rK   rj   rÝ   )rh   zdict[str, str]rl   rK   rj   rk   )rÑ   r    rj   r   )rÑ   r    rÚ   r�   rj   zlist[BaseRoute])Br…   Ú
__future__r   rŽ   rV   Ú
contextlibr   Útypingr   r   r   Úurllib.parser   Ú	streamlitr	   Ústreamlit.auth_utilr
   r   Ústreamlit.loggerr   Ústreamlit.proto.BackMsg_pb2r   Ústreamlit.runtime.runtime_utilr   Ú!streamlit.runtime.session_managerr   r   r   Ú streamlit.web.server.server_utilr   r   r   Ústreamlit.web.server.starletter   Ú6streamlit.web.server.starlette.starlette_server_configr   r   r   r   Úcollections.abcr   r   Ústarlette.datastructuresr   rØ   r   r™   r   Ústreamlit.proto.ForwardMsg_pb2r   Ústreamlit.runtimer    r‚   r!   Ú__annotations__r"   r4   r@   rH   rS   rN   rm   ro   r‰   rÓ   rÛ   r‡   rA   r3   ú<module>rñ      s÷   ðò 3å "ã Û Ý ß ,Ñ ,Ý !å ß PÝ 'Ý /Ý @÷ñ ÷
ñ õ
 ?÷ó ñ ß1å0Ý+Ý.å9Ý)á˜HÓ%€ˆÓ %ð "2Ð ˜Ó 1ð2Øð2à.ó2ó6
ó&/óR7ó2ð<%BØð%BØ*-ð%Bàó%BôP˜]ô ô<[$˜]ô [$ó|eôPrA   