§
    „ßjþ  ã                  ó@  — d dl mZ d dl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 ddlmZ ddlmZ ddlmZ ej        rddlmZ ddlmZ ddlmZ d*d„Z G d„ de¦  «        Z G d„ de¦  «        Zd+d„Zd,d#„Zd-d%„Zd.d'„Z d/d(„Z!d0d)„Z"dS )1é    )ÚannotationsN)Ú
BaseLoader)ÚEnvironment)ÚTemplate)ÚTemplateNotFoundé   )Ú_cv_app)Ú_cv_request)Úcurrent_app)Úrequest)Ústream_with_context)Úbefore_render_template)Útemplate_rendered)ÚFlask)ÚApp)ÚScaffoldÚreturnúdict[str, t.Any]c                 óŠ   — t          j        d¦  «        } t          j        d¦  «        }i }| �
| j        |d<   |�
|j        |d<   |S )z‡Default template context processor.  Replaces the ``request`` and ``g``
    proxies with their concrete objects for faster access.
    NÚgr   )r	   Úgetr
   r   r   )ÚappctxÚreqctxÚrvs      úC/var/www/html/venv/lib/python3.11/site-packages/flask/templating.pyÚ_default_template_ctx_processorr      sP   € õ Œ[˜ÑÔ€FÝŒ_˜TÑ"Ô"€FØ€BØÐØ”(ˆˆ3‰ØÐØœˆˆ9‰ð €Ió    c                  ó   — e Zd ZdZd
d„Zd	S )r   zËWorks like a regular Jinja environment but has some additional
    knowledge of how Flask's blueprint works so that it can prepend the
    name of the blueprint to referenced templates if necessary.
    Úappr   Úoptionsút.Anyr   ÚNonec                ón   — d|vr|                      ¦   «         |d<   t          j        | fi |¤Ž || _        d S )NÚloader)Úcreate_global_jinja_loaderÚBaseEnvironmentÚ__init__r   )Úselfr   r    s      r   r'   zEnvironment.__init__.   sG   € Ø˜7Ð"Ð"Ø #× >Ò >Ñ @Ô @ˆG�HÑÝÔ  Ð1Ð1¨Ð1Ð1Ð1ØˆŒˆˆr   N)r   r   r    r!   r   r"   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r'   © r   r   r   r   (   s2   € € € € € ðð ð
ð ð ð ð ð r   r   c                  óB   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	dS )ÚDispatchingJinjaLoaderz\A loader that looks for templates in the application and all
    the blueprint folders.
    r   r   r   r"   c                ó   — || _         d S ©N)r   )r(   r   s     r   r'   zDispatchingJinjaLoader.__init__:   s   € ØˆŒˆˆr   Úenvironmentr&   ÚtemplateÚstrú3tuple[str, str | None, t.Callable[[], bool] | None]c                ó~   — | j         j        d         r|                      ||¦  «        S |                      ||¦  «        S )NÚEXPLAIN_TEMPLATE_LOADING)r   ÚconfigÚ_get_source_explainedÚ_get_source_fast)r(   r2   r3   s      r   Ú
get_sourcez!DispatchingJinjaLoader.get_source=   sC   € ð Œ8Œ?Ð5Ô6ð 	EØ×-Ò-¨k¸8ÑDÔDÐDØ×$Ò$ [°(Ñ;Ô;Ð;r   c                ó"  — g }d }|                       |¦  «        D ]K\  }}	 |                     ||¦  «        }|€|}n# t          $ r d }Y nw xY w|                     |||f¦  «         ŒLddlm}  || j        ||¦  «         |�|S t          |¦  «        ‚)Nr   )Ú!explain_template_loading_attempts)Ú_iter_loadersr;   r   ÚappendÚdebughelpersr=   r   )	r(   r2   r3   ÚattemptsÚtrvÚsrcobjr$   r   r=   s	            r   r9   z,DispatchingJinjaLoader._get_source_explainedD   sÕ   € ð ˆàLPˆà"×0Ò0°Ñ:Ô:ð 	2ð 	2‰NˆF�FðØ×&Ò& {°HÑ=Ô=�Ø�;Ø�CøøÝ#ð ð ð Ø���ðøøøà�OŠO˜V V¨RÐ0Ñ1Ô1Ð1Ð1àCÐCÐCÐCÐCÐCà)Ð)¨$¬(°H¸hÑGÔGÐGàˆ?ØˆJÝ˜xÑ(Ô(Ð(s    ;»A
Á	A
c                ó¦   — |                       |¦  «        D ]-\  }}	 |                     ||¦  «        c S # t          $ r Y Œ*w xY wt          |¦  «        ‚r1   )r>   r;   r   )r(   r2   r3   Ú_srcobjr$   s        r   r:   z'DispatchingJinjaLoader._get_source_fast\   st   € ð  $×1Ò1°(Ñ;Ô;ð 	ð 	‰OˆG�VðØ×(Ò(¨°hÑ?Ô?Ð?Ð?Ð?øÝ#ð ð ð Ø�ðøøøå˜xÑ(Ô(Ð(s   œ4´
AÁ Aú't.Iterator[tuple[Scaffold, BaseLoader]]c              #  ó’   K  — | j         j        }|�| j         |fV — | j                              ¦   «         D ]}|j        }|�||fV — Œd S r1   )r   Újinja_loaderÚiter_blueprints)r(   r3   r$   Ú	blueprints       r   r>   z$DispatchingJinjaLoader._iter_loadersf   sp   è è € Ø”Ô&ˆØÐØ”(˜FÐ"Ð"Ð"Ð"àœ×1Ò1Ñ3Ô3ð 	(ð 	(ˆIØÔ+ˆFØÐ!Ø Ð'Ð'Ð'Ð'øð	(ð 	(r   ú	list[str]c                óH  — t          ¦   «         }| j        j        }|�'|                     |                     ¦   «         ¦  «         | j                             ¦   «         D ]7}|j        }|�,|                     ¦   «         D ]}|                     |¦  «         ŒŒ8t          |¦  «        S r1   )Úsetr   rH   ÚupdateÚlist_templatesrI   ÚaddÚlist)r(   Úresultr$   rJ   r3   s        r   rO   z%DispatchingJinjaLoader.list_templatesp   s¡   € Ý‘”ˆØ”Ô&ˆØÐØ�MŠM˜&×/Ò/Ñ1Ô1Ñ2Ô2Ð2àœ×1Ò1Ñ3Ô3ð 	)ð 	)ˆIØÔ+ˆFØÐ!Ø &× 5Ò 5Ñ 7Ô 7ð )ð )�HØ—J’J˜xÑ(Ô(Ð(Ð(øå�F‰|Œ|Ðr   N)r   r   r   r"   )r2   r&   r3   r4   r   r5   )r3   r4   r   rF   )r   rK   )
r)   r*   r+   r,   r'   r;   r9   r:   r>   rO   r-   r   r   r/   r/   5   s–   € € € € € ðð ðð ð ð ð<ð <ð <ð <ð)ð )ð )ð )ð0)ð )ð )ð )ð(ð (ð (ð (ðð ð ð ð ð r   r/   r   r   r3   r   Úcontextr4   c                óÎ   — |                       |¦  «         t          j        | | j        ||¬¦  «         |                     |¦  «        }t          j        | | j        ||¬¦  «         |S ©N©Ú_async_wrapperr3   rS   )Úupdate_template_contextr   ÚsendÚensure_syncÚrenderr   )r   r3   rS   r   s       r   Ú_renderr\      sz   € Ø×Ò Ñ(Ô(Ð(ÝÔØ˜CœO°hÈðñ ô ð ð 
�Š˜Ñ	!Ô	!€BÝÔØ˜CœO°hÈðñ ô ð ð €Ir   Útemplate_name_or_listú%str | Template | list[str | Template]r!   c                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )a  Render a template by name with the given context.

    :param template_name_or_list: The name of the template to render. If
        a list is given, the first name to exist will be rendered.
    :param context: The variables to make available in the template.
    )r   Ú_get_current_objectÚ	jinja_envÚget_or_select_templater\   ©r]   rS   r   r3   s       r   Úrender_templaterd   ‹   s:   € õ Ô
)Ñ
+Ô
+€CØŒ}×3Ò3Ð4IÑJÔJ€HÝ�3˜ 'Ñ*Ô*Ð*r   Úsourcec                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )zÓRender a template from the given source string with the given
    context.

    :param source: The source code of the template to render.
    :param context: The variables to make available in the template.
    )r   r`   ra   Úfrom_stringr\   ©re   rS   r   r3   s       r   Úrender_template_stringri   š   s9   € õ Ô
)Ñ
+Ô
+€CØŒ}×(Ò(¨Ñ0Ô0€HÝ�3˜ 'Ñ*Ô*Ð*r   út.Iterator[str]c                óÀ   ‡ ‡‡— ‰                       ‰¦  «         t          j        ‰ ‰ j        ‰‰¬¦  «         dˆ ˆˆfd„} |¦   «         }t          rt          |¦  «        }|S )NrV   r   rj   c               3  ó|   •K  — ‰                      ‰¦  «        E d {V —† t          j        ‰ ‰ j        ‰‰¬¦  «         d S rU   )Úgenerater   rY   rZ   )r   rS   r3   s   €€€r   rm   z_stream.<locals>.generate®   s\   øè è € Ø×$Ò$ WÑ-Ô-Ð-Ð-Ð-Ð-Ð-Ð-Ð-ÝÔØ ¤¸(ÈGð	
ñ 	
ô 	
ð 	
ð 	
ð 	
r   )r   rj   )rX   r   rY   rZ   r   r   )r   r3   rS   rm   r   s   ```  r   Ú_streamrn   ¦   s‘   øøø€ ð ×Ò Ñ(Ô(Ð(ÝÔØ˜CœO°hÈðñ ô ð ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ˆ‰Œ€Bõ ð %Ý  Ñ$Ô$ˆà€Ir   c                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )a“  Render a template by name with the given context as a stream.
    This returns an iterator of strings, which can be used as a
    streaming response from a view.

    :param template_name_or_list: The name of the template to render. If
        a list is given, the first name to exist will be rendered.
    :param context: The variables to make available in the template.

    .. versionadded:: 2.2
    )r   r`   ra   rb   rn   rc   s       r   Ústream_templaterp   ½   s:   € õ Ô
)Ñ
+Ô
+€CØŒ}×3Ò3Ð4IÑJÔJ€HÝ�3˜ 'Ñ*Ô*Ð*r   c                ó~   — t          j        ¦   «         }|j                             | ¦  «        }t	          |||¦  «        S )aZ  Render a template from the given source string with the given
    context as a stream. This returns an iterator of strings, which can
    be used as a streaming response from a view.

    :param source: The source code of the template to render.
    :param context: The variables to make available in the template.

    .. versionadded:: 2.2
    )r   r`   ra   rg   rn   rh   s       r   Ústream_template_stringrr   Ð   s9   € õ Ô
)Ñ
+Ô
+€CØŒ}×(Ò(¨Ñ0Ô0€HÝ�3˜ 'Ñ*Ô*Ð*r   )r   r   )r   r   r3   r   rS   r   r   r4   )r]   r^   rS   r!   r   r4   )re   r4   rS   r!   r   r4   )r   r   r3   r   rS   r   r   rj   )r]   r^   rS   r!   r   rj   )re   r4   rS   r!   r   rj   )#Ú
__future__r   ÚtypingÚtÚjinja2r   r   r&   r   r   Úglobalsr	   r
   r   r   Úhelpersr   Úsignalsr   r   ÚTYPE_CHECKINGr   r   Ú
sansio.appr   Úsansio.scaffoldr   r   r/   r\   rd   ri   rn   rp   rr   r-   r   r   ú<module>r}      s  ðØ "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð à Ð Ð Ð Ð Ð Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #à Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ø  Ð  Ð  Ð  Ð  Ð  Ø Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (Ø +Ð +Ð +Ð +Ð +Ð +Ø &Ð &Ð &Ð &Ð &Ð &à„?ð *ØÐÐÐÐÐØÐÐÐÐÐØ)Ð)Ð)Ð)Ð)Ð)ðð ð ð ð 
ð 
ð 
ð 
ð 
�/ñ 
ô 
ð 
ðGð Gð Gð Gð G˜Zñ Gô Gð GðT	ð 	ð 	ð 	ð+ð +ð +ð +ð	+ð 	+ð 	+ð 	+ðð ð ð ð.+ð +ð +ð +ð&+ð +ð +ð +ð +ð +r   