Ë
     ^ãjÞ  ã                  óŽ  — U d dl mZ 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 d dlZd dlmZ ddlmZmZ  ej&                  d«      Zeg df   Zd	ed
<   g d¢Zdd„Zdd„Zd d„Zi Zded<   d!d"d„Z	 d#	 	 	 	 	 	 	 d$d„Z	 d#	 	 	 	 	 d%d„Zd&d„Zd'd„Z  eg d¢ed«        eg d¢e d«       	 	 d(	 	 	 	 	 	 	 d)d„Z!d&d„Z"d*d„Z#d+d„Z$y),é    )ÚannotationsN)Údefaultdict)ÚCallableÚ	GeneratorÚIteratorÚNoReturnÚSequence)Ú	TypeAliasé   )ÚCommandLineParserErrorÚExitReplExceptionÚTr
   ÚInternalCommandCallback)
Ú_execute_internal_and_sys_cmdsÚ_exit_internalÚ_get_registered_targetÚ_help_internalÚ_resolve_contextÚ_register_internal_commandÚdispatch_repl_commandsÚhandle_internal_commandsÚsplit_arg_stringÚexitc                óˆ   — t        | d«      r+t        j                  t        t           t        | d«      «      S | j                  S ©NÚ_protected_args)ÚhasattrÚtÚcastÚlistÚstrÚgetattrÚprotected_args)Úctxs    úR/var/www/html/metafoliadorv2/venv/lib/python3.12/site-packages/click_repl/utils.pyÚ_get_protected_argsr&       s6   € äˆsÐ%Ô&Ü�v‰v”dœ3‘i¤¨Ð.?Ó!@ÓAÐAØ×ÑÐó    c                óF   — t        | d«      rt        | d|«       y || _        y r   )r   Úsetattrr#   )r$   Úargss     r%   Ú_set_protected_argsr+   '   s"   € ÜˆsÐ%Ô&Ü�Ð&¨Õ-à!ˆÕr'   c                óÆ  — | rÞ|j                   }t        |t        j                  «      r²|j                  sH|j                  || «      \  }}} |€|S |j                  || |d¬«      }t        |«      |j                  z   } na| r@|j                  || «      \  }}} |€|S |j                  || |ddd¬«      }|j                  } | rŒ@}g t        |«      ¢|j                  ¢} n	 |S | rŒÞ|S )a;  Produce the context hierarchy starting with the command and
    traversing the complete arguments. This only follows the commands,
    it doesn't trigger input prompts or callbacks.

    :param args: List of complete args before the incomplete value.
    :param cli_ctx: `click.Context` object of the CLI group
    T)ÚparentÚresilient_parsingF)r-   Úallow_extra_argsÚallow_interspersed_argsr.   )	ÚcommandÚ
isinstanceÚclickÚMultiCommandÚchainÚresolve_commandÚmake_contextr&   r*   )r*   r$   r1   ÚnameÚcmdÚsub_ctxs         r%   r   r   .   s  € ñ Ø—+‘+ˆä�gœu×1Ñ1Ô2Ø—=’=Ø")×"9Ñ"9¸#¸tÓ"D‘��c˜4à�;Ø�Jà×&Ñ& t¨T¸#ÐQUÐ&ÓV�Ü*¨3Ó/°#·(±(Ñ:‘áØ&-×&=Ñ&=¸cÀ4Ó&H‘O�D˜#˜tà�{Ø"˜
à!×.Ñ.ØØØ"Ø)-Ø05Ø*.ð /ó �Gð #Ÿ<™<�Dò ð  �ØEÔ,¨WÓ5ÐE¸¿¹ÐE‘àà€JòE ðD €Jr'   z5dict[str, tuple[InternalCommandCallback, str | None]]Ú_internal_commandsc                óÞ   — t        j                   | |¬«      }d|_        d|_        g }	 |D ]  }|j                  |«       Œ 	 |S # t        $ r |j                  |j
                  «       Y |S w xY w)a›  Split an argument string as with :func:`shlex.split`, but don't
    fail if the string is incomplete. Ignores a missing closing quote or
    incomplete escape sequence and uses the partial token as-is.
    .. code-block:: python
        split_arg_string("example 'my file")
        ["example", "my file"]
        split_arg_string("example my\")
        ["example", "my"]
    :param string: String to split.
    )ÚposixTÚ )ÚshlexÚwhitespace_splitÚ
commentersÚappendÚ
ValueErrorÚtoken)Ústringr=   ÚlexÚoutrD   s        r%   r   r   _   sw   € ô �+‰+�f EÔ
*€CØ€CÔØ€C„NØ
€CðØò 	ˆEØ�J‰J�uÕñ	ð €Jøô ò ð 	�
‰
�3—9‘9Õà€Jðús   ©A Á$A,Á+A,c                ó  — t        |d«      st        d«      ‚t        | t        «      r| g} nHt        | t        t
        t        f«      s-t        dj                  t        | «      j                  «      «      ‚| D ]  }||ft        |<   Œ y )NÚ__call__z#Internal command must be a callablez@"names" must be a string, or a Sequence of strings, but got "{}")r   rC   r2   r!   r	   r   r   ÚformatÚtypeÚ__name__r;   )ÚnamesÚtargetÚdescriptionr8   s       r%   r   r   |   s…   € ô
 �6˜:Ô&ÜÐ>Ó?Ð?ä�%œÔØ�‰ä˜¤¬)´XÐ>Ô?ÜØN×UÑUÜ�U“×$Ñ$óó
ð 	
ð ò 9ˆØ$*¨KÐ#8Ô˜4Ò ñ9r'   c                ó@   — t         j                  | d «      }|r|d   S |S )Nr   )r;   Úget)r8   ÚdefaultÚtarget_infos      r%   r   r   ’   s(   € ô %×(Ñ(¨¨tÓ4€KÙØ˜1‰~ÐØ€Nr'   c                 ó   — t        «       ‚©N)r   © r'   r%   r   r   ›   s   € Ü
Ó
Ðr'   c                 óL  — t        j                  «       } | j                  d«       | j                  «        | j	                  d«      5  | j                  d«       d d d «       | j	                  d«      5  | j                  d«       t        t        «      }t        j                  «       D ]  \  }}||d      j                  |«       Œ | j                  d„ |j                  «       D «       «       d d d «       t        | j                  «       «       y # 1 sw Y   Œ¶xY w# 1 sw Y   Œ/xY w)Nz	REPL helpzExternal Commandsz!prefix external commands with "!"zInternal Commandsz!prefix internal commands with ":"r   c           	   3  ó‚   K  — | ]7  \  }}d j                  t        dj                  t        |«      «      «      |f–— Œ9 y­w)z, z:{}N)ÚjoinÚmaprJ   Úsorted)Ú.0rO   Ú	mnemonicss      r%   ú	<genexpr>z!_help_internal.<locals>.<genexpr>®   s?   è ø€ ò 
ñ
 '�˜Yð —	‘	œ#˜eŸl™l¬F°9Ó,=Ó>Ó?Øôñ
ùs   ‚=?)r3   ÚHelpFormatterÚwrite_headingÚindentÚsectionÚ
write_textr   r    r;   ÚitemsrB   Úwrite_dlÚprintÚgetvalue)Ú	formatterÚ
info_tableÚmnemonicrS   s       r%   r   r   Ÿ   s  € Ü×#Ñ#Ó%€IØ×Ñ˜KÔ(Ø×ÑÔà	×	Ñ	Ð.Ó	/ñ BØ×ÑÐ@ÔA÷Bð 
×	Ñ	Ð.Ó	/ñ 
Ø×ÑÐ@ÔAÜ ¤Ó&ˆ
ä%7×%=Ñ%=Ó%?ò 	8Ñ!ˆH�kØ�{ 1‘~Ñ&×-Ñ-¨hÕ7ð	8ð 	×Ññ 
ð
 +5×*:Ñ*:Ó*<ô
ô 	
÷
ô 
ˆ)×
Ñ
Ó
Õ÷%Bð Bú÷
ð 
ús   ÁDÁ2A:DÄDÄD#)ÚqÚquitr   zexits the repl)ú?ÚhÚhelpz!displays general help informationc                óÊ   — |rt        | «      ry|r| j                  d«      rt        | «       y	 t        | «      S # t        $ r}t        dj                  |«      «      ‚d}~ww xY w)z_
    Executes internal, system, and all the other registered click commands from the input
    Nú:z{})r   Ú
startswithr   r   rC   r   rJ   )r1   Úallow_internal_commandsÚallow_system_commandsÚes       r%   r   r   ¿   s`   € ñ Ô!7¸Ô!@Øá 7×#5Ñ#5°cÔ#:Ü  Ô)Øð5Ü Ó(Ð(øÜò 5Ü$ T§[¡[°£^Ó4Ð4ûð5ús   ¯
: º	A"ÁAÁA"c                 ó   — t        «        y)zExit the replN)r   rV   r'   r%   r   r   Ô   s   € äÕr'   c                óX   — | j                  d«      rt        j                  | dd «       yy)zo
    Execute system commands entered in the repl.

    System commands are all commands starting with "!".
    ú!r   NTF)rr   ÚosÚsystem)r1   s    r%   r   r   Ù   s*   € ð ×Ñ˜#ÔÜ
�	‰	�'˜!˜"�+ÔØàr'   c                ó8   — t        | dd d¬«      }|r |«        yy)ze
    Run repl-internal commands.

    Repl-internal commands are all commands starting with ":".
    r   N)rR   )r   )r1   rN   s     r%   r   r   æ   s#   € ô $ G¨A¨B K¸Ô>€FÙÙ�ð r'   )r$   úclick.ContextÚreturnú	list[str])r$   r|   r*   r~   r}   ÚNone)r*   r~   r$   r|   r}   r|   )T)rE   r!   r=   Úboolr}   r~   rU   )rM   z@str | Sequence[str] | Generator[str, None, None] | Iterator[str]rN   r   rO   z
str | Noner}   r   )r8   r!   rR   zT | Noner}   z"InternalCommandCallback | T | None)r}   r   )r}   r   )TT)r1   r!   rs   r€   rt   r€   r}   zlist[str] | None)r1   r!   r}   r€   )r1   r!   r}   r   )%Ú
__future__r   ry   r?   Útypingr   Úcollectionsr   r   r   r   r   r	   r3   Útyping_extensionsr
   Ú
exceptionsr   r   ÚTypeVarr   r   Ú__annotations__Ú__all__r&   r+   r   r;   r   r   r   r   r   r   r   r   r   rV   r'   r%   ú<module>r‰      s-  ðÞ "ã 	Û Û Ý #ß DÕ Dã Ý 'ç Aà€A‡I�IˆcƒN€Ø%-¨b°$¨hÑ%7Ð ˜Ó 7ò€óó"ó+ð\ MOÐ ÐIÓ Nôð@ #ð9ØKð9à#ð9ð ð9ð 
ó	9ð. $(ðØ
ðØ ðà'óóó ñ4 Ò0°.ÐBRÔ SÙ Ú˜Ð(Kôð %)Ø"&ð5Øð5à!ð5ð  ð5ð ó	5ó*ó

ôr'   