
    i=                     N   d 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  G d d	e          Z G d
 de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )z8This module contains objects that represent story areas.    )Final)	constants)ReactionType)TelegramObject)enum)JSONDictc                   T     e Zd ZdZdZdddedededed	ed
ededz  ddf fdZ xZS )StoryAreaPositiona|  Describes the position of a clickable area within a story.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if all of their attributes are equal.

    .. versionadded:: 22.1

    Args:
        x_percentage (:obj:`float`): The abscissa of the area's center, as a percentage of the
            media width.
        y_percentage (:obj:`float`): The ordinate of the area's center, as a percentage of the
            media height.
        width_percentage (:obj:`float`): The width of the area's rectangle, as a percentage of the
            media width.
        height_percentage (:obj:`float`): The height of the area's rectangle, as a percentage of
            the media height.
        rotation_angle (:obj:`float`): The clockwise rotation angle of the rectangle, in degrees;
            0-:tg-const:`~telegram.constants.StoryAreaPositionLimit.MAX_ROTATION_ANGLE`.
        corner_radius_percentage (:obj:`float`): The radius of the rectangle corner rounding, as a
            percentage of the media width.

    Attributes:
        x_percentage (:obj:`float`): The abscissa of the area's center, as a percentage of the
            media width.
        y_percentage (:obj:`float`): The ordinate of the area's center, as a percentage of the
            media height.
        width_percentage (:obj:`float`): The width of the area's rectangle, as a percentage of the
            media width.
        height_percentage (:obj:`float`): The height of the area's rectangle, as a percentage of
            the media height.
        rotation_angle (:obj:`float`): The clockwise rotation angle of the rectangle, in degrees;
            0-:tg-const:`~telegram.constants.StoryAreaPositionLimit.MAX_ROTATION_ANGLE`.
        corner_radius_percentage (:obj:`float`): The radius of the rectangle corner rounding, as a
            percentage of the media width.

    )corner_radius_percentageheight_percentagerotation_anglewidth_percentagex_percentagey_percentageN
api_kwargsr   r   r   r   r   r   r   returnc                   t                                          |           || _        || _        || _        || _        || _        || _        | j        | j        | j        | j        | j        | j        f| _        | 	                                 d S Nr   )
super__init__r   r   r   r   r   r   	_id_attrs_freeze)	selfr   r   r   r   r   r   r   	__class__s	           S/Users/shanyulin/my-agent/.venv/lib/python3.11/site-packages/telegram/_storyarea.pyr   zStoryAreaPosition.__init__M   s     	J///#/#/'7(9%3/G% !")
 	    )	__name__
__module____qualname____doc__	__slots__floatr   r   __classcell__r   s   @r   r
   r
      s        # #JI$ '+     	
 !  #( tO 
         r   r
   c                   f     e Zd ZdZdZ	 	 	 ddddededz  dedz  dedz  d	edz  d
df fdZ xZS )LocationAddressa  Describes the physical address of a location.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`country_code`, :attr:`state`, :attr:`city` and :attr:`street`
    are equal.

    .. versionadded:: 22.1

    Args:
        country_code (:obj:`str`): The two-letter ``ISO 3166-1 alpha-2`` country code of the
            country where the location is located.
        state (:obj:`str`, optional): State of the location.
        city (:obj:`str`, optional): City of the location.
        street (:obj:`str`, optional): Street address of the location.

    Attributes:
        country_code (:obj:`str`): The two-letter ``ISO 3166-1 alpha-2`` country code of the
            country where the location is located.
        state (:obj:`str`): Optional. State of the location.
        city (:obj:`str`): Optional. City of the location.
        street (:obj:`str`): Optional. Street address of the location.

    )citycountry_codestatestreetNr   r)   r*   r(   r+   r   r   c                    t                                          |           || _        || _        || _        || _        | j        | j        | j        | j        f| _        |                                  d S r   )r   r   r)   r*   r(   r+   r   r   )r   r)   r*   r(   r+   r   r   s         r   r   zLocationAddress.__init__   sg     	J///!-!&
 $	"(+TZDKPr   )NNN	r   r   r    r!   r"   strr   r   r$   r%   s   @r   r'   r'   k   s         0 <I
 !! '+   Tz Dj	
 d
 tO 
         r   r'   c                   2    e Zd ZU dZ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<   	 ej        j        Zee	         e
d<   	 ej        j        Zee	         e
d<   	 dd	d
e	dedz  ddf fdZ xZS )StoryAreaTypeah  Describes the type of a clickable area on a story. Currently, it can be one of:

    * :class:`telegram.StoryAreaTypeLocation`
    * :class:`telegram.StoryAreaTypeSuggestedReaction`
    * :class:`telegram.StoryAreaTypeLink`
    * :class:`telegram.StoryAreaTypeWeather`
    * :class:`telegram.StoryAreaTypeUniqueGift`

    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:: 22.1

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

    Attributes:
        type (:obj:`str`): Type of the area.

    )typeLOCATIONSUGGESTED_REACTIONLINKWEATHERUNIQUE_GIFTNr   r1   r   r   c                    t                                          |           t          j        t          j        ||          | _        | j        f| _        |                                  d S r   )	r   r   r   
get_memberr   StoryAreaTypeTyper1   r   r   )r   r1   r   r   s      r   r   zStoryAreaType.__init__   sT     	J///)DdDQQ	)r   )r   r   r    r!   r"   r   r9   r2   r   r.   __annotations__r3   r4   r5   r6   r   r   r$   r%   s   @r   r0   r0      s         * I$6?HeCj???@%.%@%Sc
SSSJ 27D%*777<#5=GU3Z===?'9EKsEEEC '+	
 
 

 tO	

 

 
 
 
 
 
 
 
 
 
r   r0   c                   R     e Zd ZdZdZ	 ddddedededz  dedz  d	df
 fd
Z xZ	S )StoryAreaTypeLocationa  Describes a story area pointing to a location. Currently, a story can have up to
    :tg-const:`~telegram.constants.StoryAreaTypeLimit.MAX_LOCATION_AREAS` location areas.

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

    .. versionadded:: 22.1

    Args:
        latitude (:obj:`float`): Location latitude in degrees.
        longitude (:obj:`float`): Location longitude in degrees.
        address (:class:`telegram.LocationAddress`, optional): Address of the location.

    Attributes:
        type (:obj:`str`): Type of the area, always :attr:`~telegram.StoryAreaType.LOCATION`.
        latitude (:obj:`float`): Location latitude in degrees.
        longitude (:obj:`float`): Location longitude in degrees.
        address (:class:`telegram.LocationAddress`): Optional. Address of the location.

    )addresslatitude	longitudeNr   r>   r?   r=   r   r   c                   t                                          t          j        |           |                                 5  || _        || _        || _        | j        | j        | j        f| _	        d d d            d S # 1 swxY w Y   d S N)r1   r   )
r   r   r0   r2   	_unfrozenr>   r?   r=   r1   r   )r   r>   r?   r=   r   r   s        r   r   zStoryAreaTypeLocation.__init__   s     	m4LLL^^ 	H 	H#+DM$-DN3:DL"iGDN	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	Hs   /A??BB)N)
r   r   r    r!   r"   r#   r'   r   r   r$   r%   s   @r   r<   r<      s         * 5I +/	H '+H H HH H !4'	H tOH 
H H H H H H H H H Hr   r<   c                   Z     e Zd ZdZdZ	 	 ddddededz  dedz  dedz  d	df
 fd
Z xZ	S )StoryAreaTypeSuggestedReactiona  
    Describes a story area pointing to a suggested reaction. Currently, a story can have up to
    :tg-const:`~telegram.constants.StoryAreaTypeLimit.MAX_SUGGESTED_REACTION_AREAS`
    suggested reaction areas.

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

    .. versionadded:: 22.1

    Args:
        reaction_type (:class:`ReactionType`): Type of the reaction.
        is_dark (:obj:`bool`, optional): Pass :obj:`True` if the reaction area has a dark
            background.
        is_flipped (:obj:`bool`, optional): Pass :obj:`True` if reaction area corner is flipped.

    Attributes:
        type (:obj:`str`): Type of the area, always
            :tg-const:`~telegram.StoryAreaType.SUGGESTED_REACTION`.
        reaction_type (:class:`ReactionType`): Type of the reaction.
        is_dark (:obj:`bool`): Optional. Pass :obj:`True` if the reaction area has a dark
            background.
        is_flipped (:obj:`bool`): Optional. Pass :obj:`True` if reaction area corner is flipped.

    )is_dark
is_flippedreaction_typeNr   rG   rE   rF   r   r   c                $   t                                          t          j        |           |                                 5  || _        || _        || _        | j        | j        | j        | j        f| _	        d d d            d S # 1 swxY w Y   d S rA   )
r   r   r0   r3   rB   rG   rE   rF   r1   r   )r   rG   rE   rF   r   r   s        r   r   z'StoryAreaTypeSuggestedReaction.__init__  s     	m>:VVV^^ 	\ 	\/<D(/DL+5DO"i);T\4?[DN	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\ 	\   5BB	B	)NN)
r   r   r    r!   r"   r   boolr   r   r$   r%   s   @r   rD   rD      s         6 ;I
  $"&	\ '+\ \ \#\ \ 4K	\ tO\ 
\ \ \ \ \ \ \ \ \ \r   rD   c                   @     e Zd ZdZdZdddededz  ddf fdZ xZS )	StoryAreaTypeLinka  Describes a story area pointing to an ``HTTP`` or ``tg://`` link. Currently, a story can
    have up to :tg-const:`~telegram.constants.StoryAreaTypeLimit.MAX_LINK_AREAS` link areas.

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

    .. versionadded:: 22.1

    Args:
        url (:obj:`str`): ``HTTP`` or ``tg://`` URL to be opened when the area is clicked.

    Attributes:
        type (:obj:`str`): Type of the area, always :attr:`~telegram.StoryAreaType.LINK`.
        url (:obj:`str`): ``HTTP`` or ``tg://`` URL to be opened when the area is clicked.

    )urlNr   rM   r   r   c                    t                                          t          j        |           |                                 5  || _        | j        | j        f| _        d d d            d S # 1 swxY w Y   d S rA   )r   r   r0   r4   rB   rM   r1   r   )r   rM   r   r   s      r   r   zStoryAreaTypeLink.__init__7  s     	m0ZHHH^^ 	3 	3DH"i2DN	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3   A++A/2A/r-   r%   s   @r   rL   rL   #  s}         " I '+	3 3 33 tO	3
 
3 3 3 3 3 3 3 3 3 3r   rL   c                   H     e Zd ZdZdZdddededededz  d	df
 fd
Z	 xZ
S )StoryAreaTypeWeathera  
    Describes a story area containing weather information. Currently, a story can have up to
    :tg-const:`~telegram.constants.StoryAreaTypeLimit.MAX_WEATHER_AREAS` weather areas.

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

    .. versionadded:: 22.1

    Args:
        temperature (:obj:`float`): Temperature, in degree Celsius.
        emoji (:obj:`str`): Emoji representing the weather.
        background_color (:obj:`int`): A color of the area background in the ``ARGB`` format.

    Attributes:
        type (:obj:`str`): Type of the area, always
            :tg-const:`~telegram.StoryAreaType.WEATHER`.
        temperature (:obj:`float`): Temperature, in degree Celsius.
        emoji (:obj:`str`): Emoji representing the weather.
        background_color (:obj:`int`): A color of the area background in the ``ARGB`` format.

    )background_coloremojitemperatureNr   rT   rS   rR   r   r   c                $   t                                          t          j        |           |                                 5  || _        || _        || _        | j        | j        | j        | j        f| _	        d d d            d S # 1 swxY w Y   d S rA   )
r   r   r0   r5   rB   rT   rS   rR   r1   r   )r   rT   rS   rR   r   r   s        r   r   zStoryAreaTypeWeather.__init__`  s     	m3
KKK^^ 	^ 	^&1D#DJ)9D!"i)94:tG\]DN	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^ 	^rI   )r   r   r    r!   r"   r#   r.   intr   r   r$   r%   s   @r   rQ   rQ   E  s         0 =I '+^ ^ ^^ ^ 	^ tO^ 
^ ^ ^ ^ ^ ^ ^ ^ ^ ^r   rQ   c                   @     e Zd ZdZdZdddededz  ddf fdZ xZS )	StoryAreaTypeUniqueGiftad  
    Describes a story area pointing to a unique gift. Currently, a story can have at most
    :tg-const:`~telegram.constants.StoryAreaTypeLimit.MAX_UNIQUE_GIFT_AREAS` unique gift area.

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

    .. versionadded:: 22.1

    Args:
        name (:obj:`str`): Unique name of the gift.

    Attributes:
        type (:obj:`str`): Type of the area, always
            :tg-const:`~telegram.StoryAreaType.UNIQUE_GIFT`.
        name (:obj:`str`): Unique name of the gift.

    )nameNr   rY   r   r   c                    t                                          t          j        |           |                                 5  || _        | j        | j        f| _        d d d            d S # 1 swxY w Y   d S rA   )r   r   r0   r6   rB   rY   r1   r   )r   rY   r   r   s      r   r   z StoryAreaTypeUniqueGift.__init__  s     	m7JOOO^^ 	4 	4!DI"i3DN	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4rO   r-   r%   s   @r   rX   rX   r  s}         & I '+	4 4 44 tO	4
 
4 4 4 4 4 4 4 4 4 4r   rX   c            	       D     e Zd ZdZdZdddedededz  ddf fd	Z xZ	S )
	StoryAreaa4  Describes a clickable area on a story media.

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

    .. versionadded:: 22.1

    Args:
        position (:class:`telegram.StoryAreaPosition`): Position of the area.
        type (:class:`telegram.StoryAreaType`): Type of the area.

    Attributes:
        position (:class:`telegram.StoryAreaPosition`): Position of the area.
        type (:class:`telegram.StoryAreaType`): Type of the area.

    )positionr1   Nr   r]   r1   r   r   c                    t                                          |           || _        || _        | j        | j        f| _        |                                  d S r   )r   r   r]   r1   r   r   )r   r]   r1   r   r   s       r   r   zStoryArea.__init__  sO     	J///+3#'	-3r   )
r   r   r    r!   r"   r
   r0   r   r   r$   r%   s   @r   r\   r\     s         " %I '+  # 
 tO 
         r   r\   N)r!   typingr   telegramr   telegram._reactionr   telegram._telegramobjectr   telegram._utilsr   telegram._utils.typesr   r
   r'   r0   r<   rD   rL   rQ   rX   r\    r   r   <module>rf      s%  & ? >             + + + + + + 3 3 3 3 3 3             * * * * * *J J J J J J J JZ+ + + + +n + + +\- - - - -N - - -`'H 'H 'H 'H 'HM 'H 'H 'HT-\ -\ -\ -\ -\] -\ -\ -\`3 3 3 3 3 3 3 3D*^ *^ *^ *^ *^= *^ *^ *^Z!4 !4 !4 !4 !4m !4 !4 !4H                   r   