
    ge                     j    d Z ddlmZ ddlmZmZ ddlmZmZ ddl	m
Z
 ddlmZ  G d d	e          Zd
S )zContains the DOMWidget class    )Unicode   )Widgetwidget_serialization)InstanceDict
TypedTuple)Layout)Stylec                        e Zd ZdZ ed                              d          Z e e            d                              d          Z  e	e
          j        dddieZd Zd	 Z fd
Z xZS )	DOMWidgetz(Widget that can be inserted into the DOMDOMWidgetModelT)syncz)CSS classes applied to widget DOM element)traithelpr   c                 R    || j         vrt          | j                   |gz   | _         | S )z{
        Adds a class to the top level element of the widget.

        Doesn't add the class if it already exists.
        )_dom_classeslistself	classNames     <lib/python3.11/site-packages/ipywidgets/widgets/domwidget.py	add_classzDOMWidget.add_class   s1     D--- $T%6 7 79+ ED    c                 J    | j         v rfd| j         D             | _         | S )z
        Removes a class from the top level element of the widget.

        Doesn't remove the class if it doesn't exist.
        c                      g | ]
}|k    |S  r   ).0cr   s     r   
<listcomp>z*DOMWidget.remove_class.<locals>.<listcomp>%   s     P P Pqir   )r   r   s    `r   remove_classzDOMWidget.remove_class   s7     ))) P P P PD,= P P PDr   c              #      K   t          t          |                                           D ]=}|dk    r1t          | |          }t	          |          d|j        j        z  k    r9|V  >| j        rdV  d S d S )Nlayoutz%s()r   )superr   
_repr_keysgetattrrepr	__class____name__r   )r   keyvaluer'   s      r   r$   zDOMWidget._repr_keys(   s      D))4466 	 	Chc**;;&5?+C"CCCIIII 	!      	! 	!r   r   )r(   
__module____qualname____doc__r   tag_model_namer   r   r   r	   r   r"   r   r    r$   __classcell__)r'   s   @r   r   r      s        22'*++//T/::K:GGII4_```ddjndooL%\\&!!%HH4H3GHHF    
! 
! 
! 
! 
! 
! 
! 
! 
!r   r   N)r-   	traitletsr   widgetr   r   trait_typesr   r   widget_layoutr	   widget_styler
   r   r   r   r   <module>r6      s    # "       0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ! ! ! ! ! !      %! %! %! %! %! %! %! %! %! %!r   