ó
    ˆ*£h  ã                  ób   • S r SSKJr  SSKJr   " S S\5      r " S S\5      r " S S	\5      rg
)ah  Category-related objects.

The |category.Categories| object is returned by ``Plot.categories`` and contains zero or
more |category.Category| objects, each representing one of the category labels
associated with the plot. Categories can be hierarchical, so there are members allowing
discovery of the depth of that hierarchy and providing means to navigate it.
é    )Úannotations)ÚSequencec                  óz   ^ • \ rS rSrSrU 4S jrS rS rS r\	S 5       r
\	S 5       r\	S	 5       rS
 rS rSrU =r$ )Ú
Categoriesé   z›
A sequence of |category.Category| objects, each representing a category
label on the chart. Provides properties for dealing with hierarchical
categories.
c                ó6   >• [         [        U ]  5         Xl        g ©N)Úsuperr   Ú__init__Ú_xChart)ÚselfÚxChartÚ	__class__s     €ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pptx/chart/category.pyr   ÚCategories.__init__   s   ø€ ÜŒj˜$Ñ(Ô*Ø�ó    c                óJ   • U R                   R                  U   n[        X!5      $ r	   )r   Úcat_ptsÚCategory)r   ÚidxÚpts      r   Ú__getitem__ÚCategories.__getitem__   s!   € Ø�\‰\×!Ñ! #Ñ&ˆÜ˜Ó Ð r   c              #  óz   #   • U R                   R                  n[        U5       H  u  p#[        X25      v •  M     g 7fr	   )r   r   Ú	enumerater   )r   r   r   r   s       r   Ú__iter__ÚCategories.__iter__   s0   é € Ø—,‘,×&Ñ&ˆÜ  Ö)‰GˆCÜ˜2Ó#Ô#ò *ùs   ‚9;c                ó.   • U R                   R                  $ r	   )r   Úcat_pt_count©r   s    r   Ú__len__ÚCategories.__len__"   s   € ð
 �|‰|×(Ñ(Ð(r   c                ó|   • U R                   R                  nUc  gUR                  c  g[        UR                  5      $ )z×
Return an integer representing the number of hierarchical levels in
this category collection. Returns 1 for non-hierarchical categories
and 0 if no categories are present (generally meaning no series are
present).
r   é   )r   ÚcatÚmultiLvlStrRefÚlenÚlvls)r   r%   s     r   ÚdepthÚCategories.depth)   s8   € ð �l‰l×ÑˆØ‰;ØØ×ÑÑ%ØÜ�3—8‘8‹}Ðr   c                ól  • U R                   R                  nUc  gUR                  c&  [        U  Vs/ s H  o"R                  4PM     sn5      $ [        U R                  5        VVs/ s H1  n[        [        U5       Vs/ s H  o"R                  PM     sn5      PM3     snn5      $ s  snf s  snf s  snnf )a¡  
Return a sequence of tuples, each containing the flattened hierarchy
of category labels for a leaf category. Each tuple is in parent ->
child order, e.g. ``('US', 'CA', 'San Francisco')``, with the leaf
category appearing last. If this categories collection is
non-hierarchical, each tuple will contain only a leaf category label.
If the plot has no series (and therefore no categories), an empty
tuple is returned.
© )r   r%   r&   ÚtupleÚlabelÚ_iter_flattened_categoriesÚreversed)r   r%   ÚcategoryÚflat_cats       r   Úflattened_labelsÚCategories.flattened_labels8   s§   € ð �l‰l×ÑˆØ‰;Øà×ÑÑ%Ü¹DÓAºD°Ÿ>™>Ó+¹DÑAÓBÐBäð !%× ?Ñ ?Ô Aôâ A�Hô ´h¸xÔ6HÓIÒ6H¨(—~”~Ñ6HÑIÖJÙ Aòó
ð 	
ùò Bùò Jùós   ±B&Á&B0
Á>B+ÂB0
Â+B0
c                óŽ   • U R                   R                  nUc  / $ UR                   Vs/ s H  n[        U5      PM     sn$ s  snf )ak  
Return a sequence of |CategoryLevel| objects representing the
hierarchy of this category collection. The sequence is empty when the
category collection is not hierarchical, that is, contains only
leaf-level categories. The levels are ordered from the leaf level to
the root level; so the first level will contain the same categories
as this category collection.
)r   r%   r(   ÚCategoryLevel)r   r%   Úlvls      r   ÚlevelsÚCategories.levelsQ   s>   € ð �l‰l×ÑˆØ‰;ØˆIØ.1¯hªhÓ7ªh s”˜cÖ"©hÑ7Ð7ùÒ7s   ªAc              #  ó‚   #   • U R                   nU(       d  gUS   USS p2U H  nU R                  U4U5      v •  M     g7f)aG  
Generate a ``tuple`` object for each leaf category in this
collection, containing the leaf category followed by its "parent"
categories, e.g. ``('San Francisco', 'CA', 'USA'). Each tuple will be
the same length as the number of levels (excepting certain edge
cases which I believe always indicate a chart construction error).
Nr   r$   )r8   Ú
_parentage)r   r8   Ú
leaf_levelÚremaining_levelsr1   s        r   r/   Ú%Categories._iter_flattened_categories`   sF   é € ð —‘ˆÞØØ'-¨a¡y°&¸¸°*Ð$Û"ˆHØ—/‘/ 8 +Ð/?Ó@Ô@ò #ùs   ‚=?c                ó  • U(       d  [        U5      $ US   (       d  [        U5      $ US   USS pCUS   nUS   nU H!  nUR                  UR                  :”  a    OUnM#     [        U5      U4-   nU R                  X„5      $ )aq  
Return a tuple formed by recursively concatenating *categories* with
its next ancestor from *levels*. The idx value of the first category
in *categories* determines parentage in all levels. The returned
sequence is in child -> parent order. A parent category is the
Category object in a next level having the maximum idx value not
exceeding that of the leaf category.
r   r$   N)r-   r   r;   )	r   Ú
categoriesr8   Úparent_levelr=   Ú	leaf_nodeÚparentr1   Úextended_categoriess	            r   r;   ÚCategories._parentageo   s’   € ö Ü˜Ó$Ð$ð �a�yÜ˜Ó$Ð$à)/°©°F¸1¸2°JÐ&Ø˜q‘Mˆ	ð
 ˜a‘ˆÛ$ˆHØ�|‰|˜iŸm™mÓ+ÙØŠFñ %ô
 $ JÓ/°6°)Ñ;ÐØ�‰Ð2ÓEÐEr   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r!   Úpropertyr)   r3   r8   r/   r;   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      sj   ø† ñõò!ò$ò
)ð ñó ðð ñ
ó ð
ð0 ñ8ó ð8òA÷Fð Fr   r   c                  óH   • \ rS rSrSrS rS	S jr\S 5       r\S 5       r	Sr
g)
r   é‘   z“
An extension of `str` that provides the category label as its string
value, and additional attributes representing other aspects of the
category.
c                ób   • Uc  SOUR                   R                  n[        R                  X5      $ )NÚ )ÚvÚtextÚstrÚ__new__)Úclsr   ÚargsÚcategory_labels       r   rU   ÚCategory.__new__˜   s$   € Ø!™z™¨r¯t©t¯y©yˆÜ�{‰{˜3Ó/Ð/r   Nc                ó,   • U=U l         U l        X l        g)zª
*idx* is a required attribute of a c:pt element, but must be
specified when pt is None, as when a "placeholder" category is
created to represent a missing c:pt element.
N)Ú_elementÚ_ptÚ_idx)r   r   r   s      r   r   ÚCategory.__init__œ   s   € ð $&Ð%ˆŒ˜œØ�	r   c                ó`   • U R                   c  U R                  $ U R                   R                  $ )zé
Return an integer representing the index reference of this category.
For a leaf node, the index identifies the category. For a parent (or
other ancestor) category, the index specifies the first leaf category
that ancestor encloses.
)r\   r]   r   r    s    r   r   ÚCategory.idx¥   s&   € ð �8‰8ÑØ—9‘9ÐØ�x‰x�|‰|Ðr   c                ó   • [        U 5      $ )z0
Return the label of this category as a string.
)rT   r    s    r   r.   ÚCategory.label±   s   € ô
 �4‹yÐr   )r[   r]   r\   r	   )rF   rG   rH   rI   rJ   rU   r   rK   r   r.   rL   r,   r   r   r   r   ‘   s9   † ñò0ôð ñ	ó ð	ð ñó ór   r   c                  ó*   • \ rS rSrSrS rS rS rSrg)r6   é¹   a  
A sequence of |category.Category| objects representing a single level in
a hierarchical category collection. This object is only used when the
categories are hierarchical, meaning they have more than one level and
higher level categories group those at lower levels.
c                ó    • U=U l         U l        g r	   ©r[   Ú_lvl)r   r7   s     r   r   ÚCategoryLevel.__init__Á   s   € Ø$'Ð'ˆŒ˜�	r   c                óF   • [        U R                  R                  U   5      $ r	   )r   rg   Úpt_lst)r   Úoffsets     r   r   ÚCategoryLevel.__getitem__Ä   s   € Ü˜Ÿ	™	×(Ñ(¨Ñ0Ó1Ð1r   c                ó@   • [        U R                  R                  5      $ r	   )r'   rg   rj   r    s    r   r!   ÚCategoryLevel.__len__Ç   s   € Ü�4—9‘9×#Ñ#Ó$Ð$r   rf   N)	rF   rG   rH   rI   rJ   r   r   r!   rL   r,   r   r   r6   r6   ¹   s   † ñò(ò2õ%r   r6   N)	rJ   Ú
__future__r   Úcollections.abcr   r   rT   r   r6   r,   r   r   Ú<module>rq      s<   ðñõ #å $ô@F�ô @FôF%ˆsô %ôP%�Hõ %r   