
    ,jiK                        S SK Jr  S SK Jr  S SK Jr  S SK Jr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  SS\SSSS4S\S\S\S\S\\   S\S\\   S\\   S\S\4S jjrg)    )Any)List)Optional)Tuple)Document)Lexer)SimpleLexer)PromptSession)Style)DEFAULT_QUESTION_PREFIX)INSTRUCTION_MULTILINE)build_validator)Question)merge_styles_default NFmessagedefaultvalidateqmarkstyle	multilineinstructionlexerkwargsreturnc                 Z  ^ ^^ [        U/5      n	U=(       d    [        S5      n[        U5      n
Tc  U(       a  [        mS[        [
        [        [        4      4UU U4S jjn[        U4U	U
UUS.UD6nUR                  R                  [        U5      5        [        UR                  5      $ )aO  Prompt the user to enter a free text message.

This question type can be used to prompt the user for some text input.

Example:
    >>> import questionary
    >>> questionary.text("What's your first name?").ask()
    ? What's your first name? Tom
    'Tom'

.. image:: ../images/text.gif

This is just a really basic example, the prompt can be customised using the
parameters.

Args:
    message: Question text.

    default: Default value will be returned if the user just hits
             enter.

    validate: Require the entered value to pass a validation. The
              value can not be submitted until the validator accepts
              it (e.g. to check minimum password length).

              This can either be a function accepting the input and
              returning a boolean, or an class reference to a
              subclass of the prompt toolkit Validator class.

    qmark: Question prefix displayed in front of the question.
           By default this is a ``?``.

    style: A custom color and style for the question parts. You can
           configure colors as well as font types for different elements.

    multiline: If ``True``, multiline input will be enabled.

    instruction: Write instructions for the user if needed. If ``None``
                 and ``multiline=True``, some instructions will appear.

    lexer: Supply a valid lexer to style the answer. Leave empty to
           use a simple one by default.

    kwargs: Additional arguments, they will be passed to prompt toolkit.

Returns:
    :class:`Question`: Question instance, ready to be prompted (using ``.ask()``).
zclass:answerr   c                     > ST4SSR                  T5      4/n T(       a"  U R                  SSR                  T5      45        U $ )Nzclass:qmarkzclass:questionz {} zclass:instruction)formatappend)resultr   r   r   s    R/home/james-whalen/.local/lib/python3.13/site-packages/questionary/prompts/text.pyget_prompt_tokenstext.<locals>.get_prompt_tokensU   sD     %(+;V]]7=S*TUMM.k0JKL    )r   	validatorr   r   )r   r	   r   r   r   r   strr
   default_bufferresetr   r   app)r   r   r   r   r   r   r   r   r   merged_styler%   r"   ps   `  `  `      r!   textr,      s    v (0L0[0E)Iy+tE#s(O4   % A 8G,-AEE?r$   )typingr   r   r   r   prompt_toolkit.documentr   prompt_toolkit.lexersr   r	   prompt_toolkit.shortcuts.promptr
   prompt_toolkit.stylesr   questionary.constantsr   r   questionary.prompts.commonr   questionary.questionr   questionary.stylesr   r&   boolr,    r$   r!   <module>r8      s        , ' - 9 ' 9 7 6 ) 3
 (!!%!RRR R 	R
 E?R R #R E?R R Rr$   