
    di                     z    d Z ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZ  G d	 d
e          ZdS )zCThis module contains an object that represents a Telegram Location.    N)Final)	constants)TelegramObject)to_timedelta)get_timedelta_value)JSONDict
TimePeriodc                   4    e Zd ZU dZdZ	 	 	 	 ddddedededz  dedz  d	edz  d
edz  dedz  f fdZ	e
deej        z  dz  fd            Zej        j        Zee         ed<   	 ej        j        Zee         ed<   	 ej        j        Zee         ed<    xZS )Locationa 	  This object represents a point on the map.

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

    Args:
        longitude (:obj:`float`): Longitude as defined by the sender.
        latitude (:obj:`float`): Latitude as defined by the sender.
        horizontal_accuracy (:obj:`float`, optional): The radius of uncertainty for the location,
            measured in meters; 0-:tg-const:`telegram.Location.HORIZONTAL_ACCURACY`.
        live_period (:obj:`int` | :class:`datetime.timedelta`, optional): Time relative to the
            message sending date, during which the location can be updated, in seconds. For active
            live locations only.

            .. versionchanged:: v22.2
                |time-period-input|
        heading (:obj:`int`, optional): The direction in which user is moving, in degrees;
            :tg-const:`telegram.Location.MIN_HEADING`-:tg-const:`telegram.Location.MAX_HEADING`.
            For active live locations only.
        proximity_alert_radius (:obj:`int`, optional): Maximum distance for proximity alerts about
            approaching another chat member, in meters. For sent live locations only.

    Attributes:
        longitude (:obj:`float`): Longitude as defined by the sender.
        latitude (:obj:`float`): Latitude as defined by the sender.
        horizontal_accuracy (:obj:`float`): Optional. The radius of uncertainty for the location,
            measured in meters; 0-:tg-const:`telegram.Location.HORIZONTAL_ACCURACY`.
        live_period (:obj:`int` | :class:`datetime.timedelta`): Optional. Time relative to the
            message sending date, during which the location can be updated, in seconds. For active
            live locations only.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        heading (:obj:`int`): Optional. The direction in which user is moving, in degrees;
            :tg-const:`telegram.Location.MIN_HEADING`-:tg-const:`telegram.Location.MAX_HEADING`.
            For active live locations only.
        proximity_alert_radius (:obj:`int`): Optional. Maximum distance for proximity alerts about
            approaching another chat member, in meters. For sent live locations only.

    )_live_periodheadinghorizontal_accuracylatitude	longitudeproximity_alert_radiusN
api_kwargsr   r   r   live_periodr   r   r   c                *   t                                          |           || _        || _        || _        t          |          | _        || _        |rt          |          nd | _	        | j        | j        f| _
        |                                  d S )Nr   )super__init__r   r   r   r   r   r   intr   	_id_attrs_freeze)	selfr   r   r   r   r   r   r   	__class__s	           U/root/projects/qq-shell/venv/lib/python3.11/site-packages/telegram/_files/location.pyr   zLocation.__init__R   s     	J/// )' 2E 2>{2K2K#*+AKC&'''t 	# .$-8    returnc                 .    t          | j        d          S )Nr   )	attribute)r   r   )r   s    r   r   zLocation.live_periodn   s    "4#4NNNNr   HORIZONTAL_ACCURACYMIN_HEADINGMAX_HEADING)NNNN)__name__
__module____qualname____doc__	__slots__floatr	   r   r   r   propertydtm	timedeltar   r   LocationLimitr"   r   __annotations__r#   r$   __classcell__)r   s   @r   r   r      sc        ' 'RI -1)-"-1 '+    #T\	
  $& t !$d
 tO     8 OS3=047 O O O XO '0&=&QsQQQ (5AKsAAA (5AKsAAA   r   r   )r(   datetimer,   typingr   telegramr   telegram._telegramobjectr   telegram._utils.argumentparsingr   telegram._utils.datetimer   telegram._utils.typesr   r	   r    r   r   <module>r9      s   & J I                 3 3 3 3 3 3 8 8 8 8 8 8 8 8 8 8 8 8 6 6 6 6 6 6 6 6a a a a a~ a a a a ar   