
    g                        d dl mZ d dlmZmZ d dlmZ d dlm	Z	 erd dl
mZ  G d d      Z	 	 	 	 	 d
	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Zy)    )annotations)TYPE_CHECKINGcast)IFrame)gather_metrics)DeltaGeneratorc                      e Zd Z ed      	 	 	 d	 	 	 	 	 	 	 	 	 dd       Z ed      	 	 	 d	 	 	 	 	 	 	 	 	 d	d       Zed
d       Zy)IframeMixin_iframeNc                n    t               }t        |||||       | j                  j                  d|      S )au  Load a remote URL in an iframe.

        To use this function, import it from the ``streamlit.components.v1``
        module.

        .. warning::
            Using ``st.components.v1.iframe`` directly (instead of importing
            its module) is deprecated and will be disallowed in a later version.

        Parameters
        ----------
        src : str
            The URL of the page to embed.

        width : int
            The width of the iframe in CSS pixels. By default, this is the
            app's default element width.

        height : int
            The height of the frame in CSS pixels. By default, this is ``150``.

        scrolling : bool
            Whether to allow scrolling in the iframe. If this ``False``
            (default), Streamlit crops any content larger than the iframe and
            does not show a scrollbar. If this is ``True``, Streamlit shows a
            scrollbar when the content is larger than the iframe.

        Example
        -------

        >>> import streamlit.components.v1 as components
        >>>
        >>> components.iframe("https://example.com", height=500)

        )srcwidthheight	scrollingiframeIFrameProtomarshalldg_enqueue)selfr   r   r   r   iframe_protos         N/var/www/openai/venv/lib/python3.12/site-packages/streamlit/elements/iframe.pyr   zIframeMixin._iframe   s<    V #}	
 ww,77    _htmlc                n    t               }t        |||||       | j                  j                  d|      S )a6  Display an HTML string in an iframe.

        To use this function, import it from the ``streamlit.components.v1``
        module.

        If you want to insert HTML text into your app without an iframe, try
        ``st.html`` instead.

        .. warning::
            Using ``st.components.v1.html`` directly (instead of importing
            its module) is deprecated and will be disallowed in a later version.

        Parameters
        ----------
        html : str
            The HTML string to embed in the iframe.

        width : int
            The width of the iframe in CSS pixels. By default, this is the
            app's default element width.

        height : int
            The height of the frame in CSS pixels. By default, this is ``150``.

        scrolling : bool
            Whether to allow scrolling in the iframe. If this ``False``
            (default), Streamlit crops any content larger than the iframe and
            does not show a scrollbar. If this is ``True``, Streamlit shows a
            scrollbar when the content is larger than the iframe.

        Example
        -------

        >>> import streamlit.components.v1 as components
        >>>
        >>> components.html(
        >>>     "<p><span style='text-decoration: line-through double red;'>Oops</span>!</p>"
        >>> )

        )srcdocr   r   r   r   r   )r   htmlr   r   r   r   s         r   r   zIframeMixin._htmlP   s<    ` #}	
 ww,77r   c                    t        d|       S )zGet our DeltaGenerator.r   )r   )r   s    r   r   zIframeMixin.dg   s     $d++r   )NNF)
r   strr   
int | Noner   r!   r   boolreturnr   )
r   r    r   r!   r   r!   r   r"   r#   r   )r#   r   )__name__
__module____qualname__r   r   r   propertyr    r   r   r
   r
      s    I !!2828 28 	28
 28 
28 28h G !!7878 78 	78
 78 
78 78r , ,r   r
   Nc                    ||| _         ||| _        ||| _        d| _        ||| _        || _        yd| _        || _        y)a  Marshalls data into an IFrame proto.

    These parameters correspond directly to <iframe> attributes, which are
    described in more detail at
    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe.

    Parameters
    ----------
    proto : IFrame protobuf
        The protobuf object to marshall data into.
    src : str
        The URL of the page to embed.
    srcdoc : str
        Inline HTML to embed. Overrides src.
    width : int
        The width of the frame in CSS pixels. Defaults to the app's
        default element width.
    height : int
        The height of the frame in CSS pixels. Defaults to 150.
    scrolling : bool
        If true, show a scrollbar when the content is larger than the iframe.
        Otherwise, never show a scrollbar.

    NT   )r   r   r   	has_widthr   r   )protor   r   r   r   r   s         r   r   r      sX    @ 	  EO EOr   )NNNNF)r,   r   r   
str | Noner   r-   r   r!   r   r!   r   r"   r#   None)
__future__r   typingr   r   streamlit.proto.IFrame_pb2r   r   streamlit.runtime.metrics_utilr   streamlit.delta_generatorr   r
   r   r(   r   r   <module>r4      s~    # & < 98s, s,p / / 	/  /  	/ 
 /  /  
/ r   