Ë
    èlÖin  ã                   óÜ  — d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlmZmZ d dlmZ d dlmZmZ d dlmZmZmZmZmZmZ d dlmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+ d dl,m-Z- 	 d dl.Z. ej`                  e1«      Z2 G d„ d	e3«      Z4 e5d«      Z6d
Z7dZ8dZ9dZ:dZ; e<h d£«      Z=i de>“de?“de@“de<“deA“deB“deC“deD“deE“deF“deG“deH“deI“deJ“dd“dd“d e	j                  “e	j–                  e	j˜                  e
jš                  e'ejœ                  ejž                  ej                   eBej¢                  ej¤                  eDd!œ¥ZS G d"„ d#e/«      ZT G d$„ d%e/«      ZU G d&„ d'«      ZVd(ZW e<eCeXh«      ZY G d)„ d*«      ZZ G d+„ d,e j¶                  «      Z\ G d-„ d.e jº                  «      Z^dNd/„Z_dOd0„Z`d1„ Zad2„ ZbdPd3„ZcdQd5„ZddRd6„Zed7„ Zfd8„ Zgd9„ Zhi e
jš                  ef“e'eD“ejÒ                  eD“e@eD“e5d:„ “eCeh“e	j                  d;„ “ejÔ                  d<„ “e!eG“e"eG“e#eF“e$eF“e%d=„ “eEeg“eeH“e*eB“e+eB“ekd>„ eeDi¥Zle)e(urd?„ ele)<   dPd@„Zm G dA„ dBejÜ                  «      ZnedCedDeBfdE„«       ZoedCedFeeH   dGeIdHed4   dDeCf
dI„«       ZoedCedFeeH   dGeIdHedJ   dDeBf
dK„«       Zo	 	 	 dSdCedFeeH   dGeIdHeIdDeeBeCf   f
dL„Zo eejà                  en¬M«      Zqy# e/$ r dZ.Y �Œ\w xY w)Té    N)ÚdeepcopyÚcopy)Úpartial)ÚMappingÚKeysView)ÚCallableÚOptionalÚUnionÚoverloadÚLiteralÚAny)ÚstringsÚget_typeÚ	TEXT_VIEWÚ
np_float32Ú
np_float64Únp_int32Únp_int64Ú
np_ndarrayÚOpcodeÚ
SetOrderedÚpydantic_base_model_typeÚPydanticBaseModelÚ
NotPresentÚipranges)ÚDeltaResultc                   ó   — e Zd Zy)ÚUnsupportedFormatErrN)Ú__name__Ú
__module__Ú__qualname__© ó    ú[/var/www/html/strategist-ai/venv_dbt/lib/python3.12/site-packages/deepdiff/serialization.pyr   r   0   s   „ Ør#   r   i   zXDeepDiff Delta did not find {} in your modules. Please make sure it is already imported.z^Module '{}' is forbidden. You need to explicitly pass it by passing a safe_to_import parameterz[report_repetition must be set to True when ignore_order is True to create the delta object.zkDelta can not be made when group_by is used since the structure of data is modified from the original form.>#   ú	uuid.UUIDú
re.Patternúbuiltins.binúbuiltins.intúbuiltins.setúbuiltins.strúbuiltins.Noneúbuiltins.boolúbuiltins.dictúbuiltins.listúdatetime.timeúbuiltins.bytesúbuiltins.floatúbuiltins.rangeúbuiltins.sliceúbuiltins.tupleúdecimal.Decimalúbuiltins.complexúdatetime.datetimeúbuiltins.frozensetúdatetime.timedeltaúipaddress.IPv4Addressúipaddress.IPv4Networkúipaddress.IPv6Addressúipaddress.IPv6Networkúcollections.namedtupleúdeepdiff.helper.Opcodeúcollections.OrderedDictúipaddress.IPv4Interfaceúipaddress.IPv6Interfaceúcollections.abc.KeysViewúdeepdiff.helper.SetOrderedúorderly_set.sets.OrderedSetúorderly_set.sets.OrderlySetúorderly_set.sets.StableSetEqÚrangeÚcomplexÚsetÚ	frozensetÚsliceÚstrÚbytesÚlistÚtupleÚintÚfloatÚdictÚboolÚbinÚNoneÚNoneTypeÚdatetime)ÚtimeÚ	timedeltaÚDecimalr   Ú
namedtupleÚOrderedDictÚPatternÚiprangeÚIPv4AddressÚIPv6Addressr   c                   ó   — e Zd ZdZy)ÚModuleNotFoundErrorz<
    Raised when the module is not found in sys.modules
    N©r   r    r!   Ú__doc__r"   r#   r$   rc   rc   …   ó   „ ñð 	r#   rc   c                   ó   — e Zd ZdZy)ÚForbiddenModulezG
    Raised when a module is not explicitly allowed to be imported
    Nrd   r"   r#   r$   rh   rh   Œ   rf   r#   rh   c            	       óŒ   — e Zd Zd„ Zed„ «       Zddee   fd„Zddee	   defd„Z
	 	 	 dd	ed
ededefd„Zddeee	ef      fd„Zy)ÚSerializationMixinc                 ó–   — 	 ddl }| j                  «       }|j                  |«      S # t        $ r t        j                  d«       Y yw xY w)z×
        :ref:`to_json_pickle_label`
        Get the json pickle of the diff object. Unless you need all the attributes and functionality of DeepDiff, running to_json() is the safer option that json pickle.
        r   NzGjsonpickle library needs to be installed in order to run to_json_pickle)Ú
jsonpickler   ÚencodeÚImportErrorÚloggerÚerror)Úselfrl   Úcopieds      r$   Úto_json_picklez!SerializationMixin.to_json_pickle•   sE   € ð
	dÛØ—Y‘Y“[ˆFØ×$Ñ$ VÓ,Ð,øÜò 	dÜ�L‰LÐbÖcð	dús   ‚$' §AÁAc                 óv   — 	 ddl }|j                  |«      S # t        $ r t        j	                  d«       Y yw xY w)zÄ
        :ref:`from_json_pickle_label`
        Load DeepDiff object with all the bells and whistles from the json pickle dump.
        Note that json pickle dump comes from to_json_pickle
        r   NzIjsonpickle library needs to be installed in order to run from_json_pickle)rl   Údecodern   ro   rp   )ÚclsÚvaluerl   s      r$   Úfrom_json_picklez#SerializationMixin.from_json_pickle¡   s:   € ð	fÛØ×$Ñ$ UÓ+Ð+øÜò 	fÜ�L‰LÐdÖeð	fús   ‚ —8·8NÚdefault_mappingc                 óL   — | j                  t        ¬«      }t        |f||dœ|¤ŽS )a  
        Dump json of the text view.
        **Parameters**

        default_mapping : dictionary(optional), a dictionary of mapping of different types to json types.

        by default DeepDiff converts certain data types. For example Decimals into floats so they can be exported into json.
        If you have a certain object type that the json serializer can not serialize it, please pass the appropriate type
        conversion through this dictionary.

        force_use_builtin_json: Boolean, default = False
            When True, we use Python's builtin Json library for serialization,
            even if Orjson is installed.


        kwargs: Any other kwargs you pass will be passed on to Python's json.dumps()

        **Example**

        Serialize custom objects
            >>> class A:
            ...     pass
            ...
            >>> class B:
            ...     pass
            ...
            >>> t1 = A()
            >>> t2 = B()
            >>> ddiff = DeepDiff(t1, t2)
            >>> ddiff.to_json()
            TypeError: We do not know how to convert <__main__.A object at 0x10648> of type <class '__main__.A'> for json serialization. Please pass the default_mapping parameter with proper mapping of the object to a basic python type.

            >>> default_mapping = {A: lambda x: 'obj A', B: lambda x: 'obj B'}
            >>> ddiff.to_json(default_mapping=default_mapping)
            '{"type_changes": {"root": {"old_type": "A", "new_type": "B", "old_value": "obj A", "new_value": "obj B"}}}'
        )Úview_override)ry   Úforce_use_builtin_json)Úto_dictr   Ú
json_dumps)rq   ry   r|   ÚkwargsÚdics        r$   Úto_jsonzSerializationMixin.to_json®   s:   € ðJ �l‰l¬ˆlÓ3ˆÜØð
à+Ø#9ñ
ð ñ	
ð 	
r#   r{   Úreturnc                 óV   — |r|n| j                   }t        | j                  |«      «      S )aP  
        convert the result to a python dictionary. You can override the view type by passing view_override.

        **Parameters**

        view_override: view type, default=None,
            override the view that was used to generate the diff when converting to the dictionary.
            The options are the text or tree.
        )ÚviewrS   Ú_get_view_results)rq   r{   r„   s      r$   r}   zSerializationMixin.to_dictÛ   s'   € ñ !.‰}°4·9±9ˆÜ�D×*Ñ*¨4Ó0Ó1Ð1r#   ÚdirectedÚreport_repetition_requiredÚalways_include_valuesc           
      ól  — | j                   �t        t        «      ‚|r”|s’i }| j                  j	                  «       D ]r  \  }}g ||<   |D ]c  }t        |j                  |j                  |j                  |j                  |j                  |j                  ¬«      }||   j                  |«       Œe Œt n| j                  }t        | j                  | j                  ||¬«      }	|	j!                  «        |r'| j                  r| j"                  st        t$        «      ‚|rZ|	j	                  «       D ]G  \  }
}t'        |t(        «      sŒ|j	                  «       D ]  \  }}t'        |t(        «      sŒd|v sŒ|d= Œ  ŒI | j*                  r| j*                  |	d<   | j,                  rd|	d<   t/        t1        |	«      «      S )aß  
        Dump to a dictionary suitable for delta usage.
        Unlike to_dict, this is not dependent on the original view that the user chose to create the diff.

        **Parameters**

        directed : Boolean, default=True, whether to create a directional delta dictionary or a symmetrical

        Note that in the current implementation the symmetrical delta (non-directional) is ONLY used for verifying that
        the delta is being applied to the exact same values as what was used to generate the delta and has
        no other usages.

        If this option is set as True, then the dictionary will not have the "old_value" in the output.
        Otherwise it will have the "old_value". "old_value" is the value of the item in t1.

        If delta = Delta(DeepDiff(t1, t2)) then
        t1 + delta == t2

        Note that it the items in t1 + delta might have slightly different order of items than t2 if ignore_order
        was set to be True in the diff object.

        )ÚtagÚt1_from_indexÚt1_to_indexÚt2_from_indexÚt2_to_indexÚ
new_values)Útree_resultsÚignore_orderrˆ   Ú_iterable_opcodesÚ	old_valueÚ_numpy_pathsTÚ_iterable_compare_func_was_used)Úgroup_byÚ
ValueErrorÚDELTA_ERROR_WHEN_GROUP_BYr’   Úitemsr   rŠ   r‹   rŒ   r�   rŽ   r�   Úappendr   Útreer‘   Úremove_empty_keysÚreport_repetitionÚ*DELTA_IGNORE_ORDER_NEEDS_REPETITION_REPORTÚ
isinstancer   r”   Úiterable_compare_funcr   rS   )rq   r†   r‡   rˆ   r’   ÚpathÚop_codesÚop_codeÚnew_op_codeÚresultÚ
report_keyÚreport_valuerw   s                r$   Ú_to_delta_dictz!SerializationMixin._to_delta_dicté   s°  € ð8 �=‰=Ð$ÜÔ6Ó7Ð7áÑ1Ø "ÐØ"&×"8Ñ"8×">Ñ">Ó"@ò @‘��hØ*,Ð! $Ñ'Ø'ò 	@�GÜ"(Ø#ŸK™KØ&-×&;Ñ&;Ø$+×$7Ñ$7Ø&-×&;Ñ&;Ø$+×$7Ñ$7Ø#*×#5Ñ#5ô#�Kð & dÑ+×2Ñ2°;Õ?ñ	@ñ@ð !%× 6Ñ 6ÐäØŸ™Ø×*Ñ*Ø"7Ø/ô	
ˆð 	× Ñ Ô"Ù%¨$×*;Ò*;ÀD×DZÒDZÜÔGÓHÐHÙØ,2¯L©L«Nò 3Ñ(�
˜LÜ˜l¬GÕ4Ø'3×'9Ñ'9Ó';ò 3™˜˜eÜ% e¬WÕ5¸+ÈÒ:NØ % kÑ 2ñ3ð3ð
 ×Òð &*×%6Ñ%6ˆF�>Ñ"à×%Ò%Ø8<ˆFÐ4Ñ5äœ˜V›Ó%Ð%r#   Úprefixc                 ó,  ‡ ‡— g }‰€dŠt        ‰ j                  j                  «       «      }|D ]%  }‰ j                  |   D ]  }|t        |«      gz  }Œ Œ' t	        ‰«      rdj                  ˆˆ fd„|D «       «      S dj                  ˆfd„|D «       «      S )a·  
        The pretty human readable string output for the diff object
        regardless of what view was used to generate the diff.

        prefix can be a callable or a string or None.

        Example:
            >>> t1={1,2,4}
            >>> t2={2,3}
            >>> print(DeepDiff(t1, t2).pretty())
            Item root[3] added to set.
            Item root[4] removed from set.
            Item root[1] removed from set.
        Ú ú
c              3   ó8   •K  — | ]  } ‰‰¬ «      › |› �–— Œ y­w))ÚdiffNr"   )Ú.0Úrr©   rq   s     €€r$   ú	<genexpr>z,SerializationMixin.pretty.<locals>.<genexpr>J  s    øè ø€ ÒG¸1¡¨DÔ 1Ð2°1°#Ô6ÑGùs   ƒc              3   ó*   •K  — | ]
  }‰› |› �–— Œ y ­w©Nr"   )r¯   r°   r©   s     €r$   r±   z,SerializationMixin.pretty.<locals>.<genexpr>K  s   øè ø€ Ò8¨A˜F˜8 A 3œÑ8ùs   ƒ)Úsortedr›   ÚkeysÚpretty_print_diffÚcallableÚjoin)rq   r©   r¥   rµ   ÚkeyÚitem_keys   ``    r$   ÚprettyzSerializationMixin.pretty2  s–   ù€ ð ˆØˆ>ØˆFÜ�d—i‘i—n‘nÓ&Ó'ˆØò 	8ˆCØ ŸI™I c™Nò 8�ØÔ,¨XÓ6Ð7Ñ7‘ñ8ð	8ô �FÔØ—9‘9ÔGÀÔGÓGÐGØ�y‰yÓ8°Ô8Ó8Ð8r#   )NFr³   )TTF)r   r    r!   rs   Úclassmethodrx   r	   rS   r�   rM   r}   rT   r¨   r
   r   r»   r"   r#   r$   rj   rj   “   sœ   „ ò
dð ñ
fó ð
fñ+
 x°¡~ó +
ñZ2 X¨c¡]ð 2¸Dó 2ð  Ø+/Ø&+ñ	G&àðG&ð %)ðG&ð  $ð	G&ð
 
óG&ñR9˜X e¨C°¨MÑ&:Ñ;ô 9r#   rj   i   c                   ó    — e Zd ZdZdZd„ Zd„ Zy)Ú_SafeConstructorzVWraps a type constructor to prevent excessive memory allocation via the REDUCE opcode.©Ú_wrappedc                 ó   — || _         y r³   r¿   )rq   Úwrappeds     r$   Ú__init__z_SafeConstructor.__init__[  s	   € Øˆ�r#   c                 óä   — |D ]Z  }t        |t        «      sŒ|t        kD  sŒt        j                  dj                  | j                  j                  |t        «      «      ‚  | j                  |i |¤ŽS )Nz…Refusing to create {}() with size {}: exceeds the maximum allowed size of {} bytes. This could be a denial-of-service attack payload.)rŸ   rQ   Ú_MAX_ALLOC_SIZEÚpickleÚUnpicklingErrorÚformatrÀ   r   )rq   Úargsr   Úargs       r$   Ú__call__z_SafeConstructor.__call__^  so   € Øò 	ˆCÜ˜#œsÕ#¨¬oÓ(=Ü×,Ñ,ðHçHNÉØŸ™×.Ñ.°´_óIóð ð	ð ˆt�}‰}˜dÐ- fÑ-Ð-r#   N)r   r    r!   re   Ú	__slots__rÃ   rË   r"   r#   r$   r¾   r¾   W  s   „ Ù`Ø€Iò ó
.r#   r¾   c                   ó*   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zˆ xZS )Ú_RestrictedUnpicklerc                 ó”  •— |j                  dd «      | _        | j                  rŠt        | j                  t        «      rt	        | j                  g«      | _        n;t        | j                  t        t
        f«      rnt	        | j                  «      | _        | j                  t        z  | _        nt        | _        t        ‰| �   |i |¤Ž y )NÚsafe_to_import)	ÚpoprÐ   rŸ   r   rJ   rK   ÚSAFE_TO_IMPORTÚsuperrÃ   )rq   rÉ   r   Ú	__class__s      €r$   rÃ   z_RestrictedUnpickler.__init__m  sž   ø€ Ø$Ÿj™jÐ)9¸4Ó@ˆÔØ×ÒÜ˜$×-Ñ-¬wÔ7Ü&)¨4×+>Ñ+>Ð*?Ó&@�Õ#Ü˜D×/Ñ/´#´yÐ1AÔBØä&)¨$×*=Ñ*=Ó&>�Ô#Ø"&×"5Ñ"5¼Ñ"FˆDÕä"0ˆDÔÜ‰Ñ˜$Ð) &Ó)r#   c                 óB  — dj                  ||«      }|| j                  v r5	 t        j                  |   }t        ||«      }|t        v rt        |«      S |S t        t        j                  |«      «      d ‚# t        $ r  t        t        j                  |«      «      d ‚w xY w)Nz{}.{})rÈ   rÐ   ÚsysÚmodulesÚKeyErrorrc   ÚMODULE_NOT_FOUND_MSGÚgetattrÚ_SIZE_SENSITIVE_CALLABLESr¾   rh   ÚFORBIDDEN_MODULE_MSG)rq   ÚmoduleÚnameÚmodule_dot_classÚ
module_objrv   s         r$   Ú
find_classz_RestrictedUnpickler.find_class{  s¥   € à"Ÿ>™>¨&°$Ó7ÐØ˜t×2Ñ2Ñ2ðcÜ Ÿ[™[¨Ñ0�
ô ˜* dÓ+ˆCàÔ/Ñ/Ü'¨Ó,Ð,ØˆJäÔ2×9Ñ9Ð:JÓKÓLÐRVÐVøô ò cÜ)Ô*>×*EÑ*EÐFVÓ*WÓXÐ^bÐbðcús   ¢A5 Á5)Bc                 ó$   — |dk(  rt        d «      S y ©Nz<<NoneType>>)Útype)rq   Úpids     r$   Úpersistent_loadz$_RestrictedUnpickler.persistent_load‹  s   € Ø�.Ò Ü˜“:Ðð !r#   )r   r    r!   rÃ   rá   ræ   Ú__classcell__)rÔ   s   @r$   rÎ   rÎ   k  s   ø„ ô*òWö r#   rÎ   c                   ó   — e Zd Zd„ Zy)Ú_RestrictedPicklerc                 ó   — |t         u ryy rã   )Ú	NONE_TYPE)rq   Úobjs     r$   Úpersistent_idz _RestrictedPickler.persistent_id‘  s   € Ø”)ÑØ!Ør#   N)r   r    r!   rí   r"   r#   r$   ré   ré   �  s   „ ór#   ré   c                 ó¨   — t        |«      }|xs t        j                  «       }t        ||d¬«      j	                  | «       |s|j                  «       S y)a®  
    **pickle_dump**
    Dumps the obj into pickled content.

    **Parameters**

    obj : Any python object

    file_obj : (Optional) A file object to dump the contents into

    **Returns**

    If file_obj is passed the return value will be None. It will write the object's pickle contents into the file.
    However if no file_obj is passed, then it will return the pickle serialization of the obj in the form of bytes.
    F)ÚprotocolÚfix_importsN)rT   ÚioÚBytesIOré   ÚdumpÚgetvalue)rì   Úfile_objrï   Úfile_obj_passeds       r$   Úpickle_dumpr÷   —  sK   € ô  ˜8“n€OØÒ'œ2Ÿ:™:›<€HÜ�x¨(ÀÔF×KÑKÈCÔPÙØ× Ñ Ó"Ð"ð r#   c                 óÆ   — | s|st        d«      ‚t        | t        «      r| j                  d«      } | rt	        j
                  | «      }t        ||¬«      j                  «       S )aê  
    **pickle_load**
    Load the pickled content. content should be a bytes object.

    **Parameters**

    content : Bytes of pickled object. 

    file_obj : A file object to load the content from

    safe_to_import : A set of modules that needs to be explicitly allowed to be loaded.
        Example: {'mymodule.MyClass', 'decimal.Decimal'}
        Note that this set will be added to the basic set of modules that are already allowed.
        The set of what is already allowed can be found in deepdiff.serialization.SAFE_TO_IMPORT

    **Returns**

        A delta object that can be added to t1 to recreate t2.

    **Examples**

    Importing
        >>> from deepdiff import DeepDiff, Delta
        >>> from pprint import pprint


    z>Please either pass the content or the file_obj to pickle_load.úutf-8)rÐ   )r—   rŸ   rM   rm   rñ   rò   rÎ   Úload)Úcontentrõ   rÐ   s      r$   Úpickle_loadrü   ®  sT   € ñ8 ™8ÜÐYÓZÐZÜ�'œ3ÔØ—.‘. Ó)ˆÙÜ—:‘:˜gÓ&ˆÜ ¸ÔH×MÑMÓOÐOr#   c                 ó\   — ddddddddd	d
ddœ}| dk(  r|j                  dddddddœ«       |S )NzdType of {diff_path} changed from {type_t1} to {type_t2} and value changed from {val_t1} to {val_t2}.z7Value of {diff_path} changed from {val_t1} to {val_t2}.z%Item {diff_path} added to dictionary.z)Item {diff_path} removed from dictionary.z#Item {diff_path} added to iterable.z'Item {diff_path} removed from iterable.zAttribute {diff_path} added.zAttribute {diff_path} removed.z!Item root[{val_t2}] added to set.z%Item root[{val_t1}] removed from set.z'Repetition change for item {diff_path}.)Útype_changesÚvalues_changedÚdictionary_item_addedÚdictionary_item_removedÚiterable_item_addedÚiterable_item_removedÚattribute_addedÚattribute_removedÚset_item_addedÚset_item_removedÚrepetition_changeé   z0Item {diff_path} ({val_t2}) added to dictionary.z4Item {diff_path} ({val_t1}) removed from dictionary.z.Item {diff_path} ({val_t2}) added to iterable.z2Item {diff_path} ({val_t1}) removed from iterable.z'Attribute {diff_path} ({val_t2}) added.z)Attribute {diff_path} ({val_t1}) removed.)r   r  r  r  r  r  )Úupdate)Úverbose_levelÚpretty_form_textss     r$   Ú_get_pretty_form_textr  Ó  sb   € à~ØSØ!HØ#NØDØ!JØ9Ø=Ø=ØCØFñÐð ˜ÒØ× Ñ à)[Ø+aØ'WØ)]Ø#LØ%Pñô		
ð Ðr#   c                 ó   — t        | j                  «      j                  }t        | j                  «      j                  }|dk(  r$dj	                  t        | j                  «      «      nt        | j                  «      }|dk(  r$dj	                  t        | j                  «      «      nt        | j                  «      }| j                  d¬«      }t        | j                  «      j                  | j                  d«      j	                  |||||¬«      S )NrM   z"{}"Úroot)r  r«   )Ú	diff_pathÚtype_t1Útype_t2Úval_t1Úval_t2)r   Út1r   Út2rÈ   rM   r¡   r  r  ÚgetÚreport_type)r®   r  r  r  r  r  s         r$   r¶   r¶   ï  sÎ   € Ü�t—w‘wÓ×(Ñ(€GÜ�t—w‘wÓ×(Ñ(€Gà,3°uÒ,<ˆV�]‰]œ3˜tŸw™w›<Ô(Ä#ÀdÇgÁgÃ,€FØ,3°uÒ,<ˆV�]‰]œ3˜tŸw™w›<Ô(Ä#ÀdÇgÁgÃ,€Fà—	‘	˜v�	Ó&€IÜ  ×!3Ñ!3Ó4×8Ñ8¸×9IÑ9IÈ2ÓN×UÑUØØØØØð Vó ð r#   c                 ó´  — |€| j                  d«      d   }|dk(  r0t        | d«      5 }t        |j                  «       «      }ddd«       |S |dv r-	 ddl}t        | d«      5 }|j                  |«      }ddd«       |S |d	k(  rE	 t        j                  d
k\  rddl	}nddl
}t        | d«      5 }|j                  |«      }ddd«       |S |dk(  r2t        | d«      5 }|j                  «       }t        |«      }ddd«       |S |dv r„	 ddl}|j                  | «      }t$        j'                  d| › �«       D ]O  }|j)                  «       D ]:  \  }	}
|
j+                  «       }
t,        t.        t0        fD ]  }	  ||
«      }
|
||	<    Œ: Œ< ŒQ |S t5        d|› d�«      ‚# 1 sw Y   S xY w# t
        $ r t        d«      d‚w xY w# 1 sw Y   S xY w# t
        $ r t        d«      d‚w xY w# 1 sw Y   S xY w# 1 sw Y   S xY w# t
        $ rD ddl}t        | d«      5 }t!        |j#                  |«      «      }ddd«       n# 1 sw Y   nxY wY �Œ/w xY w# t2        $ r Y Œêw xY w)z9
    Loads and deserializes the content of the path.
    Nú.éÿÿÿÿÚjsonr°   >   ÚymlÚyamlr   úPyyaml needs to be installed.Útoml)é   é   z,On python<=3.10 tomli needs to be installed.ÚrbrÆ   >   ÚcsvÚtsvzNOTE: CSV content was empty in ú?Only json, yaml, toml, csv, tsv and pickle are supported.
 The ú extension is not known.)ÚsplitÚopenÚ
json_loadsÚreadr  rn   Ú	safe_loadrÖ   Úversion_infoÚtomllibÚtomlirú   rü   Ú	clevercsvÚ
read_dictsr$  rO   Ú
DictReaderro   Úinfor™   ÚstriprQ   rR   rI   Ú	Exceptionr   )r¡   Ú	file_typeÚthe_filerû   r  r/  r0  r$  Úrowr¹   rw   Útype_s               r$   Úload_path_contentr:  ÿ  s¿  € ð
 ÐØ—J‘J˜s“O BÑ'ˆ	Ø�FÒÜ�$˜‹_ð 	2 Ü  §¡£Ó1ˆG÷	2ðb €Nð_ 
�oÑ	%ð	IÛô �$˜‹_ð 	/ Ø—n‘n XÓ.ˆG÷	/ðT €NðQ 
�fÒ	ð	XÜ×Ñ 7Ò*Ü'ãô �$˜Óð 	+ Ø—j‘j Ó*ˆG÷	+ð@ €Nð= 
�hÒ	Ü�$˜Óð 	+ Ø—m‘m“oˆGÜ! 'Ó*ˆG÷	+ð: €Nð5 
�nÑ	$ð	9ÛØ×*Ñ*¨4Ó0ˆGô 	�‰Ð5°d°VÐ<Ô=ð ò 
	ˆCØ!Ÿi™i›kò 	‘
��UØŸ™›�Ü!¤5¬'Ð2ò �EðÙ % e£˜ð $)˜˜C™Ùññ	ð
	ð €Nô #ð &+Ø+4¨+Ð5Mð$Oó Pð 	P÷_	2ðb €NûôY ò 	IÜÐ=Ó>ÀDÐHð	Iú÷	/ðT €NûôE ò 	XÜÐLÓMÐSWÐWð	Xú÷	+ð@ €Nú÷;	+ð: €Nûô- ò 	9ÛÜ�d˜C“ð 9 HÜ˜sŸ~™~¨hÓ7Ó8�÷9÷ 9ñ 9ýð	9ûô %ò Ùðúsƒ   ¨FÁF" Á!F;ÂG Â+G!ÃG.ÄG; Å0IÆFÆ"F8Æ;GÇGÇ!G+Ç.G8Ç;IÈH8È/	IÈ8I	È=IÉIÉ	I	ÉI	Tc                 óÒ   — |› d�}t        j                  ||«       	 t        | |||¬«       |st        j                  |«       yy# t        $ r t        j                  ||«       ‚ w xY w)z7
    Saves and serializes the content of the path.
    z.bak)rû   r¡   r6  Úkeep_backupN)ÚosÚrenameÚ_save_contentÚremover5  )rû   r¡   r6  r<  Úbackup_paths        r$   Úsave_content_to_pathrB  ;  sl   € ð
 �F˜$�-€KÜ‡I�Iˆd�KÔ ð	#ÜØ $Ø¨[õ	:ñ Ü�I‰I�kÕ"ð øô	 ò Ü
�	‰	�+˜tÔ$Øðús   �A Á!A&c                 ó¼  — |dk(  r3t        |d«      5 }t        | «      } |j                  | «       d d d «       | S |dv r/	 dd l}t        |d«      5 }|j                  | |¬«      } d d d «       | S |dk(  r.	 dd l}t        |d	«      5 }|j                  | |«      } d d d «       | S |d
k(  r$t        |d	«      5 }t        | |¬«      } d d d «       | S |dv rq	 dd l	}|j                  }t        |dd¬«      5 }
t        | d   j                  «       «      } ||
|¬«      }|j                  «        |j                  | «       d d d «       | S t!        d|› d�«      ‚# 1 sw Y   | S xY w# t        $ r t	        d«      d ‚w xY w# 1 sw Y   | S xY w# t        $ r t	        d«      d ‚w xY w# 1 sw Y   | S xY w# 1 sw Y   | S xY w# t        $ r dd l}	|	j                  }Y Œðw xY w# 1 sw Y   | S xY w)Nr  Úw>   r  r  r   r  )Ústreamr   zTomli-w needs to be installed.ÚwbrÆ   )rõ   >   r$  r%  r«   )Únewline)Ú
fieldnamesr&  r'  )r)  r~   Úwriter  rn   Ú	safe_dumpÚtomli_wró   r÷   r0  Ú
DictWriterr$  rO   rµ   ÚwriteheaderÚ	writerowsr   )rû   r¡   r6  r<  r7  r  rK  r0  Údict_writerr$  ÚcsvfilerH  Úwriters                r$   r?  r?  O  s2  € Ø�FÒÜ�$˜‹_ð 	$ Ü  Ó)ˆGØ�N‰N˜7Ô#÷	$ðF €NðA 
�oÑ	%ð	IÛô �$˜‹_ð 	? Ø—n‘n W°X�nÓ>ˆG÷	?ð6 €Nð3 
�fÒ	ð	JÛô �$˜Óð 	6 Ø—l‘l 7¨HÓ5ˆG÷	6ð( €Nð% 
�hÒ	Ü�$˜Óð 	> Ü! '°HÔ=ˆG÷	>ð" €Nð 
�nÑ	$ð	)ÛØ#×.Ñ.ˆKô �$˜ RÔ(ð 	&¨GÜ˜g a™jŸo™oÓ/Ó0ˆJÙ  °ZÔ@ˆFØ×ÑÔ Ø×Ñ˜WÔ%÷		&ð €Nô #ð $+Ø+4¨+Ð5Mð$Oó Pð 	P÷C	$ðF €Nûô; ò 	IÜÐ=Ó>ÀDÐHð	Iú÷	?ð6 €Nûô- ò 	JÜÐ>Ó?ÀTÐIð	Jú÷	6ð( €Nú÷#	>ð" €Nûô ò 	)ÛØŸ.™.ŠKð	)ú÷	&ð €Núse   ’E¾E ÁE2Á2E? ÂFÂ0F%ÃF2 Ã+AGÅEÅE/Å2E<Å?FÆF"Æ%F/Æ2GÇGÇGc                 óh   — | j                  «       j                  dk(  rt        | «      S t        | «      S )Nr   )Úas_tupleÚexponentrQ   rR   ©rw   s    r$   Ú_serialize_decimalrV  w  s+   € Ø‡~�~Ó× Ñ  AÒ%Ü�5‹zÐä�U‹|Ðr#   c                 ó>   — t        | d«      r| j                  «       S | S )NÚ_asdict)ÚhasattrrX  rU  s    r$   Ú_serialize_tuplerZ  ~  s   € Üˆu�iÔ Ø�}‰}‹ÐØ€Lr#   c                 óŒ   — 	 | j                  d«      S # t        $ r' t        j                  | «      j                  d«      cY S w xY w)z¢
    Serialize bytes to JSON-compatible format.
    First tries UTF-8 decoding for backward compatibility.
    Falls back to base64 encoding for binary data.
    rù   Úascii)ru   ÚUnicodeDecodeErrorÚbase64Ú	b64encoderU  s    r$   Ú_serialize_bytesr`  „  sA   € ð7Ø�|‰|˜GÓ$Ð$øÜò 7Ü×Ñ Ó&×-Ñ-¨gÓ6Ò6ð7ús   ‚ “-AÁAc                 ó   — | j                   S r³   )r   ©Úxs    r$   ú<lambda>rd  •  s
   € �A—J‘J€ r#   c                 ó"   — | j                  «       S r³   )Ú	isoformatrb  s    r$   rd  rd  —  s   €  §¡£€ r#   c                 ó   — t        | «      S r³   )rM   rb  s    r$   rd  rd  ˜  s
   € œ˜Q›€ r#   c                 ó"   — | j                  «       S r³   )Útolistrb  s    r$   rd  rd  �  s   € ˜!Ÿ(™(›*€ r#   c                 ó"   — | j                  «       S r³   )Útobytesrb  s    r$   rd  rd  ¢  s   € ˜!Ÿ)™)›+€ r#   c                 ó"   — | j                  «       S r³   )Ú
model_dumprb  s    r$   rd  rd  §  s   € °!·,±,³.€ r#   c                 ón   ‡— | r&t         j                  «       Š‰j                  | «       nt         Šˆfd„}|S )Nc                 ó®  •— ‰	j                  «       D ]  \  }}t        | |«      sŒ || «      c S  | j                  j                  dk(  rt	        t        | «      «      S i }| j                  j                  D ]W  }|j                  j                  «       D ]8  \  }}t        |t        «      sŒ|j                  d«      rŒ)	 t        | |«      ||<   Œ: ŒY |r|S t        | d«      r>t        | «      j                  «       D ��ci c]  \  }}|j                  d«      s||“Œ c}}S t        d| ›dt        | «      j                  › d�«      ‚# t        $ r Y Œ»w xY wc c}}w )NÚlist_reverseiteratorÚ_Ú__dict__z!Don't know how to JSON-serialize z (type z)); consider adding it to default_mapping.)r™   rŸ   rÔ   r   rO   r   Ú__mro__rr  ÚpropertyÚ
startswithrÚ   r5  rY  ÚvarsÚ	TypeErrorrä   )
rì   Úoriginal_typeÚ
convert_toÚpropsrv   rÞ   Ú
descriptorÚkÚvÚ_convertor_mappings
            €r$   Ú
_convertorz*json_convertor_default.<locals>._convertor±  s_  ø€ Ø);×)AÑ)AÓ)Cò 	'Ñ%ˆM˜:Ü˜#˜}Õ-Ù! #“Ò&ð	'ð �=‰=×!Ñ!Ð%;Ò;Üœ˜S›	“?Ð"àˆØ—=‘=×(Ñ(ò 	ˆCØ$'§L¡L×$6Ñ$6Ó$8ò Ñ ��jÜ˜j¬(Õ3¸D¿O¹OÈCÕ<PðÜ&-¨c°4Ó&8˜˜dšñð	ñ ØˆLô �3˜
Ô#ô ! ›IŸO™OÓ-÷á�A�qØ—|‘| CÔ(ð �1‘óð ô Ø/°¨wð 7Ü˜#“Y×'Ñ'Ð(ð )5ð5ó
ð 	
øô %ò áðüós   Â<EÃ;EÅ	EÅE)ÚJSON_CONVERTORr   r
  )ry   r  r~  s     @r$   Újson_convertor_defaultr�  ª  s7   ø€ ÙÜ+×0Ñ0Ó2ÐØ×!Ñ! /Õ2ä+Ðô!
ðF Ðr#   c                   ó   — e Zd Zd„ Zd„ Zy)ÚJSONDecoderc                 ób   — t        j                  j                  | g|¢­d| j                  i|¤Ž y )NÚobject_hook)r  rƒ  rÃ   r…  )rq   rÉ   r   s      r$   rÃ   zJSONDecoder.__init__Ù  s+   € Ü×Ñ×!Ñ! $ÐVÀtÒV°D×4DÑ4DÐVÈvÓVr#   c                 ó`   — d|v r)d|v r%dD ]   }||   }t         j                  ||«      ||<   Œ" |S )NÚold_typeÚnew_type)r‡  rˆ  )ÚTYPE_STR_TO_TYPEr  )rq   rì   Útype_keyÚtype_strs       r$   r…  zJSONDecoder.object_hookÜ  sH   € Ø˜Ñ ¨sÑ!2Ø4ò I�Ø˜x™=�Ü 0× 4Ñ 4°X¸xÓ H��H’ðIð ˆ
r#   N)r   r    r!   rÃ   r…  r"   r#   r$   rƒ  rƒ  ×  s   „ òWór#   rƒ  Úitemr‚   c                  ó   — y r³   r"   )rŒ  r   s     r$   r~   r~   æ  s   € ð
 r#   ry   r|   Úreturn_bytesc                  ó   — y r³   r"   ©rŒ  ry   r|   rŽ  r   s        r$   r~   r~   î  ó   € ð r#   Fc                  ó   — y r³   r"   r�  s        r$   r~   r~   ù  r‘  r#   c                 ó¶  — t         rœ|sš|j                  dd«      }t         j                  t         j                  z  |d<   |r|dxx   t         j                  z  cc<   d|v rt        d«      ‚t        j                  | fdt        |¬«      i|¤Ž}|r|S |j                  d¬	«      S t        j                  | fdt        |¬«      i|¤Ž}|r|j                  d¬	«      S |S )
a  
    Dump json with extra details that are not normally json serializable

    parameters
    ----------

    force_use_builtin_json: Boolean, default = False
        When True, we use Python's builtin Json library for serialization,
        even if Orjson is installed.
    ÚindentNÚoptionÚ	sort_keysz§orjson does not accept the sort_keys parameter. If you need to pass sort_keys, set force_use_builtin_json=True to use Python's built-in json library instead of orjson.Údefault)ry   rù   )Úencoding)ÚorjsonrÑ   ÚOPT_NON_STR_KEYSÚOPT_SERIALIZE_NUMPYÚOPT_INDENT_2rw  Údumpsr�  ru   r  rm   )rŒ  ry   r|   rŽ  r   r”  r¥   s          r$   r~   r~     só   € õ" Ñ,Ø—‘˜H dÓ+ˆÜ!×2Ñ2´V×5OÑ5OÑOˆˆxÑÙØ�8Ó¤× 3Ñ 3Ñ3ÓØ˜&Ñ ÜðKóLð Lô —‘Øñä*¸?ÔKðð ñˆñ ØˆMØ�}‰} gˆ}Ó.Ð.ä—‘Øñä*¸?ÔKðð ñˆñ Ø—=‘=¨'�=Ó2Ð2Øˆr#   )rv   )Né   )NNNr³   )NT)T)NFF)rrÆ   rÖ   rñ   r=  r  ÚuuidÚloggingÚreÚbuiltinsrX   ÚdecimalÚorderly_setÚcollectionsÚ	ipaddressr^  r   r   Ú	functoolsr   Úcollections.abcr   r   Útypingr   r	   r
   r   r   r   Údeepdiff.helperr   r   r   r   r   r   r   r   r   r   r   r   r   r   Údeepdiff.modelr   r™  rn   Ú	getLoggerr   ro   rw  r   rä   rë   ÚCSV_HEADER_MAX_CHUNK_SIZErÙ   rÜ   rž   r˜   rK   rÒ   rH   rI   rJ   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rY   rZ   r[   r\   r]   r^   r`   ra   r‰  rc   rh   rj   rÅ   Ú	bytearrayrÛ   r¾   Ú	UnpicklerrÎ   ÚPicklerré   r÷   rü   r  r¶   r:  rB  r?  rV  rZ  r`  ÚStableSetEqÚUUIDÚ
memoryviewr€  r�  rƒ  r~   Úloadsr*  r"   r#   r$   ú<module>rµ     së  ðÛ Û 
Û 	Û 	Û Û Û Û 	Û Û Û Û Û Û Û ß Ý ß -÷÷ ÷÷ ÷ ÷ õ  'ðÛð 
ˆ×	Ñ	˜8Ó	$€ô	˜9ô 	ñ �‹J€	à Ð ð rÐ ØwÐ ð .KÐ *ð JÐ áò $ó $€ðNØˆUðàˆwðð 
ˆ3ðð �ð	ð
 ˆUðð 
ˆ3ðð ˆUðð ˆDðð ˆUðð 
ˆ3ðð ˆUðð ˆDðð ˆDðð 
ˆ3ðð ˆDðð  �ð!ð" �×!Ñ!ð#ð$ �M‰MØ×#Ñ#Ø�‰ØØ×(Ñ(Ø×*Ñ*Ø�z‰zØØ×(Ñ(Ø×(Ñ(Øò9Ð ô@	˜+ô 	ô	�kô 	÷x9ñ x9ð| $€ñ & u¨iÐ&8Ó9Ð ÷.ñ .ô("˜6×+Ñ+ô "ôJ˜Ÿ™ô ó#ó."PòJò8ó 9óx#ó(%òPòò	7ðØ‡O�OÐ'ðà�ðð ×Ñ˜Tðð ˆð	ð
 	Ñ
ðð 
Ððð ×ÑÑ.ðð 	‡I�IÑðð �ðð �ðð ˆcðð ˆcðð Ñ$ðð 
Ððð ˆTðð  �ð!ð" ˆcð#ð$ Ñ%Øˆdñ'€ð, Ð4Ñ4Ù(@€NÐ$Ñ%ó*ôZ�$×"Ñ"ô ð 
ðØ
ðð 	òó 
ðð 
ðØ
ðà˜T‘Nðð !ðð ˜‘ð	ð òó 
ðð 
ðØ
ðà˜T‘Nðð !ðð ˜‘ð	ð 	òó 
ðð $(Ø#(Øñ	)Ø
ð)à˜T‘Nð)ð !ð)ð ð	)ð ˆ3�ˆ:Ñó)ñX �T—Z‘Z [Ô1�
øðK ò ØƒFðús   Â
K  Ë K+Ë*K+