§
    ÷„tjð!  ã                   ó  — d dl Z d dlZd dlZd dlmZ d dlmZmZmZm	Z	m
Z
mZ d dlmZ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mZ d dlmZ  e j        e¦  «        Zee         Zee         Z eegee         f         Z!eege"f         Z# G d	„ d
¦  «        Z$de%de"fd„Z& G d„ d¦  «        Z' G d„ de$¦  «        Z( G d„ de$¦  «        Z) G d„ de$¦  «        Z* G d„ de$¦  «        Z+de%de!de#de"de"de%dee
e%         e
e$         f         fd„Z,dS )é    N)Údefaultdict)ÚCallableÚDictÚIterableÚListÚOptionalÚTuple)ÚInvalidSdistFilenameÚInvalidVersionÚInvalidWheelFilenameÚcanonicalize_nameÚparse_sdist_filenameÚparse_wheel_filename)ÚInstallationCandidate)ÚLink)Úpath_to_urlÚurl_to_path)Úis_urlc                   óN   — e Zd Zedee         fd„¦   «         Zdefd„Zde	fd„Z
dS )Ú
LinkSourceÚreturnc                 ó   — t          ¦   «         ‚)z,Returns the underlying link, if there's one.©ÚNotImplementedError©Úselfs    úY/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/pip/_internal/index/sources.pyÚlinkzLinkSource.link   s   € õ "Ñ#Ô#Ð#ó    c                 ó   — t          ¦   «         ‚)z9Candidates found by parsing an archive listing HTML file.r   r   s    r   Úpage_candidateszLinkSource.page_candidates#   ó   € å!Ñ#Ô#Ð#r   c                 ó   — t          ¦   «         ‚)z,Links found by specifying archives directly.r   r   s    r   Ú
file_linkszLinkSource.file_links'   r"   r   N)Ú__name__Ú
__module__Ú__qualname__Úpropertyr   r   r   ÚFoundCandidatesr!   Ú
FoundLinksr$   © r   r   r   r      ss   € € € € € Øð$�h˜t”nð $ð $ð $ñ „Xð$ð$ ð $ð $ð $ð $ð$˜Jð $ð $ð $ð $ð $ð $r   r   Úfile_urlr   c                 óB   — t          j        | d¬¦  «        d         dk    S )NF)Ústrictr   z	text/html)Ú	mimetypesÚ
guess_type)r,   s    r   Ú_is_html_filer1   ,   s"   € ÝÔ °Ð7Ñ7Ô7¸Ô:¸kÒIÐIr   c                   óŠ   — e Zd ZdZdeddfd„Zd	d„Zedee         fd„¦   «         Z	ede
eee         f         fd„¦   «         ZdS )
Ú_FlatDirectoryToUrlsz"Scans directory and caches resultsÚpathr   Nc                 ób   — || _         g | _        t          t          ¦  «        | _        d| _        d S )NF)Ú_pathÚ_page_candidatesr   ÚlistÚ_project_name_to_urlsÚ_scanned_directory)r   r4   s     r   Ú__init__z_FlatDirectoryToUrls.__init__3   s/   € ØˆŒ
Ø+-ˆÔÝ;FÅtÑ;LÔ;LˆÔ"Ø"'ˆÔÐÐr   c                 óÖ  — t          j        | j        ¦  «        D ]Ç}t          |j        ¦  «        }t          |¦  «        r| j                             |¦  «         Œ@	 t          |j	        ¦  «        d         }nK# t          t          f$ r7 	 t          |j	        ¦  «        d         }n# t          t          f$ r Y Y Œ�w xY wY nw xY w| j        |                              |¦  «         ŒÈd| _        dS )zrScans directory once and populates both page_candidates
        and project_name_to_urls at the same time
        r   TN)ÚosÚscandirr6   r   r4   r1   r7   Úappendr   Únamer   r   r   r
   r9   r:   )r   ÚentryÚurlÚproject_filenames       r   Ú_scan_directoryz$_FlatDirectoryToUrls._scan_directory9   s  € õ ”Z ¤
Ñ+Ô+ð 	Eð 	EˆEÝ˜eœjÑ)Ô)ˆCÝ˜SÑ!Ô!ð ØÔ%×,Ò,¨SÑ1Ô1Ð1ØðÝ#7¸¼
Ñ#CÔ#CÀAÔ#FÐ Ð øÝ(­.Ð9ð ð ð ðÝ';¸E¼JÑ'GÔ'GÈÔ'JÐ$Ð$øÝ,­nÐ=ð ð ð Ø�H�Hðøøøð %Ð$ðøøøð Ô&Ð'7Ô8×?Ò?ÀÑDÔDÐDÐDØ"&ˆÔÐÐs6   ÁA6Á6B>ÂB#Â"B>Â#B8Â4B>Â7B8Â8B>Â=B>c                 óF   — | j         s|                      ¦   «          | j        S ©N)r:   rD   r7   r   s    r   r!   z$_FlatDirectoryToUrls.page_candidatesP   s(   € àÔ&ð 	#Ø× Ò Ñ"Ô"Ð"àÔ$Ð$r   c                 óF   — | j         s|                      ¦   «          | j        S rF   )r:   rD   r9   r   s    r   Úproject_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsW   s(   € àÔ&ð 	#Ø× Ò Ñ"Ô"Ð"àÔ)Ð)r   )r   N)r%   r&   r'   Ú__doc__Ústrr;   rD   r(   r   r!   r   rH   r+   r   r   r3   r3   0   s¯   € € € € € Ø,Ð,ð(˜Sð ( Tð (ð (ð (ð (ð'ð 'ð 'ð 'ð. ð%  c¤ð %ð %ð %ñ „Xð%ð ð* d¨3°°S´	¨>Ô&:ð *ð *ð *ñ „Xð*ð *ð *r   r3   c                   óŠ   — e Zd ZU dZi Zeeef         ed<   de	dededdfd„Z
edee         fd	„¦   «         Zdefd
„Zdefd„ZdS )Ú_FlatDirectorySourcezûLink source specified by ``--find-links=<path-to-dir>``.

    This looks the content of the directory, and returns:

    * ``page_candidates``: Links listed on each HTML file in the directory.
    * ``file_candidates``: Archives in the directory.
    Ú_paths_to_urlsÚcandidates_from_pager4   Úproject_namer   Nc                 ó¾   — || _         t          |¦  «        | _        || j        v r| j        |         | _        d S t          |¬¦  «        | _        | j        | j        |<   d S )N)r4   )Ú_candidates_from_pager   Ú_project_namerM   Ú_path_to_urlsr3   )r   rN   r4   rO   s       r   r;   z_FlatDirectorySource.__init__j   sk   € ð &:ˆÔ"Ý.¨|Ñ<Ô<ˆÔð �4Ô&Ð&Ð&Ø!%Ô!4°TÔ!:ˆDÔÐÐå!5¸4Ð!@Ñ!@Ô!@ˆDÔØ(,Ô(:ˆDÔ Ñ%Ð%Ð%r   c                 ó   — d S rF   r+   r   s    r   r   z_FlatDirectorySource.linkz   s   € àˆtr   c              #   óx   K  — | j         j        D ]*}|                      t          |¦  «        ¦  «        E d {V —† Œ+d S rF   )rS   r!   rQ   r   ©r   rB   s     r   r!   z$_FlatDirectorySource.page_candidates~   sT   è è € ØÔ%Ô5ð 	=ð 	=ˆCØ×1Ò1µ$°s±)´)Ñ<Ô<Ð<Ð<Ð<Ð<Ð<Ð<Ð<Ð<ð	=ð 	=r   c              #   ó`   K  — | j         j        | j                 D ]}t          |¦  «        V — Œd S rF   )rS   rH   rR   r   rV   s     r   r$   z_FlatDirectorySource.file_links‚   s>   è è € ØÔ%Ô:¸4Ô;MÔNð 	ð 	ˆCÝ�s‘)”)ˆOˆOˆOˆOð	ð 	r   )r%   r&   r'   rI   rM   r   rJ   r3   Ú__annotations__ÚCandidatesFromPager;   r(   r   r   r   r)   r!   r*   r$   r+   r   r   rL   rL   _   sØ   € € € € € € ðð ð 79€N�D˜Ð2Ð2Ô3Ð8Ð8Ñ8ð;à0ð;ð ð;ð ð	;ð
 
ð;ð ;ð ;ð ;ð  ð�h˜t”nð ð ð ñ „Xðð= ð =ð =ð =ð =ð˜Jð ð ð ð ð ð r   rL   c                   óf   — e Zd ZdZdededdfd„Zedee         fd„¦   «         Z	de
fd„Zdefd	„ZdS )
Ú_LocalFileSourceaC  ``--find-links=<path-or-url>`` or ``--[extra-]index-url=<path-or-url>``.

    If a URL is supplied, it must be a ``file:`` URL. If a path is supplied to
    the option, it is converted to a URL first. This returns:

    * ``page_candidates``: Links listed on an HTML file.
    * ``file_candidates``: The non-HTML file.
    rN   r   r   Nc                 ó"   — || _         || _        d S rF   ©rQ   Ú_link©r   rN   r   s      r   r;   z_LocalFileSource.__init__‘   ó   € ð
 &:ˆÔ"ØˆŒ
ˆ
ˆ
r   c                 ó   — | j         S rF   ©r^   r   s    r   r   z_LocalFileSource.link™   ó
   € àŒzÐr   c              #   ó€   K  — t          | j        j        ¦  «        sd S |                      | j        ¦  «        E d {V —† d S rF   )r1   r^   rB   rQ   r   s    r   r!   z _LocalFileSource.page_candidates�   sM   è è € Ý˜TœZœ^Ñ,Ô,ð 	ØˆFØ×-Ò-¨d¬jÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9r   c              #   óR   K  — t          | j        j        ¦  «        rd S | j        V — d S rF   )r1   r^   rB   r   s    r   r$   z_LocalFileSource.file_links¢   s3   è è € Ý˜œœÑ(Ô(ð 	ØˆFØŒjÐÐÐÐÐr   ©r%   r&   r'   rI   rY   r   r;   r(   r   r   r)   r!   r*   r$   r+   r   r   r[   r[   ‡   s¯   € € € € € ðð ðà0ðð ðð 
ð	ð ð ð ð ð�h˜t”nð ð ð ñ „Xðð: ð :ð :ð :ð :ð
˜Jð ð ð ð ð ð r   r[   c                   ój   — e Zd ZdZdedededdfd„Zede	e         fd„¦   «         Z
defd	„Zdefd
„ZdS )Ú_RemoteFileSourcez¸``--find-links=<url>`` or ``--[extra-]index-url=<url>``.

    This returns:

    * ``page_candidates``: Links listed on an HTML file.
    * ``file_candidates``: The non-HTML file.
    rN   Úpage_validatorr   r   Nc                 ó0   — || _         || _        || _        d S rF   )rQ   Ú_page_validatorr^   )r   rN   ri   r   s       r   r;   z_RemoteFileSource.__init__±   s   € ð &:ˆÔ"Ø-ˆÔØˆŒ
ˆ
ˆ
r   c                 ó   — | j         S rF   rb   r   s    r   r   z_RemoteFileSource.link»   rc   r   c              #   ó‚   K  — |                       | j        ¦  «        sd S |                      | j        ¦  «        E d {V —† d S rF   )rk   r^   rQ   r   s    r   r!   z!_RemoteFileSource.page_candidates¿   sQ   è è € Ø×#Ò# D¤JÑ/Ô/ð 	ØˆFØ×-Ò-¨d¬jÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9r   c              #   ó   K  — | j         V — d S rF   rb   r   s    r   r$   z_RemoteFileSource.file_linksÄ   s   è è € ØŒjÐÐÐÐÐr   )r%   r&   r'   rI   rY   ÚPageValidatorr   r;   r(   r   r   r)   r!   r*   r$   r+   r   r   rh   rh   ¨   s¹   € € € € € ðð ðà0ðð &ðð ð	ð
 
ðð ð ð ð ð�h˜t”nð ð ð ñ „Xðð: ð :ð :ð :ð :ð
˜Jð ð ð ð ð ð r   rh   c                   óf   — e Zd ZdZdededdfd„Zedee         fd„¦   «         Z	de
fd„Zdefd	„ZdS )
Ú_IndexDirectorySourcez·``--[extra-]index-url=<path-to-directory>``.

    This is treated like a remote URL; ``candidates_from_page`` contains logic
    for this by appending ``index.html`` to the link.
    rN   r   r   Nc                 ó"   — || _         || _        d S rF   r]   r_   s      r   r;   z_IndexDirectorySource.__init__Ï   r`   r   c                 ó   — | j         S rF   rb   r   s    r   r   z_IndexDirectorySource.link×   rc   r   c              #   óJ   K  — |                       | j        ¦  «        E d {V —† d S rF   r]   r   s    r   r!   z%_IndexDirectorySource.page_candidatesÛ   s4   è è € Ø×-Ò-¨d¬jÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9r   c                 ó   — dS )Nr+   r+   r   s    r   r$   z _IndexDirectorySource.file_linksÞ   s   € Øˆrr   rf   r+   r   r   rq   rq   È   s¯   € € € € € ðð ðà0ðð ðð 
ð	ð ð ð ð ð�h˜t”nð ð ð ñ „Xðð: ð :ð :ð :ð :ð˜Jð ð ð ð ð ð r   rq   ÚlocationrN   ri   Ú
expand_dirÚcache_link_parsingrO   c                óà  — d }d }t           j                             | ¦  «        rt          | ¦  «        }| }n8|                      d¦  «        r| }t          | ¦  «        }nt          | ¦  «        r| }|€d}t                               || ¦  «         dS |€%t          ||t          ||¬¦  «        ¬¦  «        }	||	fS t           j                             |¦  «        r9|rt          |||¬¦  «        }	n t          |t          ||¬¦  «        ¬¦  «        }	||	fS t           j                             |¦  «        r$t          |t          ||¬¦  «        ¬¦  «        }	||	fS t                               d| ¦  «         |d fS )	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)rx   )rN   ri   r   )rN   r4   rO   )rN   r   z?Location '%s' is ignored: it is neither a file nor a directory.)r=   r4   Úexistsr   Ú
startswithr   r   ÚloggerÚwarningrh   r   ÚisdirrL   rq   Úisfiler[   )
rv   rN   ri   rw   rx   rO   r4   rB   ÚmsgÚsources
             r   Úbuild_sourcer‚   â   sÃ  € ð €DØ€CÝ	„w‡~‚~�hÑÔð Ý˜(Ñ#Ô#ˆØˆˆØ	×	Ò	˜WÑ	%Ô	%ð ØˆÝ˜8Ñ$Ô$ˆˆÝ	�Ñ	Ô	ð Øˆà
€{ðKð 	õ 	�Š�s˜HÑ%Ô%Ð%Øˆ|à€|Ý.Ø!5Ø)Ý�cÐ.@ÐAÑAÔAð
ñ 
ô 
ˆð
 �Vˆ}Ðå	„w‡}‚}�TÑÔð Øð 
	Ý)Ø%9ØØ)ðñ ô ˆFˆFõ +Ø%9Ý˜#Ð2DÐEÑEÔEðñ ô ˆFð �Vˆ}ÐÝ	Œ�Š˜Ñ	Ô	ð Ý!Ø!5Ý�cÐ.@ÐAÑAÔAð
ñ 
ô 
ˆð �Vˆ}ÐÝ
‡N‚NØIØñô ð ð �ˆ;Ðr   )-Úloggingr/   r=   Úcollectionsr   Útypingr   r   r   r   r   r	   Úpip._vendor.packaging.utilsr
   r   r   r   r   r   Úpip._internal.models.candidater   Úpip._internal.models.linkr   Úpip._internal.utils.urlsr   r   Úpip._internal.vcsr   Ú	getLoggerr%   r|   r)   r*   rY   Úboolro   r   rJ   r1   r3   rL   r[   rh   rq   r‚   r+   r   r   ú<module>r�      sí  ðØ €€€Ø Ð Ð Ð Ø 	€	€	€	Ø #Ð #Ð #Ð #Ð #Ð #Ø BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ Bðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð AÐ @Ð @Ð @Ð @Ð @Ø *Ð *Ð *Ð *Ð *Ð *Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ø $Ð $Ð $Ð $Ð $Ð $à	ˆÔ	˜8Ñ	$Ô	$€àÐ0Ô1€Ø�dŒ^€
Ø˜t˜f hÐ/DÔ&EÐEÔFÐ Ø˜$˜ ˜Ô&€ð$ð $ð $ð $ð $ñ $ô $ð $ðJ˜Cð J Dð Jð Jð Jð Jð,*ð ,*ð ,*ð ,*ð ,*ñ ,*ô ,*ð ,*ð^%ð %ð %ð %ð %˜:ñ %ô %ð %ðPð ð ð ð �zñ ô ð ðBð ð ð ð ˜
ñ ô ð ð@ð ð ð ð ˜Jñ ô ð ð4;Øð;ð -ð;ð "ð	;ð
 ð;ð ð;ð ð;ð ˆ8�CŒ=˜( :Ô.Ð.Ô/ð;ð ;ð ;ð ;ð ;ð ;r   