
    ɯei(                     V    d dl Zd dlmc mZ d Zd	dZd	dZd	dZ	 d
dZ	d	dZ
d	dZy)    Nc                      | d   dk(  r| dd S | S )aC  Strip trailing slash if present on link.

    Parameters
    ----------
    link : str
        URL from code sharing website

    Returns
    -------
    str
        Returns value of `link` without trailing slash.

    Example
    -------
    >>> _clean_link("https://gist.github.com/randyzwitch/be8c5e9fb5b8e7b046afebcac12e5087/")
    'https://gist.github.com/randyzwitch/be8c5e9fb5b8e7b046afebcac12e5087'

    >>> _clean_link("https://gist.github.com/randyzwitch/be8c5e9fb5b8e7b046afebcac12e5087")
    'https://gist.github.com/randyzwitch/be8c5e9fb5b8e7b046afebcac12e5087'
    /N )links    ^/var/www/html/glpi_dashboard/venv/lib/python3.12/site-packages/streamlit_embedcode/__init__.py_clean_linkr	      s    , RC491T1    c                     t        |       j                  d      dd \  }}t        j                  d| d| d|||      S )a  Embed a GitHub gist.

    Parameters
    ----------
    link : str
        URL from https://gist.github.com/
    height: int
        Height of the resulting iframe
    width: int
        Width of the resulting iframe
    scrolling: bool
        If content is larger than iframe size, provide scrollbars?
    
    Example
    -------
    >>> github_gist("https://gist.github.com/randyzwitch/934d502e53f2adcb48eea2423fe4a47e")
    r   Nz%<script src="https://gist.github.com/z.js"></script>heightwidth	scrollingr	   split
componentshtml)r   r   r   r   gistcreatorgistids         r   github_gistr      sQ    & &d+11#6rs;K??1+ax~X	 r
   c                 v    t        |       j                  d      d   }t        j                  d| d|||      S )a  Embed a Gitlab snippet.

    Parameters
    ----------
    link : str
        URL from https://gitlab.com/explore/snippets
    height: int
        Height of the resulting iframe
    width: int
        Width of the resulting iframe
    scrolling: bool
        If content is larger than iframe size, provide scrollbars?
    
    Example
    -------
    >>> gitlab_snippet("https://gitlab.com/snippets/1995463", height = 400)
    r   r   z)<script src='https://gitlab.com/snippets/z.js'></script>r   r   r   r   r   r   snippetnumbers        r   gitlab_snippetr   :   sD    &  %++C04M??5m_NU	 r
   c                 v    t        |       j                  d      d   }t        j                  d| d|||      S )a  Embed a Pastebin snippet.

    Parameters
    ----------
    link : str
        URL from https://pastebin.com/
    height: int
        Height of the resulting iframe
    width: int
        Width of the resulting iframe
    scrolling: bool
        If content is larger than iframe size, provide scrollbars?
    
    Example
    -------
    >>> pastebin_snippet("https://pastebin.com/AWYbziQF", width = 600, scrolling = False)
    r   r   z+<script src="https://pastebin.com/embed_js/"></script>r   r   r   s        r   pastebin_snippetr   V   sD    &  %++C04M??7kT	 r
   c                     t        |       j                  d      dd \  }}}t        j                  d| d| d| d| dt	        |      j                          d	| d
|||      S )ag  Embed a CodePen snippet.

    Parameters
    ----------
    link : str
        URL from https://codepen.io/
    height: int
        Height of the resulting iframe
    width: int
        Width of the resulting iframe
    scrolling: bool
        If content is larger than iframe size, provide scrollbars?
    theme: str
        Color theme of snippet (i.e. "light", "dark")
    preview: bool
        Require snippet to be clicked to load. Setting `preview=True` can improve load times.

    
    Example
    -------
    >>> codepen_snippet("https://codepen.io/ste-vg/pen/GRooLza", width = 600, scrolling = False)
    r   Nz2
        <p class="codepen" 
        data-height="z" 
        data-theme-id="z>" 
        data-default-tab="html,result" 
        data-user="z" 
        data-slug-hash="z" 
        data-preview="z" 
        style="height: zpx; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"">
    </p><script async src="https://static.codepen.io/assets/embed/ei.js"></script>
    r   )r	   r   r   r   strlower)	r   r   r   r   themepreviewuser_slughashs	            r   codepen_snippetr(   r   s    4 $D)//4RS9D!X??X w 6 !
 #7|))+, -x  
	  r
   c                 v    t        |       j                  d      d   }t        j                  d| d|||      S )a  Embed a Ideone snippet.

    Parameters
    ----------
    link : str
        URL from https://ideone.com/
    height: int
        Height of the resulting iframe
    width: int
        Width of the resulting iframe
    scrolling: bool
        If content is larger than iframe size, provide scrollbars?
    
    Example
    -------
    >>> ideone_snippet("https://ideone.com/vQ54cr")
    r   r   z%<script src="https://ideone.com/e.js/z#" type="text/javascript" ></script>r   r   r   s        r   ideone_snippetr*      sE    &  %++C04M??1-@cf	 r
   c                 v    t        |       j                  d      d   }t        j                  d| d|||      S )a  Embed a TagMyCode snippet.

    Parameters
    ----------
    link : str
        URL from https://tagmycode.com/
    height: int
        Height of the resulting iframe
    width: int
        Width of the resulting iframe
    scrolling: bool
        If content is larger than iframe size, provide scrollbars?
    
    Example
    -------
    >>> tagmycode_snippet("https://tagmycode.com/snippet/5965/recursive-list-files-in-a-dir#.Xwyc43VKglU")
    r   r   z,<script src="https://tagmycode.com/embed/js/r   r   r   r   s        r   tagmycode_snippetr,      sD    &  %++C04M??8{U	 r
   )X    T)r-   r.   TlightT)	streamlitststreamlit.components.v1r   v1r	   r   r   r   r(   r*   r,   r   r
   r   <module>r4      s9     , ,2288: IM*Z8r
   