Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/jinja2/__pycache__/utils.cpython-311.pyc
�
�܋f[i�
��UddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl
mZddl
mZddl
mZddlmZddlmZddlZejrddlZejd ejd
ejf���Zedd
dd�i����Zejed<e��Zej eed<dj!Z"dedefd�Z#dedefd�Z$dedefd�Z%Gd�dej&��Z'dedefd�Z(dedefd�Z)dedefd�Z*dedefd�Z+dejde,fd�Z-d ej.ejddfd!�Z/dXd"�Z0dYd$e1d%e,dejfd&�Z2dZd(e1d)e1dej3ej4fd*�Z5dejde1fd+�Z6dejde1fd,�Z7ej8d-ej9ej:z��Z;ej8d.��Z< d[d/e1d0ej3e=d1ej3e1d2ej3e1d3ej3ej.e1de1fd4�Z> d\d9e=d:e,d;e=d<e=de1f
d=�Z?d]dejd?e1d@e,de1fdA�Z@d]dejd?e1d@e,de1fdB�ZAejBjCGdC�dD����ZD d^dFejEe1dGejEe1dHe,dIe,dejej3e1ge,ff
dJ�ZF d_dejdKej3ejd
e1fdLejdejGfdM�ZHGdN�dO��ZIGdP�dQ��ZJGdR�dS��ZKGdT�dUejG��ZGdVejde1fdW�ZLdS)`�N)�abc)�deque)�choice)� randrange)�Lock)�CodeType)�quote_from_bytes�F.)�bound�MissingType��__repr__c��dS)N�missingr
��xs �C/opt/cloudlinux/venv/lib64/python3.11/site-packages/jinja2/utils.py�<lambda>rs�� ��r�
internal_code��f�returnc�(�tj|_|S)a�Pass the :class:`~jinja2.runtime.Context` as the first argument
to the decorated function when called while rendering a template.
Can be used on functions, filters, and tests.
If only ``Context.eval_context`` is needed, use
:func:`pass_eval_context`. If only ``Context.environment`` is
needed, use :func:`pass_environment`.
.. versionadded:: 3.0.0
Replaces ``contextfunction`` and ``contextfilter``.
)�_PassArg�context�jinja_pass_arg�rs r�pass_contextrs�� �'�A���Hrc�(�tj|_|S)a�Pass the :class:`~jinja2.nodes.EvalContext` as the first argument
to the decorated function when called while rendering a template.
See :ref:`eval-context`.
Can be used on functions, filters, and tests.
If only ``EvalContext.environment`` is needed, use
:func:`pass_environment`.
.. versionadded:: 3.0.0
Replaces ``evalcontextfunction`` and ``evalcontextfilter``.
)r�eval_contextrrs r�pass_eval_contextr"/s�� �,�A���Hrc�(�tj|_|S)aPass the :class:`~jinja2.Environment` as the first argument to
the decorated function when called while rendering a template.
Can be used on functions, filters, and tests.
.. versionadded:: 3.0.0
Replaces ``environmentfunction`` and ``environmentfilter``.
)r�environmentrrs r�pass_environmentr%@s�� �+�A���Hrc��eZdZej��Zej��Zej��Zede de
jdfd���ZdS)r�objrc��t|d��r|jSdD]f}|�dd��}|�d�|�d�fD]C}t||d��dur.t j|�d |�d
�td���||ccS�D�gdS)
Nr)rr!r$�_r�function�filterFTz= is deprecated and will stop working in Jinja 3.1. Use 'pass_z
' instead.���
stacklevel)�hasattrr�replace�getattr�warnings�warn�DeprecationWarning)�clsr'�prefix�squashed�names r�from_objz_PassArg.from_objRs����3�(�)�)� &��%�%�>� '� '�F��~�~�c�2�.�.�H�#�-�-�-�(�/B�/B�/B�B�
'�
'���3��e�,�,��4�4��M��G�G�4:�G�G�G�*�#$� �����v�;�&�&�&�&�&�5�
'��trN)
�__name__�
__module__�__qualname__�enum�autorr!r$�classmethodr
�t�Optionalr9r
rrrrMsn�������d�i�k�k�G��4�9�;�;�L��$�)�+�+�K���1����J�!7�����[���rrc�X�tjdtd���t|��S)z�Pass the context as the first argument to the decorated function.
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use :func:`~jinja2.pass_context`
instead.
zZ'contextfunction' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.r,r-)r2r3r4rrs r�contextfunctionrCgs6��
�M� )��� ������?�?�rc�X�tjdtd���t|��S)z�Pass the eval context as the first argument to the decorated
function.
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use
:func:`~jinja2.pass_eval_context` instead.
.. versionadded:: 2.4
zc'evalcontextfunction' is renamed to 'pass_eval_context', the old name will be removed in Jinja 3.1.r,r-)r2r3r4r"rs r�evalcontextfunctionrEws8��
�M� 2��� �����Q���rc�X�tjdtd���t|��S)z�Pass the environment as the first argument to the decorated
function.
.. deprecated:: 3.0
Will be removed in Jinja 3.1. Use
:func:`~jinja2.pass_environment` instead.
zb'environmentfunction' is renamed to 'pass_environment', the old name will be removed in Jinja 3.1.r,r-)r2r3r4r%rs r�environmentfunctionrG�s8��
�M� 2��� �����A���rc�D�t�|j��|S)z%Marks the function as internally used)r�add�__code__rs r�internalcoderK�s�����a�j�!�!�!��Hrr'c�.�ddlm}t||��S)a�Check if the object passed is undefined. This does nothing more than
performing an instance check against :class:`Undefined` but looks nicer.
This can be used for custom filters or tests that want to react to
undefined variables. For example a custom default filter can look like
this::
def default(var, default=''):
if is_undefined(var):
return default
return var
�)� Undefined)�runtimerN�
isinstance)r'rNs r�is_undefinedrQ�s&��#�"�"�"�"�"��c�9�%�%�%r�iterablec��|D]}�dS)z4Consumes an iterable without doing anything with it.Nr
)rRr)s r�consumerT�s��
�
�
���
�
rc�n�ddlm}ddlm}|���|���dS)a Jinja keeps internal caches for environments and lexers. These are
used so that Jinja doesn't have to recreate environments and lexers all
the time. Normally you don't have to care about that but if you are
measuring memory consumption you may want to clean the caches.
rM)�get_spontaneous_environment)�_lexer_cacheN)r$rV�lexerrW�cache_clear�clear)rVrWs r�clear_cachesr[�sR��9�8�8�8�8�8�#�#�#�#�#�#��+�+�-�-�-��������rF�import_name�silentc�� d|vr|�dd��\}}n-d|vr|�d��\}}}nt|��Stt|dd|g��|��S#tt
f$r|s�YdSwxYw)a�Imports an object based on a string. This is useful if you want to
use import paths as endpoints or something similar. An import path can
be specified either in dotted notation (``xml.sax.saxutils.escape``)
or with a colon as object delimiter (``xml.sax.saxutils:escape``).
If the `silent` is True the return value will be `None` if the import
fails.
:return: imported object
�:rM�.N)�split�
rpartition�
__import__r1�ImportError�AttributeError)r\r]�moduler'r)s r�
import_stringrg�s���
��+���%�+�+�C��3�3�K�F�C�C�
�K�
�
�(�3�3�C�8�8�N�F�A�s�s��k�*�*�*��z�&�$��s�e�<�<�c�B�B�B����(����� �� � � ����s�A
A.�
A.�.B�B�rb�filename�modec�d�tj�|��sdSt||��S)z\Returns a file descriptor for the filename if that file exists,
otherwise ``None``.
N)�os�path�isfile�open)rirjs r�open_if_existsrp�s/���7�>�>�(�#�#���t���$���rc��|�dS|turdSt|��}|jdkr
|j�d�S|j�d|j�d�S)z�Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`).
N�None�Ellipsis�builtinsz objectr`)rs�typer;r:)r'r5s r�object_type_reprrv�s`��
�{��v� �����z�
�s�)�)�C�
�~��#�#��,�'�'�'�'��n�4�4�s�|�4�4�4�4rc�$�ddlm}||��S)z.Format an object using :func:`pprint.pformat`.r)�pformat)�pprintrx)r'rxs rrxrx�s"���������7�3�<�<�ra@
^
(
(https?://|www\.) # scheme or www
(([\w%-]+\.)+)? # subdomain
(
[a-z]{2,63} # basic tld
|
xn--[\w%]{2,59} # idna tld
)
|
([\w%-]{2,63}\.)+ # basic domain
(com|net|int|edu|gov|org|info|mil) # basic tld
|
(https?://) # scheme
(
(([\d]{1,3})(\.[\d]{1,3}){3}) # IPv4
|
(\[([\da-f]{0,4}:){2}([\da-f]{0,4}:?){1,6}]) # IPv6
)
)
(?::[\d]{1,5})? # port
(?:[/?#]\S*)? # path, query, and fragment
$
z^\S+@\w[\w.-]*\.\w+$�text�trim_url_limit�rel�target�
extra_schemesc
�����dtdtf�fd�}ndtdtfd�}tjdttj|������}|rdtj|���d�nd }|rd
tj|���d�nd }t|��D�]�\} }
d |
d }
}}tjd|��}|r0|���}||���d�}|� d��rGtj
d
|��}|r0|���}
|d|����}dD]�\}}|�|��}||�|��kr�4tt||
�|������D]>}|
�|��t!|��z}||
d|�z
}|
|d�}
�?��t"�|��rZ|�d��s|�d��rd|�d|�|�d||���d�}n�d|�d|�|�d||���d�}n�|�d��r4t&�|dd���rd|�d|dd��d�}nqd|vr=|�d��s(d|vr$t&�|��r
d|�d|�d�}n0|�.|D]+}||kr#|�|��rd|�d|�|�d|�d�}�,|�|�|
��|| <���d �|��S)a;Convert URLs in text into clickable links.
This may not recognize links in some situations. Usually, a more
comprehensive formatter, such as a Markdown library, is a better
choice.
Works on ``http://``, ``https://``, ``www.``, ``mailto:``, and email
addresses. Links with trailing punctuation (periods, commas, closing
parentheses) and leading punctuation (opening parentheses) are
recognized excluding the punctuation. Email addresses that include
header fields are not recognized (for example,
``mailto:address@example.com?cc=copy@example.com``).
:param text: Original text containing URLs to link.
:param trim_url_limit: Shorten displayed URL values to this length.
:param target: Add the ``target`` attribute to links.
:param rel: Add the ``rel`` attribute to links.
:param extra_schemes: Recognize URLs that start with these schemes
in addition to the default behavior.
.. versionchanged:: 3.0
The ``extra_schemes`` parameter was added.
.. versionchanged:: 3.0
Generate ``https://`` links for URLs without a scheme.
.. versionchanged:: 3.0
The parsing rules were updated. Recognize email addresses with
or without the ``mailto:`` scheme. Validate IP addresses. Ignore
parentheses and brackets in more cases.
Nrrc�H��t|���kr
|d���d�S|S)Nz...)�len)rr{s �r�trim_urlzurlize.<locals>.trim_urlGs1����1�v�v��&�&��O�^�O�,�1�1�1�1��Hrc��|S�Nr
rs rr�zurlize.<locals>.trim_urlOs���Hrz(\s+)z rel="�"rz target="z
^([(<]|<)+)�)�>r`�,�
�>z([)>.,\n]|>)+$))�(r�)�<r�)z<r�zhttps://zhttp://z <a href="r�z</a>z<a href="https://zmailto:�z">�@zwww.r_z<a href="mailto:)�str�rera�
markupsafe�escape� enumerate�match�group�end�endswith�search�start�count�range�min�indexr��_http_re�
startswith� _email_re�join)rzr{r|r}r~r��words�rel_attr�target_attr�i�word�head�middle�tailr��
start_char�end_char�start_countr)� end_index�schemes ` r�urlizer�s5���L�!� �� �� � � � � � � � �� �� � � � �
�H�X�s�:�#4�T�#:�#:�;�;�<�<�E�58�@�1�
�)�#�.�.�1�1�1�1�b�H�>D�L�:�j�/��7�7�:�:�:�:�"�K��U�#�#�=+�=+���4���r�d�f����)�6�2�2��� +��;�;�=�=�D��E�I�I�K�K�M�M�*�F�
�?�?�=�>�>� 1��I�2�F�;�;�E��
1��{�{�}�}����%�+�+�-�-��0��%M� (� (� �J�� �,�,�z�2�2�K��f�l�l�8�4�4�4�4���3�{�D�J�J�x�,@�,@�A�A�B�B�
(�
(�� �J�J�x�0�0�3�x�=�=�@� ��$�z� �z�*�*���I�J�J�'���
(��>�>�&�!�!� W�� � ��,�,�
��0A�0A�)�0L�0L�
�W��W�W��W�;�W�W���&�AQ�AQ�W�W�W���
.��.�.��.�;�.�.��x��'�'�.�.�.���
�
�
�y�
)�
)� W�i�o�o�f�Q�R�R�j�.I�.I� W�;��;�;�6�!�"�"�:�;�;�;�F�F�
�6�M�M��%�%�f�-�-�
��6�!�!�����'�'�"�?��>�>�&�>�>�>�F�F�
�
&�'�
W�
W���V�#�#��(9�(9�&�(A�(A�#�V��V�V�(�V�K�V�V�&�V�V�V�F���*�F�*�D�*�*��a���
�7�7�5�>�>�r�T��d�n�htmlr��maxc �P�ddlm}|���}g}t|��D�]2}d}dx} }
d}d}g}
t tt||������D]�\}} t
|��}||kr|}n�|r|���}d}|tdd��z
| kr|} |
d z
}
|d
z
}|tdd��z
|
kr|x} }
|d
z
}d}|
�|����d� |
��}|�
d
��r|dd�d
z}n|�
d
��s|d
z
}|�|����4|sd� |��Stjd� d�|D������S)z+Generate some lorem ipsum for the template.rM)�LOREM_IPSUM_WORDSTrNF��r,r��
r�r`� ���z
r�c3�FK�|]}dtj|���d�V��dS)z<p>z</p>N)r�r���.0rs r� <genexpr>z'generate_lorem_ipsum.<locals>.<genexpr>�s9����C�C�q�2�
�)�!�,�,�2�2�2�C�C�C�C�C�Cr)
� constantsr�rar�r�rr�
capitalize�appendr�r�r��Markup)r�r�r�r�r�r��resultr)�next_capitalized�
last_comma�
last_fullstopr��last�p�idx�p_strs r�generate_lorem_ipsumr��s��-�,�,�,�,�,��#�#�%�%�E�
�F�
�1�X�X�%�%����%&�&�
�]������� ��i��S�&9�&9� :� :�;�;� � �F�C��
��e�}�}���4�<�<��D��
�
�
)����(�(��#(� ��Y�q�!�_�_�$�z�1�1� �
���"�
������Y�r�2�&�&�&��6�6�-0�0�
�]�����#'� �
�H�H�T�N�N�N�N���������>�>�#��� ��#�2�#�J��$�E�E�����$�$� ��S�L�E��
�
�e������#��{�{�6�"�"�"���� � �C�C�F�C�C�C�C�C���r�utf-8�charset�for_qsc��t|t��s9t|t��st|��}|�|��}|rdnd}t ||��}|r|�dd��}|S)a5Quote a string for use in a URL using the given charset.
:param obj: String or bytes to quote. Other types are converted to
string then encoded to bytes using the given charset.
:param charset: Encode text to bytes using this charset.
:param for_qs: Quote "/" and use "+" for spaces.
r�/z%20�+)rP�bytesr��encoder r0)r'r�r��safe�rvs r� url_quoter��s����c�5�!�!�"��#�s�#�#� ��c�(�(�C��j�j��!�!���"�3�3�d�D� �#�t� $� $�B�
�$�
�Z�Z��s�
#�
#��
�Irc�^�ddl}|jdtd���t|||���S)Nrz_'unicode_urlencode' has been renamed to 'url_quote'. The old name will be removed in Jinja 3.1.r,r-)r�r�)r2r3r4r�)r'r�r�r2s r�unicode_urlencoder��sH���O�O�O��H�M� .��� �����S�'�&�9�9�9�9rc��eZdZdZdeddfd�Zdd�Zdeje ej
ffd�Zdeje ej
fddfd �Zdej
fd
�Zdd�Zddej
d
ej
dej
fd�Zddej
d
ej
dej
fd�Zdd�Zdej
defd�Zdefd�Zde fd�Zdej
dej
fd�Zdej
dej
ddfd�Zdej
ddfd�Zdejej
ej
ej
ffd�Zdejej
fd�Zdejej
fd�Zdejej
fd�Zdejej
fd�Z eZ!dS) �LRUCachez"A simple LRU Cache implementation.�capacityrNc�p�||_i|_t��|_|���dSr�)r��_mappingr�_queue� _postinit)�selfr�s r�__init__zLRUCache.__init__�s1�� ��
�.0��
�).������������rc��|jj|_|jj|_|jj|_t��|_|jj |_
dSr�)r��popleft�_popleft�pop�_pop�remove�_remover�_wlockr��_append�r�s rr�zLRUCache._postinits@����+��
��K�O�� ��{�)����f�f����{�)����rc�,�|j|j|jd�S)N�r�r�r�r�r�s r�__getstate__zLRUCache.__getstate__s ���
��
��k�
�
�
r�dc�b�|j�|��|���dSr�)�__dict__�updater�)r�r�s r�__setstate__zLRUCache.__setstate__s.���
���Q�����������rc��|jfSr�)r�r�s r�__getnewargs__zLRUCache.__getnewargs__s
���
��rc��|�|j��}|j�|j��|j�|j��|S)z&Return a shallow copy of the instance.)� __class__r�r�r�r��extend�r�r�s r�copyz
LRUCache.copysJ��
�^�^�D�M�
*�
*��
����4�=�)�)�)�
� �����%�%�%�� r�key�defaultc�8� ||S#t$r|cYSwxYw)z/Return an item from the cache dict or `default`��KeyError�r�r�r�s r�getzLRUCache.gets5�� ���9���� � � ��N�N�N� ���s�
��c�B� ||S#t$r
|||<|cYSwxYw)zvSet `default` if the key is not in the cache otherwise
leave unchanged. Return the value of this key.
rrs r�
setdefaultzLRUCache.setdefault$s>�� ���9���� � � ��D��I��N�N�N� ���s�
��c��|j5|j���|j���ddd��dS#1swxYwYdS)zClear the cache.N)r�r�rZr�r�s rrZzLRUCache.clear.s���
�[� � ��M���!�!�!��K������ � � � � � � � � � � � ���� � � � � � s�3A�A�Ac��||jvS)z$Check if a key exists in this cache.�r��r�r�s r�__contains__zLRUCache.__contains__4s���d�m�#�#rc�*�t|j��S)z%Return the current size of the cache.)r�r�r�s r�__len__zLRUCache.__len__8s���4�=�!�!�!rc�B�dt|��j�d|j�d�S)Nr�r�r�)rur:r�r�s rrzLRUCache.__repr__<s&��;�4��:�:�&�;�;���;�;�;�;rc��|j5|j|}|jd|kr< |�|��n#t$rYnwxYw|�|��|cddd��S#1swxYwYdS)z�Get an item from the cache. Moves the item up so that it has the
highest priority then.
Raise a `KeyError` if it does not exist.
r�N)r�r�r�r��
ValueErrorr�)r�r�r�s r�__getitem__zLRUCache.__getitem__?s����[� � ���s�#�B��{�2��#�%�%���L�L��%�%�%�%��!�����D� �������S�!�!�!�� � � � � � � � � � � � ���� � � � � � s1�A1�>�A1�
A�A1�
A�A1�1A5�8A5�valuec�0�|j5||jvr|�|��n7t|j��|jkr|j|���=|�|��||j|<ddd��dS#1swxYwYdS)zhSets the value for an item. Moves the item up so that it
has the highest priority then.
N)r�r�r�r�r�r�r�)r�r�rs r�__setitem__zLRUCache.__setitem__Us����[� '� '��d�m�#�#����S�!�!�!�!��T�]�#�#�t�}�4�4��M�$�-�-�/�/�2��L�L�����!&�D�M�#�� '� '� '� '� '� '� '� '� '� '� '� '���� '� '� '� '� '� 's�A6B�B�Bc��|j5|j|= |�|��n#t$rYnwxYwddd��dS#1swxYwYdS)z]Remove an item from the cache dict.
Raise a `KeyError` if it does not exist.
N)r�r�r�rr s r�__delitem__zLRUCache.__delitem__bs����[� � ��
�c�"�
����S�!�!�!�!���
�
�
���
���� � � � � � � � � � � � ���� � � � � � s,� A�(�A�
5�A�5�A�A �A c�p���fd�t�j��D��}|���|S)zReturn a list of items.c�.��g|]}|�j|f��Sr
r)r�r�r�s �r�
<listcomp>z"LRUCache.items.<locals>.<listcomp>ps%���I�I�I��3��
�c�*�+�I�I�Ir)�listr��reverse)r�r�s` r�itemszLRUCache.itemsns;���I�I�I�I�t�D�K�7H�7H�I�I�I���������
rc�>�d�|���D��S)zReturn a list of all values.c��g|]
}|d��S)rMr
r�s rrz#LRUCache.values.<locals>.<listcomp>vs��+�+�+���!��+�+�+r)rr�s r�valueszLRUCache.valuests��+�+�d�j�j�l�l�+�+�+�+rc� �t|��S)z7Return a list of all keys ordered by most recent usage.)rr�s r�keysz
LRUCache.keysxs���D�z�z�rc�D�tt|j����Sr�)�reversed�tupler�r�s r�__iter__zLRUCache.__iter__|s����d�k�*�*�+�+�+rc�D�tt|j����S)zTIterate over the keys in the cache dict, oldest items
coming first.
)�iterr#r�r�s r�__reversed__zLRUCache.__reversed__s���E�$�+�&�&�'�'�'r�rN)rr�r�)"r:r;r<�__doc__�intr�r�r@�Mappingr��Anyr�r��Tupler�r�rrrZ�boolr
rrrrr�Iterablerrr �Iteratorr$r'�__copy__r
rrr�r��s�������,�,���������*�*�*�*�
�a�i��Q�U�
�3�
�
�
�
��a�i��Q�U�
�3������� ��� � � � �������q�u��q�u����������a�e��a�e��q�u����� � � � �$���$�$�$�$�$�$�"��"�"�"�"�<�#�<�<�<�<��q�u��������,'�q�u�'�Q�U�'�t�'�'�'�'�
�q�u�
��
�
�
�
��q�z�!�'�!�%���,�"7�8�����,��
�1�5�)�,�,�,�,��a�j���'�����,�!�*�Q�U�+�,�,�,�,�(�a�j���/�(�(�(�(��H�H�Hrr��r��htm�xml�enabled_extensions�disabled_extensions�default_for_stringr�c������td�|D�����td�|D�����dtjtdtf����fd�}|S)acIntelligently sets the initial value of autoescaping based on the
filename of the template. This is the recommended way to configure
autoescaping if you do not want to write a custom function yourself.
If you want to enable it for all templates created from strings or
for all templates with `.html` and `.xml` extensions::
from jinja2 import Environment, select_autoescape
env = Environment(autoescape=select_autoescape(
enabled_extensions=('html', 'xml'),
default_for_string=True,
))
Example configuration to turn it on at all times except if the template
ends with `.txt`::
from jinja2 import Environment, select_autoescape
env = Environment(autoescape=select_autoescape(
disabled_extensions=('txt',),
default_for_string=True,
default=True,
))
The `enabled_extensions` is an iterable of all the extensions that
autoescaping should be enabled for. Likewise `disabled_extensions` is
a list of all templates it should be disabled for. If a template is
loaded from a string then the default from `default_for_string` is used.
If nothing matches then the initial value of autoescaping is set to the
value of `default`.
For security reasons this function operates case insensitive.
.. versionadded:: 2.9
c3�jK�|].}d|�d�������V��/dS�r`N��lstrip�lowerr�s rr�z$select_autoescape.<locals>.<genexpr>�sA����U�U�Q�8����#���!4�!4�!6�!6�8�8�U�U�U�U�U�Urc3�jK�|].}d|�d�������V��/dSr:r;r�s rr�z$select_autoescape.<locals>.<genexpr>�sA����W�W�a�9�!�(�(�3�-�-�"5�"5�"7�"7�9�9�W�W�W�W�W�Wr�
template_namerc���|��S|���}|����rdS|����rdS�S)NTF)r=r�)r?r�r7�disabled_patterns�enabled_patternss ����r�
autoescapez%select_autoescape.<locals>.autoescape�s]���� �%�%�%�+�+�-�-�
��!�!�"2�3�3� ��4��!�!�"3�4�4� ��5��r)r#r@rAr�r.)r5r6r7r�rCrArBs `` @@r�select_autoescaperD�s�������P�U�U�BT�U�U�U�U�U���W�W�CV�W�W�W�W�W���!�*�S�/��d�����������r�dumps�kwargsc���|�tj}tj||fi|���dd���dd���dd���dd ����S)
a�Serialize an object to a string of JSON with :func:`json.dumps`,
then replace HTML-unsafe characters with Unicode escapes and mark
the result safe with :class:`~markupsafe.Markup`.
This is available in templates as the ``|tojson`` filter.
The following characters are escaped: ``<``, ``>``, ``&``, ``'``.
The returned string is safe to render in HTML documents and
``<script>`` tags. The exception is in HTML attributes that are
double quoted; either use single quotes or the ``|forceescape``
filter.
:param obj: The object to serialize to JSON.
:param dumps: The ``dumps`` function to use. Defaults to
``env.policies["json.dumps_function"]``, which defaults to
:func:`json.dumps`.
:param kwargs: Extra arguments to pass to ``dumps``. Merged onto
``env.policies["json.dumps_kwargs"]``.
.. versionchanged:: 3.0
The ``dumper`` parameter is renamed to ``dumps``.
.. versionadded:: 2.9
Nr�z\u003cr�z\u003e�&z\u0026�'z\u0027)�jsonrEr�r�r0)r'rErFs r�htmlsafe_json_dumpsrK�sv��8
�}��
����
��c���V��� ���i� � � ���i� � � ���i� � � ���i� � ���rc�t�eZdZdZdejddfd�Zd d�Zedejfd���Z dejfd�Z
e
ZdS)
�CycleraDCycle through values by yield them one at a time, then restarting
once the end is reached. Available as ``cycler`` in templates.
Similar to ``loop.cycle``, but can be used outside loops or across
multiple loops. For example, render a list of folders and files in a
list, alternating giving them "odd" and "even" classes.
.. code-block:: html+jinja
{% set row_class = cycler("odd", "even") %}
<ul class="browser">
{% for folder in folders %}
<li class="folder {{ row_class.next() }}">{{ folder }}
{% endfor %}
{% for file in files %}
<li class="file {{ row_class.next() }}">{{ file }}
{% endfor %}
</ul>
:param items: Each positional argument will be yielded in the order
given for each cycle.
.. versionadded:: 2.1
rrNc�D�|std���||_d|_dS)Nz$at least one item has to be providedr)�RuntimeErrorr�pos)r�rs rr�zCycler.__init__s,��� G��E�F�F�F���
�����rc��d|_dS)z*Resets the current item to the first item.rN)rPr�s r�resetzCycler.resets
������rc�&�|j|jS)zxReturn the current item. Equivalent to the item that will be
returned next time :meth:`next` is called.
)rrPr�s r�currentzCycler.currents��
�z�$�(�#�#rc�\�|j}|jdzt|j��z|_|S)zXReturn the current item, then advance :attr:`current` to the
next item.
rM)rTrPr�rr�s r�nextzCycler.nexts*���\���H�q�L�C��
�O�O�3���� rr()r:r;r<r)r@r,r�rR�propertyrTrV�__next__r
rrrMrM�s���������2�q�u������������$���$�$�$��X�$��a�e������H�H�HrrMc�0�eZdZdZddeddfd�Zdefd�ZdS) �JoinerzA joining helper for templates.�, �seprNc�"�||_d|_dS)NF)r\�used)r�r\s rr�zJoiner.__init__!s������� � � rc�0�|js d|_dS|jS)NTr)r^r\r�s r�__call__zJoiner.__call__%s���y� ��D�I��2��x�r)r[)r:r;r<r)r�r�r`r
rrrZrZs\������)�)���C��4������#������rrZc�~�eZdZdZdejdejddfd�Zdedejfd�Zded ejddfd
�Z defd�Z
dS)� Namespacez~A namespace object that can hold arbitrary attributes. It may be
initialized from a dictionary or with keyword arguments.�argsrFrNc�L�|d|dd�}}t|i|��|_dS)NrrM)�dict�_Namespace__attrs)rcrFr�s rr�zNamespace.__init__0s/���!�W�d�1�2�2�h�d���T�,�V�,�,����rr8c��|dvrt�||��S |j|S#t$rt |��d�wxYw)N>r�rf)�object�__getattribute__rfrre)r�r8s rrizNamespace.__getattribute__4sa���5�5�5��*�*�4��6�6�6� 1��<��%�%��� 1� 1� 1� ��&�&�D�0� 1���s �.�A rc��||j|<dSr��rf)r�r8rs rrzNamespace.__setitem__=s��"���T���rc��d|j�d�S)Nz<Namespace r�rkr�s rrzNamespace.__repr__@s��.�T�\�.�.�.�.r)r:r;r<r)r@r,r�r�rirrr
rrrbrb,s�������@�@�-���-���-�4�-�-�-�-�1�S�1�Q�U�1�1�1�1�#��#�A�E�#�d�#�#�#�#�/�#�/�/�/�/�/�/rrbc� ��eZdZd�fd� Z�xZS)r�rN�strictc���tjdtd���t���||||��S)Nzc'jinja2.Markup' is deprecated and will be removed in Jinja 3.1. Import 'markupsafe.Markup' instead.r,r-)r2r3r4�super�__new__)r5�base�encoding�errorsr�s �rrqzMarkup.__new__EsE����
�
8���
�
�
�
��w�w���s�D�(�F�;�;�;r)rNrn)r:r;r<rq�
__classcell__)r�s@rr�r�Ds=�������<�<�<�<�<�<�<�<�<�<rr��sc�b�tjdtd���tj|��S)Nzc'jinja2.escape' is deprecated and will be removed in Jinja 3.1. Import 'markupsafe.escape' instead.r,r-)r2r3r4r�r�)rvs rr�r�Os9���M� 4��� ������Q���rr()F)rh)NNNN)r�Tr�r�)r�F)r2r
TFr�)Mr=rJrlr��typingr@r2�collectionsrr�randomrr� threadingr�typesr�urllib.parser r��
TYPE_CHECKING�typing_extensions�te�TypeVar�Callabler,r
rur�__annotations__�setr�
MutableSetr��concatrr"r%�EnumrrCrErGrKr.rQr/rTr[r�rgrA�IOrprvrx�compile�
IGNORECASE�VERBOSEr�r�r*r�r�r�r��MutableMapping�registerr��
CollectionrDr�rKrMrZrbr�r
rr�<module>r�s������������ � � � � � � � ���������������������������������������������)�)�)�)�)�)������?�#�"�"�"�"�
�A�I�c���C���J�/�0�0�0��L���m�R�*�6I�6I�)J�K�K�M�M����M�M�M�(+����
�q�|�H�%�-�-�-� ���
�A�
�!�
�
�
�
�"
��
�q�
�
�
�
�"
��
�a�
�
�
�
������t�y����4
�q�
�Q�
�
�
�
� �1� �� � � � �&�1�������"
�A�
�!�
�
�
�
�&�a�e�&��&�&�&�&�"
�a�j���'�
�D�
�
�
�
�
�
�
�
���s��D��Q�U�����0 � �S� �� �q�z�!�$�7G� � � � �5�!�%�5�C�5�5�5�5�$����3������2�:��2�M�B�J��5���8
�B�J�.�/�/� �
'+��"�15�v�v�
�v��J�s�O�v�
��C��v�
�J�s�O� v�
�:�a�j��o�.�v� �
v�v�v�v�t>A�4�4�
�4��4�(+�4�7:�4��4�4�4�4�n��1�5��3��$��3�����. :� :�1�5� :�3� :�$� :�SV� :� :� :� :����R�R�R�R�R�R�R���R�l-C�-/�#�� 5�5���S�)�5���c�*�5��5�� 5�
�Z���C��!�4�'�(�5�5�5�5�r;?�%�%�
��%��z�!�*�S�#�X�"6�7�%�JK�%�%���%�%�%�%�P3�3�3�3�3�3�3�3�l��������/�/�/�/�/�/�/�/�0<�<�<�<�<�Z�
�<�<�<� �a�e� �� � � � � � r