
    .hZ                    l   S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSK	J
r
  SSKJrJrJr  SSKJr  SS	KJrJrJrJr  SS
KJr  SSKJrJr  SSKJr  SSKJr  SSKJ r   SSK!J"r"  SSK#J$r$J%r%  SSK&J'r'  SSK(J)r)  SSK*J+r+J,r,  SSK-J.r.  SSK/J0r0  SSK1J2r2  \(       a   SSK3J4r4  SSK5J6r6  SSK7J8r8  SSK9J:r:J;r;  SSK<J=r=   " S S\05      r>S-S  jr?\
S.S! j5       r@S/S0S" jjrASS#.         S1S$ jjrBS2S% jrC        S3S& jrDSSSS'.         S4S( jjrE          S5S) jrFS6S* jrGS6S+ jrH    S7S, jrIg)8zmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.    )annotationsN)Mapping)copy)cache)	Parameterismethoddescriptor	signature)Pattern)TYPE_CHECKINGAnyCallableTypeVar)PydanticUndefined)TypeIs
get_origin)typing_objects)AnnotationSource)PydanticDeprecatedSince211)PydanticUserError   )	_generics_typing_extra)ConfigWrapper)extract_docstrings_from_cls)import_cached_base_modelimport_cached_field_info)
NsResolver)Representation)can_be_positionalBaseMetadata   )	FieldInfo)	BaseModel)PydanticDataclassStandardDataclass)DecoratorInfosc                      \ rS rSrSrSrSrg)PydanticMetadata'   z0Base class for annotation markers like `Strict`. N)__name__
__module____qualname____firstlineno____doc__	__slots____static_attributes__r+       R/var/www/auris/envauris/lib/python3.13/site-packages/pydantic/_internal/_fields.pyr)   r)   '   s
    :Ir3   r)   c                 "    [        5       " U 5      $ )zCreate a new `_PydanticGeneralMetadata` class with the given metadata.

Args:
    **metadata: The metadata to add.

Returns:
    The new `_PydanticGeneralMetadata` class.
)_general_metadata_cls)metadatas    r4   pydantic_general_metadatar8   -   s     !"8,,r3   c                 2    SSK Jn    " S S[        U 5      nU$ )zCDo it this way to avoid importing `annotated_types` at import time.r   r    c                  "    \ rS rSrSrSS jrSrg)7_general_metadata_cls.<locals>._PydanticGeneralMetadata>   z,Pydantic general metadata like `max_digits`.c                    Xl         g )N__dict__)selfr7   s     r4   __init__@_general_metadata_cls.<locals>._PydanticGeneralMetadata.__init__A   s    $Mr3   r>   N)r7   r   )r,   r-   r.   r/   r0   rA   r2   r+   r3   r4   _PydanticGeneralMetadatar;   >   s
    :	%r3   rC   )annotated_typesr!   r)   )r!   rC   s     r4   r6   r6   9   s     -%#3\ % $#r3   c                    [        XS9nUR                  5        H$  u  pEUR                  b  M  XC;   d  M  X4   Ul        M&     g )Nuse_inspect)r   itemsdescription)clsfieldsrG   fields_docsann_name
field_infos         r4   _update_fields_from_docstringsrO   G   s;    -cKK &!!)h.E%0%:J" !/r3   )typevars_mapc               l   [        5       n[        5       nU R                  n0 n[        U5       H*  n[	        USS5      =n	(       d  M  UR                  U	5        M,     [        R                  " XS9n
U R                  R                  S0 5      n0 n[        5       nU
R                  5        GH  u  nu  nnUS:X  a  M  UR                   GHc  nSn[        U[        5      (       a  UR                  U5      SLnO&[        U[         5      (       a  UR#                  U5      nU(       d  M^  U HW  n[%        UU5      (       d  M  ['        UU5      (       a  U[	        US0 5      ;   a  M:  [)        SU S[	        UU5       S	U S
35      e   SnUR                   Hd  n[        U[        5      (       a.  UR                  U5      (       d  USUR*                   S34-  nMD  MF  UR#                  U5      (       a  M^  UU4-  nMf     [,        R.                  " SU SU R0                   SU SU S3	[2        5        GMf     [        R4                  " U5      (       a  UR7                  U5        GM  [	        X[8        5      n[;        U5      (       d  GM  U R<                  (       a  US:w  a  [)        SU< S35      e[	        U S0 5      R                  S5      nU H  n[>        R@                  " U5      (       a  [>        RB                  " U5      OS Vs1 s H  nURD                  iM     nn[%        X5      (       d  Mb  UUL a  Mi  UU;   a  Mq  X;  a  Mx  [,        R.                  " SU SU RF                   SURF                   S3[2        5        M     U[8        L aN  X;   d  X;  a5  URI                  U[J        RL                  S9nU(       d  SUl'        UUl(        GO8[S        X~   5      nGO)[U        X5        [        UU5      (       a;  [W        URX                  5      (       a!  URX                  R[                  SU 5      Ul,        U(       d!  [        UU5      (       a  UR]                  5       OUnUR_                  UU[J        RL                  S9nUUl0        U(       d  SUl'        UUl(        O`SURb                  ;   aP  URe                  5       (       d;  [,        R.                  " SU< SU< SU< S 3[f        S!S"9  UR7                  U5        GMF   [i        X5        U R                  S#   nUURl                  ;   a  [o        S$U< S%U R0                  < S&35      eUX'   GM     U(       a;  URq                  5        H'  nURN                  (       d  M  URs                  U5        M)     URt                  (       a  [w        X5        X4$ s  snf ! [j         a     Nf = f)'a  Collect the fields and class variables names of a nascent Pydantic model.

The fields collection process is *lenient*, meaning it won't error if string annotations
fail to evaluate. If this happens, the original annotation (and assigned value, if any)
is stored on the created `FieldInfo` instance.

The `rebuild_model_fields()` should be called at a later point (e.g. when rebuilding the model),
and will make use of these stored attributes.

Args:
    cls: BaseModel or dataclass.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting model annotations.
    typevars_map: A dictionary mapping type variables to their concrete types.

Returns:
    A two-tuple containing model fields and class variables names.

Raises:
    NameError:
        - If there is a conflict between a field name and protected namespaces.
        - If there is a field other than `root` in `RootModel`.
        - If a field shadows an attribute in the parent model.
__pydantic_fields__N)ns_resolver__annotations__model_configFzField "z" conflicts with member z of protected namespace "z".r+   zre.compile()z" in z( has conflict with protected namespace "z_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = z`.rootzUnexpected field with name z4; only 'root' is allowed as a field of a `RootModel`__pydantic_generic_metadata__originzField name "z" in "z"" shadows an attribute in parent ""_sourcefinalzAnnotation z= is marked as final and has a default value. Pydantic treats zz as a class variable, but it will be considered as a normal field in V3 to be aligned with dataclasses. If you still want zV to be considered as a class variable, annotate it as: `ClassVar[<type>] = <default>.`   )category
stacklevel__pydantic_decorators__zField z
 of class zf overrides symbol of same name in a parent class. This override with a computed_field is incompatible.)<r   r   	__bases__reversedgetattrupdater   get_model_type_hintsr?   getsetrH   protected_namespaces
isinstancer
   matchstr
startswithhasattr
issubclass	NameErrorpatternwarningswarnr,   UserWarningis_classvar_annotationaddr   is_valid_field_name__pydantic_root_model__dataclassesis_dataclassrK   namer.   from_annotationr   CLASS	_complete_original_annotationr   #_warn_on_nested_alias_in_annotationr   default__get___copyfrom_annotated_attribute_original_assignment_qualifiersis_requiredr   delattrAttributeErrorcomputed_fields	TypeErrorvaluesapply_typevars_mapuse_attribute_docstringsrO   )rJ   config_wrapperrS   rP   r$   
FieldInfo_basesparent_fields_lookupbasemodel_fields
type_hintsr   rK   
class_varsrM   ann_type	evaluatedprotected_namespacens_violationbvalid_namespacespnassigned_valuegeneric_originfielddataclass_fieldsrN   original_assignment
decoratorss                                r4   collect_model_fieldsr   N   s   > )*I)+JMME13"4)>EE<E ''5   33CQJ ,,""#4b9K#%F5J+5+;+;+=''8Y~% #1#F#F!&L-w77288B$N/55'223FG|Aq(++ *1i 8 8XQRTikmIn=n"+")(3KGTUW_L`Ka";<O;PPR!T#   (*$,AA%b'22#%88H#5#5 0{2::,a5P4R R 0 $6 $,#6#6r#:#: 0RE 9 0 B MM!(5>fgzf{ |DDTCUUWY $	3 $G> //99NN8$ 0AB"8,,&&8v+=-h\9mn  !&ErJNNxXDEPE]E]^bEcEc););D)Aik)k )ku

)k    t&&>)// ."8*F33C3C2D E))*!-% 0 ..&(*N (77JZJ`J`7a
 +0J( 7?J3 ""6"@A
 0C.*55:L^McMc:d:d *8)?)?)G)Gc)R& /8J~Wa<b<b$$&hv   $<<X~_o_u_u<vJ /BJ+',
$2:
/J222:;Q;Q;S;S!(-jksjv w""*  .DE 8  x(
& &)\\2K%L
z111Js||.> ?G G  &g ,>j ]]_E((6 % ..&s3K b " s   =V!/V&&
V32V3c                \   [        5       n[        U SS 5      nU(       a  U H  n[        R                  " [	        U5      5      (       d  M)  [
        R                  " U5       HD  n[        XR5      (       d  M  UR                  c  M$  [        R                  " SU S3[        5            g    M     g g )N__args__z `alias` specification on field "z5" must be set on outermost annotation to take effect.)r   rd   r   is_annotatedr   r   get_argsrj   aliasrr   rs   rt   )r   rM   r#   argsanno_arganno_type_args         r4   r   r     s    (*I8Z.DH**:h+?@@%2%;%;H%EM!-;;@S@S@_ >xjH}~'  &F  r3   c               p   [        5       n0 nUR                  U 5         U R                  R                  5        H  u  pVUR                  (       a  XdU'   M  UR
                  n[        R                  " UR                  /UR                  Q76 n[        R                  " X5      nUR                  =n	[        L a  UR                  U[        R                   S9n
OUR#                  X[        R                   S9n
U
R
                  b  U
R
                  OUU
l        XU'   M     SSS5        U$ ! , (       d  f       U$ = f)a  Rebuild the (already present) model fields by trying to reevaluate annotations.

This function should be called whenever a model with incomplete fields is encountered.

Raises:
    NameError: If one of the annotations failed to evaluate.

Note:
    This function *doesn't* mutate the model fields in place, as it can be called during
    schema generation, where you don't want to mutate other model's fields.
r[   N)r   pushrR   rH   r~   rI   r   	eval_typer   types_namespacer   replace_typesr   r   r|   r   r}   r   )rJ   rS   rP   r   rebuilt_fieldsf_namerN   existing_descannassign	new_fields              r4   rebuild_model_fieldsr   -  s   " *+J+-N			#	"%"9"9"?"?"AF##)3v& * 6 6#--33 00  --c@(===FBSS * : :3HXH^H^ : _I * C CCYiYoYo C pIAJAVAVAb	(=(=hu	%)2v&# #B 
( ) 
	( s   C>D&&
D5)rS   rP   r   c          
        [        5       n0 nU=(       d
    [        5       nU R                  n[        U R                  5       GH2  n[
        R                  " U5      (       d  M!  UR                  U5         UR                  5        GH  u  pXR                  R                  S0 5      ;  a  M'  UR                  u  p[        R                  " U	R                  X5      u  p[        R                  " U5      (       a  Mu  U	R                   (       d<  U	R"                  [
        R$                  L a  U	R&                  [
        R$                  L a  M  [)        U	R"                  U5      (       a  U	R"                  R*                  (       a*  U	R"                  R                   SL a  [-        SU S3SS9eGM"  UR/                  XR"                  [0        R2                  S9nU	R"                  Ul        O$UR/                  X[0        R2                  S9nXl        U(       d  SUl        Xl        XU'   UR"                  [:        Ld  GM  [)        [=        XU5      U5      (       d  GM  [?        XUR"                  5        GM     SSS5        GM5     U(       a(  URA                  5        H  nURC                  U5        M     Ub+  URD                  (       a  [G        U U[I        U S	5      (       + S
9  U$ ! , (       d  f       GM  = f)aX  Collect the fields of a dataclass.

Args:
    cls: dataclass.
    ns_resolver: Namespace resolver to use when getting dataclass annotations.
        Defaults to an empty instance.
    typevars_map: A dictionary mapping type variables to their concrete types.
    config_wrapper: The config wrapper instance.

Returns:
    The dataclass fields.
rT   FzDataclass field zD has init=False and init_var=True, but these are mutually exclusive.zclashing-init-and-init-var)coder[   N__is_pydantic_dataclass__rF   )%r   r   __dataclass_fields__rc   __mro__ry   rz   r   rH   r?   rg   r   r   try_eval_typetyperu   initr   MISSINGdefault_factoryrj   init_varr   r   r   	DATACLASSr   r~   r   r   rd   setattrr   r   r   rO   rn   )rJ   rS   rP   r   r   rK   r   r   rM   dataclass_fieldglobalnslocalnsr   r   rN   r   s                   r4   collect_dataclass_fieldsr   X  s   & *+J#%F-K//
 %''--d#-=-C-C-E)==#4#45F#KK $/$?$?!&3&A&A/BVBVX`&j# 77AA (,,'//;3F3FF'77;;N;NN o55zBB&..77*22775@"3"28*  =A  !B%A#  !!+!D!D "9"9CSC]C] "E "J 7F6M6MJ3!+!D!D ;K;U;U "E "J 7F3 +0J(6>3#-x %%->>:C:6
D D C:+=+=>g .F $#	 &t ]]_E $$\2	 % !n&M&M& $C)DEE	
 MM $#s   3F:K2KK
K'	c                  [        5       n0 nUR                  U 5         U R                  R                  5        H  u  pgUR                  (       a  XuU'   M  UR
                  n[        R                  " UR                  /UR                  Q76 n	[        R                  " X5      n	UR                  U	UR                  [        R                  S9n
U
R
                  b  U
R
                  OUU
l        XU'   M     SSS5        U$ ! , (       d  f       U$ = f)a  Rebuild the (already present) dataclass fields by trying to reevaluate annotations.

This function should be called whenever a dataclass with incomplete fields is encountered.

Raises:
    NameError: If one of the annotations failed to evaluate.

Note:
    This function *doesn't* mutate the dataclass fields in place, as it can be called during
    schema generation, where you don't want to mutate other dataclass's fields.
r[   N)r   r   rR   rH   r~   rI   r   r   r   r   r   r   r   r   r   r   )rJ   r   rS   rP   r   r   r   rN   r   r   r   s              r4   rebuild_dataclass_fieldsr     s   $ *+J+-N			#	"%"9"9"?"?"AF##)3v& * 6 6#--33 00  --c@&??33,66 @ 	 BKAVAVAb	(=(=hu	%)2v&% #B 
* + 
	* s   CC==
Dc                .    U R                  S5      (       + $ )N_rm   r{   s    r4   rw   rw     s    s###r3   c                ^    U R                  S5      =(       a    U R                  S5      (       + $ )Nr   __r   r   s    r4   is_valid_privateattr_namer     s"    ??3=(=$==r3   c                    [        U 5      n[        UR                  R                  5       5      n[        U5      S:H  =(       a4    [        US   5      =(       a    US   R                  [        R                  L $ ! [        [        4 a     gf = f)zMWhether the provided default factory callable has a validated data parameter.Fr   r   )r	   
ValueErrorr   list
parametersr   lenr   r   r   empty)r   sigr   s      r4   takes_validated_data_argumentr     s    ( cnn++-.Jz?aq$5jm$DqTUI^I^bkbqbqIqq 	"  s   A9 9BB)r7   r   returnr!   )r   ztype[BaseMetadata])F)rJ   	type[Any]rK   dict[str, FieldInfo]rG   boolr   None)
rJ   type[BaseModel]r   r   rS   NsResolver | NonerP   zMapping[TypeVar, Any] | Noner   z%tuple[dict[str, FieldInfo], set[str]])r   r   rM   rl   r   r   )rJ   r   rS   r   rP   Mapping[TypeVar, Any]r   r   )
rJ   ztype[StandardDataclass]rS   r   rP   zdict[Any, Any] | Noner   zConfigWrapper | Noner   r   )
rJ   ztype[PydanticDataclass]r   r   rS   r   rP   r   r   r   )r{   rl   r   r   )r   z3Callable[[], Any] | Callable[[dict[str, Any]], Any]r   z'TypeIs[Callable[[dict[str, Any]], Any]])Jr0   
__future__r   _annotationsry   rr   collections.abcr   r   	functoolsr   inspectr   r   r	   rer
   typingr   r   r   r   pydantic_corer   typing_extensionsr   r   typing_inspectionr   typing_inspection.introspectionr   pydanticr   pydantic.errorsr    r   r   _configr   _docs_extractionr   _import_utilsr   r   _namespace_utilsr   _reprr   _utilsr   rD   r!   rK   r#   mainr$   _dataclassesr%   r&   _decoratorsr'   r)   r8   r6   rO   r   r   r   r   r   rw   r   r   r+   r3   r4   <module>r      s   s 2   #   < <  8 8 + 0 , < / - & " 9 M ( ! %," B+~ 	- 
$ 
$; 26L	L!L #L
 /L +L^ (	( ( (	(
 (\ &**.+/f	 f #f (	f
 )f fR*	 * "* 	*
 (* *Z$>rHr,rr3   