§
    „ßj2  ã                  óÖ   — d dl mZ d dlZddlmZ ddlmZ ddlmZ  ej	        dej
        dej        f         ¬	¦  «        Z eg d
¢¦  «        Z G d„ d¦  «        Z G d„ de¦  «        ZdS )é    )ÚannotationsNé   )Útyping)Úcurrent_app)ÚrequestÚF.)Úbound)ÚgetÚpostÚheadÚoptionsÚdeleteÚputÚtraceÚpatchc                  ól   — e Zd ZU dZdZded<   dZded<   g Zded<   d	Zd
ed<   dd„Z	e
dd„¦   «         ZdS )ÚViewa  Subclass this class and override :meth:`dispatch_request` to
    create a generic class-based view. Call :meth:`as_view` to create a
    view function that creates an instance of the class with the given
    arguments and calls its ``dispatch_request`` method with any URL
    variables.

    See :doc:`views` for a detailed guide.

    .. code-block:: python

        class Hello(View):
            init_every_request = False

            def dispatch_request(self, name):
                return f"Hello, {name}!"

        app.add_url_rule(
            "/hello/<name>", view_func=Hello.as_view("hello")
        )

    Set :attr:`methods` on the class to change what methods the view
    accepts.

    Set :attr:`decorators` on the class to apply a list of decorators to
    the generated view function. Decorators applied to the class itself
    will not be applied to the generated view function!

    Set :attr:`init_every_request` to ``False`` for efficiency, unless
    you need to store request-global data on ``self``.
    Nz$t.ClassVar[t.Collection[str] | None]Úmethodszt.ClassVar[bool | None]Úprovide_automatic_optionsz(t.ClassVar[list[t.Callable[..., t.Any]]]Ú
decoratorsTzt.ClassVar[bool]Úinit_every_requestÚreturnúft.ResponseReturnValuec                ó   — t          ¦   «         ‚)z·The actual view function behavior. Subclasses must override
        this and return a valid response. Any variables from the URL
        rule are passed as keyword arguments.
        )ÚNotImplementedError)Úselfs    ú>/var/www/html/venv/lib/python3.11/site-packages/flask/views.pyÚdispatch_requestzView.dispatch_requestN   s   € õ
 "Ñ#Ô#Ð#ó    ÚnameÚstrÚ
class_argsút.AnyÚclass_kwargsúft.RouteCallablec                ó$  ‡‡‡‡— | j         r	dˆˆˆfd„Šn | ‰i ‰¤ŽŠdˆfd„Š| j        r(|‰_        | j        ‰_        | j        D ]} |‰¦  «        ŠŒ| ‰_        |‰_        | j        ‰_        | j        ‰_        | j        ‰_        | j        ‰_        ‰S )af  Convert the class into a view function that can be registered
        for a route.

        By default, the generated view will create a new instance of the
        view class for every request and call its
        :meth:`dispatch_request` method. If the view class sets
        :attr:`init_every_request` to ``False``, the same instance will
        be used for every request.

        Except for ``name``, all other arguments passed to this method
        are forwarded to the view class ``__init__`` method.

        .. versionchanged:: 2.2
            Added the ``init_every_request`` class attribute.
        Úkwargsr#   r   r   c                 ó\   •—  ‰j         ‰i ‰¤Ž} t          j        |j        ¦  «        di | ¤ŽS ©N© )Ú
view_classr   Úensure_syncr   )r'   r   r"   r$   Úviews     €€€r   r-   zView.as_view.<locals>.viewj   sH   ø€ Ø&�t”ØðØ#/ðð �ð F•{Ô.¨tÔ/DÑEÔEÐOÐOÈÐOÐOÐOr   c                 óB   •—  t          j        ‰j        ¦  «        di | ¤ŽS r)   )r   r,   r   )r'   r   s    €r   r-   zView.as_view.<locals>.views   s'   ø€ ØE•{Ô.¨tÔ/DÑEÔEÐOÐOÈÐOÐOÐOr   ©r'   r#   r   r   )r   r   Ú__name__Ú
__module__r+   Ú__doc__r   r   )Úclsr    r"   r$   Ú	decoratorr   r-   s     `` @@r   Úas_viewzView.as_viewU   sû   øøøø€ ð& Ô!ð 	PðPð Pð Pð Pð Pð Pð Pð Pð Pð �3˜
Ð3 lÐ3Ð3ˆDðPð Pð Pð Pð Pð Pð Œ>ð 	'Ø ˆDŒMØ!œnˆDŒOØ œ^ð 'ð '�	Ø �y ‘”��ð ˆŒØˆŒØ”{ˆŒØœ.ˆŒØ”{ˆŒØ),Ô)FˆÔ&Øˆr   )r   r   )r    r!   r"   r#   r$   r#   r   r%   )r0   r1   Ú__qualname__r2   r   Ú__annotations__r   r   r   r   Úclassmethodr5   r*   r   r   r   r      s£   € € € € € € ðð ðD 59€GÐ8Ð8Ð8Ñ8ð
 :>ÐÐ=Ð=Ð=Ñ=ð <>€JÐ=Ð=Ð=Ñ=ð ,0ÐÐ/Ð/Ð/Ñ/ð$ð $ð $ð $ð ð1ð 1ð 1ñ „[ð1ð 1ð 1r   r   c                  ó,   ‡ — e Zd ZdZd	ˆ fd„Zd
d„Zˆ xZS )Ú
MethodViewaí  Dispatches request methods to the corresponding instance methods.
    For example, if you implement a ``get`` method, it will be used to
    handle ``GET`` requests.

    This can be useful for defining a REST API.

    :attr:`methods` is automatically set based on the methods defined on
    the class.

    See :doc:`views` for a detailed guide.

    .. code-block:: python

        class CounterAPI(MethodView):
            def get(self):
                return str(session.get("counter", 0))

            def post(self):
                session["counter"] = session.get("counter", 0) + 1
                return redirect(url_for("counter"))

        app.add_url_rule(
            "/counter", view_func=CounterAPI.as_view("counter")
        )
    r'   r#   r   ÚNonec                ón  •—  t          ¦   «         j        di |¤Ž d| j        vr�t          ¦   «         }| j        D ]-}t          |dd ¦  «        r|                     |j        ¦  «         Œ.t          D ]9}t          | |¦  «        r'| 
                    |                     ¦   «         ¦  «         Œ:|r|| _        d S d S d S )Nr   r*   )ÚsuperÚ__init_subclass__Ú__dict__ÚsetÚ	__bases__ÚgetattrÚupdater   Úhttp_method_funcsÚhasattrÚaddÚupper)r3   r'   r   ÚbaseÚkeyÚ	__class__s        €r   r>   zMethodView.__init_subclass__¥   sÑ   ø€ Ø!�‰ŒÔ!Ð+Ð+ FÐ+Ð+Ð+à˜CœLÐ(Ð(Ý‘e”eˆGàœð 1ð 1�Ý˜4 ¨DÑ1Ô1ð 1Ø—N’N 4¤<Ñ0Ô0Ð0øå(ð -ð -�Ý˜3 Ñ$Ô$ð -Ø—K’K §	¢	¡¤Ñ,Ô,Ð,øàð &Ø%�”��ð )Ð(ð&ð &r   r   c                ó  — t          | t          j                             ¦   «         d ¦  «        }|€!t          j        dk    rt          | dd ¦  «        }|€J dt          j        ›�¦   «         ‚ t	          j        |¦  «        di |¤ŽS )NÚHEADr
   zUnimplemented method r*   )rB   r   ÚmethodÚlowerr   r,   )r   r'   Úmeths      r   r   zMethodView.dispatch_request¶   s…   € Ý�t�Wœ^×1Ò1Ñ3Ô3°TÑ:Ô:ˆð ˆ<�GœN¨fÒ4Ð4Ý˜4 ¨Ñ-Ô-ˆDàÐÐÐ!K½¼Ð!KÐ!KÑÔÐØ,�{Ô& tÑ,Ô,Ð6Ð6¨vÐ6Ð6Ð6r   )r'   r#   r   r;   r/   )r0   r1   r6   r2   r>   r   Ú__classcell__)rJ   s   @r   r:   r:   Š   s[   ø€ € € € € ðð ð4&ð &ð &ð &ð &ð &ð"	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7ð 	7r   r:   )Ú
__future__r   r   ÚtÚ ÚftÚglobalsr   r   ÚTypeVarÚCallableÚAnyr   Ú	frozensetrD   r   r:   r*   r   r   ú<module>rZ      sü   ðØ "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð à Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ø Ð Ð Ð Ð Ð à€A„Iˆc˜œ C¨¬ JÔ/Ð0Ñ0Ô0€à�IØIÐIÐIñô Ð ð
wð wð wð wð wñ wô wð wðt57ð 57ð 57ð 57ð 57�ñ 57ô 57ð 57ð 57ð 57r   