+
    }if3                      a  0 t $ R t^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHtHtHtHtHt ^ RIHtHtHtHt ^ RIHtHt ^R	IHt ^R
IH t  ^RI!H"t"H#t# ^RIH$t$ ^RI%H&t&H't' ^RI(H)t) ^RI*H+t+H,t, ^RI-H.t. ^RI/H0t0 ^RI1H2t2 ^RI3H4t4 ^RI5H6t6 ]'       d   ^ RI7H8t9 ^RI:H;t;  ! R R]9]4      t<R*R R llt=RRRRRR/R  R! llt>R" R# lt?R$ R% lt@]A]B]P                  ],          3,          tDR&]ER'&   ]R( R) l4       tFR# )+z0Private logic for creating pydantic dataclasses.)annotationsN)	Generator)contextmanager)partial)TYPE_CHECKINGAnyClassVarProtocolcast)
ArgsKwargsSchemaSerializerSchemaValidatorcore_schema)	TypeAliasTypeIs)PydanticUndefinedAnnotation)	FieldInfo)PluggableSchemaValidatorcreate_schema_validator)PydanticDeprecatedSince20)_config_decorators)collect_dataclass_fields)GenerateSchemaInvalidSchemaError)get_standard_typevars_map)set_dataclass_mocks)
NsResolver)generate_pydantic_signature)LazyClassAttribute)DataclassInstance)
ConfigDictc                  x    ] tR t^(t$ RtR]R&   R]R&   R]R&   R]R	&   R
]R&   R]R&   R]R&   ]R R l4       tRtR# )PydanticDataclassa!  A protocol containing attributes only available once a class has been decorated as a Pydantic dataclass.

Attributes:
    __pydantic_config__: Pydantic-specific configuration settings for the dataclass.
    __pydantic_complete__: Whether dataclass building is completed, or if there are still undefined fields.
    __pydantic_core_schema__: The pydantic-core schema used to build the SchemaValidator and SchemaSerializer.
    __pydantic_decorators__: Metadata containing the decorators defined on the dataclass.
    __pydantic_fields__: Metadata about the fields defined on the dataclass.
    __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the dataclass.
    __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the dataclass.
zClassVar[ConfigDict]__pydantic_config__zClassVar[bool]__pydantic_complete__z ClassVar[core_schema.CoreSchema]__pydantic_core_schema__z$ClassVar[_decorators.DecoratorInfos]__pydantic_decorators__zClassVar[dict[str, FieldInfo]]__pydantic_fields__zClassVar[SchemaSerializer]__pydantic_serializer__z4ClassVar[SchemaValidator | PluggableSchemaValidator]__pydantic_validator__c                   V ^8  d   QhRR/# )   returnbool )formats   "q/Users/ahmad/.openclaw/workspace/my-crawler/.venv/lib/python3.14/site-packages/pydantic/_internal/_dataclasses.py__annotate__PydanticDataclass.__annotate__>   s    :::    c                	    R # Nr/   clss   &r1   __pydantic_fields_complete__.PydanticDataclass.__pydantic_fields_complete__=   s    7:r4   r/   N)	__name__
__module____qualname____firstlineno____doc____annotations__classmethodr9   __static_attributes__r/   r4   r1   r#   r#   (   sA    
	 21--"BB!EE;;!;; TT	: 
:r4   r#   c               (    V ^8  d   QhRRRRRRRR/# )	r,   r8   ztype[StandardDataclass]config_wrapper_config.ConfigWrapperns_resolverNsResolver | Noner-   Noner/   )r0   s   "r1   r2   r2   A   s0     % %	 %)% #% 
	%r4   c                B    \        V 4      p\        WW1R7      pW@n        R# )zCollect and set `cls.__pydantic_fields__`.

Args:
    cls: The class.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting dataclass annotations.
)rF   typevars_maprD   N)r   r   r(   )r8   rD   rF   rJ   fieldss   &&&  r1   set_dataclass_fieldsrL   A   s%     -S1L%<F %r4   raise_errorsTrF   _force_buildFc               0    V ^8  d   QhRRRRRRRRR	RR
R/# )r,   r8   	type[Any]rD   rE   rM   r.   rF   rG   rN   r-   r/   )r0   s   "r1   r2   r2   U   sL     i i	i)i 	i
 #i i 
ir4   c                  V P                   pR R lpV P                   R2Vn        W`n         VP                  V n        \	        WVR7       V'       g    VP
                  '       d   \        V 4       R# \        V R4      '       d   \        P                  ! R\        4       \        V 4      p\        VVVR7      p\        R	\        \        VV P                   VP"                  VP$                  R
R7      4      V n         VP)                  V 4      p	TP/                  T P0                  R7      p TP3                  T	4      p	\7        RT 4      p Yn        \;        YT P<                  T P                  RYP>                  4      T n         \C        Y4      T n"        R
T n#        R
#   \*         d/   p
T'       d   h \        T RT
P,                   R24        Rp
?
R# Rp
?
ii ; i  \4         d    \        T 4        R# i ; i)aJ  Finish building a pydantic dataclass.

This logic is called on a class which has already been wrapped in `dataclasses.dataclass()`.

This is somewhat analogous to `pydantic._internal._model_construction.complete_model_class`.

Args:
    cls: The class.
    config_wrapper: The config wrapper instance.
    raise_errors: Whether to raise errors, defaults to `True`.
    ns_resolver: The namespace resolver instance to use when collecting dataclass fields
        and during schema building.
    _force_build: Whether to force building the dataclass, no matter if
        [`defer_build`][pydantic.config.ConfigDict.defer_build] is set.

Returns:
    `True` if building a pydantic dataclass is successfully completed, `False` otherwise.

Raises:
    PydanticUndefinedAnnotation: If `raise_error` is `True` and there is an undefined annotations.
c               (    V ^8  d   QhRRRRRRRR/# )r,   __dataclass_self__r#   argsr   kwargsr-   rH   r/   )r0   s   "r1   r2   (complete_dataclass.<locals>.__annotate__v   s0     \ \%6 \s \c \VZ \r4   c                Z    R pT pVP                   P                  \        W4      VR7       R# )T)self_instanceN)r*   validate_pythonr   )rS   rT   rU   __tracebackhide__ss   &*,  r1   __init__$complete_dataclass.<locals>.__init__v   s,     	  00D1IYZ0[r4   z	.__init__)rD   rF   F__post_init_post_parse__zVSupport for `__post_init_post_parse__` has been dropped, the method will not be called)rF   rJ   __signature__T)initrK   validate_by_nameextrais_dataclass`N)titleztype[PydanticDataclass]	dataclass)$r\   r=   config_dictr$   rL   defer_buildr   hasattrwarningswarnr   r   r   r   r   r   r(   ra   rb   r_   generate_schemar   namecore_configr;   clean_schemar   r
   r&   r   r<   plugin_settingsr*   r   r)   r%   )r8   rD   rM   rF   rN   original_initr\   rJ   
gen_schemaschemaern   s   &&$$$       r1   complete_dataclassru   U   s   : LLM\
  #//0	:HL,88CUN666C s.//d%	

 -S1L!J +' **+<< &&		
C++C0 !,,3<<,@K((0 (#
.C#) !8S^^S%5%5{KQoQo"C #36"GC $C1 ' C1QVVHA/	  C s*   ;F )G G"#GGG-,G-c                    V ^8  d   QhRRRR/# )r,   r8   rP   r-   zTypeIs[type[StandardDataclass]]r/   )r0   s   "r1   r2   r2      s     a aY a.M ar4   c               R    RV P                   9   ;'       d    \        V R4      '       * # )aJ  Returns `True` if the class is a stdlib dataclass and *not* a Pydantic dataclass.

Unlike the stdlib `dataclasses.is_dataclass()` function, this does *not* include subclasses
of a dataclass that are themselves not dataclasses.

Args:
    cls: The class.

Returns:
    `True` if the class is a stdlib dataclass, `False` otherwise.
__dataclass_fields__r*   )__dict__ri   r7   s   "r1   is_stdlib_dataclassrz      s&     "S\\1``'#G_:`6``r4   c                    V ^8  d   QhRRRR/# )r,   pydantic_fieldr   r-   zdataclasses.Field[Any]r/   )r0   s   "r1   r2   r2      s     + +y +5K +r4   c                0   R V /p\         P                  R8  d   V P                  e   V P                  VR&   \         P                  R8  d   V P                  '       d   RVR&   V P                  RJd   V P                  VR&   \
        P                  ! R/ VB # )defaultdocTkw_onlyrepr)      r   
   r/   )sysversion_infodescriptionr   r   dataclassesfield)r|   
field_argss   & r1   as_dataclass_fieldr      s    "+^!<J 7"~'A'A'M*66
5 7"~'='='= $
9 $&+00
6*z**r4   r   DcFieldsc                    V ^8  d   QhRRRR/# )r,   r8   rP   r-   zGenerator[None]r/   )r0   s   "r1   r2   r2      s     U4 U49 U4 U4r4   c           	   #    "   . pV P                   R,           EFm  pVP                  P                  R/ 4      pVP                  4        UUu/ uFy  w  rE\	        VP
                  \        4      '       g   K'  VP
                  P                  f9   VP
                  P                  '       g   VP
                  P                  RJg   Kw  WEbK{  	  pppV'       g   K  VP                  W634       VP                  4        F  w  rE\        \        VP
                  4      p\        P                  ! V4      p\        P                  R8  d   VP                  '       d   RVn        VP                  RJd   VP                  Vn	        WV&   K  	  EKp  	   Rx  V F"  w  rV
P                  4        F	  w  rKWV&   K  	  K$  	  R# u uppi   T F"  w  rT
P                  4        F	  w  rKYT&   K  	  K$  	  i ; i5i)a  Temporarily patch the stdlib dataclasses bases of `cls` if the Pydantic `Field()` function is used.

When creating a Pydantic dataclass, it is possible to inherit from stdlib dataclasses, where
the Pydantic `Field()` function is used. To create this Pydantic dataclass, we first apply
the stdlib `@dataclass` decorator on it. During the construction of the stdlib dataclass,
the `kw_only` and `repr` field arguments need to be understood by the stdlib *during* the
dataclass construction. To do so, we temporarily patch the fields dictionary of the affected
bases.

For instance, with the following example:

```python {test="skip" lint="skip"}
import dataclasses as stdlib_dc

import pydantic
import pydantic.dataclasses as pydantic_dc

@stdlib_dc.dataclass
class A:
    a: int = pydantic.Field(repr=False)

# Notice that the `repr` attribute of the dataclass field is `True`:
A.__dataclass_fields__['a']
#> dataclass.Field(default=FieldInfo(repr=False), repr=True, ...)

@pydantic_dc.dataclass
class B(A):
    b: int = pydantic.Field(repr=False)
```

When passing `B` to the stdlib `@dataclass` decorator, it will look for fields in the parent classes
and reuse them directly. When this context manager is active, `A` will be temporarily patched to be
equivalent to:

```python {test="skip" lint="skip"}
@stdlib_dc.dataclass
class A:
    a: int = stdlib_dc.field(default=Field(repr=False), repr=False)
```

!!! note
    This is only applied to the bases of `cls`, and not `cls` itself. The reason is that the Pydantic
    dataclass decorator "owns" `cls` (in the previous example, `B`). As such, we instead modify the fields
    directly (in the previous example, we simply do `setattr(B, 'b', as_dataclass_field(pydantic_field))`).

!!! note
    This approach is far from ideal, and can probably be the source of unwanted side effects/race conditions.
    The previous implemented approach was mutating the `__annotations__` dict of `cls`, which is no longer a
    safe operation in Python 3.14+, and resulted in unexpected behavior with field ordering anyway.
:   NNrx   NTr   )__mro__ry   getitems
isinstancer~   r   r   r   r   appendr
   copyr   r   )r8   original_fields_listbase	dc_fields
field_namer   &dc_fields_with_pydantic_field_defaultsr~   new_dc_fieldrK   original_fieldsoriginal_fields   &           r1   patch_base_fieldsr      s    n =?B7;}}7H7HI_ac7d	 &/__%62
%6!
%--3  **6%--:O:O:OSXS`S`SeSemqSq	 J%6 	/ 2
 21 ''([\%K%Q%Q%S!
y%--8  $yy/ ##w.7???+/L(<<t+(/L%(4*% &T  04';#F.=.C.C.E*
%3z" /F (<32
2 (<#F.=.C.C.E*
%3z" /F (<sI   A	G,$F943F9(F9F9
G,A=G,5G,F? 0G,?*G))G,r6   )G__conditional_annotations__r?   
__future__r   _annotationsr   r   r   rj   collections.abcr   
contextlibr   	functoolsr   typingr   r   r   r	   r
   pydantic_corer   r   r   r   typing_extensionsr   r   errorsr   rK   r   plugin._schema_validatorr   r   r    r   r   _fieldsr   _generate_schemar   r   	_genericsr   _mock_val_serr   _namespace_utilsr   
_signaturer   _utilsr   	_typeshedr    StandardDataclassconfigr!   r#   rL   ru   rz   r   dictstrFieldr   r@   r   )r   s   @r1   <module>r      s    6 2   
  % %  ? ?  0 0  X 0 " - @ 0 . ( 3 &@#;-x ;2%(i 	i
 &*i iXa+$ 3 1 1# 667) 7 U4 U4r4   