Ë
    …jÐj½*  ã                   ó‚   — d Z ddlmZmZmZmZ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 erdd
lZ G d„ de«      Zy
)zProvide the Front class.é    )ÚTYPE_CHECKINGÚDictÚIteratorÚListÚUnioné   )ÚAPI_PATH)Ú_deprecate_argsé   )ÚPRAWBase)ÚListingGenerator)Ústream_generatorNc                   ó  — e Zd ZdZdeeeeeef   f   deed      fd„Z	de
d   fd„Zdeeeeeef   f   ded	   fd
„Zd„ Zde
ed      fd„Zde
ed      fd„Zdeeeeeef   f   ded	   fd„Zdeddfd„Zdeeeeeef   f   ded   fd„Zdeeeeeef   f   ded   fd„Zdeeeeeef   f   deed      fd„Zdeeeeeef   f   ded	   fd„Zde
d   fd„Z ed«      ddœdedeeeeeef   f   deed      fd„«       Zy)ÚInboxz3Inbox is a Listing class that represents the inbox.Úgenerator_kwargsÚreturn)úpraw.models.Messageúpraw.models.Commentc                 ó>   — t        | j                  t        d   fi |¤ŽS )aˆ  Return a :class:`.ListingGenerator` for all inbox comments and messages.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        To output the type and ID of all items available via this listing do:

        .. code-block:: python

            for item in reddit.inbox.all(limit=None):
                print(repr(item))

        Úinbox©r   Ú_redditr	   ©Úselfr   s     ú‹/var/labsstorage/home/Thilakkumar/htdocs/soical-media-automation/automation_platform/venv/lib/python3.12/site-packages/praw/models/inbox.pyÚallz	Inbox.all   s    € ô    §¡¬h°wÑ.?ÑTÐCSÑTÐTó    Úitemsr   c                 óœ   — |rJddj                  d„ |dd D «       «      i}| j                  j                  t        d   |¬«       |dd }|rŒIyy)ae  Mark an inbox message as collapsed.

        :param items: A list containing instances of :class:`.Message`.

        Requests are batched at 25 items (reddit limit).

        For example, to collapse all unread Messages, try:

        .. code-block:: python

            from praw.models import Message

            unread_messages = []
            for item in reddit.inbox.unread(limit=None):
                if isinstance(item, Message):
                    unread_messages.append(item)
            reddit.inbox.collapse(unread_messages)

        .. seealso::

            :meth:`.Message.uncollapse`

        Úidú,c              3   ó4   K  — | ]  }|j                   –— Œ y ­w©N©Úfullname©Ú.0Úxs     r   ú	<genexpr>z!Inbox.collapse.<locals>.<genexpr><   ó   è ø€ Ò"B°! 1§:¥:Ñ"Bùó   ‚Né   Úcollapse©Údata©Újoinr   Úpostr	   ©r   r   r/   s      r   r-   zInbox.collapse#   sR   € ñ0 Ø˜#Ÿ(™(Ñ"B°u¸S¸b°zÔ"BÓBÐCˆDØ�L‰L×Ñœh zÑ2¸ÐÔ>Ø˜"˜#�JˆEô r   r   c                 ó>   — t        | j                  t        d   fi |¤ŽS )ay  Return a :class:`.ListingGenerator` for comment replies.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        To output the author of one request worth of comment replies try:

        .. code-block:: python

            for reply in reddit.inbox.comment_replies():
                print(reply.author)

        Úcomment_repliesr   r   s     r   r5   zInbox.comment_replies@   s(   € ô   Ø�L‰Lœ(Ð#4Ñ5ñ
Ø9Iñ
ð 	
r   c                 óH   — | j                   j                  t        d   «       y)a6  Mark all messages as read with just one API call.

        Example usage:

        .. code-block:: python

            reddit.inbox.mark_all_read()

        .. note::

            This method returns after Reddit acknowledges your request, instead of after
            the request has been fulfilled.

        Úread_all_messagesN)r   r2   r	   )r   s    r   Úmark_all_readzInbox.mark_all_readT   s   € ð 	�‰×Ñœ(Ð#6Ñ7Õ8r   )r   r   c                 óœ   — |rJddj                  d„ |dd D «       «      i}| j                  j                  t        d   |¬«       |dd }|rŒIyy)a  Mark Comments or Messages as read.

        :param items: A list containing instances of :class:`.Comment` and/or
            :class:`.Message` to be marked as read relative to the authorized user's
            inbox.

        Requests are batched at 25 items (reddit limit).

        For example, to mark all unread Messages as read, try:

        .. code-block:: python

            from praw.models import Message

            unread_messages = []
            for item in reddit.inbox.unread(limit=None):
                if isinstance(item, Message):
                    unread_messages.append(item)
            reddit.inbox.mark_read(unread_messages)

        .. seealso::

            - :meth:`.Comment.mark_read`
            - :meth:`.Message.mark_read`

        r    r!   c              3   ó4   K  — | ]  }|j                   –— Œ y ­wr#   r$   r&   s     r   r)   z"Inbox.mark_read.<locals>.<genexpr>ƒ   r*   r+   Nr,   Úread_messager.   r0   r3   s      r   Ú	mark_readzInbox.mark_reade   sR   € ñ: Ø˜#Ÿ(™(Ñ"B°u¸S¸b°zÔ"BÓBÐCˆDØ�L‰L×Ñœh ~Ñ6¸TÐÔBØ˜"˜#�JˆEô r   c                 óœ   — |rJddj                  d„ |dd D «       «      i}| j                  j                  t        d   |¬«       |dd }|rŒIyy)aX  Unmark Comments or Messages as read.

        :param items: A list containing instances of :class:`.Comment` and/or
            :class:`.Message` to be marked as unread relative to the authorized user's
            inbox.

        Requests are batched at 25 items (Reddit limit).

        For example, to mark the first 10 items as unread try:

        .. code-block:: python

            to_unread = list(reddit.inbox.all(limit=10))
            reddit.inbox.mark_unread(to_unread)

        .. seealso::

            - :meth:`.Comment.mark_unread`
            - :meth:`.Message.mark_unread`

        r    r!   c              3   ó4   K  — | ]  }|j                   –— Œ y ­wr#   r$   r&   s     r   r)   z$Inbox.mark_unread.<locals>.<genexpr>    r*   r+   Nr,   Úunread_messager.   r0   r3   s      r   Úmark_unreadzInbox.mark_unread‡   sS   € ñ0 Ø˜#Ÿ(™(Ñ"B°u¸S¸b°zÔ"BÓBÐCˆDØ�L‰L×ÑœhÐ'7Ñ8¸tÐÔDØ˜"˜#�JˆEô r   c                 ó>   — t        | j                  t        d   fi |¤ŽS )a
  Return a :class:`.ListingGenerator` for mentions.

        A mention is :class:`.Comment` in which the authorized redditor is named in its
        body like u/spez.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        For example, to output the author and body of the first 25 mentions try:

        .. code-block:: python

            for mention in reddit.inbox.mentions(limit=25):
                print(f"{mention.author}\\n{mention.body}\\n")

        Úmentionsr   r   s     r   rB   zInbox.mentions¤   s    € ô&   §¡¬h°zÑ.BÑWÐFVÑWÐWr   Ú
message_idc                 ój  — | j                   j                  t        d   j                  |¬«      «      }|d   g|d   j                  z   D �ci c]  }|j
                  |“Œ }}|j                  «       D ]&  \  }}|j                  |j                  d«      |_        Œ( |d|j                  «       › �   S c c}w )zéReturn a :class:`.Message` corresponding to ``message_id``.

        :param message_id: The base36 ID of a message.

        For example:

        .. code-block:: python

            message = reddit.inbox.message("7bnlgu")

        Úmessage)r    r   NÚt4_)
r   Úgetr	   ÚformatÚrepliesr%   r   Ú	parent_idÚparentÚlower)r   rC   ÚlistingrE   Úmessagesr%   s         r   rE   zInbox.message¹   s½   € ð —,‘,×"Ñ"¤8¨IÑ#6×#=Ñ#=ÀÐ#=Ó#LÓMˆà6=¸a±j°\ÀGÈAÁJ×DVÑDVÑ5Vö
Ø*1ˆG×Ñ˜gÑ%ð
ˆð 
ð "*§¡Ó!1ò 	CÑˆH�gØ%Ÿ\™\¨'×*;Ñ*;¸TÓBˆG�Nð	Cà˜#˜j×.Ñ.Ó0Ð1Ð2Ñ3Ð3ùò
s   ÁB0c                 ó>   — t        | j                  t        d   fi |¤ŽS )a�  Return a :class:`.ListingGenerator` for inbox messages.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        For example, to output the subject of the most recent 5 messages try:

        .. code-block:: python

            for message in reddit.inbox.messages(limit=5):
                print(message.subject)

        rN   r   r   s     r   rN   zInbox.messagesÍ   s    € ô    §¡¬h°zÑ.BÑWÐFVÑWÐWr   c                 ó>   — t        | j                  t        d   fi |¤ŽS )a}  Return a :class:`.ListingGenerator` for sent messages.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        For example, to output the recipient of the most recent 15 messages try:

        .. code-block:: python

            for message in reddit.inbox.sent(limit=15):
                print(message.dest)

        Úsentr   r   s     r   rQ   z
Inbox.sentß   s    € ô    §¡¬h°vÑ.>ÑSÐBRÑSÐSr   Ústream_optionsc                 ó.   — t        | j                  fi |¤ŽS )a�  Yield new inbox items as they become available.

        Items are yielded oldest first. Up to 100 historical items will initially be
        returned.

        Keyword arguments are passed to :func:`.stream_generator`.

        For example, to retrieve all new inbox items, try:

        .. code-block:: python

            for item in reddit.inbox.stream():
                print(item)

        )r   Úunread)r   rR   s     r   ÚstreamzInbox.streamñ   s   € ô$   §¡Ñ>¨~Ñ>Ð>r   c                 ó>   — t        | j                  t        d   fi |¤ŽS )a‚  Return a :class:`.ListingGenerator` for submission replies.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        To output the author of one request worth of submission replies try:

        .. code-block:: python

            for reply in reddit.inbox.submission_replies():
                print(reply.author)

        Úsubmission_repliesr   r   s     r   rW   zInbox.submission_replies  s(   € ô   Ø�L‰Lœ(Ð#7Ñ8ñ
Ø<Lñ
ð 	
r   c                 óœ   — |rJddj                  d„ |dd D «       «      i}| j                  j                  t        d   |¬«       |dd }|rŒIyy)ai  Mark an inbox message as uncollapsed.

        :param items: A list containing instances of :class:`.Message`.

        Requests are batched at 25 items (reddit limit).

        For example, to uncollapse all unread Messages, try:

        .. code-block:: python

            from praw.models import Message

            unread_messages = []
            for item in reddit.inbox.unread(limit=None):
                if isinstance(item, Message):
                    unread_messages.append(item)
            reddit.inbox.uncollapse(unread_messages)

        .. seealso::

            :meth:`.Message.collapse`

        r    r!   c              3   ó4   K  — | ]  }|j                   –— Œ y ­wr#   r$   r&   s     r   r)   z#Inbox.uncollapse.<locals>.<genexpr>2  r*   r+   Nr,   Ú
uncollapser.   r0   r3   s      r   rZ   zInbox.uncollapse  sR   € ñ0 Ø˜#Ÿ(™(Ñ"B°u¸S¸b°zÔ"BÓBÐCˆDØ�L‰L×Ñœh |Ñ4¸4ÐÔ@Ø˜"˜#�JˆEô r   r<   F)r<   c                óf   — | j                  |d|¬«       t        | j                  t        d   fi |¤ŽS )a¸  Return a :class:`.ListingGenerator` for unread comments and messages.

        :param mark_read: Marks the inbox as read (default: ``False``).

        .. note::

            This only marks the inbox as read not the messages. Use
            :meth:`.Inbox.mark_read` to mark the messages.

        Additional keyword arguments are passed in the initialization of
        :class:`.ListingGenerator`.

        For example, to output the author of unread comments try:

        .. code-block:: python

            from praw.models import Comment

            for item in reddit.inbox.unread(limit=None):
                if isinstance(item, Comment):
                    print(item.author)

        Úparams)Ú	argumentsÚkeyÚmarkrT   )Ú_safely_add_argumentsr   r   r	   )r   r<   r   s      r   rT   zInbox.unread6  s<   € ð< 	×"Ñ"Ø&¨H¸9ð 	#ô 	
ô   §¡¬h°xÑ.@ÑUÐDTÑUÐUr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚstrÚintr   r   r   r   r-   r5   r8   r<   r@   rB   rE   rN   rQ   rU   rW   rZ   r
   ÚboolrT   © r   r   r   r      s2  „ Ù=ðUØ"'¨¨S°$°s¸C°x±.Ð(@Ñ"AðUà	�%ÐDÑEÑ	FóUð$˜dÐ#8Ñ9ó ð:
Ø"'¨¨S°$°s¸C°x±.Ð(@Ñ"Að
à	Ð'Ñ	(ó
ò(9ð" Ø˜%Ð LÑMÑNó ðDØ˜%Ð LÑMÑNóð:XØ"'¨¨S°$°s¸C°x±.Ð(@Ñ"AðXà	Ð'Ñ	(óXð*4 #ð 4Ð*?ó 4ð(XØ"'¨¨S°$°s¸C°x±.Ð(@Ñ"AðXà	Ð'Ñ	(óXð$TØ"'¨¨S°$°s¸C°x±.Ð(@Ñ"AðTà	Ð'Ñ	(óTð$?Ø % c¨3°°S¸#°X±Ð&>Ñ ?ð?à	�%ÐDÑEÑ	Fó?ð(
Ø"'¨¨S°$°s¸C°x±.Ð(@Ñ"Að
à	Ð'Ñ	(ó
ð( Ð%:Ñ ;ó ñ: �[Ó!ð  ò Vð ð Vð " # s¨D°°c°©NÐ":Ñ;ð	 Vð
 
�%ÐDÑEÑ	Fò Vó "ñ Vr   r   )rd   Útypingr   r   r   r   r   Úconstr	   Úutilr
   Úbaser   Úlisting.generatorr   r   Úprawr   rh   r   r   ú<module>ro      s3   ðÙ ß =Õ =å Ý "Ý Ý /Ý "áÛôIVˆHõ IVr   