� K�g'���ddlmZddlmZmZddlZddlmZm Z ddl Z ddl m Z d d �Z ejd ie ��Gd �d ����ZdS)�)� annotations)�Callable�MutableMappingN)�Any�Literal)�DATACLASS_KWARGS�valuer�returnc�V�|siSt|t��rt|��S|S)z�Convert Token.attrs set as ``None`` or ``[[key, value], ...]`` to a dict. This improves compatibility with upstream markdown-it. )� isinstance�list�dict)r s �a/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/markdown_it/token.py� convert_attrsr s4�� ��� ��%������E�{�{�� �L�c�~�eZdZUded< ded< ded< eje���Zded< d Zd ed < d Z d ed< d Z ded< dZ ded< dZ ded< dZ ded< eje���Zded< dZded< dZded< d;d�Zd<d�Zd=d!�Zd>d$�Zd?d'�Zd@d)�ZdAd*�ZdBd-�Zd.d.d d ed/�dCd8�ZedDd:���Zd S)E�Token�str�type�tagzLiteral[-1, 0, 1]�nesting)�default_factoryzdict[str, str | int | float]�attrsNzlist[int] | None�mapr�int�levelzlist[Token] | None�children��content�markup�infozdict[Any, Any]�metaF�bool�block�hiddenr �Nonec�8�t|j��|_dS�N)rr��selfs r� __post_init__zToken.__post_init__Os��"�4�:�.�.�� � � r�namec��tjdt��||jvrdSt |j������|��S)NzEToken.attrIndex should not be used, since Token.attrs is a dictionary�����)�warnings�warn� UserWarningrr �keys�index�r*r,s r� attrIndexzToken.attrIndexRsX��� � S� � � � � �t�z� !� !��2��D�J�O�O�%�%�&�&�,�,�T�2�2�2r�#list[tuple[str, str | int | float]]c�N�t|j�����S)zGet (key, value) list of attrs.)r r�itemsr)s r� attrItemszToken.attrItems[s���D�J�$�$�&�&�'�'�'r�attrData�tuple[str, str | int | float]c�<�|\}}|�||��dS)zAAdd `[ name, value ]` attribute to list. Init attrs if necessary.N)�attrSet)r*r:r,r s r�attrPushzToken.attrPush_s%��� ��e� � � �T�5�!�!�!�!�!rr �str | int | floatc��||j|<dS)z>Set `name` attribute to `value`. Override old value if exists.N)r)r*r,r s rr=z Token.attrSetds�� �� �4���r�None | str | int | floatc�8�|j�|d��S)z@Get the value of attribute `name`, or null if it does not exist.N)r�getr4s r�attrGetz Token.attrGeths���z�~�~�d�D�)�)�)rc���||jvrP|j|}t|t��std|j|�����|�d|��|j|<dS||j|<dS)z�Join value to existing attribute via space. Or create new attribute if not exists. Useful to operate with token classes. z#existing attr 'name' is not a str: � N)rr r� TypeError)r*r,r �currents r�attrJoinzToken.attrJoinls��� �4�:� � ��j��&�G��g�s�+�+� ��L�$�*�T�:J�L�L����#*�3�3�E�3�3�D�J�t� � � �$�D�J�t� � � r�changesrc �&�tj|fi|��S)z&Return a shallow copy of the instance.)�dc�replace)r*rJs r�copyz Token.copy{s���z�$�*�*�'�*�*�*rT)r� as_upstream�meta_serializer�filter� dict_factoryrOrP�&Callable[[dict[Any, Any]], Any] | NonerQ�!Callable[[str, Any], bool] | NonerR�'Callable[..., MutableMapping[str, Any]]�MutableMapping[str, Any]c�����������fd�tj���D����}�r)��fd�|���D����}�r5d|vr1|dsdn#d�|d���D��|d<�rd|vr�|d��|d<�r1|�dd��r�����fd�|dD��|d<|S) a�Return the token as a dictionary. :param children: Also convert children to dicts :param as_upstream: Ensure the output dictionary is equal to that created by markdown-it For example, attrs are converted to null or lists :param meta_serializer: hook for serializing ``Token.meta`` :param filter: A callable whose return code determines whether an attribute or element is included (``True``) or dropped (``False``). Is called with the (key, value) pair. :param dict_factory: A callable to produce dictionaries from. For example, to produce ordered dictionaries instead of normal Python dictionaries, pass in ``collections.OrderedDict``. c3�P�K�|] }|jt�|j��fV��!dSr()r,�getattr)�.0�fr*s �r� <genexpr>z Token.as_dict.<locals>.<genexpr>�s6�����X�X�1�����a�f�(=�(=�>�X�X�X�X�X�Xrc3�>�K�|]\}}�||���||fV��dSr(�)rZ�k�vrQs �rr\z Token.as_dict.<locals>.<genexpr>�s<�����"V�"V�d�a����PQ�ST���"V�A�q�6�"V�"V�"V�"V�"V�"VrrNc��g|] \}}||g�� Sr^r^)rZr_r`s r� <listcomp>z!Token.as_dict.<locals>.<listcomp>�s ��B�B�B���A�q�!�f�B�B�Brr"rc �D��g|]}|�����������S))rrQrRrOrP)�as_dict)rZ�childrOrrRrQrPs �����rrbz!Token.as_dict.<locals>.<listcomp>�sM��� #� #� #��� � �%�!�!-� +�$3� ��� #� #� #r)rL�fieldsr8rC)r*rrOrPrQrR�mappings`````` rrdz Token.as_dictsU��������.�,�X�X�X�X�� �RV���X�X�X�X�X�� � W�"�l�"V�"V�"V�"V�g�m�m�o�o�"V�"V�"V�V�V�G� � �7�g�-�-��w�'�C���B�B���)9�)?�)?�)A�)A�B�B�B� �G� � � ?�v��0�0�-�o�g�f�o�>�>�G�F�O� � �� � �J��5�5� � #� #� #� #� #� #� #� #�%�Z�0� #� #� #�G�J� ��r�dctc�V���di|��}|jr�fd�|jD��|_|S)zConvert a dict to a Token.c�:��g|]}��|����Sr^)� from_dict)rZ�c�clss �rrbz#Token.from_dict.<locals>.<listcomp>�s%���G�G�G�1�c�m�m�A�.�.�G�G�Grr^)r)rmrh�tokens` rrkzToken.from_dict�sC����� � �c� � �� �>� H�G�G�G�G���G�G�G�E�N�� r)r r&)r,rr r)r r6)r:r;r r&)r,rr r?r r&)r,rr rA)r,rr rr r&)rJrr r) rr#rOr#rPrSrQrTrRrUr rV)rhrVr r)�__name__� __module__� __qualname__�__annotations__rL�fieldrrrrrrr r!r"r$r%r+r5r9r>r=rDrIrNrd� classmethodrkr^rrrrs������� �I�I�I�;� �H�H�H�!������ +3�"�(�4�*H�*H�*H�E�H�H�H�H�� !�C� � � � �=��E�N�N�N�N�2�#'�H�'�'�'�'�7��G�����U��F�����?��D�N�N�N�N�� $�2�8�D�9�9�9�D�9�9�9�9�9��E�������F������/�/�/�/�3�3�3�3�(�(�(�(�"�"�"�"� !�!�!�!�*�*�*�*� %� %� %� %�+�+�+�+�� �BF�48�@D�-�-�-�-�-�-�^�����[���rr)r rr rr^)� __future__r�collections.abcrr� dataclassesrL�typingrrr/�markdown_it._compatrr� dataclassrr^rr�<module>r{s���"�"�"�"�"�"�4�4�4�4�4�4�4�4�����������������0�0�0�0�0�0� � � � ����!�!� �!�!�\�\�\�\�\�\�\�"�!�\�\�\r
Memory