OwlCyberSecurity - MANAGER
Edit File: references.cpython-311.pyc
� �������hӏ�����������������������h����d�Z�dZddlmZmZ�ddlmZ��G�d��de������������Z�G�d��de������������Z�G�d ��d e������������Z �G�d��de������������Z �G�d ��de������������Z�G�d��de������������Z�G�d��de ������������Z�G�d��de������������Z�G�d��de������������Z�G�d��de������������Z�G�d��dej��������������������ZdS�)z& Transforms for resolving references. �reStructuredText�����)�nodes�utils)� Transformc�������������������������e�Zd�ZdZdZd��ZdS�)�PropagateTargetsa}�� Propagate empty internal targets to the next element. Given the following nodes:: <target ids="internal1" names="internal1"> <target anonymous="1" ids="id1"> <target ids="internal2" names="internal2"> <paragraph> This is a test. PropagateTargets propagates the ids and names of the internal targets preceding the paragraph to the paragraph itself:: <target refid="internal1"> <target anonymous="1" refid="id1"> <target refid="internal2"> <paragraph ids="internal2 id1 internal1" names="internal2 internal1"> This is a test. i��c����������������������|�j������������������������������t����������j��������������������D��]T}t ����������|j��������t����������j��������������������s?|���������������������d������������s*|���������������������d������������s|���������������������d������������r�bt����������|������������dk����s J�d���������������|� ��������������������d�������������}t ����������|t����������j ��������������������r1|� ��������������������dd� ������������}t ����������|t����������j ���������������������1|�@t ����������|t����������j��������t����������j��������f������������rt ����������|t����������j��������������������s��$|d ���������� ��������������������|d ����������������������|d���������� ��������������������|d����������������������t����������|d������������si�|_��������t����������|d ������������si�|_��������|d ���������D�]}||�j���������j��������|<���||j��������|<����|d���������D�]}||j��������|<���� |j�����������������������������t%����������|di��������������������������|j�����������������������������t%����������|d i��������������������������|d ���������d���������|d<���g�|d <���g�|d<���|�j������������������������������|���������������Vd�S�)N�refid�refuri�refnamer���z&error: block-level target has childrenT)�ascendF)r ����descend�ids�names�expect_referenced_by_name�expect_referenced_by_id)�document�findallr����target� isinstance�parent�TextElement�hasattr�len� next_node�system_message� Invisible� Targetable�extendr���r���r����update�getattr� note_refid)�selfr���r����id�names��� �~/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/docutils/transforms/references.py�applyzPropagateTargets.apply(���s�������m�+�+�E�L�9�9��- -��- -�F��6�=�%�*;�<�<�� ��N�N�7�+�+� �/5�~�~�h�/G�/G� ��~�~�i�0�0� ����v�;�;�!�#�#�#�%M�#�#�#��(�(��(�5�5�I��Y��(<�=�=�� L�%�/�/�t�U�/�K�K� ���Y��(<�=�=�� L���!��i�%�/�5�;K�)L�M�M��"�"�9�e�l�;�;��"����e��#�#�F�5�M�2�2�2��g��%�%�f�W�o�6�6�6��9�&A�B�B�� 9�68� �3��9�&?�@�@�� 7�46� �1��U�m�� ?�� ?��(1�� �!�"�%��9?� �1�"�5�5��w��� C�� C��<B� �3�D�9�9�� �/�6�6��� ;�R�@�@� B�� B�� B��-�4�4��� 9�2�>�>� @�� @�� @��%�U�m�A�.�F�7�O���F�5�M� �F�7�O��M�$�$�V�,�,�,�,�[- -��- -�����N��__name__� __module__�__qualname__�__doc__�default_priorityr'�����r(���r&���r���r������s5�����������������*���.-��.-��.-��.-��.-r(���r���c�������������������������e�Zd�ZdZdZd��ZdS�)�AnonymousHyperlinksa��� Link anonymous references to targets. Given:: <paragraph> <reference anonymous="1"> internal <reference anonymous="1"> external <target anonymous="1" ids="id1"> <target anonymous="1" ids="id2" refuri="http://external"> Corresponding references are linked via "refid" or resolved via "refuri":: <paragraph> <reference anonymous="1" refid="id1"> text <reference anonymous="1" refuri="http://external"> external <target anonymous="1" ids="id1"> <target anonymous="1" ids="id2" refuri="http://external"> i���c������������������D����g�}g�}|�j������������������������������t����������j��������������������D�],}|���������������������d������������r|���������������������|��������������-|�j������������������������������t����������j��������������������D�],}|���������������������d������������r|���������������������|��������������-t����������|������������t����������|������������k����r�|�j���������j��������� ��������������������dt����������|�������������dt����������|�������������d�������������}|�j���������� ��������������������|������������}|D�]g}t����������j��������|j��������|j��������|�������������}|�j���������� ��������������������|������������}|� ��������������������|�������������|���������������������|��������������hd�S�t����������||������������D�]�\��}} d| _�������� �| ���������������������d������������r| d���������|d<���d|_��������nM| d ���������s|�j���������j��������| d ������������������} �J| d ���������d���������|d <���|�j������������������������������|������������� ���d�S�)N� anonymouszAnonymous hyperlink mismatch: z references but z+ targets. See "backrefs" attribute for IDs.�r �������Tr���r���r ���r���)r���r���r���� reference�get�appendr���r����reporter�error�set_id�problematic� rawsource�add_backref�replace_self�zip� referencedr����resolvedr���r"���) r#����anonymous_refs�anonymous_targets�node�msg�msgid�ref�prb�prbidr���s ��� r&���r'���zAnonymousHyperlinks.applys���sC����������M�)�)�%�/�:�:�� ,�� ,�D��x�x��$�$�� ,��%�%�d�+�+�+���M�)�)�%�,�7�7�� /�� /�D��x�x��$�$�� /�!�(�(��.�.�.���~���#�&7�"8�"8�8�8��-�(�.�.�.����(�(�(�(�#�.?�*@�*@�*@�*@�B�C��C�C���M�(�(��-�-�E�%�� &�� &���'��m�S�]�%�A��A��A��� �,�,�S�1�1������&�&�&�� � ��%�%�%�%��F��~�/@�A�A�� �� �K�C�� !�F�� ��>�>�(�+�+���$*�8�$4�C��M�#$�C�L��!�%�=��!�!%��!2�6�'�?�!C�� �#)�%�=��#3�C��L��M�,�,�S�1�1�1��� �� r(���Nr)���r/���r(���r&���r1���r1���Y���s5�����������������,���$��$��$��$��$r(���r1���c��������������������:�����e�Zd�ZdZdZd��Zd��Zd��Zd��Zd��Z d��Z d S�) �IndirectHyperlinksaN�� a) Indirect external references:: <paragraph> <reference refname="indirect external"> indirect external <target id="id1" name="direct external" refuri="http://indirect"> <target id="id2" name="indirect external" refname="direct external"> The "refuri" attribute is migrated back to all indirect targets from the final direct target (i.e. a target not referring to another indirect target):: <paragraph> <reference refname="indirect external"> indirect external <target id="id1" name="direct external" refuri="http://indirect"> <target id="id2" name="indirect external" refuri="http://indirect"> Once the attribute is migrated, the preexisting "refname" attribute is dropped. b) Indirect internal references:: <target id="id1" name="final target"> <paragraph> <reference refname="indirect internal"> indirect internal <target id="id2" name="indirect internal 2" refname="final target"> <target id="id3" name="indirect internal" refname="indirect internal 2"> Targets which indirectly refer to an internal target become one-hop indirect (their "refid" attributes are directly set to the internal target's "id"). References which indirectly refer to an internal target become direct internal references:: <target id="id1" name="final target"> <paragraph> <reference refid="id1"> indirect internal <target id="id2" name="indirect internal 2" refid="id1"> <target id="id3" name="indirect internal" refid="id1"> i���c�����������������������|�j���������j��������D�]3}|j��������s|����������������������|�������������|����������������������|��������������4d�S��N)r����indirect_targetsrB����resolve_indirect_target�resolve_indirect_references�r#���r���s��� r&���r'���zIndirectHyperlinks.apply����sU�������m�4�� 5�� 5�F��?�� 5��,�,�V�4�4�4��,�,�V�4�4�4�4� 5�� 5r(���c����������������������|����������������������d������������}|� |d���������}nY|�j��������j������������������������������|������������}|s8|�j��������j��������j��������D�]}�||������������r�n�|����������������������|�������������d�S�|�j��������j��������|���������}|���������������������|��������������t����������|t����������j ��������������������ra|j��������sZ|���������������������d������������rEt����������|d������������r|�� ��������������������|�������������d�S�d|_��������|����������������������|�������������|`|���������������������d������������r|d���������|d<���d|v�r|d=�nz|���������������������d������������r&|d���������|d<���|�j�����������������������������|�������������n?|d���������r ||d<���|�j�����������������������������|�������������n|����������������������|�������������d�S�|�|d=�d|_��������d�S�)Nr���r ����r$����multiply_indirectr5���r���r���)r7���r����nameids�transformer�unknown_reference_resolvers�nonexistent_indirect_targetr����note_referenced_byr���r���r���rB���r����circular_indirect_referencerU���rP���r"���)r#���r���r����reftarget_id�resolver_function� reftargets��� r&���rP���z*IndirectHyperlinks.resolve_indirect_target����s������*�*�Y�'�'���?�!�'�?�L�L��=�0�4�4�W�=�=�L��� ��� �1�M�=��=�%�(�(��0�0��������4�4�V�<�<�<����M�%�l�3� ��$�$��$�5�5�5��y�%�,�/�/�� )��&� )��!�!�)�,�,� )���v�2�3�3�� ��0�0��8�8�8���'(�F�$��(�(��3�3�3��(����X�&�&�� �(��2�F�8���&� � ��7�O�� � � �w� '� '�� �'��0�F�7�O��M�$�$�V�,�,�,�,����� �".��w��� �(�(��0�0�0�0��0�0��8�8�8������y�!�����r(���c�����������������������|d���������|�j���������j��������v�r|����������������������|d�������������d�S�|����������������������|d�������������d�S�)Nr���z>which is a duplicate, and cannot be used as a unique referencezwhich does not exist)r���rV����indirect_target_errorrR���s��� r&���rY���z.IndirectHyperlinks.nonexistent_indirect_target��se�������)��� � 5�5�5��&�&�v��0N�� O�� O�� O�� O�� O�� �&�&�v�/E�F�F�F�F�Fr(���c������������������2�����|�����������������������|d�������������d�S�)Nzforming a circular reference)r`���rR���s��� r&���r[���z.IndirectHyperlinks.circular_indirect_reference ��s�������"�"�6�+I�J�J�J�J�Jr(���c����������� �����������d}g�}|d���������rd|d���������d���������z��}|d���������D�]5}|����������������������|�j��������j�����������������������������|g���������������������������6|d���������D�]5}|����������������������|�j��������j�����������������������������|g���������������������������6|d���������r|d|d���������d���������z��z ��}|�j��������j�����������������������������d|�d|d ����������d |�d�|�������������}|�j�����������������������������|������������}t����������j ��������|������������D�]g} t����������j��������| j��������| j��������|� ������������} |�j�����������������������������| ������������}|� ��������������������|�������������| ���������������������| ��������������hd|_��������d�S�)N��r���z"%s" r���r���z (id="%s")zIndirect hyperlink target z refers to target "r���z", �.�� base_noder4���r5���)r���r����refnamesr7����refidsr9���r:���r;���r����uniqr���r<���r=���r>���r?���rB���)r#���r����explanation�naming�reflistr%���r$���rF���rG���rH���rI���rJ���s��� r&���r`���z(IndirectHyperlinks.indirect_target_error��s�����������'�?�� 2��v�g��q�1�1�F��7�O�� A�� A�D��N�N�4�=�1�5�5�d�B�?�?�@�@�@�@���-�� =�� =�B��N�N�4�=�/�3�3�B��;�;�<�<�<�<��%�=�� 5��k�F�5�M�!�$4�4�4�F��m�$�*�*�*����� �*�*�*�K�K�K�9�DJ��+��L��L���� �$�$�S�)�)���:�g�&�&�� "�� "�C��#��-���e�=��=��=�C��M�(�(��-�-�E��O�O�E�"�"�"����S�!�!�!�!�����r(���c����������������������|����������������������d������������rd}|�j��������j��������}n|����������������������d������������rd}d�}nd�S�||���������}|d���������D�]�}|�j��������j�����������������������������|g�������������}|r|���������������������|��������������|D�]U}|j��������r� |d=�|||<���|r�||�������������d|_��������t����������|t����������j ��������������������r|�� ��������������������|��������������V��|d���������D�]�}|�j��������j�����������������������������|g�������������}|r|���������������������|��������������|D�]U}|j��������r� |d=�|||<���|r�||�������������d|_��������t����������|t����������j ��������������������r|�� ��������������������|��������������V��d�S�) Nr ���r���r����r%���r���r5���r���rT���)r���r���r"���rg���r7���rZ���rB���r���r���r���rQ���rh���) r#���r����attname�call_method�attvalr%���rl���rH���r$���s ��� r&���rQ���z.IndirectHyperlinks.resolve_indirect_references#��s�������>�>�'�"�"�� ��G��-�2�K�K� �^�^�H� %� %�� ��G��K�K��F������7�O�� :�� :�D��m�,�0�0��r�:�:�G��� 5��)�)�t�)�4�4�4��� :�� :���<����� �N�%��G����%��K��$�$�$� ����c�5�<�0�0��:��4�4�S�9�9�9�� :����-�� :�� :�B��m�*�.�.�r�2�6�6�G��� 1��)�)�R�)�0�0�0��� :�� :���<������L�%��G����%��K��$�$�$� ����c�5�<�0�0��:��4�4�S�9�9�9�� :� :�� :r(���N)r*���r+���r,���r-���r.���r'���rP���rY���r[���r`���rQ���r/���r(���r&���rL���rL�������s���������������0��0�d���5��5��5�*��*��*�XG��G��G�K��K��K������.%:��%:��%:��%:��%:r(���rL���c�������������������������e�Zd�ZdZdZd��ZdS�)�ExternalTargetsa��� Given:: <paragraph> <reference refname="direct external"> direct external <target id="id1" name="direct external" refuri="http://direct"> The "refname" attribute is replaced by the direct "refuri" attribute:: <paragraph> <reference refuri="http://direct"> direct external <target id="id1" name="direct external" refuri="http://direct"> i���c������������������L����|�j������������������������������t����������j��������������������D�]~}|���������������������d������������rg|d���������}|d���������D�]V}|�j���������j�����������������������������|g�������������}|r|���������������������|��������������|D�]}|j��������r� |d=�||d<���d|_����������W�d�S�)Nr���r���rn���r���r5���) r���r���r���r���r���rg���r7���rZ���rB���)r#���r���r���r%���rl���rH���s��� r&���r'���zExternalTargets.apply_��s��������m�+�+�E�L�9�9�� )�� )�F��~�~�h�'�'�� )���)��"�7�O�� )�� )�D�"�m�4�8�8��r�B�B�G���=��1�1�t�1�<�<�<�&��)��)���<��%�$�� �N�(.��H� �'(����)�� )�� )r(���Nr)���r/���r(���r&���rs���rs���K��s5����������������� ��� )�� )�� )�� )�� )r(���rs���c�������������������������e�Zd�ZdZd��Zd��ZdS�)�InternalTargetsi���c������������������������|�j������������������������������t����������j��������������������D�]A}|���������������������d������������s*|���������������������d������������s|����������������������|��������������Bd�S�)Nr���r ���)r���r���r���r���r����resolve_reference_idsrR���s��� r&���r'���zInternalTargets.applys��si�������m�+�+�E�L�9�9�� 3�� 3�F��>�>�(�+�+�� 3�F�N�N�7�4K�4K�� 3��*�*�6�2�2�2�� 3�� 3r(���c����������������������|d���������D�]w}|�j���������j�����������������������������|������������}|�j���������j�����������������������������|g�������������}|r|���������������������|��������������|D�]}|j��������r� |r|d=�||d<���d|_����������xdS�)a��� Given:: <paragraph> <reference refname="direct internal"> direct internal <target id="id1" name="direct internal"> The "refname" attribute is replaced by "refid" linking to the target's "id":: <paragraph> <reference refid="id1"> direct internal <target id="id1" name="direct internal"> r���rn���r���r ���r5���N)r���rV���r7���rg���rZ���rB���)r#���r���r%���r ���rl���rH���s��� r&���rx���z%InternalTargets.resolve_reference_idsx��s�������"��7�O�� !�� !�D��M�)�-�-�d�3�3�E��m�,�0�0��r�:�:�G��� 5��)�)�t�)�4�4�4��� !�� !���<������)��I��#(�C��L� ���� !� !�� !r(���N)r*���r+���r,���r.���r'���rx���r/���r(���r&���rv���rv���o��s8����������������3��3��3� !��!��!��!��!r(���rv���c��������������������H�����e�Zd�ZdZdZdZ �g�d�Zd��Zd��Zd��Z d��Z d ��Zd ��ZdS�)� Footnotesa��� Assign numbers to autonumbered footnotes, and resolve links to footnotes, citations, and their references. Given the following ``document`` as input:: <document> <paragraph> A labeled autonumbered footnote reference: <footnote_reference auto="1" id="id1" refname="footnote"> <paragraph> An unlabeled autonumbered footnote reference: <footnote_reference auto="1" id="id2"> <footnote auto="1" id="id3"> <paragraph> Unlabeled autonumbered footnote. <footnote auto="1" id="footnote" name="footnote"> <paragraph> Labeled autonumbered footnote. Auto-numbered footnotes have attribute ``auto="1"`` and no label. Auto-numbered footnote_references have no reference text (they're empty elements). When resolving the numbering, a ``label`` element is added to the beginning of the ``footnote``, and reference text to the ``footnote_reference``. The transformed result will be:: <document> <paragraph> A labeled autonumbered footnote reference: <footnote_reference auto="1" id="id1" refid="footnote"> 2 <paragraph> An unlabeled autonumbered footnote reference: <footnote_reference auto="1" id="id2" refid="id3"> 1 <footnote auto="1" id="id3" backrefs="id2"> <label> 1 <paragraph> Unlabeled autonumbered footnote. <footnote auto="1" id="footnote" name="footnote" backrefs="id1"> <label> 2 <paragraph> Labeled autonumbered footnote. Note that the footnotes are not in the same order as the references. The labels and reference text are added to the auto-numbered ``footnote`` and ``footnote_reference`` elements. Footnote elements are backlinked to their references via "refids" attributes. References are assigned "id" and "refid" attributes. After adding labels and reference text, the "auto" attributes can be ignored. il��N) �*u���†u���‡����§����¶�#u���♠u���♥u���♦u���♣c������������������������g�|�_���������|�j��������j��������}|����������������������|������������|�j��������_��������|����������������������|�������������|�������������������������������������|�������������������������������������d�S�rN���)�autofootnote_labelsr����autofootnote_start�number_footnotes�number_footnote_references�symbolize_footnotes�resolve_footnotes_and_citations)r#����startnums��� r&���r'���zFootnotes.apply���sj������#%�� ��=�3��+/�+@�+@��+J�+J�� �(��'�'��1�1�1�� � �"�"�"��,�,�.�.�.�.�.r(���c������������������L����|�j���������j��������D��]�} �t����������|������������}|dz ��}||�j���������j��������vrn�$|���������������������dt����������j��������d|�������������������������|d���������D�]�}|�j���������j�����������������������������|g�������������D�]�}|t����������j ��������|������������z ��}|� ��������������������d�������������t����������|d���������������������t����������|d���������������������cxk����rdk����sn�J��|d���������d���������|d<���|���������������������|d���������d����������������������|�j���������� ��������������������|�������������d|_������������|d���������sX|d ���������sP|d������������������������������|�������������|�j������������������������������||�������������|�j�����������������������������|����������������|S�) z� Assign numbers to autonumbered footnotes. For labeled autonumbered footnotes, copy the number over to corresponding footnote references. Tr5���r���rc���r���r���r���r ����dupnames)r���� autofootnotes�strrV����insertr����label� footnote_refsr7����Text�delattrr���r>���r"���rB���r8����note_explicit_targetr����)r#���r�����footnoter����r%���rH���s��� r&���r����zFootnotes.number_footnotes���s�������� �3�� 7�� 7�H� ��H� � ���A� ���� � 5�5�5�� � � �O�O�A�u�{�2�u�5�5�6�6�6� ��)�� %�� %���=�6�:�:�4��D�D��%��%�C��5�:�e�,�,�,�C��K�K� �*�*�*��x���/�/�3�s�5�z�?�?�G�G�G�G�a�G�G�G�G�G�G�#+�E�?�1�#5�C��L��(�(��U��A��7�7�7��M�,�,�S�1�1�1�#$�C�L�L�%���G�$�� 7�X�j�-A�� 7���!�(�(��/�/�/�� �2�2�8�X�F�F�F��(�/�/��6�6�6���r(���c����������������������d}|�j���������j��������D��]�}|j��������s|���������������������d������������r� �|�j��������|���������}n�#�t ����������$�r��|�j���������j�����������������������������dt����������|�j��������������������z��|�������������}|�j���������� ��������������������|������������}|�j���������j��������|d����������D�]�}|j��������s|���������������������d������������r�t����������j��������|j��������|j��������|�������������}|�j���������� ��������������������|������������}|� ��������������������|�������������|���������������������|���������������Y��dS�w�xY�w|t����������j��������|������������z ��}|�j���������j��������|���������} |�j���������j��������| ���������} | |d<���|�j������������������������������|�������������t����������|d���������������������d k����sJ��| � ��������������������|d���������d����������������������d |_��������|d z ��}���dS�) z3Assign numbers to autonumbered footnote references.r���r ���zUToo many autonumbered footnote references: only %s corresponding footnotes available.re���Nr���r4���r���r5���)r����autofootnote_refsrB���r���r����� IndexErrorr9���r:���r���r;���r���r<���r=���r>���r?���r����rV���r���r"���)r#���r�����irH���r����rF���rG���rI���rJ���r$���r����s��� r&���r����z$Footnotes.number_footnote_references��s����� ���=�2�� �� �C��|�� �s�{�{�7�3�3�� �� ��0��3������ �� �� ��m�,�2�2�;��D�4�5�5�6�AD��3��F��F���� �,�,�S�1�1���=�:�1�2�2�>��*��*�C��|��!�s�{�{�9�'=�'=��!� ��+��-���e�E��E��E�C� �M�0�0��5�5�E��O�O�E�*�*�*��$�$�S�)�)�)�)����� ����� �5�:�e�$�$�$�C���&�u�-�B��}�(��,�H��C��L��M�$�$�S�)�)�)��s�5�z�?�?�a�'�'�'�'�� � ��U��A��/�/�/��C�L� ��F�A�A�9 �� s���� >�C3D6�5D6c�����������������������g�}|�j���������j��������D�]�}t����������|�j���������j��������t ����������|�j��������������������������������\��}}|�j��������|���������|dz���z��}|���������������������|�������������|���������������������dt����������j ��������d|�������������������������|�j���������xj��������dz ��c_��������|�j���������� ��������������������|���������������d}|�j���������j��������D��]�} �|t����������j��������||���������������������z ��}n�#�t����������$�r��|�j���������j�����������������������������dt ����������|������������z��|�������������}|�j���������� ��������������������|������������} |�j���������j��������|d����������D�]�}|j��������s|���������������������d������������r�t����������j��������|j��������|j��������| �������������} |�j���������� ��������������������| ������������}|���������������������|�������������|���������������������| ���������������Y��dS�w�xY�w|�j���������j��������|���������}t ����������|d ���������������������dk����sJ��|d ���������d���������|d<���|�j������������������������������|�������������|���������������������|d ���������d����������������������|dz ��}���dS�) z<Add symbols indexes to "[*]"-style footnotes and references.r5���r���rc���zOToo many symbol footnote references: only %s corresponding footnotes available.re���Nr ���r4���r���)r����symbol_footnotes�divmod�symbol_footnote_startr����symbolsr8���r����r���r����r;����symbol_footnote_refsr����r����r9���r:���rB���r���r<���r=���r>���r?���r"���)r#����labelsr�����reps�index� labeltextr����rH���rF���rG���rI���rJ���s��� r&���r����zFootnotes.symbolize_footnotes0��s��������� �6�� +�� +�H� ���!D�!$�T�\�!2�!2�4��4�K�D�%���U�+�t�a�x�8�I��M�M�)�$�$�$��O�O�A�u�{�2�y�9�9�:�:�:��M�/�/�1�4�/�/��M� � ��*�*�*�*� ���=�5�� �� �C� ��u�z�&��)�,�,�,������ �� �� ��m�,�2�2�;�=@��[�[�I� #��3��%��%���� �,�,�S�1�1���=�=�a�b�b�A��*��*�C��|��!�s�{�{�7�';�';��!� ��+��-���e�E��E��E�C� �M�0�0��5�5�E��O�O�E�*�*�*��$�$�S�)�)�)�)����� ������}�5�a�8�H��x���'�'�1�,�,�,�,�#�E�?�1�-�C��L��M�$�$�S�)�)�)�� � ��U��A��/�/�/� ��F�A�A�/ �� s����C1�1C.G$�#G$c������������������F����|�j���������j��������D�]C}|d���������D�]8}||�j���������j��������v�r(|�j���������j��������|���������}|����������������������||��������������9�D|�j���������j��������D�]C}|d���������D�]8}||�j���������j��������v�r(|�j���������j��������|���������}|����������������������||��������������9�DdS�)za Link manually-labeled footnotes and citations to/from their references. r���N)r���� footnotesr�����resolve_references� citations� citation_refs)r#���r����r����rl����citations��� r&���r����z)Footnotes.resolve_footnotes_and_citationsU��s������� �� �/�� ?�� ?�H�!�'�*�� ?�� ?���D�M�7�7�7�"�m�9�%�@�G��+�+�H�g�>�>�>�� ?��� �/�� ?�� ?�H�!�'�*�� ?�� ?���D�M�7�7�7�"�m�9�%�@�G��+�+�H�g�>�>�>�� ?� ?�� ?r(���c������������������:����t����������|d���������������������dk����sJ��|d���������d���������}|D�]g}|j��������r� |���������������������d�������������||d<���t����������|d���������������������dk����sJ��|���������������������|d���������d����������������������d|_���������hd|_��������d�S�)Nr���r5���r���r���r ���)r���rB���r����r>���)r#����noterl���r$���rH���s��� r&���r����zFootnotes.resolve_referencese��s��������4��;���1�$�$�$�$� �%�[��^���� �� �C��|�� ���K�K� �"�"�"��C��L��s�5�z�?�?�a�'�'�'�'����S��Z��]�+�+�+��C�L�L��� � � r(���) r*���r+���r,���r-���r.���r����r����r'���r����r����r����r����r����r/���r(���r&���r{���r{������s���������������9��9�v�����9������G�"/��/��/������:�����B#��#��#�J?��?��?� ��������r(���r{���c�������������������������e�Zd�ZdS�)�#CircularSubstitutionDefinitionErrorN)r*���r+���r,���r/���r(���r&���r����r����s��s���������������Dr(���r����c�������������������������e�Zd�ZdZdZ �d��ZdS�)� SubstitutionsaD�� Given the following ``document`` as input:: <document> <paragraph> The <substitution_reference refname="biohazard"> biohazard symbol is deservedly scary-looking. <substitution_definition name="biohazard"> <image alt="biohazard" uri="biohazard.png"> The ``substitution_reference`` will simply be replaced by the contents of the corresponding ``substitution_definition``. The transformed result will be:: <document> <paragraph> The <image alt="biohazard" uri="biohazard.png"> symbol is deservedly scary-looking. <substitution_definition name="biohazard"> <image alt="biohazard" uri="biohazard.png"> �����c����������� �������� ����|�j���������j��������}|�j���������j��������}i�}t����������|�j���������j��������dd������������}t����������|�j������������������������������t����������j��������������������������������}|D��]�}d}|d���������}||v�r|} n*|� ����������������������������������} |� ��������������������| d�������������} | �%|�j���������j�����������������������������d|z��|�������������}nO|| ���������}t����������|�����������������������������������������������|k����r"|�j���������j�����������������������������d| z��������������}|r�|�j������������������������������|������������}t����������j��������|j��������|j��������|�������������} |�j������������������������������| ������������}|���������������������|�������������|���������������������| ���������������7|j��������}|���������������������|������������}d |j��������v�s d |j��������v�rL|dk����rFt/����������||dz �����������t����������j��������������������r#||dz ����������������������������������������������||dz ��<���d |j��������v�s d |j��������v�r\t����������|������������|dz���k����rFt/����������||dz������������t����������j��������������������r#||dz�����������������������������������������������||dz���<���|�����������������������������������} �|���������������������t����������j��������������������D�]v}||d���������� �������������������������������������������}||���������������������|g�������������v�rt:�����������||������������������������������| �������������||d<���|���������������������|��������������w�ne#�t:����������$��rW�|j��������}t/����������|t����������j��������������������r[|�j���������j�����������������������������dt����������j ��������|j��������|j��������������������|j!��������|�������������}|���������������������|�������������n�|}|�"��������������������d������������r|d���������}|�"��������������������d�������������|�j���������j�����������������������������d|z��|�������������}|�j������������������������������|������������}t����������j��������|j��������|j��������|�������������} |�j������������������������������| ������������}|���������������������|�������������|���������������������| �������������Y���-w�xY�w|���������������������|j#���������������������|j#��������D�]:}t/����������|t����������j$��������������������rd|v�r|�j����������%��������������������|��������������;���d�S�)N�line_length_limiti'��rc���r���z(Undefined substitution referenced: "%s".re���z;Substitution definition "%s" exceeds the line-length-limit.r4����ltrim�trimr���r5����rtrimz ref-originz*Circular substitution definition detected:)�linerf���z2Circular substitution definition referenced: "%s".)&r����substitution_defs�substitution_namesr!����settings�listr���r����substitution_reference�lowerr7���r9���r:���r����astextr;���r<���r=���r>���r?���r���r����� attributesr���r�����rstrip�lstrip�deepcopy� setdefaultr����r8����substitution_definition� literal_blockr����r����children�Referential�note_refname)r#����defs�normed�nestedr����� subreflistrH���rF���r����key�normed_name�subdefrG���rI���rJ���r���r�����subdef_copy� nested_ref�nested_name� ref_originrE���s��� r&���r'���zSubstitutions.apply���sK������}�.����1����#�D�M�$:�$7��@��@����$�-�/�/��0L�M�M�N�N� ���R 9��R 9�C��C��)�n�G��$������%�m�m�o�o���j�j��d�3�3���{��m�,�2�2�@�� �+.��3��0��0�����c����v�}�}���'�'�*;�;�;��-�0�6�6�2�47�8�9��9�C���� �� �,�,�S�1�1���'��m�S�]�%�A��A��A��� �,�,�S�1�1������&�&�&�� � ��%�%�%���Z�F��L�L��%�%�E��6�,�,�,��V�.�.�.��1�9�9��F�5�1�9�,=�,1�J�"8��"8�9�(.�u�q�y�(9�(@�(@�(B�(B�F�5�1�9�%��6�,�,�,��V�.�.�.���K�K�%�!�)�+�+�"�6�%�!�)�#4�e�j�A�A��,�(.�u�q�y�(9�(@�(@�(B�(B�F�5�1�9�%� �/�/�+�+�K�! �"-�"5�"5��4�#6��#6��2��2�J�"(��I�)>�)D�)D�)F�)F�"G�K�"�f�&7�&7��R�&H�&H�H�H�A�A��;�'�.�.�s�3�3�3�/2�J�|�,��%�%�j�1�1�1�1�2���7�� �� �� �����f�e�&C�D�D��*��-�0�6�6�D��+�F�,<�,2�,<�>��>�#�[�F� �7��<��<�C� ��'�'��,�,�,�,��"%�J�$�,�,�\�:�:��>�%/��%=� ��%�,�,�\�:�:��>��-�0�6�6� �")�*�5?��7��A��A�C��!�M�0�0��5�5�E��+�� �s�}�E�C��C��C�C� �M�0�0��5�5�E��O�O�E�*�*�*��$�$�S�)�)�)���/ ����0� ���[�1�2�2�2��$�,�� 9�� 9���d�E�$5�6�6��9��!�D�(�(�� �2�2�4�8�8�8�� 9�[R 9��R 9s����BL5�5ER�RNr)���r/���r(���r&���r����r����w��s?�����������������4���>�Z9��Z9��Z9��Z9��Z9r(���r����c��������������������*�����e�Zd�ZdZdZ �d��Zd��Zd��ZdS�)�TargetNotesz� Creates a footnote for each external target in the text, and corresponding footnote references after each reference. i��c������������������t�����t����������j��������|�||��������������|j�����������������������������dg�������������|�_��������d�S�)N)� startnode�class)r����__init__�detailsr7����classes)r#���r���r����s��� r&���r����zTargetNotes.__init__���s8��������4��Y�?�?�?�?� �(�,�,�W�b�9�9����r(���c����������������������i�}g�}|�j������������������������������t����������j��������������������D�]�}|���������������������d������������s�|d���������}g�}|D�]5}|���������������������|�j���������j�����������������������������|g���������������������������6|s�]|����������������������|d���������||������������}|d���������|vr |||d���������<���|� ��������������������|���������������|�j������������������������������t����������j ��������������������D�]u}|���������������������d������������s�|���������������������d������������rH|����������������������|d���������|g|������������}|d���������|vr |||d���������<���|� ��������������������|��������������v|�j�����������������������������|�������������d�S�)Nr���r���r3���) r���r���r���r���r���r���rg���r7����make_target_footnoter8���r6���r����r?���) r#����notes�nodelistr���r����refsr%���r����rH���s ��� r&���r'���zTargetNotes.apply��s�����������m�+�+�E�L�9�9�� *�� *�F��>�>�(�+�+�� ���7�O�E��D��� B�� B�����D�M�2�6�6�t�R�@�@�A�A�A�A��� ���0�0���1A�4�16�8��8�H��h��u�,�,�*2��f�X�&�'�����)�)�)���=�(�(���9�9�� .�� .�C��7�7�;�'�'�� ���{�{�8�$�$�� .��4�4�S��]�S�E�5:�<��<���x�=��-�-�+3�E�#�h�-�(��O�O�H�-�-�-����#�#�H�-�-�-�-�-r(���c������������������,����||v�r2||���������}t����������|d���������������������dk����sJ��|d���������d���������}n�t����������j����������������������}|�j�����������������������������|������������}d|z���}d|d<���|g|d<���t����������j����������������������}|t����������j��������d||�������������z ��}||z ��}|�j�����������������������������|�������������|�j�����������������������������||�������������|D��]5}t����������|t����������j ��������������������r�t����������j��������|d�������������} | d xx���������|�j��������z ��cc<���|�j��������� ��������������������| �������������|�j�����������������������������| �������������|j�����������������������������|������������dz���} | g}t#����������j��������|�j��������j��������������������s_|�j��������r0|���������������������dt����������j��������d |�j����������������������������������n(|���������������������dt����������j��������d �������������������������|j�����������������������������| |���������������7|S�)Nr���r5���r���z TARGET_NOTE: �autorc���)r���)r���r����r����� )�text�Classes)r���r���r����r���r;���� paragraphr6����note_autofootnoter����r���r����footnote_referencer�����note_autofootnote_ref�note_footnote_refr���r����r����get_trim_footnote_ref_spacer����r�����inliner����)r#���r���r����r����r����� footnote_name�footnote_id�footnote_paragraphrH����refnoder����rl���s��� r&���r����z TargetNotes.make_target_footnote"��s%������U�?�?��V�}�H��x��(�)�)�Q�.�.�.�.�$�W�-�a�0�M�M��~�'�'�H��-�.�.�x�8�8�K��,�k�9�M� �H�V��!.��H�W��!&��!2�!2���%�/�"�f�V�"L�"L�"L�L���*�*�H��M�+�+�H�5�5�5��M�.�.�x��B�B�B��� .�� .�C��#�u�|�,�,�� ���.�}�1�M�M�M�G��I����$�,�.�����M�/�/��8�8�8��M�+�+�G�4�4�4��J�$�$�S�)�)�A�-�E��i�G��4�T�]�5K�L�L�� 7��<��7��N�N��5�<�S�$�,�G�G�G�I��I��I��I���N�N�1�e�j��o�o�6�6�6��J���e�W�-�-�-�-��r(���N)r*���r+���r,���r-���r.���r����r'���r����r/���r(���r&���r����r�������sX����������������� ����:��:��:� .��.��.�<"��"��"��"��"r(���r����c�������������������������e�Zd�ZdZdZd��ZdS�)�DanglingReferencesze Check for dangling references (incl. footnote & citation) and for unreferenced targets. iR��c����������������������t����������|�j��������|�j��������j��������j��������������������}|�j�����������������������������|�������������|�j�����������������������������t����������j��������������������D�]y}|j��������sp|� ��������������������d������������r�|d���������r|d���������d���������}n|d���������r|d���������d���������}n|d���������}|�j��������j �����������������������������d|z��|���������������zd�S�)Nr3���r���r���r���r ���z(Hyperlink target "%s" is not referenced.re���)�DanglingReferencesVisitorr���rW���rX����walkr���r���r���rA���r7���r9����info)r#����visitorr���rk���s��� r&���r'���zDanglingReferences.applyP��s������+��M��M�%�A�C��C��� � ���7�#�#�#���m�+�+�E�L�9�9�� 0�� 0�F��$�� 0��:�:�k�*�*��� ���'�?��-�#�G�_�Q�/�F�F��E�]��-�#�E�]�1�-�F�F��$�G�_�F�� �&�+�+�>���(.��,��0��0��0��! 0�� 0r(���Nr)���r/���r(���r&���r����r����G��s5����������������� ���0��0��0��0��0r(���r����c��������������������(�����e�Zd�Zd��Zd��Zd��ZexZZdS�)r����c������������������b�����t�����������j�����������������������������|�|�������������||�_��������||�_��������d�S�rN���)r����SparseNodeVisitorr����r���rX���)r#���r���rX���s��� r&���r����z"DanglingReferencesVisitor.__init__n��s0������ ��(�(��x�8�8�8� �� �+F��(�(�(r(���c�����������������������d�S�rN���r/���)r#���rE���s��� r&���� unknown_visitz'DanglingReferencesVisitor.unknown_visits��s�������r(���c����������������������|j���������s|���������������������d������������sd�S�|d���������}|�j��������j�����������������������������|������������}|��[|�j��������D�]}�||������������r�d�S��t ����������|�j��������j��������dd������������r#t����������|t����������j ��������������������r d|_���������d�S�||�j��������j��������v�r+|�j��������j�����������������������������d|d���������z��|�������������}n+|�j��������j�����������������������������d|d�����������d�|�������������}|�j��������� ��������������������|������������}t����������j��������|j��������|j��������|� ������������} �|d ���������d���������}n*#�t ����������$�r�|�j��������� ��������������������|������������}Y�nw�xY�w|���������������������|�������������|���������������������|�������������d�S�|d=�||d<���|�j��������j��������|������������������������������|� �������������d|_���������d�S�)Nr���� use_bibtexFTzBDuplicate target name, cannot be used as a unique reference: "%s".re���zUnknown target name: "z".r4���r���r���r ���rT���)rB���r���r���rV���r7���rX���r!���r����r���r����citation_referencer9���r:���r;���r<���r=���r����r>���r?���r���rZ���) r#���rE���r���r$���r]���rF���rG���rI���rJ���s ��� r&����visit_referencez)DanglingReferencesVisitor.visit_referencev��s#������=�� ����Y� 7� 7�� ��F��y�/�� �]� "� &� &�w� /� /�� �:�%)�%E�� '�� '�!�$�$�T�*�*����E�E����D�M�2�L�%�H�H���"�4��)A�B�B���%)�D�M��F��d�m�3�3�3��-�0�6�6�+�.2�9�o�?�JN��7��P��P�C�C���-�0�6�6�D��i��D�D�D�"&��7��(��(�C��� �,�,�S�1�1���'��n�d�n�E�C��C��C��6� ��K��N�E�E��!��6��6��6� �M�0�0��5�5�E�E�E�6��������&�&�&��!�!�#�&�&�&�&�&��Y���D��M��M��b�!�4�4��4�;�;�;� �D�M�M�Ms����?E��$E5�4E5N)r*���r+���r,���r����r����r�����visit_footnote_reference�visit_citation_referencer/���r(���r&���r����r����l��sP��������������G��G��G� �� �� �$!��$!��$!�L�;J�I��7�7�7r(���r����N)r-���� __docformat__�docutilsr���r����docutils.transformsr���r���r1���rL���rs���rv���r{���� Exceptionr����r����r����r����r����r����r/���r(���r&����<module>r�����sV���� ����#� ��!��!��!��!��!��!��!��!��)��)��)��)��)��)�G-��G-��G-��G-��G-�y��G-��G-��G-�T>��>��>��>��>�)��>��>��>�Bn:��n:��n:��n:��n:���n:��n:��n:�b!)��!)��!)��!)��!)�i��!)��!)��!)�H%!��%!��%!��%!��%!�i��%!��%!��%!�PY��Y��Y��Y��Y� ��Y��Y��Y�x �� �� �� �� �)�� �� �� �z9��z9��z9��z9��z9�I��z9��z9��z9�zP��P��P��P��P�)��P��P��P�f"0��"0��"0��"0��"0���"0��"0��"0�J0J��0J��0J��0J��0J�� 7��0J��0J��0J��0J��0Jr(���