
    i                         S SK Jr  S SK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	 r\" S
5      r\" S5      rS\\\4   S\\S\4   /\\\4   4   4S jrSS\S\S\4S jjrS\S\S\4S jrg)    )Callable)datetime)Enum)Any	ParamSpecTypeVarget_args   )is_subclass)	ConverterUnstructureHook)identityc                 L    [        U [        5      (       d  [        SU  35      eU $ )NzExpected datetime, got )
isinstancer   	Exception)v_s     V/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/cattrs/preconf/__init__.pyvalidate_datetimer      s'    a""1!566H    TPr   return.c                 T    S[         S[        4   S[         [        [        4   4S jnU$ )z1Wrap a `Converter` `__init__` in a type-safe way.x.r   c                     U $ N )r   s    r   implwrap.<locals>.impl   s    r   )r   r   r   )r   r   s     r   wrapr!      s-    a  Xad^  Kr   typeinclude_bare_enumsc                     [        U [        5      =(       aO    [        U [        [        45      =(       d2    U=(       a)    U R	                  5       SS [        R                  " 5       :H  $ )z8Is this a string or int enum that can be passed through?   N)r   r   strintmro)r"   r#   s     r   is_primitive_enumr)      sI    tT" D3*% 	A?488:ab>TXXZ#?r   typ	converterc                 n   ^ [        U4S j[        U 5       5       5      (       a  [        $ TR                  $ )zAn unstructure hook factory for literals containing enums.

If all contained enums can be passed through (their unstructure hook is `identity`),
the entire literal can also be passed through.
c              3   f   >#    U  H&  nTR                  [        U5      5      [        :H  v   M(     g 7fr   )get_unstructure_hookr"   r   ).0argr+   s     r   	<genexpr>:literals_with_enums_unstructure_factory.<locals>.<genexpr>.   s(      IV#	&&tCy1X=s   .1)allr	   r   unstructure)r*   r+   s    `r   'literals_with_enums_unstructure_factoryr5   &   s7      IQRU      r   N)F)collections.abcr   r   enumr   typingr   r   r   r	   _compatr   
convertersr   r   fnsr   r   r   r   r!   boolr)   r5   r   r   r   <module>r=      s    $   4 4 ! 3  CLcNHQV 8CF+;*<hq!tn*L!M C T d !	!"!!r   