ó
    ‰*£hè  ã                  ó‚   • S 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Jr   " S
 S\
5      rg)z<Styles object, container for all objects in the styles part.é    )Úannotations)Úwarn)ÚWD_STYLE_TYPE)Ú	CT_Styles)ÚElementProxy)Ú	BabelFish)ÚLatentStyles)Ú	BaseStyleÚStyleFactoryc                  óž   ^ • \ rS rSrSrSU 4S jjrS rSS jrS rS r	SS jr
SS	 jrSS
 jrS r\S 5       rSS jrSS jrSS jrSrU =r$ )ÚStylesé   z¶Provides access to the styles defined in a document.

Accessed using the :attr:`.Document.styles` property. Supports ``len()``, iteration,
and dictionary-style access by style name.
c                ó0   >• [         TU ]  U5        Xl        g ©N)ÚsuperÚ__init__Ú_element)ÚselfÚstylesÚ	__class__s     €ÚO/home/mande/repo/quber/.venv/lib/python3.13/site-packages/docx/styles/styles.pyr   ÚStyles.__init__   s   ø€ Ü‰Ñ˜Ô Ø�ó    c                ó‚   ^• [         R                  " U5      m[        U4S jU R                  R                   5       5      $ )z$Enables `in` operator on style name.c              3  ó@   >#   • U  H  oR                   T:H  v •  M     g 7fr   )Úname_val)Ú.0ÚstyleÚinternal_names     €r   Ú	<genexpr>Ú&Styles.__contains__.<locals>.<genexpr>   s   øé € ÐXÒ@W°u—>‘> ]Ö2Ò@Wùs   ƒ)r   Úui2internalÚanyr   Ú	style_lst)r   Únamer   s     @r   Ú__contains__ÚStyles.__contains__   s.   ø€ ä!×-Ò-¨dÓ3ˆÜÔXÀÇÁ×@WÒ@WÓXÓXÐXr   c                ó  • U R                   R                  [        R                  " U5      5      nUb  [	        U5      $ U R                   R                  U5      nUb  Sn[        U[        SS9  [	        U5      $ [        SU-  5      e)z‘Enables dictionary-style access by UI name.

Lookup by style id is deprecated, triggers a warning, and will be removed in a
near-future release.
zFstyle lookup by style_id is deprecated. Use style name as key instead.é   )Ú
stacklevelzno style with name '%s')	r   Úget_by_namer   r"   r   Ú	get_by_idr   ÚUserWarningÚKeyError)r   ÚkeyÚ	style_elmÚmsgs       r   Ú__getitem__ÚStyles.__getitem__   s{   € ð —M‘M×-Ñ-¬i×.CÒ.CÀCÓ.HÓIˆ	ØÑ Ü 	Ó*Ð*à—M‘M×+Ñ+¨CÓ0ˆ	ØÑ ØZˆCÜ�”k¨aÒ0Ü 	Ó*Ð*äÐ0°3Ñ6Ó7Ð7r   c                ó<   • S U R                   R                   5       $ )Nc              3  ó8   #   • U  H  n[        U5      v •  M     g 7fr   )r   )r   r   s     r   r    Ú"Styles.__iter__.<locals>.<genexpr>2   s   é € ÐIÒ1H¨”˜U×#Ð#Ò1Hùs   ‚)r   r$   ©r   s    r   Ú__iter__ÚStyles.__iter__1   s   € ÙI°·±×1HÒ1HÓIÐIr   c                ó@   • [        U R                  R                  5      $ r   )Úlenr   r$   r7   s    r   Ú__len__ÚStyles.__len__4   s   € Ü�4—=‘=×*Ñ*Ó+Ð+r   c                ó¢   • [         R                  " U5      nX@;   a  [        SU-  5      eU R                  R	                  XBU5      n[        U5      $ )z¡Return a newly added style object of `style_type` and identified by `name`.

A builtin style can be defined by passing True for the optional `builtin`
argument.
z$document already contains style '%s')r   r"   Ú
ValueErrorr   Úadd_style_of_typer   )r   r%   Ú
style_typeÚbuiltinÚ
style_namer   s         r   Ú	add_styleÚStyles.add_style7   sL   € ô ×*Ò*¨4Ó0ˆ
ØÓÜÐCÀdÑJÓKÐKØ—‘×/Ñ/°
ÈÓPˆÜ˜EÓ"Ð"r   c                óV   • U R                   R                  U5      nUc  g[        U5      $ )zhReturn the default style for `style_type` or |None| if no default is defined
for that type (not common).N)r   Údefault_forr   )r   rA   r   s      r   ÚdefaultÚStyles.defaultC   s+   € ð —‘×)Ñ)¨*Ó5ˆØ‰=ØÜ˜EÓ"Ð"r   c                óL   • Uc  U R                  U5      $ U R                  X5      $ )z¿Return the style of `style_type` matching `style_id`.

Returns the default for `style_type` if `style_id` is not found or is |None|, or
if the style having `style_id` is not of `style_type`.
)rH   Ú
_get_by_id)r   Ústyle_idrA   s      r   r,   ÚStyles.get_by_idK   s(   € ð ÑØ—<‘< 
Ó+Ð+Ø�‰˜xÓ4Ð4r   c                óx   • Uc  g[        U[        5      (       a  U R                  X5      $ U R                  X5      $ )aJ  Return the id of the style corresponding to `style_or_name`, or |None| if
`style_or_name` is |None|.

If `style_or_name` is not a style object, the style is looked up using
`style_or_name` as a style name, raising |ValueError| if no style with that name
is defined. Raises |ValueError| if the target style is not of `style_type`.
N)Ú
isinstancer
   Ú_get_style_id_from_styleÚ_get_style_id_from_name)r   Ústyle_or_namerA   s      r   Úget_style_idÚStyles.get_style_idU   s<   € ð Ñ ØÜ˜¤y×1Ñ1Ø×0Ñ0°ÓKÐKà×/Ñ/°ÓJÐJr   c                óH   • [        U R                  R                  5       5      $ )zÍA |LatentStyles| object providing access to the default behaviors for latent
styles and the collection of |_LatentStyle| objects that define overrides of
those defaults for a particular named latent style.)r	   r   Úget_or_add_latentStylesr7   s    r   Úlatent_stylesÚStyles.latent_stylesd   s   € ô
 ˜DŸM™M×AÑAÓCÓDÐDr   c                ó¨   • U(       a  U R                   R                  U5      OSnUb  UR                  U:w  a  U R                  U5      $ [	        U5      $ )z±Return the style of `style_type` matching `style_id`.

Returns the default for `style_type` if `style_id` is not found or if the style
having `style_id` is not of `style_type`.
N)r   r,   ÚtyperH   r   )r   rL   rA   r   s       r   rK   ÚStyles._get_by_idk   sF   € ö 6>�—‘×'Ñ'¨Ô1À4ˆØ‰=˜EŸJ™J¨*Ó4Ø—<‘< 
Ó+Ð+Ü˜EÓ"Ð"r   c                ó*   • U R                  X   U5      $ )zóReturn the id of the style of `style_type` corresponding to `style_name`.

Returns |None| if that style is the default style for `style_type`. Raises
|ValueError| if the named style is not found in the document or does not match
`style_type`.
)rP   )r   rC   rA   s      r   rQ   ÚStyles._get_style_id_from_namev   s   € ð ×,Ñ,¨TÑ-=¸zÓJÐJr   c                óž   • UR                   U:w  a  [        SUR                   < SU< 35      eXR                  U5      :X  a  gUR                  $ )z{Id of `style`, or |None| if it is the default style of `style_type`.

Raises |ValueError| if style is not of `style_type`.
zassigned style is type z, need type N)rZ   r?   rH   rL   )r   r   rA   s      r   rP   ÚStyles._get_style_id_from_style   sA   € ð
 �:‰:˜Ó#ÝÈ%Ï*Ì*ÒV`ÐaÓbÐbØ—L‘L Ó,Ó,ØØ�~‰~Ðr   )r   )r   r   )r/   Ústr)F)rA   r   )rL   ú
str | NonerA   r   )rC   r`   rA   r   Úreturnra   )r   r
   rA   r   rb   ra   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r&   r2   r8   r<   rD   rH   r,   rS   ÚpropertyrW   rK   rQ   rP   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      sc   ø† ñ÷òYô
8ò$Jò,ô
#ô#ô5òKð ñEó ðEô	#ôK÷	ò 	r   r   N)rg   Ú
__future__r   Úwarningsr   Údocx.enum.styler   Údocx.oxml.stylesr   Údocx.sharedr   Údocx.stylesr   Údocx.styles.latentr	   Údocx.styles.styler
   r   r   © r   r   Ú<module>rt      s.   ðÙ Bå "å å )Ý &Ý $Ý !Ý +ß 5ôyˆ\õ yr   