Ë
    ©2ÚiU  ã                  ó  — d Z ddlmZ ddlZddlmZmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZmZ ej                   r dd
lmZ ddlmZ  ej(                  dd¬«      ZdZ ej(                  d«      Z G d„ deej0                  e   «      Zy)z%RootModel class and type definitions.é    )ÚannotationsN)ÚcopyÚdeepcopy)ÚPydanticUndefinedé   )ÚPydanticUserError)Ú_repr)Ú	BaseModelÚ_object_setattr)ÚAny)ÚLiteralÚModelr
   )Úbound)Ú	RootModelÚRootModelRootTypec            
      óþ   ‡ — e Zd ZU dZdZdZdZded<   ˆ fd„Ze	fdd„Z
de
_        eddˆ fd„«       Zdd	„Zdd
„Zdd„Zddd„Zej&                  r"ddddddddddœ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdˆ fd„Zdd„Zˆ xZS )r   a�  Usage docs: https://docs.pydantic.dev/2.4/concepts/models/#rootmodel-and-custom-root-types

    A Pydantic `BaseModel` for the root object of the model.

    Attributes:
        root: The root object of the model.
        __pydantic_root_model__: Whether the model is a RootModel.
        __pydantic_private__: Private fields in the model.
        __pydantic_extra__: Extra fields in the model.

    TNr   Úrootc                óx   •— | j                   j                  d«      }|�t        dd¬«      ‚t        ‰| �  di |¤Ž y )NÚextraz<`RootModel` does not support setting `model_config['extra']`zroot-model-extra)Úcode© )Úmodel_configÚgetr   ÚsuperÚ__init_subclass__)ÚclsÚkwargsr   Ú	__class__s      €úJ/var/www/html/acx/venv/lib/python3.12/site-packages/pydantic/root_model.pyr   zRootModel.__init_subclass__/   sD   ø€ Ø× Ñ ×$Ñ$ WÓ-ˆØÐÜ#ØNÐUgôð ô 	‰Ñ!Ñ+ FÓ+ó    c                óp   — d}|r|t         urt        d«      ‚|}| j                  j                  || ¬«       y )NTz_"RootModel.__init__" accepts either a single positional argument or arbitrary keyword arguments)Úself_instance)r   Ú
ValueErrorÚ__pydantic_validator__Úvalidate_python)Ú__pydantic_self__r   ÚdataÚ__tracebackhide__s       r   Ú__init__zRootModel.__init__7   sE   € Ø ÐÙØÔ,Ñ,Ü Øuóð ð ˆDØ×0Ñ0×@Ñ@ÀÐUfÐ@Õgr    c                ó&   •— t         ‰| �  ||¬«      S )aS  Create a new model using the provided root object and update fields set.

        Args:
            root: The root object of the model.
            _fields_set: The set of fields to be updated.

        Returns:
            The new model.

        Raises:
            NotImplemented: If the model is not a subclass of `RootModel`.
        )r   Ú_fields_set)r   Úmodel_construct)r   r   r+   r   s      €r   r,   zRootModel.model_constructC   s   ø€ ô ‰wÑ&¨D¸kÐ&ÓJÐJr    c                ó4   — | j                   | j                  dœS )N©Ú__dict__Ú__pydantic_fields_set__r.   ©Úselfs    r   Ú__getstate__zRootModel.__getstate__S   s   € àŸ™Ø'+×'CÑ'Cñ
ð 	
r    c                óD   — t        | d|d   «       t        | d|d   «       y )Nr0   r/   )r   )r2   Ústates     r   Ú__setstate__zRootModel.__setstate__Y   s&   € Ü˜Ð7¸Ð?XÑ9YÔZÜ˜˜j¨%°
Ñ*;Õ<r    c                ó¾   — t        | «      }|j                  |«      }t        |dt        | j                  «      «       t        |dt        | j
                  «      «       |S )z$Returns a shallow copy of the model.r/   r0   )ÚtypeÚ__new__r   r   r/   r0   )r2   r   Úms      r   Ú__copy__zRootModel.__copy__]   sK   € ä�4‹jˆØ�K‰K˜ÓˆÜ˜˜:¤t¨D¯M©MÓ':Ô;Ü˜Ð4´d¸4×;WÑ;WÓ6XÔYØˆr    c                óÂ   — t        | «      }|j                  |«      }t        |dt        | j                  |¬«      «       t        |dt        | j                  «      «       |S )z!Returns a deep copy of the model.r/   )Úmemor0   )r8   r9   r   r   r/   r   r0   )r2   r=   r   r:   s       r   Ú__deepcopy__zRootModel.__deepcopy__e   sO   € ä�4‹jˆØ�K‰K˜ÓˆÜ˜˜:¤x°·±ÀDÔ'IÔJô 	˜Ð4´d¸4×;WÑ;WÓ6XÔYØˆr    ÚpythonF)	ÚmodeÚincludeÚexcludeÚby_aliasÚexclude_unsetÚexclude_defaultsÚexclude_noneÚ
round_tripÚwarningsc       	         ó   — y)a(  This method is included just to get a more accurate return type for type checkers.
            It is included in this `if TYPE_CHECKING:` block since no override is actually necessary.

            See the documentation of `BaseModel.model_dump` for more details about the arguments.
            Nr   )
r2   r@   rA   rB   rC   rD   rE   rF   rG   rH   s
             r   Ú
model_dumpzRootModel.model_dumpq   s   € ð$ r    c                ó¸   •— t        |t        «      st        S | j                  d   j                  |j                  d   j                  k(  xr t
        ‰| �  |«      S ©Nr   )Ú
isinstancer   ÚNotImplementedÚmodel_fieldsÚ
annotationr   Ú__eq__)r2   Úotherr   s     €r   rQ   zRootModel.__eq__…   sR   ø€ Ü˜%¤Ô+Ü!Ð!Ø× Ñ  Ñ(×3Ñ3°u×7IÑ7IÈ&Ñ7Q×7\Ñ7\Ñ\ÒvÔafÑahÑaoÐpuÓavÐvr    c              #  ó,   K  — d| j                   f–— y ­wrL   )r   r1   s    r   Ú__repr_args__zRootModel.__repr_args__Š   s   è ø€ Ø�d—i‘iÐÓùs   ‚)r   r   ÚreturnÚNone)N)r   ztype[Model]r   r   r+   zset[str] | NonerU   r   )rU   údict[Any, Any])r5   rW   rU   rV   )r2   r   rU   r   )r2   r   r=   zdict[int, Any] | NonerU   r   )r@   zLiteral['json', 'python'] | strrA   r   rB   r   rC   ÚboolrD   rX   rE   rX   rF   rX   rG   rX   rH   rX   rU   r   )rR   r   rU   rX   )rU   z_repr.ReprArgs)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__pydantic_root_model__Ú__pydantic_private__Ú__pydantic_extra__Ú__annotations__r   r   r)   Ú__pydantic_base_init__Úclassmethodr,   r3   r6   r;   r>   ÚtypingÚTYPE_CHECKINGrJ   rQ   rT   Ú__classcell__)r   s   @r   r   r      s  ø… ñ
ð #ÐØÐØÐà
Óô,ð ?Pô hð '+€HÔ#àõKó ðKó
ó=óôð ×Òð
 5=ØØØ"Ø"'Ø%*Ø!&Ø$Ø!ñ	ð 2ð	ð ð		ð
 ð	ð ð	ð  ð	ð #ð	ð ð	ð ð	ð ð	ð ó	õ(w÷
 r    r   )r\   Ú
__future__r   Ú_annotationsrc   r   r   Úpydantic_corer   Ú r   Ú	_internalr	   Úmainr
   r   rd   r   Útyping_extensionsr   ÚTypeVarr   Ú__all__r   ÚGenericr   r   r    r   ú<module>rp      ss   ðÙ +å 2ã ß å +å Ý ß ,à	×ÒÝå)àˆF�N‰N˜7¨+Ô6€Eð €ð #�F—N‘NÐ#6Ó7Ð ôo �	˜6Ÿ>™>Ð*;Ñ<õ o r    