Ë
    :vžjl  ã                   óÀ   — d Z ddlmZ ddlmZ ddl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mZmZmZmZmZ e G d
„ dee
«      «       Ze G d„ dee
«      «       Zy)z­Button class.

Represents a button in the frontend using a widget.  Allows user to listen for
click events on the button and trigger backend code when the clicks are fired.
é   )Údeprecation)Ú	DOMWidget)ÚCallbackDispatcherÚregisterÚwidget_serialization)Ú
CoreWidget)ÚStyle)ÚColorÚInstanceDicté    )ÚUnicodeÚBoolÚCaselessStrEnumÚInstanceÚvalidateÚdefaultc                   óð  — e Zd ZdZ ed«      j                  d¬«      Z eddd¬«      j                  d¬«      Z eddd¬«      j                  d¬«      Z	 eddd	¬«      j                  d¬«      Z
 eddd
¬«      j                  d¬«      Z eddd¬«      j                  d¬«      Z eddd¬«      j                  d¬«      Z eddd¬«      j                  d¬«      Z eddd¬«      j                  d¬«      Zy)ÚButtonStylezButton style widget.ÚButtonStyleModelT©ÚsyncNzColor of the button)Ú
allow_noneÚhelpzButton text font family.zButton text font size.zButton text font style.zButton text font variant.zButton text font weight.zButton text color.zButton text decoration.)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚtagÚ_model_namer
   Úbutton_colorÚfont_familyÚ	font_sizeÚ
font_styleÚfont_variantÚfont_weightÚ
text_colorÚtext_decoration© ó    úq/workspace/moltex-experiments/.pixi/envs/default/lib/python3.12/site-packages/ipywidgets/widgets/widget_button.pyr   r      s  „ áÙÐ,Ó-×1Ñ1°tÐ1Ó<€KÙ˜¨$Ð5JÔK×OÑOÐUYÐOÓZ€LÙ˜$¨4Ð6PÔQ×UÑUÐ[_ÐUÓ`€KÙ˜¨Ð4LÔM×QÑQÐW[ÐQÓ\€IÙ˜¨$Ð5NÔO×SÑSÐY]ÐSÓ^€JÙ˜4¨DÐ7RÔS×WÑWÐ]aÐWÓb€LÙ˜$¨4Ð6PÔQ×UÑUÐ[_ÐUÓ`€KÙ˜¨$Ð5IÔJ×NÑNÐTXÐNÓY€JÙ˜d¨tÐ:SÔT×XÑXÐ^bÐXÓc�Or)   r   c                   óº  ‡ — e Zd ZdZ ed«      j                  d¬«      Z ed«      j                  d¬«      Z ed¬«      j                  d¬«      Z e	dd	¬«      j                  d¬«      Z
 ed
d¬«      j                  d¬«      Z eg d¢d
d¬«      j                  d¬«      Z  ee«      j
                  dddie¤ŽZˆ fd„Z ed«      d„ «       Zdd„Zd„ Zd„ Zˆ xZS )ÚButtonaŠ  Button widget.

    This widget has an `on_click` method that allows you to listen for the
    user clicking on the button.  The click event itself is stateless.

    Parameters
    ----------
    description: str
       description displayed on the button
    icon: str
       font-awesome icon names, without the 'fa-' prefix
    disabled: bool
       whether user interaction is enabled
    Ú
ButtonViewTr   ÚButtonModelzButton label.)r   FzEnable or disable user changes.Ú z2Font-awesome icon names, without the 'fa-' prefix.)ÚprimaryÚsuccessÚinfoÚwarningÚdangerr/   z(Use a predefined styling for the button.)ÚvaluesÚdefault_valuer   r   c                 óx   •— t        ‰| �  di |¤Ž t        «       | _        | j	                  | j
                  «       y )Nr(   )ÚsuperÚ__init__r   Ú_click_handlersÚon_msgÚ_handle_button_msg)ÚselfÚkwargsÚ	__class__s     €r*   r9   zButton.__init__?   s0   ø€ Ü‰ÑÑ"˜6Ò"Ü1Ó3ˆÔØ�‰�D×+Ñ+Õ,r)   Úiconc                 óZ   — |d   }d|v r!t        dg d¢¬«       |j                  dd«      }|S )zStrip 'fa-' if necessary'Úvaluezfa-z}icons names no longer need 'fa-', just use the class names themselves (for example, 'gear spin' instead of 'fa-gear fa-spin'))zipywidgets/widgets/ztraitlets/traitlets.pyz/contextlib.py)Úinternalr/   )r   Úreplace)r=   ÚproposalrB   s      r*   Ú_validate_iconzButton._validate_iconD   s>   € ð ˜Ñ!ˆØ�E‰>Üð jâXõZð —M‘M %¨Ó,ˆEØˆr)   c                 ó>   — | j                   j                  ||¬«       y)a9  Register a callback to execute when the button is clicked.

        The callback will be called with one argument, the clicked button
        widget instance.

        Parameters
        ----------
        remove: bool (optional)
            Set to true to remove the callback from the list of callbacks.
        )ÚremoveN)r:   Úregister_callback)r=   ÚcallbackrH   s      r*   Úon_clickzButton.on_clickO   s   € ð 	×Ñ×.Ñ.¨xÀÐ.ÕGr)   c                 ó&   — | j                  | «       y)z�Programmatically trigger a click event.

        This will call the callbacks registered to the clicked button
        widget instance.
        N)r:   )r=   s    r*   ÚclickzButton.click\   s   € ð 	×Ñ˜TÕ"r)   c                 óP   — |j                  dd«      dk(  r| j                  «        yy)z†Handle a msg from the front-end.

        Parameters
        ----------
        content: dict
            Content of the msg.
        Úeventr/   rM   N)ÚgetrM   )r=   Ú_ÚcontentÚbufferss       r*   r<   zButton._handle_button_msgd   s%   € ð �;‰;�w Ó# wÒ.Ø�J‰J�Lð /r)   r(   )F)r   r   r   r   r   r   Ú
_view_namer   Údescriptionr   Údisabledr@   r   Úbutton_styler   r   r   Ústyler9   r   rF   rK   rM   r<   Ú__classcell__)r?   s   @r*   r,   r,   "   sú   ø„ ññ ˜Ó&×*Ñ*°Ð*Ó5€JÙ˜-Ó(×,Ñ,°$Ð,Ó7€Ká˜Ô/×3Ñ3¸Ð3Ó>€KÙ�EÐ AÔB×FÑFÈDÐFÓQ€HÙ�2ÐPÔQ×UÑUÐ[_ÐUÓ`€Dá"ÚFÐVXØ;ô=ç=@¹SÀd¸S»^ð ð *‰L˜Ó%×)Ñ)ÑL¨tÐLÐ7KÑL€Eô-ñ
 ˆfÓñó ðóHò#ö	r)   r,   N)r   Úutilsr   Ú	domwidgetr   Úwidgetr   r   r   Úwidget_corer   Úwidget_styler	   Útrait_typesr
   r   Ú	traitletsr   r   r   r   r   r   r   r,   r(   r)   r*   Ú<module>ra      sg   ðñõ Ý  ß FÑ FÝ #Ý ß ,ç Q× Qð 
ô
d�%˜ó 
dó 
ð
dð 
ôJˆY˜
ó Jó 
ñJr)   