
    YiM                     f   S 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
  SSKJr  SSKJr  SSKJr  SS	KJr  \(       a  SS
KJr   " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      rg) z9This module contains objects related to chat backgrounds.    )Sequence)TYPE_CHECKINGFinalOptional)	constants)Document)TelegramObject)enum)parse_sequence_arg)JSONDict)Botc            	         ^  \ rS rSr% SrSr\R                  R                  r\	\R                     \
S'    \R                  R                  r\	\R                     \
S'    \R                  R                  r\	\R                     \
S'    SS.S	\S
\\   4U 4S jjjr\ SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )BackgroundFill"   a9  Base class for Telegram BackgroundFill Objects. It can be one of:

* :class:`telegram.BackgroundFillSolid`
* :class:`telegram.BackgroundFillGradient`
* :class:`telegram.BackgroundFillFreeformGradient`

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`type` is equal.

.. versionadded:: 21.2

Args:
    type (:obj:`str`): Type of the background fill. Can be one of:
        :attr:`~telegram.BackgroundFill.SOLID`, :attr:`~telegram.BackgroundFill.GRADIENT`
        or :attr:`~telegram.BackgroundFill.FREEFORM_GRADIENT`.

Attributes:
    type (:obj:`str`): Type of the background fill. Can be one of:
        :attr:`~telegram.BackgroundFill.SOLID`, :attr:`~telegram.BackgroundFill.GRADIENT`
        or :attr:`~telegram.BackgroundFill.FREEFORM_GRADIENT`.
typeSOLIDGRADIENTFREEFORM_GRADIENTN
api_kwargsr   r   c                   > [         TU ]  US9  [        R                  " [        R
                  X5      U l        U R                  4U l        U R                  5         g Nr   )	super__init__r
   
get_memberr   BackgroundFillTyper   	_id_attrs_freezeselfr   r   	__class__s      C/app/.venv/lib/python3.13/site-packages/telegram/_chatbackground.pyr   BackgroundFill.__init__D   C     	J/)E)EtR	))    databotr   returnc                 0  > U R                  U5      nU(       d  gU R                  [        U R                  [        U R
                  [        0nU [        L a5  UR                  S5      U;   a   X1R                  S5         R                  XS9$ [        TU ])  XS9$ ,See :meth:`telegram.TelegramObject.de_json`.Nr   r'   r(   )_parse_datar   BackgroundFillSolidr   BackgroundFillGradientr   BackgroundFillFreeformGradientr   getpopde_jsonr   clsr'   r(   _class_mappingr"   s       r#   r4   BackgroundFill.de_jsonQ   s    
 t$ II*LL0!!#A;
 . TXXf%5%G!((6"23;;;OOwD22r&   r   r   N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r   r   __annotations__r   r   strr   r   r   classmethodr4   __static_attributes____classcell__r"   s   @r#   r   r   "   s    , I1:1M1M1S1SE5--.S>4=4P4P4Y4YHeI001YA$$66 uY99:  K *.	 X&	  >B3H%3,4UO3	"	#3 3r&   r   c                   J   ^  \ rS rSrSrSrSS.S\S\\   4U 4S jjjr	S	r
U =r$ )
r/   g   a  
The background is filled using the selected color.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`color` is equal.

.. versionadded:: 21.2

Args:
    color (:obj:`int`): The color of the background fill in the `RGB24` format.

Attributes:
    type (:obj:`str`): Type of the background fill. Always
        :attr:`~telegram.BackgroundFill.SOLID`.
    color (:obj:`int`): The color of the background fill in the `RGB24` format.
)colorNr   rI   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        U R                  4U l        S S S 5        g ! , (       d  f       g = fN)r   r   )r   r   r   	_unfrozenrI   r   )r!   rI   r   r"   s      r#   r   BackgroundFillSolid.__init__{   sC     	djjZ@^^#J"jj]DN    A
A)r   rI   r;   r<   r=   r>   r?   r@   intr   r   r   rD   rE   rF   s   @r#   r/   r/   g   s5    " I *.	++ X&	+ +r&   r/   c            
       R   ^  \ rS rSrSrSrSS.S\S\S\S	\\   4U 4S
 jjjr	Sr
U =r$ )r0      a.  
The background is a gradient fill.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`top_color`, :attr:`bottom_color`
and :attr:`rotation_angle` are equal.

.. versionadded:: 21.2

Args:
    top_color (:obj:`int`): Top color of the gradient in the `RGB24` format.
    bottom_color (:obj:`int`): Bottom color of the gradient in the `RGB24` format.
    rotation_angle (:obj:`int`): Clockwise rotation angle of the background
        fill in degrees;
        0-:tg-const:`telegram.constants.BackgroundFillLimit.MAX_ROTATION_ANGLE`.


Attributes:
    type (:obj:`str`): Type of the background fill. Always
        :attr:`~telegram.BackgroundFill.GRADIENT`.
    top_color (:obj:`int`): Top color of the gradient in the `RGB24` format.
    bottom_color (:obj:`int`): Bottom color of the gradient in the `RGB24` format.
    rotation_angle (:obj:`int`): Clockwise rotation angle of the background
        fill in degrees;
        0-:tg-const:`telegram.constants.BackgroundFillLimit.MAX_ROTATION_ANGLE`.
)bottom_colorrotation_angle	top_colorNr   rU   rS   rT   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        X l        X0l        U R                  U R
                  U R                  4U l        S S S 5        g ! , (       d  f       g = frK   )r   r   r   rL   rU   rS   rT   r   )r!   rU   rS   rT   r   r"   s        r#   r   BackgroundFillGradient.__init__   s`     	dmm
C^^"+N%1'5"nnd.?.?ATATUDN s   ;A..
A<)r   rS   rT   rU   rO   rF   s   @r#   r0   r0      sP    6 @I *.VV V 	V X&V Vr&   r0   c                   P   ^  \ rS rSrSrSrSS.S\\   S\\	   4U 4S jjjr
S	rU =r$ )
r1      a  
The background is a freeform gradient that rotates after every message in the chat.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`colors` is equal.

.. versionadded:: 21.2

Args:
    colors (Sequence[:obj:`int`]): A list of the 3 or 4 base colors that are used to
        generate the freeform gradient in the `RGB24` format

Attributes:
    type (:obj:`str`): Type of the background fill. Always
        :attr:`~telegram.BackgroundFill.FREEFORM_GRADIENT`.
    colors (Sequence[:obj:`int`]): A list of the 3 or 4 base colors that are used to
        generate the freeform gradient in the `RGB24` format
)colorsNr   rZ   r   c                   > [         TU ]  U R                  US9  U R                  5          [	        U5      U l        U R
                  4U l        S S S 5        g ! , (       d  f       g = frK   )r   r   r   rL   r   rZ   r   )r!   rZ   r   r"   s      r#   r   'BackgroundFillFreeformGradient.__init__   sL     	d44L^^+=f+EDK"kk^DN s   #A
A$)r   rZ   )r;   r<   r=   r>   r?   r@   r   rP   r   r   r   rD   rE   rF   s   @r#   r1   r1      s9    & I *.	,, X&	, ,r&   r1   c            	         ^  \ rS rSr% SrSr\R                  R                  r\	\R                     \
S'    \R                  R                  r\	\R                     \
S'    \R                  R                  r\	\R                     \
S'    \R                  R                  r\	\R                     \
S'    SS	.S
\S\\   4U 4S jjjr\ SS\\   S\S   S\S    4U 4S jjj5       rSrU =r$ )BackgroundType   a  Base class for Telegram BackgroundType Objects. It can be one of:

* :class:`telegram.BackgroundTypeFill`
* :class:`telegram.BackgroundTypeWallpaper`
* :class:`telegram.BackgroundTypePattern`
* :class:`telegram.BackgroundTypeChatTheme`.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`type` is equal.

.. versionadded:: 21.2

Args:
    type (:obj:`str`): Type of the background. Can be one of:
        :attr:`~telegram.BackgroundType.FILL`, :attr:`~telegram.BackgroundType.WALLPAPER`
        :attr:`~telegram.BackgroundType.PATTERN` or
        :attr:`~telegram.BackgroundType.CHAT_THEME`.

Attributes:
    type (:obj:`str`): Type of the background. Can be one of:
        :attr:`~telegram.BackgroundType.FILL`, :attr:`~telegram.BackgroundType.WALLPAPER`
        :attr:`~telegram.BackgroundType.PATTERN` or
        :attr:`~telegram.BackgroundType.CHAT_THEME`.

r   FILL	WALLPAPERPATTERN
CHAT_THEMENr   r   r   c                   > [         TU ]  US9  [        R                  " [        R
                  X5      U l        U R                  4U l        U R                  5         g r   )	r   r   r
   r   r   BackgroundTypeTyper   r   r   r    s      r#   r   BackgroundType.__init__  r%   r&   r'   r(   r   r)   c                 
  > U R                  U5      nU(       d  gU R                  [        U R                  [        U R
                  [        U R                  [        0nU [        L a5  UR                  S5      U;   a   X1R                  S5         R                  XS9$ SU;   a(  [        R                  UR                  S5      U5      US'   SU;   a)  [        R                  " UR                  S5      U5      US'   [        TU ]1  XS9$ )r,   Nr   r-   filldocument)r.   r`   BackgroundTypeFillra   BackgroundTypeWallpaperrb   BackgroundTypePatternrc   BackgroundTypeChatThemer^   r2   r3   r4   r   r   r   r5   s       r#   r4   BackgroundType.de_json  s    
 t$ HH(MM2KK.NN3	;
 . TXXf%5%G!((6"23;;;OOT>)11$((62BCHDL'//0DcJDwD22r&   r9   r:   )r;   r<   r=   r>   r?   r@   r   re   r`   r   rA   ra   rb   rc   rB   r   r   r   rC   r4   rD   rE   rF   s   @r#   r^   r^      s   4 I090L0L0Q0QD%	,,
-Q=5>5Q5Q5[5[IuY112[B3<3O3O3W3WGU9//0W@6?6R6R6]6]Ji223]C *.	 X&	  >B3H%3,4UO3	"	#3 3r&   r^   c                   N   ^  \ rS rSrSrSrSS.S\S\S\\	   4U 4S	 jjjr
S
rU =r$ )rj   i-  ak  
The background is automatically filled based on the selected colors.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`fill` and :attr:`dark_theme_dimming` are equal.

.. versionadded:: 21.2

Args:
    fill (:class:`telegram.BackgroundFill`): The background fill.
    dark_theme_dimming (:obj:`int`): Dimming of the background in dark themes, as a
        percentage;
        0-:tg-const:`telegram.constants.BackgroundTypeLimit.MAX_DIMMING`.

Attributes:
    type (:obj:`str`): Type of the background. Always
        :attr:`~telegram.BackgroundType.FILL`.
    fill (:class:`telegram.BackgroundFill`): The background fill.
    dark_theme_dimming (:obj:`int`): Dimming of the background in dark themes, as a
        percentage;
        0-:tg-const:`telegram.constants.BackgroundTypeLimit.MAX_DIMMING`.
)dark_theme_dimmingrh   Nr   rh   rp   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        X l        U R                  U R
                  4U l        S S S 5        g ! , (       d  f       g = frK   )r   r   r`   rL   rh   rp   r   )r!   rh   rp   r   r"   s       r#   r   BackgroundTypeFill.__init__G  sR     	diiJ?^^(,I+=#"ii)@)@ADN	 s   *A
A+)r   rp   rh   )r;   r<   r=   r>   r?   r@   r   rP   r   r   r   rD   rE   rF   s   @r#   rj   rj   -  sD    . /I *.BB  B
 X&B Br&   rj   c                   j   ^  \ rS rSrSrSr  SSS.S\S\S\\	   S	\\	   S
\\
   4
U 4S jjjjrSrU =r$ )rk   iW  a  
The background is a wallpaper in the `JPEG` format.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`document` and :attr:`dark_theme_dimming` are equal.

.. versionadded:: 21.2

Args:
    document (:class:`telegram.Document`): Document with the wallpaper
    dark_theme_dimming (:obj:`int`): Dimming of the background in dark themes, as a
        percentage;
        0-:tg-const:`telegram.constants.BackgroundTypeLimit.MAX_DIMMING`.
    is_blurred (:obj:`bool`, optional): :obj:`True`, if the wallpaper is downscaled to fit
        in a 450x450 square and then box-blurred with radius 12
    is_moving (:obj:`bool`, optional): :obj:`True`, if the background moves slightly
        when the device is tilted

Attributes:
    type (:obj:`str`): Type of the background. Always
        :attr:`~telegram.BackgroundType.WALLPAPER`.
    document (:class:`telegram.Document`): Document with the wallpaper
    dark_theme_dimming (:obj:`int`): Dimming of the background in dark themes, as a
        percentage;
        0-:tg-const:`telegram.constants.BackgroundTypeLimit.MAX_DIMMING`.
    is_blurred (:obj:`bool`): Optional. :obj:`True`, if the wallpaper is downscaled to fit
        in a 450x450 square and then box-blurred with radius 12
    is_moving (:obj:`bool`): Optional. :obj:`True`, if the background moves slightly
        when the device is tilted
)rp   ri   
is_blurred	is_movingNr   ri   rp   rt   ru   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        X l        X0l        X@l        U R                  U R
                  4U l        S S S 5        g ! , (       d  f       g = frK   )	r   r   ra   rL   ri   rp   rt   ru   r   )r!   ri   rp   rt   ru   r   r"   s         r#   r    BackgroundTypeWallpaper.__init__y  s\     	dnnD^^&.M+=#.8O-6N"mmT-D-DEDN s   6A))
A7)r   rp   ri   rt   ru   NN)r;   r<   r=   r>   r?   r@   r   rP   r   boolr   r   rD   rE   rF   s   @r#   rk   rk   W  sq    > NI &*$(F *.FF  F TN	F
 D>F X&F Fr&   rk   c                   n   ^  \ rS rSrSrSr  SSS.S\S\S\S	\	\
   S
\	\
   S\	\   4U 4S jjjjrSrU =r$ )rl   i  aO  
The background is a `PNG` or `TGV` (gzipped subset of `SVG` with `MIME` type
`"application/x-tgwallpattern"`) pattern to be combined with the background fill
chosen by the user.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`document` and :attr:`fill` and :attr:`intensity` are equal.

.. versionadded:: 21.2

Args:
    document (:class:`telegram.Document`): Document with the pattern.
    fill (:class:`telegram.BackgroundFill`): The background fill that is combined with
        the pattern.
    intensity (:obj:`int`): Intensity of the pattern when it is shown above the filled
        background;
        0-:tg-const:`telegram.constants.BackgroundTypeLimit.MAX_INTENSITY`.
    is_inverted (:obj:`int`, optional): :obj:`True`, if the background fill must be applied
        only to the pattern itself. All other pixels are black in this case. For dark
        themes only.
    is_moving (:obj:`bool`, optional): :obj:`True`, if the background moves slightly
        when the device is tilted.

Attributes:
    type (:obj:`str`): Type of the background. Always
        :attr:`~telegram.BackgroundType.PATTERN`.
    document (:class:`telegram.Document`): Document with the pattern.
    fill (:class:`telegram.BackgroundFill`): The background fill that is combined with
        the pattern.
    intensity (:obj:`int`): Intensity of the pattern when it is shown above the filled
        background;
        0-:tg-const:`telegram.constants.BackgroundTypeLimit.MAX_INTENSITY`.
    is_inverted (:obj:`int`): Optional. :obj:`True`, if the background fill must be applied
        only to the pattern itself. All other pixels are black in this case. For dark
        themes only.
    is_moving (:obj:`bool`): Optional. :obj:`True`, if the background moves slightly
        when the device is tilted.
)ri   rh   	intensityis_invertedru   Nr   ri   rh   r{   r|   ru   r   c                  > [         TU ]  U R                  US9  U R                  5          Xl        X l        X0l        X@l        XPl        U R                  U R
                  U R                  4U l	        S S S 5        g ! , (       d  f       g = frK   )
r   r   rb   rL   ri   rh   r{   r|   ru   r   )r!   ri   rh   r{   r|   ru   r   r"   s          r#   r   BackgroundTypePattern.__init__  se     	dllzB^^&.M(,I"+N/:-6N"mmTYYGDN s   AA::
B)r   ri   rh   r{   r|   ru   rx   )r;   r<   r=   r>   r?   r@   r   r   rP   r   ry   r   r   rD   rE   rF   s   @r#   rl   rl     s|    %NI '+$(H *.HH H 	H
 d^H D>H X&H Hr&   rl   c                   J   ^  \ rS rSrSrSrSS.S\S\\   4U 4S jjjr	S	r
U =r$ )
rm   i  a  
The background is taken directly from a built-in chat theme.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`theme_name` is equal.

.. versionadded:: 21.2

Args:
    theme_name (:obj:`str`): Name of the chat theme, which is usually an emoji.

Attributes:
    type (:obj:`str`): Type of the background. Always
        :attr:`~telegram.BackgroundType.CHAT_THEME`.
    theme_name (:obj:`str`): Name of the chat theme, which is usually an emoji.
)
theme_nameNr   r   r   c                   > [         TU ]  U R                  US9  U R                  5          Xl        U R                  4U l        S S S 5        g ! , (       d  f       g = frK   )r   r   rc   rL   r   r   )r!   r   r   r"   s      r#   r    BackgroundTypeChatTheme.__init__  sD     	doo*E^^#-O"oo/DN rN   )r   r   )r;   r<   r=   r>   r?   r@   rB   r   r   r   rD   rE   rF   s   @r#   rm   rm     s5    "  I *.	00 X&	0 0r&   rm   c            	          ^  \ rS rSrSrSrSS.S\S\\   4U 4S jjjr	\
 SS	\\   S
\S   S\S    4U 4S jjj5       rSrU =r$ )ChatBackgroundi  an  
This object represents a chat background.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`type` is  equal.

.. versionadded:: 21.2

Args:
    type (:class:`telegram.BackgroundType`): Type of the background.

Attributes:
    type (:class:`telegram.BackgroundType`): Type of the background.
r   Nr   r   r   c                p   > [         TU ]  US9  Xl        U R                  4U l        U R	                  5         g r   )r   r   r   r   r   r    s      r#   r   ChatBackground.__init__  s0     	J/$(	))r&   r'   r(   r   r)   c                    > U R                  U5      nU(       d  g[        R                  UR                  S5      U5      US'   [        TU ]	  XS9$ r+   )r.   r^   r4   r2   r   )r6   r'   r(   r"   s      r#   r4   ChatBackground.de_json  sI    
 t$%--dhhv.>DVwD22r&   r9   r:   )r;   r<   r=   r>   r?   r@   r^   r   r   r   rC   r4   rD   rE   rF   s   @r#   r   r     ss     I *.	

 X&	
 
 >B3H%3,4UO3	"	#3 3r&   r   N)r?   collections.abcr   typingr   r   r   telegramr   telegram._files.documentr   telegram._telegramobjectr	   telegram._utilsr
   telegram._utils.argumentparsingr   telegram._utils.typesr   r   r   r/   r0   r1   r^   rj   rk   rl   rm   r    r&   r#   <module>r      s   & @ $ 1 1  - 3   > *B3^ B3J+. +D-V^ -V`!,^ !,HM3^ M3`'B 'BT5Fn 5FpEHN EHP0n 0D*3^ *3r&   