a
    õ£Be•  ã                   @  sþ   U d Z ddlmZ ddlmZmZmZ ddlmZm	Z	m
Z
 g d¢ZG dd„ de
ƒZeddd	d	d	d	d	d	d	d
�	Zg d¢Zdddddddddddœ
Zded< ee ¡ ƒ eeƒ¡s°J ‚ee ¡ ƒeeƒ@ rÈJ ‚G dd„ ded�ZG dd„ deƒZG dd„ deƒZd S )!z#
The base classes for the styling.
é    )Úannotations)ÚABCMetaÚabstractmethodÚabstractproperty)ÚCallableÚHashableÚ
NamedTuple)ÚAttrsÚDEFAULT_ATTRSÚANSI_COLOR_NAMESÚANSI_COLOR_NAMES_ALIASESÚ	BaseStyleÚ
DummyStyleÚDynamicStylec                   @  sV   e Zd ZU ded< ded< ded< ded< ded< ded< ded	< ded
< ded< dS )r	   z
str | NoneÚcolorÚbgcolorzbool | NoneÚboldÚ	underlineÚstrikeÚitalicÚblinkÚreverseÚhiddenN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© r   r   ú]/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/prompt_toolkit/styles/base.pyr	      s   
r	   Ú F)	r   r   r   r   r   r   r   r   r   )ZansidefaultÚ	ansiblackÚansiredÚ	ansigreenÚ
ansiyellowÚansiblueÚansimagentaÚansicyanÚansigrayÚansibrightblackÚansibrightredÚansibrightgreenÚansibrightyellowÚansibrightblueÚansibrightmagentaÚansibrightcyanÚ	ansiwhiter(   r&   r.   r#   r%   r-   r'   r!   r"   r$   )
ZansidarkgrayZansitealZansiturquoiseZ	ansibrownZ
ansipurpleZansifuchsiaZansilightgrayZansidarkredZansidarkgreenZansidarkbluezdict[str, str]r   c                   @  sN   e Zd ZdZeefddddœdd„ƒZeddœd	d
„ƒZeddœdd„ƒZ	dS )r   z8
    Abstract base class for prompt_toolkit styles.
    Ústrr	   ©Ú	style_strÚdefaultÚreturnc                 C  s   dS )a  
        Return :class:`.Attrs` for the given style string.

        :param style_str: The style string. This can contain inline styling as
            well as classnames (e.g. "class:title").
        :param default: `Attrs` to be used if no styling was defined.
        Nr   ©Úselfr2   r3   r   r   r   Úget_attrs_for_style_strq   s    z!BaseStyle.get_attrs_for_style_strúlist[tuple[str, str]]©r4   c                 C  s   g S )z‡
        The list of style rules, used to create this style.
        (Required for `DynamicStyle` and `_MergedStyle` to work.)
        r   ©r6   r   r   r   Ústyle_rules}   s    zBaseStyle.style_rulesr   c                 C  s   dS )z¾
        Invalidation hash for the style. When this changes over time, the
        renderer knows that something in the style changed, and that everything
        has to be redrawn.
        Nr   r:   r   r   r   Úinvalidation_hash…   s    zBaseStyle.invalidation_hashN)
r   r   r   Ú__doc__r   r
   r7   r   r;   r<   r   r   r   r   r   l   s   ÿr   )Ú	metaclassc                   @  sF   e Zd ZdZefddddœdd„Zddœd	d
„Zeddœdd„ƒZdS )r   z.
    A style that doesn't style anything.
    r0   r	   r1   c                 C  s   |S ©Nr   r5   r   r   r   r7   “   s    z"DummyStyle.get_attrs_for_style_strr   r9   c                 C  s   dS )Né   r   r:   r   r   r   r<   ˜   s    zDummyStyle.invalidation_hashr8   c                 C  s   g S r?   r   r:   r   r   r   r;   ›   s    zDummyStyle.style_rulesN)	r   r   r   r=   r
   r7   r<   Úpropertyr;   r   r   r   r   r   Ž   s   ÿr   c                   @  sT   e Zd ZdZddœdd„Zefddddœd	d
„Zddœdd„Zeddœdd„ƒZ	dS )r   z‹
    Style class that can dynamically returns an other Style.

    :param get_style: Callable that returns a :class:`.Style` instance.
    zCallable[[], BaseStyle | None])Ú	get_stylec                 C  s   || _ tƒ | _d S r?   )rB   r   Ú_dummy)r6   rB   r   r   r   Ú__init__§   s    zDynamicStyle.__init__r0   r	   r1   c                 C  s   |   ¡ p| j}| ||¡S r?   )rB   rC   r7   )r6   r2   r3   Ústyler   r   r   r7   «   s    z$DynamicStyle.get_attrs_for_style_strr   r9   c                 C  s   |   ¡ p| j ¡ S r?   )rB   rC   r<   r:   r   r   r   r<   ²   s    zDynamicStyle.invalidation_hashr8   c                 C  s   |   ¡ p| jjS r?   )rB   rC   r;   r:   r   r   r   r;   µ   s    zDynamicStyle.style_rulesN)
r   r   r   r=   rD   r
   r7   r<   rA   r;   r   r   r   r   r       s   ÿr   N)r=   Ú
__future__r   Úabcr   r   r   Útypingr   r   r   Ú__all__r	   r
   r   r   r   ÚsetÚvaluesÚissubsetÚkeysr   r   r   r   r   r   r   Ú<module>   sB   ÷ö"