§
    î-PhÛ  ã                   ó    — d 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
 ddlmZ ddlmZ d	d
lmZmZ dedededededdfd„Zddeddfd„ZdS )z•customize events for logo management.

we use one event to copy over custom logo images to _static
and another even to link them in the html context
é    )Úpartial)ÚPath)ÚNode)ÚSphinx)ÚExtensionError)Úisurl)Úcopy_asset_fileé   )Úget_theme_options_dictÚ
maybe_warnÚappÚpagenameÚtemplatenameÚcontextÚdoctreeÚreturnNc                 óæ  — |                      d¦  «        }|                      d¦  «        p|                      d¦  «        }|                      di ¦  «        }i |d<   dD ]Ž}|                      d|› ¦  «        }	|	r?t          |	¦  «        s$t          |	¦  «        j        }
 |d|
› d	¬
¦  «        }	|	|d         |<   Œ[t	          |t
          ¦  «        rt          |¦  «        dk    r||d         |<   Œ||d<   dS )ap  Set up relative paths to logos in our HTML templates.

    In Sphinx, the context["logo"] is a path to the `html_logo` image now in the output
    `_static` folder.

    If logo["image_light"] and logo["image_dark"] are given, we must modify them to
    follow the same pattern. They have already been copied to the output folder
    in the `update_config` event.
    ÚpathtoÚlogo_urlÚlogoÚ
theme_logoÚimage_relative©ÚlightÚdarkÚimage_z_static/T)Úresourcer   N)Úgetr   r   ÚnameÚ
isinstanceÚstrÚlen)r   r   r   r   r   r   r   r   ÚkindÚimage_kind_logoÚimage_kind_names              úX/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pydata_sphinx_theme/logo.pyÚsetup_logo_pathr'      s  € ð [Š[˜Ñ"Ô"€FØ;Š;zÑ"Ô"Ð9 g§k¢k°&Ñ&9Ô&9€DØ—’˜\¨2Ñ.Ô.€Jð $&€JÐÑ Ø!ð 6ð 6ˆØ$Ÿ.š.¨°$¨¨Ñ9Ô9ˆð ð 		6Ý˜Ñ)Ô)ð VÝ"& Ñ"7Ô"7Ô"<Ø"( &Ð)E°OÐ)EÐ)EÐPTÐ"UÑ"UÔ"UØ1@ˆJÐ'Ô(¨Ñ.Ð.õ ˜cÑ"Ô"ð 	6¥s¨4¡y¤y°1¢} }Ø15ˆJÐ'Ô(¨Ñ.øð '€GˆLÑÐÐó    c                 óè  — t          t          | ¦  «        }t          | ¦  «                             di ¦  «        }t	          | j        j        ¦  «        dz  }|                     ¦   «         sJ ‚dD ]}|                     d|› ¦  «        }|rt          |¦  «        rŒ-|t	          |¦  «        j	        z   
                    ¦   «         rŒWt	          | j        ¦  «        |z  }|                     ¦   «         sJ ‚| 
                    ¦   «         s |d|› d|› ¦  «         |                     ¦   «                              d¦  «        rt          d|› d	|› d
¦  «        ‚t          t!          |¦  «        |¦  «         ŒdS )z¿
    Copy logo image to the _static directory.

    If logo image paths are given, copy them to the `_static` folder.
    Then we can link to them directly in an html_page_context event.
    r   Ú_staticr   r   zPath to z image logo does not exist: Ú_tzThe z logo path 'zC' looks like a Sphinx template; please provide a static logo image.N)r   r   r   r   r   ÚbuilderÚoutdirÚis_absoluter   r   ÚexistsÚsrcdirÚlowerÚendswithr   r	   r!   )r   Ú	exceptionÚwarningr   Ú	staticdirr#   Ú
path_imageÚfull_logo_paths           r&   Úcopy_logo_imagesr8   :   s©  € õ •j #Ñ&Ô&€GÝ! #Ñ&Ô&×*Ò*¨6°2Ñ6Ô6€DÝS”[Ô'Ñ(Ô(¨9Ñ4€IØ× Ò Ñ"Ô"Ð"Ð"Ð"Ø!ð 8ñ 8ˆØ—X’X˜o t˜o˜oÑ.Ô.ˆ
Øð 	U :Ñ.Ô.ð 	ØØ˜ZÑ(Ô(Ô-Ñ-×5Ò5Ñ7Ô7ð 	ð Ý˜cœjÑ)Ô)¨JÑ6ˆØ×)Ò)Ñ+Ô+Ð+Ð+Ð+Ø×$Ò$Ñ&Ô&ð 	OØˆGÐM˜tÐMÐMÀÐMÐMÑNÔNÐNð ×ÒÑÔ×&Ò& tÑ,Ô,ð 	Ý ð6tð 6ð 6¨ð 6ð 6ð 6ñô ð õ 	˜NÑ+Ô+¨YÑ7Ô7Ð7Ñ7ð'8ð 8r(   )N)Ú__doc__Ú	functoolsr   Úpathlibr   Údocutils.nodesr   Úsphinx.applicationr   Úsphinx.errorsr   Úsphinx.utilr   Úsphinx.util.fileutilr	   Úutilsr   r   r!   Údictr'   r8   © r(   r&   ú<module>rD      s  ððð ð Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %Ø (Ð (Ð (Ð (Ð (Ð (Ø Ð Ð Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0à 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5ð$'Ø	ð$'Øð$'Ø.1ð$'Ø<@ð$'ØKOð$'à	ð$'ð $'ð $'ð $'ðN8ð 8˜&ð 8°Tð 8ð 8ð 8ð 8ð 8ð 8r(   