o
    f>h                     @   s  d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 ddl
mZ ddlmZmZ er8ddlmZ ddlmZmZ ed	Zd
eee  deedf fddZdee dee	 dee	 fddZededdZeddddZerxeG dd deZdee dee ded dee fddZdee dee ded ded  dee f
d!d"Zdeee  dee ded deedf fd#d$Zdeee  dee ded ded  deedf f
d%d&Z d'S )(a:  This module contains helper functions related to parsing arguments for classes and methods.

Warning:
    Contents of this module are intended to be used internally by the library and *not* by the
    user. Changes to this module are not considered breaking changes and may not be documented in
    the changelog.
    )Sequence)TYPE_CHECKINGOptionalProtocolTypeVar)LinkPreviewOptions)TelegramObject)JSONDictODVInput)type_check_only)BotFileCredentialsTargreturn.c                 C   s   | rt | S dS )zParses an optional sequence into a tuple

    Args:
        arg (:obj:`Sequence`): The sequence to parse.

    Returns:
        :obj:`Tuple`: The sequence converted to a tuple or an empty tuple.
     )tuple)r   r   r   R/var/www/html/venv/lib/python3.10/site-packages/telegram/_utils/argumentparsing.pyparse_sequence_arg)   s   	r   disable_web_page_previewlink_preview_optionsc                 C   s&   | r|rt d| durt| d}|S )zWrapper around warn_about_deprecated_arg_return_new_arg. Takes care of converting
    disable_web_page_preview to LinkPreviewOptions.
    zXParameters `disable_web_page_preview` and `link_preview_options` are mutually exclusive.N)is_disabled)
ValueErrorr   )r   r   r   r   r   parse_lpo_and_dwpp5   s   
r   Tele_coT)bound	covariantTeleCrypto_coHasDecryptMethodc                   @   sx   e Zd ZdZedee deded de	d def
d	d
Z
edee de	e ded de	d deedf f
ddZdS )r   r   clsdatabotr   credentialsr   r   c                 C      d S Nr   r   r    r!   r"   r   r   r   de_json_decryptedP      z"HasDecryptMethod.de_json_decrypted.c                 C   r#   r$   r   r%   r   r   r   de_list_decryptedX   r'   z"HasDecryptMethod.de_list_decryptedN)__name__
__module____qualname__	__slots__classmethodtyper   r	   r   listr&   r   r(   r   r   r   r   r   L   s4    
r    r   r!   r   c                 C   s   | du rdS | | |S )z<Wrapper around TO.de_json that returns None if data is None.N)de_jsonr    r   r!   r   r   r   de_json_optionala      r2   r"   r   c                 C   s   | du rdS | | ||S )zFWrapper around TO.de_json_decrypted that returns None if data is None.N)r&   r    r   r!   r"   r   r   r   de_json_decrypted_optionalk      r5   c                 C   s   | du rdS | | |S )zEWrapper around TO.de_list that returns an empty list if data is None.Nr   )de_listr1   r   r   r   de_list_optionalx   r3   r8   c                 C   s   | du rdS | | ||S )zOWrapper around TO.de_list_decrypted that returns an empty list if data is None.Nr   )r(   r4   r   r   r   de_list_decrypted_optional   r6   r9   N)!__doc__collections.abcr   typingr   r   r   r   telegram._linkpreviewoptionsr   telegram._telegramobjectr   telegram._utils.typesr	   r
   r   telegramr   r   r   r   r   boolr   r   r   r   r.   r2   r/   r5   r8   r9   r   r   r   r   <module>   s~   "









