§
    Ÿjè$  ã                   óÐ   — d dl mZ d dlmZ dZ G d„ de¦  «        Z G d„ de¦  «        Z G d„ d	¦  «        Z G d
„ de¦  «        Z	 G d„ de¦  «        Z
 G d„ de	¦  «        Zdd„ZdS )é    )Úcontextmanager)Úcopy)z'django.template.context_processors.csrfc                   ó   — e Zd ZdZdS )ÚContextPopExceptionz,pop() has been called more times than push()N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úd/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/django/template/context.pyr   r      s   € € € € € Ø2Ð2à€Dr   r   c                   ó*   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zˆ xZS )ÚContextDictc                 ó|   •—  t          ¦   «         j        |i |¤Ž |j                             | ¦  «         || _        d S ©N)ÚsuperÚ__init__ÚdictsÚappendÚcontext)Úselfr   ÚargsÚkwargsÚ	__class__s       €r   r   zContextDict.__init__   s@   ø€ Ø�‰ŒÔ˜$Ð) &Ð)Ð)Ð)àŒ×Ò˜TÑ"Ô"Ð"ØˆŒˆˆr   c                 ó   — | S r   r   ©r   s    r   Ú	__enter__zContextDict.__enter__   s   € Øˆr   c                 ó8   — | j                              ¦   «          d S r   )r   Úpop)r   r   r   s      r   Ú__exit__zContextDict.__exit__   s   € ØŒ×ÒÑÔÐÐÐr   )r   r   r	   r   r   r    Ú__classcell__©r   s   @r   r   r      sV   ø€ € € € € ðð ð ð ð ðð ð ðð ð ð ð ð ð r   r   c                   ó~   — e Zd Zdd„Zdd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Zdd„Zdd„Zdd„Zd„ Zd„ ZdS )ÚBaseContextNc                 ó0   — |                       |¦  «         d S r   )Ú_reset_dicts)r   Údict_s     r   r   zBaseContext.__init__   s   € Ø×Ò˜%Ñ Ô Ð Ð Ð r   c                 óÆ   — ddd dœ}|g| _         t          |t          ¦  «        r| xj         |j         dd …         z  c_         d S |�| j                              |¦  «         d S d S )NTF)ÚTrueÚFalseÚNoneé   )r   Ú
isinstancer$   r   )r   ÚvalueÚbuiltinss      r   r&   zBaseContext._reset_dicts    st   € Ø ¨5¸$Ð?Ð?ˆØ�ZˆŒ
Ý�e�[Ñ)Ô)ð 	%ØˆJŒJ˜%œ+ a b bœ/Ñ)ˆJŒJˆJˆJØÐØŒJ×Ò˜eÑ$Ô$Ð$Ð$Ð$ð Ðr   c                 ó”   — t          ¦   «         }| j        |_        t          | j        ¦  «        |_        | j        d d …         |_        |S r   )r$   r   r   Ú__dict__r   )r   Ú	duplicates     r   Ú__copy__zBaseContext.__copy__(   s>   € Ý‘M”Mˆ	Ø"œnˆ	ÔÝ! $¤-Ñ0Ô0ˆ	ÔØœ* Q Q Qœ-ˆ	ŒØÐr   c                 ó*   — t          | j        ¦  «        S r   )Úreprr   r   s    r   Ú__repr__zBaseContext.__repr__/   s   € Ý�D”JÑÔÐr   c                 ó*   — t          | j        ¦  «        S r   ©Úreversedr   r   s    r   Ú__iter__zBaseContext.__iter__2   s   € Ý˜œ
Ñ#Ô#Ð#r   c                 óª   — g }|D ]?}t          |t          ¦  «        r||j        dd …         z  }Œ*|                     |¦  «         Œ@t	          | g|¢R i |¤ŽS ©Nr,   )r-   r$   r   r   r   )r   r   r   r   Úds        r   ÚpushzBaseContext.push5   sm   € ØˆØð 	 ð 	 ˆAÝ˜!�[Ñ)Ô)ð  Ø˜œ   œÑ$��à—’˜Q‘”��Ý˜4Ð2 %Ð2Ð2Ð2¨6Ð2Ð2Ð2r   c                 ór   — t          | j        ¦  «        dk    rt          ‚| j                             ¦   «         S r<   )Úlenr   r   r   r   s    r   r   zBaseContext.pop>   s-   € ÝˆtŒz‰?Œ?˜aÒÐÝ%Ð%ØŒz�~Š~ÑÔÐr   c                 ó&   — || j         d         |<   dS )z%Set a variable in the current contextéÿÿÿÿN©r   )r   Úkeyr.   s      r   Ú__setitem__zBaseContext.__setitem__C   s   € à#ˆŒ
�2Œ�sÑÐÐr   c                 óh   — | j         d         }t          | j         ¦  «        D ]
}||v r|} nŒ|||<   dS )z|
        Set a variable in one of the higher contexts if it exists there,
        otherwise in the current context.
        rB   N)r   r9   )r   rD   r.   r   r=   s        r   Ú
set_upwardzBaseContext.set_upwardG   sO   € ð
 ”*˜R”.ˆÝ˜$œ*Ñ%Ô%ð 	ð 	ˆAØ�aˆxˆxØ�Ø�ð ð ˆ�‰ˆˆr   c                 ój   — t          | j        ¦  «        D ]}||v r
||         c S Œt          |¦  «        ‚)zHGet a variable's value, starting at the current context and going upward)r9   r   ÚKeyError)r   rD   r=   s      r   Ú__getitem__zBaseContext.__getitem__S   sB   € å˜$œ*Ñ%Ô%ð 	ð 	ˆAØ�aˆxˆxØ˜”v���ð å�s‰mŒmÐr   c                 ó"   — | j         d         |= dS )z*Delete a variable from the current contextrB   NrC   ©r   rD   s     r   Ú__delitem__zBaseContext.__delitem__Z   s   € àŒJ�rŒN˜3ÐÐÐr   c                 óD   ‡— t          ˆfd„| j        D ¦   «         ¦  «        S )Nc              3   ó    •K  — | ]}‰|v V — Œ	d S r   r   )Ú.0r=   rD   s     €r   ú	<genexpr>z+BaseContext.__contains__.<locals>.<genexpr>_   s'   øè è € Ð0Ð0 �3˜!�8Ð0Ð0Ð0Ð0Ð0Ð0r   )Úanyr   rL   s    `r   Ú__contains__zBaseContext.__contains__^   s(   ø€ ÝÐ0Ð0Ð0Ð0 T¤ZÐ0Ñ0Ô0Ñ0Ô0Ð0r   c                 óP   — t          | j        ¦  «        D ]}||v r
||         c S Œ|S r   r8   )r   rD   Ú	otherwiser=   s       r   ÚgetzBaseContext.geta   s<   € Ý˜$œ*Ñ%Ô%ð 	ð 	ˆAØ�aˆxˆxØ˜”v���ð àÐr   c                 óB   — 	 | |         S # t           $ r || |<   Y nw xY w|S r   )rI   )r   rD   Údefaults      r   Ú
setdefaultzBaseContext.setdefaultg   s>   € ð	 Ø˜”9ÐøÝð 	 ð 	 ð 	 ØˆD�‰IˆIˆIð	 øøøàˆs   ‚
 Š›c                 óN   — t          | ¦  «        }|                     |¦  «         |S )z{
        Return a new context with the same properties, but with only the
        values given in 'values' stored.
        )r   r&   )r   ÚvaluesÚnew_contexts      r   ÚnewzBaseContext.newn   s)   € õ
 ˜4‘j”jˆØ× Ò  Ñ(Ô(Ð(ØÐr   c                 óH   — i }| j         D ]}|                     |¦  «         Œ|S )z6
        Return self.dicts as one dictionary.
        )r   Úupdate)r   Úflatr=   s      r   ÚflattenzBaseContext.flattenw   s0   € ð ˆØ”ð 	ð 	ˆAØ�KŠK˜‰NŒNˆNˆNØˆr   c                 óŽ   — t          |t          ¦  «        st          S |                      ¦   «         |                     ¦   «         k    S )zN
        Compare two contexts by comparing theirs 'dicts' attributes.
        )r-   r$   ÚNotImplementedra   )r   Úothers     r   Ú__eq__zBaseContext.__eq__€   s7   € õ ˜%¥Ñ-Ô-ð 	"Ý!Ð!à�|Š|‰~Œ~ §¢¡¤Ò0Ð0r   r   )r   r   r	   r   r&   r3   r6   r:   r>   r   rE   rG   rJ   rM   rS   rV   rY   r]   ra   re   r   r   r   r$   r$      s,  € € € € € ð!ð !ð !ð !ð%ð %ð %ð %ðð ð ð ð  ð  ð$ð $ð $ð3ð 3ð 3ð ð  ð  ð
$ð $ð $ð
ð 
ð 
ðð ð ð ð  ð  ð1ð 1ð 1ðð ð ð ðð ð ð ðð ð ð ðð ð ð1ð 1ð 1ð 1ð 1r   r$   c                   óJ   ‡ — e Zd ZdZdˆ fd„	Zed„ ¦   «         Zˆ fd„Zd„ Zˆ xZ	S )	ÚContextz&A stack container for variable contextNTc                 ó¶   •— || _         || _        || _        d| _        t	          ¦   «         | _        d | _        t          ¦   «                              |¦  «         d S )NÚunknown)	Ú
autoescapeÚuse_l10nÚuse_tzÚtemplate_nameÚRenderContextÚrender_contextÚtemplater   r   )r   r'   rj   rk   rl   r   s        €r   r   zContext.__init__�   sS   ø€ Ø$ˆŒØ ˆŒØˆŒØ&ˆÔÝ+™oœoˆÔð ˆŒÝ‰Œ×Ò˜ÑÔÐÐÐr   c              #   ót   K  — | j         �t          d¦  «        ‚|| _         	 d V — d | _         d S # d | _         w xY w)Nú&Context is already bound to a template)rp   ÚRuntimeError)r   rp   s     r   Úbind_templatezContext.bind_template˜   sP   è è € àŒ=Ð$ÝÐGÑHÔHÐHØ ˆŒð	!ØˆEˆEˆEà ˆDŒMˆMˆMø˜DˆDŒMÐ Ð Ð Ð s   ¡. ®	7c                 óz   •— t          ¦   «                              ¦   «         }t          | j        ¦  «        |_        |S r   )r   r3   r   ro   )r   r2   r   s     €r   r3   zContext.__copy__¢   s1   ø€ Ý‘G”G×$Ò$Ñ&Ô&ˆ	Ý#'¨Ô(;Ñ#<Ô#<ˆ	Ô ØÐr   c                 óÌ   — t          |d¦  «        st          d¦  «        ‚t          |t          ¦  «        r!|j        dd…                              ¦   «         }t          | |¦  «        S )z;Push other_dict to the stack of dictionaries in the ContextrJ   z6other_dict must be a mapping (dictionary-like) object.r,   N)ÚhasattrÚ	TypeErrorr-   r$   r   r   r   )r   Ú
other_dicts     r   r_   zContext.update§   sc   € å�z =Ñ1Ô1ð 	VÝÐTÑUÔUÐUÝ�j¥+Ñ.Ô.ð 	4Ø#Ô)¨!¨"¨"Ô-×1Ò1Ñ3Ô3ˆJÝ˜4 Ñ,Ô,Ð,r   )NTNN)
r   r   r	   r
   r   r   rt   r3   r_   r!   r"   s   @r   rg   rg   Š   s†   ø€ € € € € Ø,Ð,ð	 ð 	 ð 	 ð 	 ð 	 ð 	 ð ð!ð !ñ „^ð!ðð ð ð ð ð
-ð -ð -ð -ð -ð -ð -r   rg   c                   óH   — e Zd ZdZdZd„ Zd„ Zd	d„Zd„ Ze	d
d„¦   «         Z
dS )rn   aÈ  
    A stack container for storing Template state.

    RenderContext simplifies the implementation of template Nodes by providing a
    safe place to store state between invocations of a node's `render` method.

    The RenderContext also provides scoping rules that are more sensible for
    'template local' variables. The render context stack is pushed before each
    template is rendered, creating a fresh scope with nothing in it. Name
    resolution fails if a variable is not found at the top of the RequestContext
    stack. Thus, variables are local to a specific template and don't affect the
    rendering of other templates as they would if they were stored in the normal
    template context.
    Nc              #   ó0   K  — | j         d         E d {V —† d S ©NrB   rC   r   s    r   r:   zRenderContext.__iter__Â   s*   è è € Ø”:˜b”>Ð!Ð!Ð!Ð!Ð!Ð!Ð!Ð!Ð!r   c                 ó    — || j         d         v S r|   rC   rL   s     r   rS   zRenderContext.__contains__Å   s   € Ø�d”j ”nÐ$Ð$r   c                 óD   — | j         d                              ||¦  «        S r|   )r   rV   )r   rD   rU   s      r   rV   zRenderContext.getÈ   s   € ØŒz˜"Œ~×!Ò! # yÑ1Ô1Ð1r   c                 ó(   — | j         d         |         S r|   rC   rL   s     r   rJ   zRenderContext.__getitem__Ë   s   € ØŒz˜"Œ~˜cÔ"Ð"r   Tc              #   óà   K  — | j         }|| _         |r|                      ¦   «          	 d V — || _         |r|                      ¦   «          d S d S # || _         |r|                      ¦   «          w w xY wr   )rp   r>   r   )r   rp   Úisolated_contextÚinitials       r   Ú
push_statezRenderContext.push_stateÎ   sŠ   è è € à”-ˆØ ˆŒØð 	Ø�IŠI‰KŒKˆKð	ØˆEˆEˆEà#ˆDŒMØð Ø—’‘
”
�
�
�
ðð øð $ˆDŒMØð Ø—’‘
”
�
�
ðøøøs   ¨A Á A-r   )T)r   r   r	   r
   rp   r:   rS   rV   rJ   r   rƒ   r   r   r   rn   rn   °   s†   € € € € € ðð ð €Hð"ð "ð "ð%ð %ð %ð2ð 2ð 2ð 2ð#ð #ð #ð ð
ð 
ð 
ñ „^ð
ð 
ð 
r   rn   c                   óP   ‡ — e Zd ZdZ	 	 	 	 	 dˆ fd„	Zed„ ¦   «         Zdˆ fd„	Zˆ xZS )	ÚRequestContextzù
    This subclass of template.Context automatically populates itself using
    the processors defined in the engine's configuration.
    Additional processors can be specified as a list of callables
    using the "processors" keyword argument.
    NTc                 ó  •— t          ¦   «                              ||||¬¦  «         || _        |€dnt          |¦  «        | _        t          | j        ¦  «        | _        |                      i ¦  «         |                      i ¦  «         d S )N)rk   rl   rj   r   )	r   r   ÚrequestÚtupleÚ_processorsr@   r   Ú_processors_indexr_   )r   r‡   r'   Ú
processorsrk   rl   rj   r   s          €r   r   zRequestContext.__init__ä   s|   ø€ õ 	‰Œ×Ò˜¨¸&ÈZÐÑXÔXÐXØˆŒØ!+Ð!3˜2˜2½¸zÑ9JÔ9JˆÔÝ!$ T¤Z¡¤ˆÔð 	�Š�B‰Œˆð 	�Š�B‰Œˆˆˆr   c              #   ó¦  K  — | j         �t          d¦  «        ‚|| _         |j        j        | j        z   }i }|D ]S} || j        ¦  «        }	 |                     |¦  «         Œ)# t          $ r}t          d|j        › d�¦  «        |‚d }~ww xY w|| j	        | j
        <   	 d V — d | _         i | j	        | j
        <   d S # d | _         i | j	        | j
        <   w xY w)Nrr   zContext processor z didn't return a dictionary.)rp   rs   ÚengineÚtemplate_context_processorsr‰   r‡   r_   rx   r	   r   rŠ   )r   rp   r‹   ÚupdatesÚ	processorr   Úes          r   rt   zRequestContext.bind_templateù   s$  è è € àŒ=Ð$ÝÐGÑHÔHÐHà ˆŒà”_Ô@À4ÔCSÑSˆ
ØˆØ#ð 	ð 	ˆIØ�i ¤Ñ-Ô-ˆGðØ—’˜wÑ'Ô'Ð'Ð'øÝð ð ð Ýð"¨Ô)?ð "ð "ð "ñô ð ðøøøøðøøøð .5ˆŒ
�4Ô)Ñ*ð	4ØˆEˆEˆEà ˆDŒMà13ˆDŒJ�tÔ-Ñ.Ð.Ð.øð !ˆDŒMà13ˆDŒJ�tÔ-Ñ.Ð3Ð3Ð3Ð3s$   ÁA!Á!
B	Á+BÂB	ÂB8 Â8Cc                 ón   •— t          ¦   «                              |¦  «        }t          |d¦  «        r|`|S )NrŠ   )r   r]   rw   rŠ   )r   r[   r\   r   s      €r   r]   zRequestContext.new  s9   ø€ Ý‘g”g—k’k &Ñ)Ô)ˆõ �;Ð 3Ñ4Ô4ð 	.ØÐ-ØÐr   )NNNNTr   )	r   r   r	   r
   r   r   rt   r]   r!   r"   s   @r   r…   r…   Ü   s‘   ø€ € € € € ðð ð ØØØØðð ð ð ð ð ð* ð4ð 4ñ „^ð4ð6ð ð ð ð ð ð ð ð ð r   r…   Nc                 óØ   — | �1t          | t          ¦  «        st          d| j        j        z  ¦  «        ‚|€t          | fi |¤Ž} n&| }t          |fi |¤Ž} |r|                      |¦  «         | S )zT
    Create a suitable Context from a plain dict and optionally an HttpRequest.
    Nz&context must be a dict rather than %s.)r-   Údictrx   r   r   rg   r…   r>   )r   r‡   r   Úoriginal_contexts       r   Úmake_contextr–     s”   € ð Ð¥:¨gµtÑ#<Ô#<ÐÝØ4°wÔ7HÔ7QÑQñ
ô 
ð 	
ð €Ý˜'Ð,Ð, VÐ,Ð,ˆˆð #ÐÝ  Ð3Ð3¨FÐ3Ð3ˆØð 	+Ø�LŠLÐ)Ñ*Ô*Ð*Ø€Nr   r   )Ú
contextlibr   r   Ú_builtin_context_processorsÚ	Exceptionr   r”   r   r$   rg   rn   r…   r–   r   r   r   ú<module>rš      sV  ðØ %Ð %Ð %Ð %Ð %Ð %Ø Ð Ð Ð Ð Ð ð KÐ ð	ð 	ð 	ð 	ð 	˜)ñ 	ô 	ð 	ðð ð ð ð �$ñ ô ð ðk1ð k1ð k1ð k1ð k1ñ k1ô k1ð k1ð\#-ð #-ð #-ð #-ð #-ˆkñ #-ô #-ð #-ðL)ð )ð )ð )ð )�Kñ )ô )ð )ðX?ð ?ð ?ð ?ð ?�Wñ ?ô ?ð ?ðDð ð ð ð ð r   