§
    ‹hþhƒ  ã                   ó\   — d dl m Z  d dlZd dlZd dlZdej        j        _        d„ Zd„ ZdZ	dS )é    )ÚglobNÚsphinx_gallery_pngc                 óì  — t           j                             |d         ¦  «        }t          t	          t           j                             |d¦  «        ¦  «        ¦  «        }t          t	          t           j                             |d¦  «        ¦  «        ¦  «        }|d         }t          ¦   «         }t          ¦   «         }	t          ||¦  «        D ]‘\  }
}||	vrˆ|	t          |¦  «        z  }	t          |¦  «        }t           j         
                    |¦  «        d         dz   }|                     |¦  «         t          j        ||¦  «         t          j        |
|¦  «         Œ’t          ||d         ¦  «        S )a<  Scrape Plotly figures for galleries of examples using
    sphinx-gallery.

    Examples should use ``plotly.io.show()`` to display the figure with
    the custom sphinx_gallery renderer.

    Since the sphinx_gallery renderer generates both html and static png
    files, we simply crawl these files and give them the appropriate path.

    Parameters
    ----------
    block : tuple
        A tuple containing the (label, content, line_number) of the block.
    block_vars : dict
        Dict of block variables.
    gallery_conf : dict
        Contains the configuration of Sphinx-Gallery
    **kwargs : dict
        Additional keyword arguments to pass to
        :meth:`~matplotlib.figure.Figure.savefig`, e.g. ``format='svg'``.
        The ``format`` kwarg in particular is used to set the file extension
        of the output file (currently only 'png' and 'svg' are supported).

    Returns
    -------
    rst : str
        The ReSTructuredText that will be rendered to HTML containing
        the images.

    Notes
    -----
    Add this function to the image scrapers
    Úsrc_filez*.pngz*.htmlÚimage_path_iteratorr   z.htmlÚsrc_dir)ÚosÚpathÚdirnameÚsortedr   ÚjoinÚlistÚsetÚzipÚnextÚsplitextÚappendÚshutilÚmoveÚ
figure_rst)ÚblockÚ
block_varsÚgallery_confÚkwargsÚexamples_dirÚpngsÚhtmlsr   Úimage_namesÚseenÚhtmlÚpngÚthis_image_path_pngÚthis_image_path_htmls                 úL/var/www/histauto/venv/lib/python3.11/site-packages/plotly/io/_sg_scraper.pyÚplotly_sg_scraperr%      s<  € õD ”7—?’? :¨jÔ#9Ñ:Ô:€LÝ•$•r”w—|’| L°'Ñ:Ô:Ñ;Ô;Ñ<Ô<€DÝ•4�œŸš \°8Ñ<Ô<Ñ=Ô=Ñ>Ô>€EØ$Ð%:Ô;ÐÝ‘&”&€KÝ‰5Œ5€DÝ˜ Ñ%Ô%ð 4ð 4‰	ˆˆcØ�dˆ?ˆ?Ø•C˜‘H”HÑˆDÝ"&Ð':Ñ";Ô";ÐÝ#%¤7×#3Ò#3Ð4GÑ#HÔ#HÈÔ#KÈgÑ#UÐ Ø×ÒÐ3Ñ4Ô4Ð4ÝŒK˜Ð0Ñ1Ô1Ð1ÝŒK˜Ð2Ñ3Ô3Ð3øå�k <°	Ô#:Ñ;Ô;Ð;ó    c                 óÎ   ‡— ˆfd„| D ¦   «         }d}|s|S |d         }t           j                             dt           j                             |¦  «        ¦  «        }t          |z  }|S )aÀ  Generate RST for a list of PNG filenames.

    Depending on whether we have one or more figures, we use a
    single rst call to 'image' or a horizontal list.

    Parameters
    ----------
    figure_list : list
        List of strings of the figures' absolute paths.
    sources_dir : str
        absolute path of Sphinx documentation sources

    Returns
    -------
    images_rst : str
        rst code to embed the images in the document
    c                 ó²   •— g | ]S}t           j                             |‰¦  «                             t           j        d ¦  «                             d ¦  «        ‘ŒTS )ú/)r	   r
   ÚrelpathÚreplaceÚsepÚlstrip)Ú.0Úfigure_pathÚsources_dirs     €r$   ú
<listcomp>zfigure_rst.<locals>.<listcomp>T   sY   ø€ ð ð ð àõ 	Œ�Š˜ [Ñ1Ô1×9Ò9½"¼&À#ÑFÔF×MÒMÈcÑRÔRðð ð r&   Ú r   Úimages)r	   r
   r   ÚbasenameÚSINGLE_HTML)Úfigure_listr0   Úfigure_pathsÚ
images_rstÚfigure_namer/   s    `    r$   r   r   A   s~   ø€ ð&ð ð ð à&ðñ ô €Lð €JØð ØÐØ˜q”/€KÝ”'—,’,˜x­¬×)9Ò)9¸+Ñ)FÔ)FÑGÔG€KÝ˜{Ñ*€JØÐr&   z
.. raw:: html
    :file: %s
)
r   r	   r   ÚplotlyÚioÚ	renderersÚdefaultr%   r   r5   © r&   r$   ú<module>r?      sl   ðð Ð Ð Ð Ð Ð Ø 	€	€	€	Ø €€€à €€€à2€„	Ô Ô ð1<ð 1<ð 1<ðhð ð ð@€€€r&   