
    [i
                       d Z ddlmZ ddlZddlmZ  ej                  d      Z ej                  d      Z ej                  d      Z	 ej                  d      Z
 ej                  d	      Z ej                  d
      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Zi dedede	de
dededededededed ed!ed"ed#ed$eZd&d%Zy)'a  
Format a pretty string of a `SoupSieve` object for easy debugging.

This won't necessarily support all types and such, and definitely
not support custom outputs.

It is mainly geared towards our types as the `SelectorList`
object is a beast to look at without some indentation and newlines.
The format and various output types is fairly known (though it
hasn't been tested extensively to make sure we aren't missing corners).

Example:
-------
```
>>> import soupsieve as sv
>>> sv.compile('this > that.class[name=value]').selectors.pretty()
SelectorList(
    selectors=(
        Selector(
            tag=SelectorTag(
                name='that',
                prefix=None),
            ids=(),
            classes=(
                'class',
                ),
            attributes=(
                SelectorAttribute(
                    attribute='name',
                    prefix='',
                    pattern=re.compile(
                        '^value$'),
                    xml_type_pattern=None),
                ),
            nth=(),
            selectors=(),
            relation=SelectorList(
                selectors=(
                    Selector(
                        tag=SelectorTag(
                            name='this',
                            prefix=None),
                        ids=(),
                        classes=(),
                        attributes=(),
                        nth=(),
                        selectors=(),
                        relation=SelectorList(
                            selectors=(),
                            is_not=False,
                            is_html=False),
                        rel_type='>',
                        contains=(),
                        lang=(),
                        flags=0),
                    ),
                is_not=False,
                is_html=False),
            rel_type=None,
            contains=(),
            lang=(),
            flags=0),
        ),
    is_not=False,
    is_html=False)
```

    )annotationsN)Anyz(?i)[a-z_][_a-z\d.]+\(z(?i)[_a-z][_a-z\d]+=z\(\)|\[\]|\{\}z\[z\{z\(z\]z\}z\)z\d+z(?i)[_a-z][_a-z\d.]+z"(?:\\.|[^"\\])*"z'(?:\\.|[^'\\])*'z	\s*(,)\s*z	\s*(:)\s*z
\s*(\|)\s*classparamemptylstrtdstrttstrtlenddendtendsqstrsepdseppsepintkworddqstrc                >   t        |       }d}t        |      dz
  }d}g }||k  rhd}t        j                         D ],  \  }}|j	                  ||      }|s|}	|j                  d      }|	dv r.|dz  }|j                  |j                  d       dd|z          n|	dv r!|j                  |j                  d             n|	d	v r&|dz  }|j                  |j                  d             n}|	d
v r)|j                  |j                  d       dd|z          nP|	dv r$|j                  |j                  d       d       n(|	dv r$|j                  d|j                  d       d        n ||j                  ||          |dz  }||k  rhdj                  |      S )z%Make the object output string pretty.r      N)r   r   r	   r
      
 )r   r   r   r   r   r   )r   r   r   )r   )r   r    )	strlenTOKENSitemsmatchendappendgroupjoin)
objselindexr    indentoutputmkvnames
             I/mnt/data/GridWatch/venv/lib/python3.12/site-packages/soupsieve/pretty.pyprettyr.   n   s    c(CE
c(Q,CFF
3,LLN 	DAqU#Aa??aKFMMQWWQZL3<."ABQQMM!''!*-55aKFMM!''!*-X%MMQWWQZL3<."ABY&MMQWWQZL"23f%MMAaggaj\"34)	. 9MM#e*%QJE7 3,: 776?    )r$   r   returnr   )__doc__
__future__r   retypingr   compileRE_CLASSRE_PARAMRE_EMPTYRE_LSTRTRE_DSTRTRE_TSTRTRE_LENDRE_DENDRE_TENDRE_INTRE_KWORDRE_DQSTRRE_SQSTRRE_SEPRE_DSEPRE_PSEPr   r.    r/   r-   <module>rG      s  CH # 	 2::/02::-.2::'(2::e2::e2::e
"**U

"**U

"**U
	F	2::-.2::*+2::*+	L	!
"**\
"
"**]
#
X
X
 X
 X	

 X
 X
 G
 G
 G
 X
 
6
 G
 G
 
6
 X
  X!
(&r/   