
    &e#                         d dl mZ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	ed
ee         dee         dee         dee         deddfdZdS )    )TYPE_CHECKINGOptionalcast)IFrame)gather_metrics)DeltaGeneratorc                       e Zd Z ed          	 	 	 ddedee         dee         dedd	f
d
            Z ed          	 	 	 ddedee         dee         dedd	f
d            Z	e
dd            ZdS )IframeMixin_iframeNFsrcwidthheight	scrollingreturnr   c                 |    t                      }t          |||||           | j                            d|          S )a  Load a remote URL in an iframe.

        Parameters
        ----------
        src : str
            The URL of the page to embed.
        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, do not show a scrollbar. Defaults to False.

        )r   r   r   r   iframeIFrameProtomarshalldg_enqueue)selfr   r   r   r   iframe_protos         9lib/python3.11/site-packages/streamlit/elements/iframe.pyr   zIframeMixin._iframe   sM    0 #}}	
 	
 	
 	
 w,777    _htmlhtmlc                 |    t                      }t          |||||           | j                            d|          S )a"  Display an HTML string in an iframe.

        Parameters
        ----------
        html : str
            The HTML string to embed in the iframe.
        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, do not show a scrollbar. Defaults to False.

        )srcdocr   r   r   r   r   )r   r   r   r   r   r   s         r   r   zIframeMixin._html;   sM    0 #}}	
 	
 	
 	
 w,777r   c                 "    t          d|           S )zGet our DeltaGenerator.r   )r   )r   s    r   r   zIframeMixin.dg]   s     $d+++r   )NNF)r   r   )__name__
__module____qualname__r   strr   intboolr   r   propertyr    r   r   r
   r
      s       ^I  $ $8 88 }8 	8
 8 
8 8 8 8B ^G  $ $8 88 }8 	8
 8 
8 8 8 8B , , , X, , ,r   r
   NFprotor   r   r   r   r   r   c                 z    ||| _         ||| _        ||| _        d| _        ||| _        nd| _        || _        dS )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   )r)   r   r   r   r   r   s         r   r   r   c   sS    @ 	EOOOr   )NNNNF)typingr   r   r   streamlit.proto.IFrame_pb2r   r   streamlit.runtime.metrics_utilr   streamlit.delta_generatorr   r
   r$   r%   r&   r   r(   r   r   <module>r1      s   1 0 0 0 0 0 0 0 0 0 < < < < < < 9 9 9 9 9 9 9888888H, H, H, H, H, H, H, H,Z   /  / / 	#/  SM/  C=	/ 
 SM/  /  
/  /  /  /  /  / r   