§
    ~Štj8  ã                   ó  — d dl Z d dlmZmZ ddlmZmZ ddlmZm	Z	 ddl
mZ ddlmZ ddlmZ d	Zerdd
lmZ  ed¦  «        Zdededeeef         fd„Zdedefd„Zddde	dœdedededee         def
d„Zdddefd„ZdS )é    N)ÚTYPE_CHECKINGÚTypeVaré   )ÚHandlerÚ
Middleware)ÚHTTPMoveÚHTTPPermanentRedirect)ÚRequest)ÚStreamResponse)ÚSystemRoute)Ú
middlewareÚnormalize_path_middleware)ÚApplicationÚ_FuncÚrequestÚpathÚreturnc              ƒ   ó¨   K  — |                       |¬¦  «        }| j        j                             |¦  «        ƒ d {V —†}||_        |j        €d|fS d| fS )N)Úrel_urlTF)ÚcloneÚappÚrouterÚresolveÚ_match_infoÚhttp_exception)r   r   Úalt_requestÚ
match_infos       úU/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/aiohttp/web_middlewares.pyÚ_check_request_resolvesr      si   è è € Ø—-’-¨�-Ñ-Ô-€Kà”{Ô)×1Ò1°+Ñ>Ô>Ð>Ð>Ð>Ð>Ð>Ð>€JØ(€KÔàÔ Ð(Ø�[Ð Ð à�'ˆ>Ðó    Úfc                 ó   — d| _         | S )Nr   )Ú__middleware_version__)r!   s    r   r   r   !   s   € Ø €AÔØ€Hr    TF)Úappend_slashÚremove_slashÚmerge_slashesÚredirect_classr$   r%   r&   r'   c                 ó†   ‡ ‡‡‡— ‰ o‰ }|s
J d¦   «         ‚t           dt          dt          dt          fˆ ˆˆˆfd„¦   «         }|S )a€  Factory for producing a middleware that normalizes the path of a request.

    Normalizing means:
        - Add or remove a trailing slash to the path.
        - Double slashes are replaced by one.

    The middleware returns as soon as it finds a path that resolves
    correctly. The order if both merge and append/remove are enabled is
        1) merge slashes
        2) append/remove slash
        3) both merge slashes and append/remove slash.
    If the path resolves with at least one of those conditions, it will
    redirect to the new path.

    Only one of `append_slash` and `remove_slash` can be enabled. If both
    are `True` the factory will raise an assertion error

    If `append_slash` is `True` the middleware will append a slash when
    needed. If a resource is defined with trailing slash and the request
    comes without it, it will append it automatically.

    If `remove_slash` is `True`, `append_slash` must be `False`. When enabled
    the middleware will remove trailing slashes and redirect if the resource
    is defined

    If merge_slashes is True, merge multiple consecutive slashes in the
    path into one.
    z#Cannot both remove and append slashr   Úhandlerr   c              “   ój  •K  — t          | j        j        t          ¦  «        �r€g }d| j        v r$| j                             dd¦  «        \  }}d|z   }n	d}| j        }‰r)|                     t          j        dd|¦  «        ¦  «         ‰r2| j	         
                    d¦  «        s|                     |dz   ¦  «         ‰
r7| j	         
                    d¦  «        r|                     |d d…         ¦  «         ‰r.‰r,|                     t          j        dd|dz   ¦  «        ¦  «         ‰r5‰
r3t          j        dd|¦  «        }|                     |d d…         ¦  «         |D ]F}t          j        dd|¦  «        }t          | |¦  «        ƒ d {V —†\  }} |r ‰	| j        |z   ¦  «        ‚ŒG || ¦  «        ƒ d {V —†S )Nú?r   Ú z//+ú/éÿÿÿÿz^//+)Ú
isinstancer   Úrouter   Úraw_pathÚsplitÚappendÚreÚsubr   Úendswithr   )r   r)   Úpaths_to_checkr   ÚqueryÚmerged_slashesÚresolvesr$   r&   r'   r%   s          €€€€r   Úimplz'normalize_path_middleware.<locals>.implL   s  øè è € å�gÔ(Ô.µÑ<Ô<ñ 	CØˆNØ�gÔ&Ð&Ð&Ø%Ô.×4Ò4°S¸!Ñ<Ô<‘��eØ˜e™��à�ØÔ'�àð @Ø×%Ò%¥b¤f¨U°C¸Ñ&>Ô&>Ñ?Ô?Ð?Øð 2 G¤L×$9Ò$9¸#Ñ$>Ô$>ð 2Ø×%Ò% d¨S¡jÑ1Ô1Ð1Øð 1 ¤× 5Ò 5°cÑ :Ô :ð 1Ø×%Ò% d¨3¨B¨3¤iÑ0Ô0Ð0Øð F ð FØ×%Ò%¥b¤f¨U°C¸À¹Ñ&DÔ&DÑEÔEÐEØð ; ð ;Ý!#¤¨¨s°DÑ!9Ô!9�Ø×%Ò% n°S°b°SÔ&9Ñ:Ô:Ð:à&ð Cð C�Ý”v˜f c¨4Ñ0Ô0�Ý*AÀ'È4Ñ*PÔ*PÐ$PÐ$PÐ$PÐ$PÐ$PÐ$PÑ!�˜'Øð CØ(˜.¨Ô)9¸EÑ)AÑBÔBÐBðCð �W˜WÑ%Ô%Ð%Ð%Ð%Ð%Ð%Ð%Ð%r    ©r   r
   r   r   )r$   r%   r&   r'   Úcorrect_configurationr;   s   ````  r   r   r   &   s   øøøø€ ðF ".Ð!>°,Ð?ÐØ ÐGÐGÐ"GÑGÔGÐ åð&�Gð &­gð &½.ð &ð &ð &ð &ð &ð &ð &ð &ñ „Zð&ð< €Kr    r   r   c                 óX   ‡ — t           dt          dt          dt          fˆ fd„¦   «         }|S )Nr   r)   r   c              “   ó~   •K  — | j         }|j        }‰|_        	  || ¦  «        ƒ d {V —†	 ||_        S # ||_        w xY w)N)r   Úcurrent_app)r   r)   r   Úprevr   s       €r   r;   z&_fix_request_current_app.<locals>.implo   se   øè è € àÔ'ˆ
ØÔ%ˆØ!$ˆ
Ôð	*Ø ˜ Ñ)Ô)Ð)Ð)Ð)Ð)Ð)Ð)Ð)à%)ˆJÔ"Ð"ø TˆJÔ"Ð)Ð)Ð)Ð)s   š3 ³	<r<   )r   r;   s   ` r   Ú_fix_request_current_apprB   n   sG   ø€ Ýð*�Gð *­gð *½.ð *ð *ð *ð *ð *ñ „Zð*ð €Kr    )r4   Útypingr   r   Útypedefsr   r   Úweb_exceptionsr   r	   Úweb_requestr
   Úweb_responser   Úweb_urldispatcherr   Ú__all__Úweb_appr   r   ÚstrÚtupleÚboolr   r   Útyper   rB   © r    r   ú<module>rP      sª  ðØ 	€	€	€	Ø )Ð )Ð )Ð )Ð )Ð )Ð )Ð )à )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø  Ð  Ð  Ð  Ð  Ð  Ø (Ð (Ð (Ð (Ð (Ð (Ø *Ð *Ð *Ð *Ð *Ð *ð€ð
 ð %Ø$Ð$Ð$Ð$Ð$Ð$àˆ�ÑÔ€ð	¨7ð 	¸#ð 	À%ÈÈgÈÔBVð 	ð 	ð 	ð 	ð�%ð ˜Eð ð ð ð ð ØØØ%:ðEð Eð EàðEð ðEð ð	Eð
 ˜”NðEð ðEð Eð Eð EðP -ð °Jð ð ð ð ð ð r    