§
    }ŠtjÄ  ã            	       ó   — d Z ddlZddlZddlmZ ddlmZmZ  ej        dej	        ej
        z  ej        z  ¬¦  «        Zdd	edz  d
ee         fd„Zddeded	edz  d
dfd„Zdded	edz  d
dfd„Zded
ee         fd„ZdS )z-Contains utilities to manage Git credentials.é    Né   )ÚENDPOINTé   )Úrun_interactive_subprocessÚrun_subprocesszß
        ^\s* # start of line
        credential\.helper # credential.helper value
        \s*=\s* # separator
        ([\w\-\/]+) # the helper name or absolute path (group 1)
        (\s|$) # whitespace or end of line
    )ÚflagsÚfolderÚreturnc                 ó¨   — 	 t          d| ¬¦  «        j        }t          |¦  «        }|S # t          j        $ r}t          |j        ¦  «        ‚d}~ww xY w)a“  Return the list of git credential helpers configured.

    See https://git-scm.com/docs/gitcredentials.

    Credentials are saved in all configured helpers (store, cache, macOS keychain,...).
    Calls "`git credential approve`" internally. See https://git-scm.com/docs/git-credential.

    Args:
        folder (`str`, *optional*):
            The folder in which to check the configured helpers.
    zgit config --list©r	   N)r   ÚstdoutÚ_parse_credential_outputÚ
subprocessÚCalledProcessErrorÚOSErrorÚstderr)r	   ÚoutputÚparsedÚexcs       úc/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/huggingface_hub/utils/_git_credential.pyÚlist_credential_helpersr   #   sa   € ð"ÝÐ 3¸FÐCÑCÔCÔJˆÝ)¨&Ñ1Ô1ˆØˆøÝÔ(ð "ð "ð "Ý�c”jÑ!Ô!Ð!øøøøð"øøøs   ‚&) ©A¸AÁAÚhf_userÚtokenÚusernamec           
      óô   — t          d|¬¦  «        5 \  }}|                     dt          › d|                     ¦   «         › d| › d�¦  «         |                     ¦   «          ddd¦  «         dS # 1 swxY w Y   dS )a«  Save a username/token pair in git credential for HF Hub registry.

    Credentials are saved in all configured helpers (store, cache, macOS keychain,...).
    Calls "`git credential approve`" internally. See https://git-scm.com/docs/git-credential.

    Args:
        username (`str`, defaults to `"hf_user"`):
            A git username. Defaults to `"hf_user"`, the default user used in the Hub.
        token (`str`, defaults to `"hf_user"`):
            A git password. In practice, the User Access Token for the Hub.
            See https://huggingface.co/settings/tokens.
        folder (`str`, *optional*):
            The folder in which to check the configured helpers.
    zgit credential approver   úurl=z

username=z

password=z

N)r   Úwriter   ÚlowerÚflush)r   r   r	   ÚstdinÚ_s        r   Úset_git_credentialr"   7   sÈ   € õ 
$Ð$<ÀVÐ	LÑ	LÔ	Lð ñ QØØ	à�ŠÐX�8ÐXÐX°·²Ñ0@Ô0@ÐXÐXÈUÐXÐXÐXÑYÔYÐYØ�Š‰Œˆðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   ’AA-Á-A1Á4A1c                 ó  — t          d|¬¦  «        5 \  }}dt          › d�}| �|d|                      ¦   «         › d�z  }|dz  }|                     |¦  «         |                     ¦   «          ddd¦  «         dS # 1 swxY w Y   dS )aY  Erase credentials from git credential for HF Hub registry.

    Credentials are erased from the configured helpers (store, cache, macOS
    keychain,...), if any. If `username` is not provided, any credential configured for
    HF Hub endpoint is erased.
    Calls "`git credential erase`" internally. See https://git-scm.com/docs/git-credential.

    Args:
        username (`str`, defaults to `"hf_user"`):
            A git username. Defaults to `"hf_user"`, the default user used in the Hub.
        folder (`str`, *optional*):
            The folder in which to check the configured helpers.
    zgit credential rejectr   r   ú
Nz	username=)r   r   r   r   r   )r   r	   r    r!   Ústandard_inputs        r   Úunset_git_credentialr&   N   sâ   € õ 
$Ð$;ÀFÐ	KÑ	KÔ	Kð 
ñ PØØ	à,¥Ð,Ð,Ð,ˆØÐØÐ>¨(¯.ª.Ñ*:Ô*:Ð>Ð>Ð>Ñ>ˆNØ˜$Ñˆà�Š�NÑ#Ô#Ð#Ø�Š‰Œˆð
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
øøøð 
ð 
ð 
ð 
ð 
ð 
s   ’AA9Á9A=Â A=r   c                 ód   — t          d„ t                               | ¦  «        D ¦   «         ¦  «        S )z›Parse the output of `git credential fill` to extract the password.

    Args:
        output (`str`):
            The output of `git credential fill`.
    c                 ó   — h | ]
}|d          ’ŒS )r   © )Ú.0Úmatchs     r   ú	<setcomp>z+_parse_credential_output.<locals>.<setcomp>t   s)   € ð 	
ð 	
ð 	
ØˆE�!ŒHð	
ð 	
ð 	
ó    )ÚsortedÚGIT_CREDENTIAL_REGEXÚfindall)r   s    r   r   r   i   s@   € õ ð	
ð 	
Ý"6×">Ò">¸vÑ"FÔ"Fð	
ñ 	
ô 	
ñô ð r-   )N)r   N)Ú__doc__Úrer   Ú	constantsr   Ú_subprocessr   r   ÚcompileÚ	MULTILINEÚ
IGNORECASEÚVERBOSEr/   ÚstrÚlistr   r"   r&   r   r)   r-   r   ú<module>r;      sM  ðð 4Ð 3à 	€	€	€	Ø Ð Ð Ð à  Ð  Ð  Ð  Ð  Ð  Ø CÐ CÐ CÐ CÐ CÐ CÐ CÐ Cð "�r”zðð Œ,˜œÑ
&¨¬Ñ
3ð	ñ 	ô 	Ð ð"ð " C¨$¡Jð "¸$¸s¼)ð "ð "ð "ð "ð(ð ˜cð ¨Sð ÀcÈDÁjð Ð\`ð ð ð ð ð.ð  3ð ¸CÀ$¹Jð ÐRVð ð ð ð ð6 Sð ¨T°#¬Yð ð ð ð ð ð r-   