
    Yi+                     &   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  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g)zCThis module contains objects that represent paid media in Telegram.    )Sequence)TYPE_CHECKINGFinalOptional)	constants)	PhotoSize)Video)TelegramObject)User)enum)parse_sequence_arg)JSONDict)Botc            	       H  ^  \ rS rSr% SrSr\R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    \R                  R                  r\	\
   \S'    S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$ )	PaidMedia%   a  Describes the paid media added to a message. Currently, it can be one of:

* :class:`telegram.PaidMediaPreview`
* :class:`telegram.PaidMediaPhoto`
* :class:`telegram.PaidMediaVideo`

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.4

Args:
    type (:obj:`str`): Type of the paid media.

Attributes:
    type (:obj:`str`): Type of the paid media.
)typePREVIEWPHOTOVIDEON
api_kwargsr   r   returnc                   > [         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   PaidMediaTyper   	_id_attrs_freeze)selfr   r   	__class__s      >/app/.venv/lib/python3.13/site-packages/telegram/_paidmedia.pyr   PaidMedia.__init__A   sC     	J/)@)@$M	))    databotr   c                 J  > U R                  U5      nUc  gU(       d
  U [        L a  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$ )a   Converts JSON data to the appropriate :class:`PaidMedia` object, i.e. takes
care of selecting the correct subclass.

Args:
    data (dict[:obj:`str`, ...]): The JSON data.
    bot (:class:`telegram.Bot`, optional): The bot associated with this object.

Returns:
    The Telegram object.

Nr   r'   r(   )_parse_datar   r   PaidMediaPreviewr   PaidMediaPhotor   PaidMediaVideogetpopde_jsonr   )clsr'   r(   _class_mappingr#   s       r$   r1   PaidMedia.de_jsonM   s     t$<y( KK)II~II~6
 ) 0N B!((6"23;;;OOwD22r&   )r    r   N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r   r   str__annotations__r   r   r   r   r   classmethodr1   __static_attributes____classcell__r#   s   @r$   r   r   %   s    $ I#1199GU3Z9;!//55E5:59!//55E5:59 *.	

 X&	

 

 
 >B3H%3,4UO3	+	3 3r&   r   c                   r   ^  \ 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$ )r,   p   a  The paid media isn't available before the payment.

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

.. versionadded:: 21.4

Args:
    type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PREVIEW`.
    width (:obj:`int`, optional): Media width as defined by the sender.
    height (:obj:`int`, optional): Media height as defined by the sender.
    duration (:obj:`int`, optional): Duration of the media in seconds as defined by the sender.

Attributes:
    type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PREVIEW`.
    width (:obj:`int`): Optional. Media width as defined by the sender.
    height (:obj:`int`): Optional. Media height as defined by the sender.
    duration (:obj:`int`): Optional. Duration of the media in seconds as defined by the sender.
)durationheightwidthNr   rF   rE   rD   r   r   c                  > [         TU ]  [        R                  US9  U R	                  5          Xl        X l        X0l        U R                  U R
                  U R                  U R                  4U l	        S S S 5        g ! , (       d  f       g = fN)r   r   )
r   r   r   r   	_unfrozenrF   rE   rD   r   r    )r"   rF   rE   rD   r   r#   s        r$   r   PaidMediaPreview.__init__   sb     	i//JG^^(-J)/K+3M"iiT[[$--PDN s   AA==
B)r    rD   rE   rF   )NNN)r6   r7   r8   r9   r:   r;   r   intr   r   r?   r@   rA   s   @r$   r,   r,   p   sw    * 0I  $ $"&	Q *.Q}Q Q 3-	Q X&Q 
Q Qr&   r,   c            	          ^  \ rS rSrSrSrSS.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$ )r-      a  
The paid media is a photo.

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

.. versionadded:: 21.4

Args:
    type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PHOTO`.
    photo (Sequence[:class:`telegram.PhotoSize`]): The photo.

Attributes:
    type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.PHOTO`.
    photo (tuple[:class:`telegram.PhotoSize`]): The photo.
)photoNr   rN   r   r   r   c                   > [         TU ]  [        R                  US9  U R	                  5          [        U5      U l        U R                  U R                  4U l        S S S 5        g ! , (       d  f       g = frH   )	r   r   r   r   rI   r   rN   r   r    )r"   rN   r   r#   s      r$   r   PaidMediaPhoto.__init__   sQ     	ioo*E^^0B50IDJ"ii4DN s   .A%%
A3r'   r(   r   c                    > U R                  U5      nU(       d  g [        R                  " UR                  S5      US9US'   [        TU ]  XS9$ )NrN   r(   r*   )r+   r   de_listr/   r   r1   r2   r'   r(   r#   s      r$   r1   PaidMediaPhoto.de_json   sI     t$!))$((7*;EWwD22r&   )r    rN   r5   )r6   r7   r8   r9   r:   r;   r   r   r   r   r>   r1   r?   r@   rA   s   @r$   r-   r-      s    " I *.	5$5 X&	5
 
5 5 >B	3H%	3,4UO	3	"	#	3 	3r&   r-   c            	          ^  \ rS rSrSrSrS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$ )r.      a  
The paid media is a video.

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

.. versionadded:: 21.4

Args:
    type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.VIDEO`.
    video (:class:`telegram.Video`): The video.

Attributes:
    type (:obj:`str`): Type of the paid media, always :tg-const:`telegram.PaidMedia.VIDEO`.
    video (:class:`telegram.Video`): The video.
)videoNr   rX   r   r   c                   > [         TU ]  [        R                  US9  U R	                  5          Xl        U R                  U R
                  4U l        S S S 5        g ! , (       d  f       g = frH   )r   r   r   r   rI   rX   r   r    )r"   rX   r   r#   s      r$   r   PaidMediaVideo.__init__   sJ     	ioo*E^^ %J"ii4DN s   $A
A)r'   r(   r   c                    > U R                  U5      nU(       d  g [        R                  " UR                  S5      US9US'   [        TU ]	  XS9$ )NrX   rR   r*   )r+   r	   r1   r/   r   rT   s      r$   r1   PaidMediaVideo.de_json   sG     t$dhhw&7SAWwD22r&   )r    rX   r5   )r6   r7   r8   r9   r:   r;   r	   r   r   r   r>   r1   r?   r@   rA   s   @r$   r.   r.      s}    " I *.	55 X&	5
 
5 5 >B	3H%	3,4UO	3	"	#	3 	3r&   r.   c            	          ^  \ rS rSrSrSrSS.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$ )PaidMediaInfo   a  
Describes the paid media added to a message.

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

.. versionadded:: 21.4

Args:
    star_count (:obj:`int`): The number of Telegram Stars that must be paid to buy access to
        the media.
    paid_media (Sequence[:class:`telegram.PaidMedia`]): Information about the paid media.

Attributes:
    star_count (:obj:`int`): The number of Telegram Stars that must be paid to buy access to
        the media.
    paid_media (tuple[:class:`telegram.PaidMedia`]): Information about the paid media.
)
paid_media
star_countNr   ra   r`   r   r   c                   > [         TU ]  US9  Xl        [        U5      U l        U R                  U R                  4U l        U R                  5         g r   )r   r   ra   r   r`   r    r!   )r"   ra   r`   r   r#   s       r$   r   PaidMediaInfo.__init__  sC     	J/)1CJ1O//4??;r&   r'   r(   r   c                    > U R                  U5      nU(       d  g [        R                  UR                  S5      US9US'   [        TU ]  XS9$ )Nr`   rR   r*   )r+   r   rS   r/   r   r1   rT   s      r$   r1   PaidMediaInfo.de_json  sM     t$&..txx/E3.O\wD22r&   )r    r`   ra   r5   )r6   r7   r8   r9   r:   r;   rK   r   r   r   r   r   r>   r1   r?   r@   rA   s   @r$   r^   r^      s    & -I *. Y'
 X& 
  >B	3H%	3,4UO	3	/	"	3 	3r&   r^   c            	          ^  \ rS rSrSrSrSS.S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$ )PaidMediaPurchasedi'  a  This object contains information about a paid media purchase.

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

Note:
    In Python :keyword:`from` is a reserved word. Use :paramref:`from_user` instead.

.. versionadded:: 21.6

Args:
    from_user (:class:`telegram.User`): User who purchased the media.
    paid_media_payload (:obj:`str`): Bot-specified paid media payload.

Attributes:
    from_user (:class:`telegram.User`): User who purchased the media.
    paid_media_payload (:obj:`str`): Bot-specified paid media payload.
)	from_userpaid_media_payloadNr   rh   r   ri   r   r   c                   > [         TU ]  US9  Xl        X l        U R                  U R                  4U l        U R                  5         g r   )r   r   rh   ri   r    r!   )r"   rh   ri   r   r#   s       r$   r   PaidMediaPurchased.__init__=  s?     	J/('9..$*A*ABr&   r'   r(   r   c                    > U R                  U5      nU(       d  g [        R                  " UR                  S5      US9US'   [        TU ]	  XS9$ )Nfromr*   rh   )r+   r   r1   r0   r   rT   s      r$   r1   PaidMediaPurchased.de_jsonK  sH     t$ LLdhhv.>CH[wD22r&   )r    rh   ri   r5   )r6   r7   r8   r9   r:   r;   r<   r   r   r   r>   r1   r?   r@   rA   s   @r$   rg   rg   '  s    & 4I *.  
 X& 
  >B	3H%	3,4UO	3	&	'	3 	3r&   rg   N)r:   collections.abcr   typingr   r   r   telegramr   telegram._files.photosizer   telegram._files.videor	   telegram._telegramobjectr
   telegram._userr   telegram._utilsr   telegram._utils.argumentparsingr   telegram._utils.typesr   r   r   r,   r-   r.   r^   rg    r&   r$   <module>rz      s   & J $ 1 1  / ' 3    > *H3 H3V'Qy 'QT+3Y +3\+3Y +3\.3N .3b.3 .3r&   