Ë
    ö­¦j9  ã                   óz   — d dl mZmZmZ d dlmZ d dlmZmZm	Z	m
Z
mZmZmZmZ e
ez  ez  ez  ZdZ G d„ d«      Zy)é    )ÚAnyÚLiteralÚoverload)ÚInputMediaType)ÚUNSET_PARSE_MODEÚ	InputFileÚ
InputMediaÚInputMediaAudioÚInputMediaDocumentÚInputMediaPhotoÚInputMediaVideoÚMessageEntityé
   c                   ó¢  — e Zd Z	 	 	 d#dee   dz  dedz  dee   dz  ddfd„Zdeddfd„Zdee   ddfd„Z	e
deddddd	œd
eej                     deez  dedz  dedz  dee   dz  dedz  dedz  dedz  deddfd„«       Ze
dedddœd
eej&                     deez  dedz  dedz  dee   dz  dedz  deddfd„«       Ze
ddedddddddœ	d
eej*                     deez  deez  dz  dedz  dedz  dee   dz  dedz  dedz  dedz  dedz  dedz  deddfd„«       Ze
ddedddœd
eej,                     deez  deez  dz  dedz  dedz  dee   dz  dedz  deddfd„«       Zdeddfd„Zddeddddfdeez  dedz  dedz  dedz  dee   dz  dedz  dedz  dedz  deddfd„Zdeddfdeez  dedz  dedz  dee   dz  dedz  deddfd„Zddeddddddf	deez  dedz  dedz  dedz  dee   dz  dedz  dedz  dedz  dedz  dedz  deddfd „Zddeddfdeez  dedz  dedz  dedz  dee   dz  dedz  deddfd!„Zdee   fd"„Zy)$ÚMediaGroupBuilderNÚmediaÚcaptionÚcaption_entitiesÚreturnc                 óX   — g | _         || _        || _        | j                  |xs g «       y)aK  
        Helper class for building media groups.

        :param media: A list of media elements to add to the media group. (optional)
        :param caption: Caption for the media group. (optional)
        :param caption_entities: List of special entities in the caption,
            like usernames, URLs, etc. (optional)
        N)Ú_mediar   r   Ú_extend)Úselfr   r   r   s       úL/var/www/html/venv/lib/python3.12/site-packages/aiogram/utils/media_group.pyÚ__init__zMediaGroupBuilder.__init__   s*   € ð (*ˆŒØˆŒØ 0ˆÔà�‰�U’[˜bÕ!ó    c                 óÆ   — t        |t        «      sd}t        |«      ‚t        | j                  «      t
        k\  rd}t        |«      ‚| j                  j                  |«       y )Nz$Media must be instance of InputMediaz/Media group can't contain more than 10 elements)Ú
isinstancer	   Ú
ValueErrorÚlenr   ÚMAX_MEDIA_GROUP_SIZEÚappend)r   r   Úmsgs      r   Ú_addzMediaGroupBuilder._add+   sN   € Ü˜%¤Ô,Ø8ˆCÜ˜S“/Ð!äˆt�{‰{ÓÔ3Ò3ØCˆCÜ˜S“/Ð!à�‰×Ñ˜5Õ!r   c                 ó4   — |D ]  }| j                  |«       Œ y ©N)r$   )r   r   Úms      r   r   zMediaGroupBuilder._extend6   s   € Øò 	ˆAØ�I‰I�a�Lñ	r   )r   Ú
parse_moder   ÚdurationÚ	performerÚtitleÚtyper(   r)   r*   r+   Úkwargsc                 ó   — y r&   © )
r   r,   r   r   r(   r   r)   r*   r+   r-   s
             r   ÚaddzMediaGroupBuilder.add:   s   € ð 	r   )r   r(   r   Úhas_spoilerr1   c                 ó   — y r&   r/   )r   r,   r   r   r(   r   r1   r-   s           r   r0   zMediaGroupBuilder.addJ   s   € ð 	r   )	Ú	thumbnailr   r(   r   ÚwidthÚheightr)   Úsupports_streamingr1   r3   r4   r5   r6   c                 ó   — y r&   r/   )r   r,   r   r3   r   r(   r   r4   r5   r)   r6   r1   r-   s                r   r0   zMediaGroupBuilder.addX   s   € ð" 	r   )r3   r   r(   r   Údisable_content_type_detectionr8   c                 ó   — y r&   r/   )	r   r,   r   r3   r   r(   r   r8   r-   s	            r   r0   zMediaGroupBuilder.addk   s   € ð 	r   c                 óv  — |j                  dd«      }|t        j                  k(  r | j                  di |¤Ž y|t        j                  k(  r | j
                  di |¤Ž y|t        j                  k(  r | j                  di |¤Ž y|t        j                  k(  r | j                  di |¤Ž yd|›�}t        |«      ‚)zØ
        Add a media object to the media group.

        :param kwargs: Keyword arguments for the media object.
                The available keyword arguments depend on the media type.
        :return: None
        r,   NzUnknown media type: r/   )Úpopr   ÚAUDIOÚ	add_audioÚPHOTOÚ	add_photoÚVIDEOÚ	add_videoÚDOCUMENTÚadd_documentr   )r   r-   Útype_r#   s       r   r0   zMediaGroupBuilder.addz   s¨   € ð —
‘
˜6 4Ó(ˆØ”N×(Ñ(Ò(ØˆD�N‰NÑ$˜VÓ$Ø”n×*Ñ*Ò*ØˆD�N‰NÑ$˜VÓ$Ø”n×*Ñ*Ò*ØˆD�N‰NÑ$˜VÓ$Ø”n×-Ñ-Ò-ØˆD×ÑÑ' Ó'à(¨¨	Ð2ˆCÜ˜S“/Ð!r   c	                 óJ   — | j                  t        d||||||||dœ|	¤Ž«       y)u³  
        Add an audio file to the media group.

        :param media: File to send. Pass a file_id to send a file that exists on the
            Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from
            the Internet, or pass 'attach://<file_attach_name>' to upload a new one using
            multipart/form-data under <file_attach_name> name.
             :ref:`More information on Sending Files Â» <sending-files>`
        :param thumbnail: *Optional*. Thumbnail of the file sent; can be ignored if
            thumbnail generation for the file is supported server-side. The thumbnail should
            be in JPEG format and less than 200 kB in size. A thumbnail's width and height
            should not exceed 320.
        :param caption: *Optional*. Caption of the audio to be sent, 0-1024 characters
            after entities parsing
        :param parse_mode: *Optional*. Mode for parsing entities in the audio caption.
            See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_
            for more details.
        :param caption_entities: *Optional*. List of special entities that appear in the caption,
            which can be specified instead of *parse_mode*
        :param duration: *Optional*. Duration of the audio in seconds
        :param performer: *Optional*. Performer of the audio
        :param title: *Optional*. Title of the audio
        :return: None
        )r   r3   r   r(   r   r)   r*   r+   Nr/   )r$   r
   )
r   r   r3   r   r(   r   r)   r*   r+   r-   s
             r   r=   zMediaGroupBuilder.add_audio�   s@   € ðH 	�	‰	Üð 
ØØ#ØØ%Ø!1Ø!Ø#Øñ
ð ñ
õ	
r   c                 óD   — | j                  t        d|||||dœ|¤Ž«       y)uF  
        Add a photo to the media group.

        :param media: File to send. Pass a file_id to send a file that exists on the
            Telegram servers (recommended), pass an HTTP URL for Telegram to get a file
            from the Internet, or pass 'attach://<file_attach_name>' to upload a new
            one using multipart/form-data under <file_attach_name> name.
             :ref:`More information on Sending Files Â» <sending-files>`
        :param caption: *Optional*. Caption of the photo to be sent, 0-1024 characters
            after entities parsing
        :param parse_mode: *Optional*. Mode for parsing entities in the photo caption.
            See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_
            for more details.
        :param caption_entities: *Optional*. List of special entities that appear in the caption,
            which can be specified instead of *parse_mode*
        :param has_spoiler: *Optional*. Pass :code:`True` if the photo needs to be covered
            with a spoiler animation
        :return: None
        )r   r   r(   r   r1   Nr/   )r$   r   )r   r   r   r(   r   r1   r-   s          r   r?   zMediaGroupBuilder.add_photoÁ   s6   € ð8 	�	‰	Üð ØØØ%Ø!1Ø'ñð ñõ		
r   c                 óN   — | j                  t        d|||||||||	|
dœ
|¤Ž«       y)uü  
        Add a video to the media group.

        :param media: File to send. Pass a file_id to send a file that exists on the
            Telegram servers (recommended), pass an HTTP URL for Telegram to get a file
            from the Internet, or pass 'attach://<file_attach_name>' to upload a new one
            using multipart/form-data under <file_attach_name> name.
            :ref:`More information on Sending Files Â» <sending-files>`
        :param thumbnail: *Optional*. Thumbnail of the file sent; can be ignored if thumbnail
            generation for the file is supported server-side. The thumbnail should be in JPEG
            format and less than 200 kB in size. A thumbnail's width and height should
            not exceed 320. Ignored if the file is not uploaded using multipart/form-data.
            Thumbnails can't be reused and can be only uploaded as a new file, so you
            can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
            multipart/form-data under <file_attach_name>.
            :ref:`More information on Sending Files Â» <sending-files>`
        :param caption: *Optional*. Caption of the video to be sent,
            0-1024 characters after entities parsing
        :param parse_mode: *Optional*. Mode for parsing entities in the video caption.
            See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_
            for more details.
        :param caption_entities: *Optional*. List of special entities that appear in the caption,
            which can be specified instead of *parse_mode*
        :param width: *Optional*. Video width
        :param height: *Optional*. Video height
        :param duration: *Optional*. Video duration in seconds
        :param supports_streaming: *Optional*. Pass :code:`True` if the uploaded video is
            suitable for streaming
        :param has_spoiler: *Optional*. Pass :code:`True` if the video needs to be covered
            with a spoiler animation
        :return: None
        )
r   r3   r   r(   r   r4   r5   r)   r6   r1   Nr/   )r$   r   )r   r   r3   r   r(   r   r4   r5   r)   r6   r1   r-   s               r   rA   zMediaGroupBuilder.add_videoè   sF   € ð\ 	�	‰	Üð ØØ#ØØ%Ø!1ØØØ!Ø#5Ø'ñð ñõ	
r   c                 óF   — | j                  t        d||||||dœ|¤Ž«       y)uq  
        Add a document to the media group.

        :param media: File to send. Pass a file_id to send a file that exists on the
            Telegram servers (recommended), pass an HTTP URL for Telegram to get a file
            from the Internet, or pass 'attach://<file_attach_name>' to upload a new one using
            multipart/form-data under <file_attach_name> name.
            :ref:`More information on Sending Files Â» <sending-files>`
        :param thumbnail: *Optional*. Thumbnail of the file sent; can be ignored
            if thumbnail generation for the file is supported server-side.
            The thumbnail should be in JPEG format and less than 200 kB in size.
            A thumbnail's width and height should not exceed 320.
            Ignored if the file is not uploaded using multipart/form-data.
            Thumbnails can't be reused and can be only uploaded as a new file,
            so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded
            using multipart/form-data under <file_attach_name>.
            :ref:`More information on Sending Files Â» <sending-files>`
        :param caption: *Optional*. Caption of the document to be sent,
            0-1024 characters after entities parsing
        :param parse_mode: *Optional*. Mode for parsing entities in the document caption.
            See `formatting options <https://core.telegram.org/bots/api#formatting-options>`_
            for more details.
        :param caption_entities: *Optional*. List of special entities that appear
            in the caption, which can be specified instead of *parse_mode*
        :param disable_content_type_detection: *Optional*. Disables automatic server-side
            content type detection for files uploaded using multipart/form-data.
            Always :code:`True`, if the document is sent as part of an album.
        :return: None

        )r   r3   r   r(   r   r8   Nr/   )r$   r   )r   r   r3   r   r(   r   r8   r-   s           r   rC   zMediaGroupBuilder.add_document&  s:   € ðP 	�	‰	Üð ØØ#ØØ%Ø!1Ø/Mñð ñõ
	
r   c                 ó   — d| j                   i}| j                  �| j                  |d<   d|d<   t        | j                  «      D ��cg c]*  \  }}|dk(  r| j                   �|j	                  |¬«      n|‘Œ, c}}S c c}}w )z²
        Builds a list of media objects for a media group.

        Adds the caption to the first media object if it is present.

        :return: List of media objects.
        r   Nr   r(   r   )Úupdate)r   r   Ú	enumerater   Ú
model_copy)r   Úupdate_first_mediaÚindexr   s       r   ÚbuildzMediaGroupBuilder.buildZ  s–   € ð /8¸¿¹Ð-FÐØ× Ñ Ð,Ø59×5JÑ5JÐÐ1Ñ2Ø/3Ð˜|Ñ,ô !*¨$¯+©+Ó 6÷
ñ ��uð ˜A’: $§,¡,Ð":ð × Ñ Ð(:Ð Ô;àñó
ð 	
ùó 
s   Á/A:)NNN)Ú__name__Ú
__module__Ú__qualname__ÚlistÚ	MediaTypeÚstrr   r   r$   r   r   r   r   r   r<   r   Úintr   r0   r>   Úboolr@   rB   r=   r?   rA   rC   rO   r/   r   r   r   r      sî  „ ð
 )-Ø"Ø7;ñ	"à�I‰ Ñ%ð"ð �t‘ð"ð ˜}Ñ-°Ñ4ð	"ð
 
ó"ð(	"˜)ð 	"¨ó 	"ð˜T )™_ð °ó ð ð #Ø!1Ø7;Ø#Ø $Ø òð �n×*Ñ*Ñ+ðð �Y‰ð	ð
 �t‘ðð ˜$‘Jðð ˜}Ñ-°Ñ4ðð ˜‘*ðð ˜‘:ðð �T‰zðð ðð 
òó ðð ð #Ø!1Ø7;Ø#'òð �n×*Ñ*Ñ+ðð �Y‰ð	ð
 �t‘ðð ˜$‘Jðð ˜}Ñ-°Ñ4ðð ˜D‘[ðð ðð 
òó ðð ð -1Ø"Ø!1Ø7;Ø Ø!Ø#Ø*.Ø#'òð �n×*Ñ*Ñ+ðð �Y‰ð	ð
 ˜s‘? TÑ)ðð �t‘ðð ˜$‘Jðð ˜}Ñ-°Ñ4ðð �T‰zðð �d‘
ðð ˜‘*ðð ! 4™Kðð ˜D‘[ðð ðð 
òó ðð$ ð -1Ø"Ø!1Ø7;Ø6:òð �n×-Ñ-Ñ.ðð �Y‰ð	ð
 ˜s‘? TÑ)ðð �t‘ðð ˜$‘Jðð ˜}Ñ-°Ñ4ðð )-¨t©ðð ðð 
òó ðð"˜Cð " Dó "ð0 '+Ø"Ø!1Ø7;Ø#Ø $Ø ñ0
à�Y‰ð0
ð ˜tÑ#ð0
ð �t‘ð	0
ð
 ˜$‘Jð0
ð ˜}Ñ-°Ñ4ð0
ð ˜‘*ð0
ð ˜‘:ð0
ð �T‰zð0
ð ð0
ð 
ó0
ðj #Ø!1Ø7;Ø#'ñ%
à�Y‰ð%
ð �t‘ð%
ð ˜$‘Jð	%
ð
 ˜}Ñ-°Ñ4ð%
ð ˜D‘[ð%
ð ð%
ð 
ó%
ðT '+Ø"Ø!1Ø7;Ø Ø!Ø#Ø*.Ø#'ñ<
à�Y‰ð<
ð ˜tÑ#ð<
ð �t‘ð	<
ð
 ˜$‘Jð<
ð ˜}Ñ-°Ñ4ð<
ð �T‰zð<
ð �d‘
ð<
ð ˜‘*ð<
ð ! 4™Kð<
ð ˜D‘[ð<
ð ð<
ð 
ó<
ðB '+Ø"Ø!1Ø7;Ø6:ñ2
à�Y‰ð2
ð ˜tÑ#ð2
ð �t‘ð	2
ð
 ˜$‘Jð2
ð ˜}Ñ-°Ñ4ð2
ð )-¨t©ð2
ð ð2
ð 
ó2
ðh
�t˜I‘ô 
r   r   N)Útypingr   r   r   Úaiogram.enumsr   Úaiogram.typesr   r   r	   r
   r   r   r   r   rT   r!   r   r/   r   r   ú<module>r[      sF   ðß )Ñ )å (÷	÷ 	ó 	ð ˜oÑ-°Ñ?ÐBTÑT€	àÐ ÷Z
ò Z
r   