
    /_i 8                    ^   U d dl mZ d dl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mZmZmZ d dlmZmZ d dlmZ d d	lmZmZ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%m&Z& d dl'm(Z( e
rd dl	m)Z) dZ*de+d<   dZ,de+d<   dZ-de+d<   ee.z  Z/de+d<   ed   Z0de+d<   ed   Z1de+d<   ed   Z2de+d<   ed    Z3de+d!<   ed"   Z4de+d#<   ee2e3e4f   Z5de+d$<   ee5e.dz  f   Z6de+d%<    e7d&      Z8de+d'<   d0d(Z9d1d)Z: e!d*      	 	 	 	 	 d2	 	 	 	 	 	 	 	 	 	 	 d3d+       Z;d4d,Z<	 	 	 	 	 	 d5d-Z=d6d.Z>d7d/Z?y)8    )annotationsN)Mapping)Path)dedent)TYPE_CHECKINGAnyFinalLiteral	TypeAliascast)AtomicImageimage_to_url)LayoutConfig) StreamlitInvalidMenuItemKeyErrorStreamlitInvalidPageLayoutError!StreamlitInvalidSidebarStateErrorStreamlitInvalidURLError)
ForwardMsg)
PageConfig)gather_metrics)get_script_run_ctx)is_emojivalidate_material_icon)is_url)	TypeGuardget helpr	   GET_HELP_KEYreport a bugREPORT_A_BUG_KEYabout	ABOUT_KEYr   PageIcon)centeredwideLayout)autoexpanded	collapsedInitialSideBarState)zGet helpzGet Helpr   _GetHelp)zReport a bugr   _ReportABug)Aboutr    _AboutMenuKey	MenuItemsu  🔥™🎉🚀🌌💣✨🌙🎆🎇💥🤩🤙🌛🤘⬆💡🤪🥂⚡💨🌠🎊🍿😛🔮🤟🌃🍃🍾💫▪🌴🎈🎬🌀🎄😝☔⛽🍂💃😎🍸🎨🥳☀😍🅱🌞😻🌟😜💦💅🦄😋😉👻🍁🤤👯🌻‼🌈👌🎃💛😚🔫🙌👽🍬🌅☁🍷👭☕🌚💁👅🥰🍜😌🎥🕺❕🧡☄💕🍻✅🌸🚬🤓🍹®☺💪😙☘🤠✊🤗🍵🤞😂💯😏📻🎂💗💜🌊❣🌝😘💆🤑🌿🦋😈⛄🚿😊🌹🥴😽💋😭🖤🙆👐⚪💟☃🙈🍭💻🥀🚗🤧🍝💎💓🤝💄💖🔞⁉⏰🕊🎧☠♥🌳🏾🙉⭐💊🍳🌎🙊💸❤🔪😆🌾✈📚💀🏠✌🏃🌵🚨💂🤫🤭😗😄🍒👏🙃🖖💞😅🎅🍄🆓👉💩🔊🤷⌚👸😇🚮💏👳🏽💘💿💉👠🎼🎶🎤👗❄🔐🎵🤒🍰👓🏄🌲🎮🙂📈🚙📍😵🗣❗🌺🙄👄🚘🥺🌍🏡♦💍🌱👑👙☑👾🍩🥶📣🏼🤣☯👵🍫➡🎀😃✋🍞🙇😹🙏👼🐝⚫🎁🍪🔨🌼👆👀😳🌏📖👃🎸👧💇🔒💙😞⛅🏻🍴😼🗿🍗♠🦁✔🤖☮🐢🐎💤😀🍺😁😴📺☹😲👍🎭💚🍆🍋🔵🏁🔴🔔🧐👰☎🏆🤡🐠📲🙋📌🐬✍🔑📱💰🐱💧🎓🍕👟🐣👫🍑😸🍦👁🆗🎯📢🚶🦅🐧💢🏀🚫💑🐟🌽🏊🍟💝💲🐍🍥🐸☝♣👊⚓❌🐯🏈📰🌧👿🐳💷🐺📞🆒🍀🤐🚲🍔👹🙍🌷🙎🐥💵🔝📸⚠❓🎩✂🍼😑⬇⚾🍎💔🐔⚽💭🏌🐷🍍✖🍇📝🍊🐙👋🤔🥊🗽🐑🐘🐰💐🐴♀🐦🍓✏👂🏴👇🆘😡🏉👩💌😺✝🐼🐒🐶👺🖕👬🍉🐻🐾⬅⏬▶👮🍌♂🔸👶🐮👪⛳🐐🎾🐕👴🐨🐊🔹©🎣👦👣👨👈💬⭕📹📷RANDOM_EMOJISc                    | j                         D ci c]-  \  }}t        |      j                         j                         |/ c}}S c c}}w N)itemsstrlowerstrip)dictkvs      ]/var/www/html/land_sniper/venv/lib/python3.12/site-packages/streamlit/commands/page_config.py_lower_clean_dict_keysr;   ;   s8    26**,?$!QCFLLN  "A%???s   2A
c                j   | dk(  r
t               S t        | t              rt        |       rd|  S t        | t              r| j	                  d      rt        |       S t        | t              rt        |       } 	 t        | t        d      dddd	
      S # t        $ r t        | t              r| cY S  w xY w)a  Return the string to pass to the frontend to have it show
    the given PageIcon.

    If page_icon is a string that looks like an emoji (or an emoji shortcode),
    we return it as-is. Otherwise we use `image_to_url` to return a URL.

    (If `image_to_url` raises an error and page_icon is a string, return
    the unmodified page_icon string instead of re-raising the error.)
    randomzemoji:z	:materialstretch)widthFRGBr&   favicon)layout_configclampchannelsoutput_formatimage_id)
get_random_emoji
isinstancer4   r   
startswithr   r   r   r   	Exception)	page_icons    r:   _get_favicon_stringrL   ?   s     H!! )S!hy&9	{##)S!i&:&:;&G%i00 )T"	N	&  	
 		
  i% s   8B B20B2set_page_configc                   t               }| | |j                  _        |t        |      |j                  _        |dk(  rt
        j                  }n5|dk(  rt
        j                  }n|t
        j                  }nt        |      ||j                  _
        |dk(  rt
        j                  }nK|dk(  rt
        j                  }n5|dk(  rt
        j                  }n|t
        j                  }nt        |      ||j                  _        |Bt#        d	t%        |            }t'        |       |j                  j(                  }	t+        ||	       t-               }
|
y|
j/                  |       y)
u   
    Configure the default settings of the page.

    This command can be called multiple times in a script run to dynamically
    change the page configuration. The calls are additive, with each successive
    call overriding only the parameters that are specified.

    Parameters
    ----------
    page_title: str or None
        The page title, shown in the browser tab. If this is ``None``
        (default), the page title is inherited from the previous call of
        ``st.set_page_config``. If this is ``None`` and no previous call
        exists, the page title is inferred from the page source.

        If a page source is a Python file, its inferred title is derived from
        the filename. If a page source is a callable object, its inferred title
        is derived from the callable's name.

    page_icon : Anything supported by st.image (except list), str, or None
        The page favicon. If ``page_icon`` is ``None`` (default), the page icon
        is inherited from the previous call of ``st.set_page_config``. If this
        is ``None`` and no previous call exists, the favicon is a monochrome
        Streamlit logo.

        In addition to the types supported by |st.image|_ (except list), the
        following strings are valid:

        - A single-character emoji. For example, you can set ``page_icon="🦈"``.

        - An emoji short code. For example, you can set ``page_icon=":shark:"``.
          For a list of all supported codes, see
          https://share.streamlit.io/streamlit/emoji-shortcodes.

        - The string literal, ``"random"``. You can set ``page_icon="random"``
          to set a random emoji from the supported list above.

        - An icon from the Material Symbols library (rounded style) in the
          format ``":material/icon_name:"`` where "icon_name" is the name
          of the icon in snake case.

          For example, ``page_icon=":material/thumb_up:"`` will display the
          Thumb Up icon. Find additional icons in the `Material Symbols           <https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
          font library.

        .. note::
            Colors are not supported for Material icons. When you use a
            Material icon for favicon, it will be black, regardless of browser
            theme.

        .. |st.image| replace:: ``st.image``
        .. _st.image: https://docs.streamlit.io/develop/api-reference/media/st.image

    layout: "centered", "wide", or None
        How the page content should be laid out. If this is ``None`` (default),
        the page layout is inherited from the previous call of
        ``st.set_page_config``. If this is ``None`` and no previous call
        exists, the page layout is ``"centered"``.

        ``"centered"`` constrains the elements into a centered column of fixed
        width. ``"wide"`` uses the entire screen.

    initial_sidebar_state: "auto", "expanded", "collapsed", or None
        How the sidebar should start out. If this is ``None`` (default), the
        sidebar state is inherited from the previous call of
        ``st.set_page_config``. If no previous call exists, the sidebar state
        is ``"auto"``.

        The folowing states are supported:

        - ``"auto"``: The sidebar is hidden on small devices and shown otherwise.
        - ``"expanded"``: The sidebar is shown initially.
        - ``"collapsed"``: The sidebar is hidden initially.

        In most cases, ``"auto"`` provides the best user experience across
        devices of different sizes.

    menu_items: dict
        Configure the menu that appears on the top-right side of this app.
        The keys in this dict denote the menu item to configure. The following
        keys can have string or ``None`` values:

        - "Get help": The URL this menu item should point to.
        - "Report a Bug": The URL this menu item should point to.
        - "About": A markdown string to show in the About dialog.

        A URL may also refer to an email address e.g. ``mailto:john@example.com``.

        If you do not include a key, its menu item will be hidden (unless it
        was set by a previous call to ``st.set_page_config``). To remove an
        item that was specified in a previous call to ``st.set_page_config``,
        set its value to ``None`` in the dictionary.

    Example
    -------
    >>> import streamlit as st
    >>>
    >>> st.set_page_config(
    ...     page_title="Ex-stream-ly Cool App",
    ...     page_icon="🧊",
    ...     layout="wide",
    ...     initial_sidebar_state="expanded",
    ...     menu_items={
    ...         'Get Help': 'https://www.extremelycoolapp.com/help',
    ...         'Report a bug': "https://www.extremelycoolapp.com/bug",
    ...         'About': "# This is a header. This is an *extremely* cool app!"
    ...     }
    ... )
    Nr#   r$   )layoutr&   r'   r(   )initial_sidebar_stater/   )ForwardProtopage_config_changedtitlerL   rA   PageConfigProtoCENTEREDWIDELAYOUT_UNSETr   rO   AUTOEXPANDED	COLLAPSEDSIDEBAR_UNSETr   rP   r   r;   validate_menu_items
menu_itemsset_menu_items_protor   enqueue)
page_titlerK   rO   rP   r]   msg	pb_layoutpb_sidebar_statelowercase_menu_itemsmenu_items_protoctxs              r:   rM   rM   n   s[   n .C(2%*=i*H' #,,		6	#((		#00	 .V<<%.C" &*//	*	,*33	+	-*44		&*88 0"7
 	
 5EC1#K1G
1ST0122==13CD

C
{KK    c                 4    t        j                  t              S r2   )r=   choicer0    rg   r:   rG   rG     s    ==''rg   c                
   t         | v r| t            | t            |_        nd|_        t        | v r| t           | t           |_        nd|_        t        | v r-| t           t        | t           xs d      |_        y d|_	        y y )NT )
r   get_help_urlhide_get_helpr   report_a_bug_urlhide_report_a_bugr!   r   about_section_mdclear_about_md)rd   re   s     r:   r^   r^     s     ++-9,@,N)-1*// 01=0DEU0V-15.((	*606$Y/521-
 /3+ )rg   c                    | j                         D ]A  \  }}t        |      st        |      | t        |d      r-|t        k7  s7t        |       y )Nkey)httphttpsmailto)url)r3   valid_menu_item_keyr   r   r!   r   )r]   r8   r9   s      r:   r\   r\   7  sR      " 21"1%2q99=q561	>*q112rg   c                (    | t         t        t        hv S r2   )r   r   r!   rt   s    r:   rz   rz   A  s    <!19===rg   )r7   r/   returnzdict[str, Any])rK   r"   r|   r4   )NNNNN)r`   z
str | NonerK   zPageIcon | NonerO   zLayout | NonerP   zInitialSideBarState | Noner]   zMenuItems | Noner|   None)r|   r4   )rd   r/   re   zPageConfigProto.MenuItemsr|   r}   )r]   r/   r|   r}   )ru   r4   r|   zTypeGuard[MenuKey])@
__future__r   r=   collections.abcr   pathlibr   textwrapr   typingr   r   r	   r
   r   r   "streamlit.elements.lib.image_utilsr   r   #streamlit.elements.lib.layout_utilsr   streamlit.errorsr   r   r   r   streamlit.proto.ForwardMsg_pb2r   rQ   streamlit.proto.PageConfig_pb2r   rT   streamlit.runtime.metrics_utilr   7streamlit.runtime.scriptrunner_utils.script_run_contextr   streamlit.string_utilr   r   streamlit.url_utilr   r   r   __annotations__r   r!   r4   r"   r%   r)   r*   r+   r-   r.   r/   listr0   r;   rL   rM   rG   r^   r\   rz   rj   rg   r:   <module>r      s   #  #   F F H <  F H 9 V B %  e  ( % (	5 !C') './	 /!()H!I Y I@A) A !?@Y @,-	 -X{F:; ;wd
23	9 3 bu 
@,^ !"!!% 8<#'ggg g 6	g
 !g 
g #gT(
3#37P3	322>rg   