Current File : /home/inlingua/miniconda3/lib/python3.1/site-packages/__pycache__/jsonpatch.cpython-312.pyc
�

6�0fRt���dZddlmZddlZddlZddlZddlZddlZ	ddlm	Z		ddlmZddlmZmZdZdZ	ddlmZmZd	Zd
ZdZdZej6d
k\reefZGd�de�ZGd�de�Z Gd�de�Z!Gd�dee"�Z#d�Z$ejJejLe$��Z'defd�Z(efd�Z)Gd�de*�Z+Gd�de+�Z,Gd�d e+�Z-Gd!�d"e+�Z.Gd#�d$e+�Z/Gd%�d&e+�Z0Gd'�d(e+�Z1Gd)�d*e*�Z2Gd+�d,e*�Z3d-�Z4y#e
$r
ddlm	Z	Y��wxYw#e
$re
ZY��wxYw#e
$rddlmZmZeZY��
wxYw).z Apply JSON-Patches (RFC 6902) �)�unicode_literalsN)�Sequence)�MappingProxyType)�JsonPointer�JsonPointerException�)�MutableMapping�MutableSequenceu Stefan Kögl <stefan@skoegl.net>z1.33z0https://github.com/stefankoegl/python-json-patchzModified BSD License)�rc��eZdZdZy)�JsonPatchExceptionzBase Json Patch exceptionN��__name__�
__module__�__qualname__�__doc__���)lib/python3.12/site-packages/jsonpatch.pyr
r
P���#rr
c��eZdZdZy)�InvalidJsonPatchz, Raised if an invalid JSON Patch is created NrrrrrrTs��6rrc��eZdZdZy)�JsonPatchConflicta
Raised if patch could not be applied due to conflict situation such as:
    - attempt to add object key when it already exists;
    - attempt to operate with nonexistence object key;
    - attempt to insert value to array at position beyond its size;
    - etc.
    NrrrrrrXs��rrc��eZdZdZy)�JsonPatchTestFailedz A Test operation failed Nrrrrrrarrrc��tjt�}|D]\}}||j|��t	d�|j�D��S)z'Convert duplicate keys values to lists.c3�PK�|]\}}|t|�dk(r|dn|f��� y�w)rrN)�len)�.0�key�valuess   r�	<genexpr>zmultidict.<locals>.<genexpr>ls4�����
�C��

�3�v�;�!�+�f�Q�i��8��s�$&)�collections�defaultdict�list�append�dict�items)�
ordered_pairs�mdictr!�values    r�	multidictr-es]��
�#�#�D�)�E�#�!�
��U�
�c�
���%� �!���!�;�;�=���r)�object_pairs_hookFc��t|t�rtj||��}n
t||��}|j	||�S)a�Apply list of patches to specified json document.

    :param doc: Document object.
    :type doc: dict

    :param patch: JSON patch as list of dicts or raw JSON-encoded string.
    :type patch: list or str

    :param in_place: While :const:`True` patch will modify target document.
                     By default patch will be applied to document copy.
    :type in_place: bool

    :param pointer_cls: JSON pointer class to use.
    :type pointer_cls: Type[JsonPointer]

    :return: Patched document object.
    :rtype: dict

    >>> doc = {'foo': 'bar'}
    >>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]
    >>> other = apply_patch(doc, patch)
    >>> doc is not other
    True
    >>> other == {'foo': 'bar', 'baz': 'qux'}
    True
    >>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]
    >>> apply_patch(doc, patch, in_place=True) == {'foo': 'bar', 'baz': 'qux'}
    True
    >>> doc == other
    True
    ��pointer_cls)�
isinstance�
basestring�	JsonPatch�from_string�apply)�doc�patch�in_placer1s    r�apply_patchr:xsA��B�%��$��%�%�e��%�E���%�[�9���;�;�s�H�%�%rc�2�tj|||��S)a!Generates patch by comparing two document objects. Actually is
    a proxy to :meth:`JsonPatch.from_diff` method.

    :param src: Data source document object.
    :type src: dict

    :param dst: Data source document object.
    :type dst: dict

    :param pointer_cls: JSON pointer class to use.
    :type pointer_cls: Type[JsonPointer]

    >>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}
    >>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}
    >>> patch = make_patch(src, dst)
    >>> new = patch.apply(src)
    >>> new == dst
    True
    r0)r4�	from_diff)�src�dstr1s   r�
make_patchr?�s��*���s�C�[��A�Arc�v�eZdZdZefd�Zd�Zd�Zd�Zd�Z	e
d��Ze
d��Zejd	��Zy
)�PatchOperationz'A single operation inside a JSON Patch.c�d�||_|jd�std��t|d|j�r&|dj|_|d|_||_y|d|_	|j|j
�|_||_y#t$r}td��d}~wwxYw)N�pathz#Operation must have a 'path' memberzInvalid 'path')	r1�__contains__rr2rC�location�pointer�	TypeError�	operation)�selfrHr1�exs    r�__init__zPatchOperation.__init__�s���&����%�%�f�-�"�#H�I�I��i��'��)9�)9�:�%�f�-�2�2�D�M�$�V�,�D�L�#���
&�f�-�D�M�
9�#�/�/��
�
�>���#�����
9�&�'7�8�8��
9�s�. B�	B/�B*�*B/c��td��)zGAbstract method that applies a patch operation to the specified object.z%should implement the patch operation.)�NotImplementedError)rI�objs  rr6zPatchOperation.apply�s��!�"I�J�Jrc�Z�tt|jj���S�N)�hash�	frozensetrHr)�rIs r�__hash__zPatchOperation.__hash__�s���I�d�n�n�2�2�4�5�6�6rc�V�t|t�sy|j|jk(S�NF)r2rArH�rI�others  r�__eq__zPatchOperation.__eq__�s"���%��0���~�~����0�0rc��||k(SrPrrWs  r�__ne__zPatchOperation.__ne__�����5�=�!�!rc�R�dj|jjdd�S)N�/���)�joinrF�partsrSs rrCzPatchOperation.path�s"���x�x����*�*�3�B�/�0�0rc��	t|jjd�S#t$r|jjdcYSwxYw)Nr_)�intrFra�
ValueErrorrSs rr!zPatchOperation.key�sE��	*��t�|�|�)�)�"�-�.�.���	*��<�<�%�%�b�)�)�	*�s�!$�"A	�A	c��t|�|jjd<|jj|_|j|j
d<y)Nr_rC)�strrFrarCrErH)rIr,s  rr!zPatchOperation.key�s=��!$�U�������2�����)�)��
�!%������v�rN)rrrrrrKr6rTrYr[�propertyrCr!�setterrrrrArA�sb��1�.9�#�$K�7�1�
"��1��1��*��*�	�Z�Z�/��/rrAc�"�eZdZdZd�Zd�Zd�Zy)�RemoveOperationz/Removes an object property or an array element.c�$�|jj|�\}}t|t�r*t|t�stdj
|���	||=|S#ttf$r!}dj
|�}t|��d}~wwxYw)Nzinvalid array index '{0}'z(can't remove a non-existent object '{0}')
rF�to_lastr2rrcr�format�KeyError�
IndexErrorr)rIrN�subobj�partrJ�msgs      rr6zRemoveOperation.apply�s����|�|�+�+�C�0�����f�h�'�
�4��0E�&�'B�'I�'I�$�'O�P�P�	)��t��
�
��	�*�%�	)�<�C�C�D�I�C�#�C�(�(��	)�s�A�B�.B
�
Bc�z�|j|k(r+|j|k\r|xjdz
c_|S|dz}|S�Nr�rCr!�rIrCr!s   r�_on_undo_removezRemoveOperation._on_undo_remove�s=���9�9����x�x�3�����A�
���
��q����
rc�z�|j|k(r+|j|kDr|xjdzc_|S|dz}|Srtrurvs   r�_on_undo_addzRemoveOperation._on_undo_add�=���9�9����x�x�#�~����A�
���
��q����
rN�rrrrr6rwryrrrrjrj�s��9���rrjc�"�eZdZdZd�Zd�Zd�Zy)�AddOperationz,Adds an object property or an array element.c��	|jd}|jj	|�\}}t|t�rJ|dk(r|j|�|S|t|�kDs|dkrtd��|j||�|St|t�r
|�|}|S|||<|S|�#tdjt|����tdj|j|���#t$r}td��d}~wwxYw)Nr,�/The operation does not contain a 'value' member�-rzcan't insert outside of list�invalid document type {0}�2unable to fully resolve json pointer {0}, part {1})rHrnrrFrlr2r
r'rr�insertr	rGrm�typerE)rIrNr,rJrprqs      rr6zAddOperation.applys#��	C��N�N�7�+�E�
�|�|�+�+�C�0�����f�o�.��s�{��
�
�e�$�&�
�#��F��#�t�a�x�'�(F�G�G��
�
�d�E�*��
����
/��|����
� %��t���
�	�|�� ;� B� B�4��<� P�Q�Q�'�(\�(c�(c�dh�dq�dq�sw�(x�y�y��5�	C�"�A�C�
C��	C�s�C0�0	D	�9D�D	c�z�|j|k(r+|j|kDr|xjdz
c_|S|dz
}|Srtrurvs   rrwzAddOperation._on_undo_remove3rzrc�z�|j|k(r+|j|kDr|xjdzc_|S|dz
}|Srtrurvs   rryzAddOperation._on_undo_add;rzrNr{rrrr}r}s��6��@�rr}c�"�eZdZdZd�Zd�Zd�Zy)�ReplaceOperationz?Replaces an object property or an array element by a new value.c��	|jd}|jj	|�\}}|�|S|dk(rtd��t|t�r|t|�k\s|dkr�td��t|t�r ||vrfdj|�}t|��|�#tdjt|����td	j|j|���|||<|S#t$r}td��d}~wwxYw)
Nr,rr�z7'path' with '-' can't be applied to 'replace' operationrzcan't replace outside of listz)can't replace a non-existent object '{0}'r�r�)rHrnrrFrlr2r
rrr	rmrGr�rE)rIrNr,rJrprqrrs       rr6zReplaceOperation.applyGs��	C��N�N�7�+�E�
�|�|�+�+�C�0�����<��L��3�;�"�#\�]�]��f�o�.��s�6�{�"�d�Q�h�'�(G�H�H�
���
/��6�!�A�H�H��N��'��,�,��|�� ;� B� B�4��<� P�Q�Q�'�(\�(c�(c�dh�dq�dq�sw�(x�y�y���t���
��7�	C�"�A�C�
C��	C�s�C2�2	D�;D�Dc��|SrPrrvs   rrwz ReplaceOperation._on_undo_removeg����
rc��|SrPrrvs   rryzReplaceOperation._on_undo_addjr�rNr{rrrr�r�Ds��I��@�rr�c�f�eZdZdZd�Zed��Zed��Zejd��Zd�Z	d�Z
y)	�
MoveOperationz?Moves an object property or an array element to a new location.c���	t|jd|j�r|jd}n|j|jd�}|j|�\}}	||}|j|k(r|St|t�r&|jj|�rtd��td|jdd�|j��j|�}td|j|d�|j��j|�}|S#t$r}t	d��d}~wwxYw#ttf$r}tt|���d}~wwxYw)	N�from�.The operation does not contain a 'from' memberz*Cannot move values into their own children�remove��oprCr0�add�r�rCr,)r2rHr1rnrrlrorrfrFr	�containsrjr6r}rE�rIrN�from_ptrrJrprqr,s       rr6zMoveOperation.applyqsg��	B��$�.�.��0�$�2B�2B�C��>�>�&�1���+�+�D�N�N�6�,B�C��
 �'�'��,����	-��4�L�E�
�<�<�8�#��J��f�n�-����%�%�h�/�#�$P�Q�Q����N�N�6�*�
��'�'�)�*/��s��	�
���M�M��
��'�'�	)�*/��s��		��
��;�	B�"�@�B�
B��	B���*�%�	-�#�C��G�,�,��	-�s0�AD �(D<� 	D9�)D4�4D9�<E$�E�E$c�z�|j|jd�}dj|jdd�S)Nr�r^r_)r1rHr`ra�rIr�s  r�	from_pathzMoveOperation.from_path�s5���#�#�D�N�N�6�$:�;���x�x����s��+�,�,rc��|j|jd�}	t|jd�S#t$r|jdcYSwxYw�Nr�r_)r1rHrcrarGr�s  r�from_keyzMoveOperation.from_key�sR���#�#�D�N�N�6�$:�;��	&��x�~�~�b�)�*�*���	&��>�>�"�%�%�	&�s�8�A�Ac��|j|jd�}t|�|jd<|j|jd<yr�)r1rHrfrarC)rIr,r�s   rr�zMoveOperation.from_key�s?���#�#�D�N�N�6�$:�;�� ��Z����r��!)������v�rc���|j|k(r*|j|k\r|xjdz
c_n|dz}|j|k(r+|j|kDr|xjdz
c_|S|dz
}|Srt�r�r�rCr!rvs   rrwzMoveOperation._on_undo_remove�sl���>�>�T�!��}�}��#��
�
��"�
��q����9�9����x�x�#�~����A�
���
��q����
rc���|j|k(r*|j|kDr|xjdzc_n|dz}|j|k(r+|j|kDr|xjdzc_|S|dz
}|Srtr�rvs   rryzMoveOperation._on_undo_add�sl���>�>�T�!��}�}�s�"��
�
��"�
��q����9�9����x�x�#�~����A�
���
��q����
rN)rrrrr6rgr�r�rhrwryrrrr�r�nsU��I�#�J�-��-��&��&��_�_�/��/�
�rr�c��eZdZdZd�Zy)�
TestOperationz!Test value by specified location.c
��	|jj|�\}}|�|}n|jj||�}	|jd}||k7r1d}t	|j|t|�|t|����|S#t$r}t	t|���d}~wwxYw#t$r}td��d}~wwxYw)Nr,rz0{0} ({1}) is not equal to tested value {2} ({3}))rFrl�walkrrrfrHrnrrmr�)rIrNrprq�valrJr,rrs        rr6zTestOperation.apply�s���	/��<�<�/�/��4�L�F�D��|����l�l�'�'���5��	C��N�N�7�+�E�
�%�<�D�C�%�c�j�j��d�3�i�16��U��'E�F�
F��
��$�	/�%�c�"�g�.�.��	/��
�	C�"�A�C�
C��	C�s/�?B	�B.�		B+�B&�&B+�.	C�7C�CN�rrrrr6rrrr�r��s
��+�rr�c��eZdZdZd�Zy)�
CopyOperationzA Copies an object property or an array element to a new location c��	|j|jd�}|j	|�\}}	tj||�}td|j|d�|j��j|�}|S#t$r}td��d}~wwxYw#ttf$r}tt|���d}~wwxYw)Nr�r�r�r�r0)
r1rHrnrrl�copy�deepcopyrorrfr}rEr6r�s       rr6zCopyOperation.apply�s���	B��'�'����v�(>�?�H�
 �'�'��,����	-��M�M�&��,�/�E����M�M��
��'�'�	)�*/��s��		��
��!�	B�"�@�B�
B��	B���*�%�	-�#�C��G�,�,��	-�s.�B�B�	B�B�B�C�.C�CNr�rrrr�r��s
��K�rr�c	���eZdZeej
�Zee�Ze	e
eee
eed��Z	efd�Zd�Zd�ZeZd�Zd�Zd�Zd�Zed	efd
��Zedd	efd��Zdd
�Zed��Zdd�Z d�Z!y	)r4)r�r��replace�move�testr�c��||_||_|jD].}t|t�rt	d��|j|��0y)NzMDocument is expected to be sequence of operations, got a sequence of strings.)r8r1r2r3r�_get_operation)rIr8r1r�s    rrKzJsonPatch.__init__2sW����
�&����*�*�	$�B��"�j�)�&�(P�Q�Q�
����#�	$rc�"�|j�S)zstr(self) -> self.to_string())�	to_stringrSs r�__str__zJsonPatch.__str__Js���~�~��rc�,�t|j�SrP)�boolr8rSs r�__bool__zJsonPatch.__bool__N����D�J�J��rc�,�t|j�SrP)�iterr8rSs r�__iter__zJsonPatch.__iter__Sr�rc�>�tt|j��SrP)rQ�tuple�_opsrSs rrTzJsonPatch.__hash__Vs���E�$�)�)�$�%�%rc�V�t|t�sy|j|jk(SrV)r2r4r�rWs  rrYzJsonPatch.__eq__Ys"���%��+���y�y�E�J�J�&�&rc��||k(SrPrrWs  rr[zJsonPatch.__ne__^r\rNc�F�|xs|j}||�}|||��S)a�Creates JsonPatch instance from string source.

        :param patch_str: JSON patch as raw string.
        :type patch_str: str

        :param loads: A function of one argument that loads a serialized
                      JSON string.
        :type loads: function

        :param pointer_cls: JSON pointer class to use.
        :type pointer_cls: Type[JsonPointer]

        :return: :class:`JsonPatch` instance.
        r0)�json_loader)�cls�	patch_str�loadsr1r�r8s      rr5zJsonPatch.from_stringas)�� �.�s�����I�&���5�k�2�2rTc��|xs|j}t||||��}|jdd||�t|j	��}|||��S)aCCreates JsonPatch instance based on comparison of two document
        objects. Json patch would be created for `src` argument against `dst`
        one.

        :param src: Data source document object.
        :type src: dict

        :param dst: Data source document object.
        :type dst: dict

        :param dumps: A function of one argument that produces a serialized
                      JSON string.
        :type dumps: function

        :param pointer_cls: JSON pointer class to use.
        :type pointer_cls: Type[JsonPointer]

        :return: :class:`JsonPatch` instance.

        >>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}
        >>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}
        >>> patch = JsonPatch.from_diff(src, dst)
        >>> new = patch.apply(src)
        >>> new == dst
        True
        r0�N)�json_dumper�DiffBuilder�_compare_valuesr&�execute)	r�r=r>�optimization�dumpsr1r��builder�opss	         rr<zJsonPatch.from_diffusT��>�.�s�����c�3���M������D�#�s�3��7�?�?�$�%���3�K�0�0rc�F�|xs|j}||j�S)z!Returns patch set as JSON string.)r�r8)rIr�r�s   rr�zJsonPatch.to_string�s!���/�t�/�/���4�:�:�&�&rc�T�tt|j|j��SrP)r��mapr�r8rSs rr�zJsonPatch._ops�s���S��,�,�d�j�j�9�:�:rc�x�|stj|�}|jD]}|j|�}�|S)a5Applies the patch to a given object.

        :param obj: Document object.
        :type obj: dict

        :param in_place: Tweaks the way how patch would be applied - directly to
                         specified `obj` or to its copy.
        :type in_place: bool

        :return: Modified `obj`.
        )r�r�r�r6)rIrNr9rHs    rr6zJsonPatch.apply�s=����-�-��$�C����	'�I��/�/�#�&�C�	'��
rc��d|vrtd��|d}t|t�std��||jvrtdj	|���|j|}|||j
��S)Nr�z&Operation does not contain 'op' memberzOperation's op must be a stringzUnknown operation {0!r}r0)rr2r3�
operationsrmr1)rIrHr�r�s    rr�zJsonPatch._get_operation�sy���y� �"�#K�L�L�
�t�_���"�j�)�"�#D�E�E�
�T�_�_�$�"�#<�#C�#C�B�#G�H�H��o�o�b�!���9�$�*:�*:�;�;rrP)F)"rrr�staticmethod�jsonr�r��
_jsonloadsr�rrjr}r�r�r�r�r�rrKr�r��__nonzero__r�rTrYr[�classmethodr5r<r�rgr�r6r�rrrr4r4�s����t�z�z�*�K��z�*�K�!�!��#����
#��J�,�Z+6�$�0 � ��K� �&�'�
"��*.�K�3��3�&�(,�D�#�"1��"1�H'�
�;��;��*
<rr4c�z�eZdZejefd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zy)r�c��||_||_iig|_ggg|_gx|_}||_||_||dg|ddyrP)r�r1�
index_storage�index_storage2�_DiffBuilder__root�src_doc�dst_doc)rIr�r�r�r1�roots      rrKzDiffBuilder.__init__�sS����
�&��� �"�X���!�2�h�������d���������t�$��Q�rc��|t|�f}	|j|}|j|�}|�|g||<y||j|�y#t$r#|j
|j||f�YywxYwrP)r�r��getr'rGr�)rIr,�index�st�	typed_key�storage�storeds       r�store_indexzDiffBuilder.store_index�s����D��K�(�	�		?��(�(��,�G��[�[��+�F��~�&+�W��	�"��	�"�)�)�%�0���	?�����#�*�*�I�u�+=�>�	?�s�(A
�A
�
)A9�8A9c�>�|t|�f}	|j|j|�}|r|j�Sy#t$rS|j
|}t
t|�dz
dd�D]%}||d|k(s�|j|�dccYSYywxYw)Nrr_r)r�r�r��poprGr��ranger)rIr,r�r�r�r��is       r�
take_indexzDiffBuilder.take_index�s����D��K�(�	�		-��'�'��+�/�/�	�:�F���z�z�|�#����	-��)�)�"�-�G��3�w�<��>�2�r�2�
-���1�:�a�=�I�-�"�;�;�q�>�!�,�,�
-�	-�s�/A�?B�B�B�Bc�H�|j}|d}|||gx|d<|d<|dS)Nrr�r�)rIr�r��lasts    rr�zDiffBuilder.insert�s6���{�{���A�w��!�4��,�,��Q��$�q�'��A�w�rc�.�|\}}}||d<||d<g|ddy)Nrrr)rIr��	link_prev�	link_next�_s     rr�zDiffBuilder.remove�s)��"'��	�9�a� �	�!�� �	�!����a�rc#�ZK�|j}|d}||ur|d��|d}||ur�yy�w�Nr�r�)rI�startr��currs    r�	iter_fromzDiffBuilder.iter_from�s<�����{�{���Q�x���$���q�'�M���7�D��$����&+�+c#�ZK�|j}|d}||ur|d��|d}||ur�yy�wr�r�)rIr�r�s   rr�zDiffBuilder.__iter__s<�����{�{���A�w���$���q�'�M���7�D��$��rc#�K�|j}|d}||ur�|d|ur�|d|dd}}|j|jk(rkt|�tk(rYt|�tk(rGtd|j|jdd�|j��j��|dd}��|dj��|d}||ur��yy�w)Nrr�r�r,r�r0)r�rEr�rjr}r�rHr1)rIr�r��op_first�	op_seconds     rr�zDiffBuilder.executes������{�{���A�w���$���A�w�d�"�&*�1�g�t�A�w�q�z�)���$�$�	�(:�(:�:��X��/�9��Y��<�7�*�'� )� 2� 2�!*�!4�!4�W�!=�,�$(�#3�#3�	5�6?�Y�	?�
 ��7�1�:�D���q�'�#�#�#���7�D��$��s�CC
�C
c��|j|t�}|��|d}t|j�tk(rSt|�tk(rA|j|�D]-}|j
|j|j�|_�/|j|�|jt||�k7rAtd|jt||�d�|j��}|j|�yytdt||�|d�|j��}|j|�}|j||t �y)Nr�r��r�r�rCr0r�r�)r��
_ST_REMOVEr�r!rcr�rwrCr�rE�
_path_joinr�r1r�r}r��_ST_ADD)	rIrCr!�itemr�r��v�new_op�	new_indexs	         r�_item_addedzDiffBuilder._item_addeds"������j�1�����q��B��B�F�F�|�s�"�t�C�y�C�'7�����.�@�A��.�.�r�w�w����?�B�F�@�
�K�K����{�{�j��s�3�3�&� ��K�K�&�t�S�1�(� $�/�/�	1��
���F�#�
4�"��"�4��-��#� �+�+�	-�F�
���F�+�I����T�9�g�6rc��tdt||�d�|j��}|j|t�}|j|�}|��|d}|jj|j�d}t|�tk(rA|j|�D]-}	|	j|j|j�|_�/|j|�|j |j k7r5t#d|j |j d�|j��}||d<y|j|�y|j%||t&�y)Nr�r�r0r�rr�r)rjrr1r�r	r�rFrlr�r�r&r�ryrCr!r�rEr�r�r)
rIrCr!r
rr�r
r��
added_itemrs
          r�
_item_removedzDiffBuilder._item_removed5s,�� ���t�S�)�"
��'�'�)������g�.���K�K��'�	����q��B�
���+�+�D�L�L�9�!�<�J��J��4�'�����.�=�A��^�^�B�G�G�R�V�V�<�B�F�=�
�K�K������"�+�+�-�&� �"�O�O��K�K�(� $�/�/�	1��
 &�	�!�����I�&�
���T�9�j�9rc	�l�|jtdt||�|d�|j���y)Nr�r�r0)r�r�rr1)rIrCr!r
s    r�_item_replacedzDiffBuilder._item_replacedVs6�����$���t�S�)��&
��'�'�	)�	*rc�\�t|j��}t|j��}||z
}||z
}|D]!}|j|t|�||��#|D]!}|j	|t|�||��#||zD]}|j||||||��yrP)�set�keysrrfrr�)	rIrCr=r>�src_keys�dst_keys�
added_keys�removed_keysr!s	         r�_compare_dictszDiffBuilder._compare_dicts]s����s�x�x�z�?���s�x�x�z�?����(�
��(�*���	9�C����t�S��X�s�3�x�8�	9��	7�C����T�3�s�8�S��X�6�	7��h�&�	@�C�� � ��s�C��H�c�#�h�?�	@rc�T�t|�t|�}}t||�}t||�}t|�D]�}||kr�||||}
}	|	|
k(r�t	|	t
�r.t	|
t
�r|j
t||�|	|
��Vt	|	t�r.t	|
t�r|jt||�|	|
���|j|||	�|j|||
���||kDr|j||||���|j||||���yrP)r�max�minr�r2r	rrr
�_compare_listsrr)rIrCr=r>�len_src�len_dst�max_len�min_lenr!�old�news           rrzDiffBuilder._compare_listsls���s�8�S��X����g�w�'���g�w�'����>�	6�C��W�}��s�8�S��X�S���#�:����^�4��s�N�3��'�'�
�4��(=�s�C�H���_�5�"�3��8��'�'�
�4��(=�s�C�H��&�&�t�S�#�6��$�$�T�3��4��7�"��"�"�4��#�c�(�;�� � ��s�C��H�5�-	6rc�j�t|t�r.t|t�r|jt||�||�yt|t�r.t|t�r|jt||�||�y|j
|�|j
|�k(ry|j|||�yrP)r2r	rrr
rr�r)rIrCr!r=r>s     rr�zDiffBuilder._compare_values�s����c�>�*��3��/����
�4�� 5�s�C�@�
��_�
-��3��0����
�4�� 5�s�C�@��Z�Z��_��
�
�3��
/��
����c�3�/rN)rrrr�r�rrKr�r�r�r�r�r�r�rrrrrr�rrrr�r��sS��/3�z�z�{�%�?�-������(7�2:�B*�
@�6�80rr�c�l�|�|S|dzt|�jdd�jdd�zS)Nr^�~z~0z~1)rfr�rus  rrr�s9��
�{����#�:��C��(�(��d�3�;�;�C��F�F�Fr)5r�
__future__rr$r��	functoolsr��sys�collections.abcr�ImportError�typesrr(�jsonpointerrrr	rr	r
�unicoderf�
__author__�__version__�__website__�__license__�version_info�bytesr3�	Exceptionr
rr�AssertionErrorrr-�partialr�r�r:r?�objectrArjr}r�r�r�r�r4r�rrrr�<module>r;s���B&�'�����
�%�(��&�
:���
�
��?�0�
���@��$�����v�����J�$��$�7�)�7��*��$�,�n�$�� �Y�
�
�t�z�z�Y�
G�
�&+��%&�P&1�B�03/�V�3/�l�n��D1�>�1�h'�~�'�TS�N�S�l�N��6�N��2M<��M<�`T0�&�T0�nG��e�%�$�$�%��
��������;�
�C��s3�D�D-�D;�D*�)D*�-D8�7D8�;E�
E