__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

̮�g4����SrSSKJr SSKrSSKJr SSKJrJrJ	r	 SSK
JrJrJ
r
JrJrJrJrJrJrJrJrJrJrJrJrJrJr \(aSSKJr "SS	\\5r"S
S5r \RB"S5RDr#\RB"S
5RHr%\RB"S5RHr&"SS5r'"SS\'5r(g)z�
cssselect.xpath
===============

Translation of parsed CSS selectors to XPath expressions.


:copyright: (c) 2007-2012 Ian Bicking and contributors.
See AUTHORS for more details.
:license: BSD, see LICENSE for more details.

�)�annotationsN)�Callable)�
TYPE_CHECKING�Optional�cast)�Attrib�Class�CombinedSelector�Element�Function�Hash�Matching�Negation�Pseudo�
PseudoElement�Relation�Selector�
SelectorError�SpecificityAdjustment�Tree�parse�parse_series)�Selfc��\rSrSrSrSrg)�ExpressionError�-z3Unknown or unsupported selector (eg. pseudo-class).�N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r��1/usr/lib/python3/dist-packages/cssselect/xpath.pyrr-s��=r$rc��\rSrSrSSSjjrS
SjrS
SjrSSSjjrSSjrSSjr	SSS	jjr
S
rg)�	XPathExpr�4c�(�XlX lX0lg�N)�path�element�	condition)�selfr+r,r-�star_prefixs     r%�__init__�XPathExpr.__init__5s���	���"�r$c��[UR5[UR5-nUR(aUSURS3-
nU$�N�[�]��strr+r,r-)r.r+s  r%�__str__�XPathExpr.__str__@sA���4�9�9�~��D�L�L� 1�1���>�>��a����'�q�)�)�D��r$c�:�URRSUS3$r3)�	__class__r�r.s r%�__repr__�XPathExpr.__repr__Fs ���.�.�)�)�*�!�D�6��3�3r$c�n�UR(aSURSUSUS3UlU$XlU$)N�(z) z (�))r-)r.r-�
conjuctions   r%�
add_condition�XPathExpr.add_conditionIs=���>�>� ���� 0��:�,�b���1�M�D�N���'�N��r$c��URS:XagURS[RUR535 SUlg)N�*z	name() = )r,rC�GenericTranslator�
xpath_literalr<s r%�
add_name_test�XPathExpr.add_name_testPs>���<�<�3������Y�'8�'F�'F�t�|�|�'T�&U�V�W���r$c�.�U=RS-
slg)zM
Append '*/' to the path to keep the context constrained
to a single parent.
�*/N)r+r<s r%�add_star_prefix�XPathExpr.add_star_prefixWs��
	
�	�	�T��	r$Nc��[U5U-nURS:waXRR-
nXPlU(d:U(aURU-OURUlURUlU$URUlUR(a%U=RSUR-S--
slU(aU=RU-
slU$)NrLr4r5r6)r.�combiner�other�closing_combiner�has_inner_conditionr+s      r%�join�XPathExpr.join^s����4�y�8�#���:�:����J�J��D��	�"�4D��
�
� 0�0�%�-�-�
�L�#�_�_�D�N���!�=�=�D�L��������e�o�o� 5�� ;�;������ 0�0���r$)r-r,r+)�rFrVF)
r+r7r,r7r-r7r/�bool�return�None)rXr7)�and)r-r7rBr7rXr)rXrY)NF)
rPr7rQr'rR�
str | NonerSrWrXr)rrr r!r0r8r=rCrIrMrTr#rr$r%r'r'4s������!�	#��	#��	#��		#�
�	#�
�
	#��4����(,�$)������%�	�
"��
�
�r$r'z('+)z^[a-zA-Z_][a-zA-Z0-9_.-]*$z^[^ \t\r\n\f]+$c	��\rSrSrSrSSSSS.rSS	S
SSS
SSS.rSrSrSr	Sr
Sr\r
SFSGSjjrSHSISjjrSJSjr\SKSj5rSLSjrSMSjrSNSjrSOSjrSPSjrSQSjrSRSjrSSSjrSTS jrSUS!jrSVS"jrSWS#jrSXS$jrSXS%jr SXS&jr!SXS'jr"SXS(jr#SXS)jr$SXS*jr%SXS+jr&SYSZS,jjr'S[S-jr(S[S.jr)S[S/jr*S[S0jr+S[S1jr,S\S2jr-S\S3jr.S\S4jr/S\S5jr0S\S6jr1S\S7jr2S\S8jr3S\S9jr4S\S:jr5S\S;jr6\6r7\6r8\6r9\6r:\6r;\6r<\6r=\6r>\6r?S]S<jr@S]S=jrAS]S>jrBS]S?jrCS]S@jrDS]SAjrES]SBjrFS]SCjrGSDrHgE)^rG�z�
Translator for "generic" XML documents.

Everything is case-sensitive, no assumption is made on the meaning
of element names and attribute names.

�
descendant�child�direct_adjacent�indirect_adjacent)� �>�+�~�exists�equals�includes�	dashmatch�prefixmatch�suffixmatch�substringmatch�	different)rf�=z~=z|=z^=z$=z*=z!=�idzxml:langFc�P^^�SRUU4Sj[U555$)u>Translate a *group of selectors* to XPath.

Pseudo-elements are not supported here since XPath only knows
about "real" elements.

:param css:
    A *group of selectors* as a string.
:param prefix:
    This string is prepended to the XPath expression for each selector.
    The default makes selectors scoped to the context node’s subtree.
:raises:
    :class:`~cssselect.SelectorSyntaxError` on invalid selectors,
    :class:`ExpressionError` on unknown/unsupported selectors,
    including pseudo-elements.
:returns:
    The equivalent XPath 1.0 expression as a string.

z | c3�F># �UHnTRUTSS9v� M g7f)T)�translate_pseudo_elementsN)�selector_to_xpath)�.0�selector�prefixr.s  ��r%�	<genexpr>�1GenericTranslator.css_to_xpath.<locals>.<genexpr>�s*����
�&��
�"�"�8�V�t�"�T�&�s�!)rTr)r.�cssrvs` `r%�css_to_xpath�GenericTranslator.css_to_xpath�s'���&�z�z�
�!�#�J�
�
�	
r$c�6�[USS5nU(d[SU<35eURU5n[XPR5(deU(a,UR
(aUR
XQR
5nU=(d S[U5-$)u�Translate a parsed selector to XPath.


:param selector:
    A parsed :class:`Selector` object.
:param prefix:
    This string is prepended to the resulting XPath expression.
    The default makes selectors scoped to the context node’s subtree.
:param translate_pseudo_elements:
    Unless this is set to ``True`` (as :meth:`css_to_xpath` does),
    the :attr:`~Selector.pseudo_element` attribute of the selector
    is ignored.
    It is the caller's responsibility to reject selectors
    with pseudo-elements, or to account for them somehow.
:raises:
    :class:`ExpressionError` on unknown/unsupported selectors.
:returns:
    The equivalent XPath 1.0 expression as a string.

�parsed_treeNz Expected a parsed selector, got rV)�getattr�	TypeError�xpath�
isinstance�
xpathexpr_cls�pseudo_element�xpath_pseudo_elementr7)r.rurvrr�treer�s      r%rs�#GenericTranslator.selector_to_xpath�s���4�x���5����>�x�l�K�L�L��
�
�4� ���%�!3�!3�4�4�4�4�$��)@�)@��-�-�e�5L�5L�M�E���"��E�
�*�*r$c��[S5e)zwTranslate a pseudo-element.

Defaults to not supporting pseudo-elements at all,
but can be overridden by sub-classes.

z"Pseudo-elements are not supported.)r)r.r�r�s   r%r��&GenericTranslator.xpath_pseudo_elements���B�C�Cr$c��[U5nSU;aSUS3nU$SU;aSUS3nU$[U5Vs/sHnU(dMSU;aSUS3OSUS3PM  nnSRSRU55nU$s snf)N�'�"z
concat({})�,)r7�split_at_single_quotes�formatrT)�s�part�parts_quoteds   r%rH�GenericTranslator.xpath_literals�����F���a�<��A�3�a��A�����\��A�3�a��A���	3�1�5��5�D��<�s�d�{�!�D�6���!�D�6���;�5�
��
�#�#�C�H�H�\�$:�;�A����
s�A>�A>c	���[U5Rn[[[[
/[4[USUR53S55nUc[US35eU"U5$)z%Translate any parsed selector object.�xpath_Nz is not supported.)
�typerrrrrr'r~�lowerr)r.�parsed_selector�	type_name�methods    r%r��GenericTranslator.xpath sp����)�2�2�	���X�t�f�i�/�0�1��D�F�9�?�?�#4�"5�6��=�
���>�!�Y�K�/A�"B�C�C��o�&�&r$c	��URURn[[[[/[4[USUS355nU"UR
UR5UR
UR55$)zTranslate a combined selector.r��_combinator)	�combinator_mapping�
combinatorrrr'r~r�ru�subselector)r.�combinedr�r�s    r%�xpath_combinedselector�(GenericTranslator.xpath_combinedselector-st���,�,�X�-@�-@�A�
���i��+�Y�6�7��D�F�:�,�k�:�;�
���d�j�j��!2�!2�3�T�Z�Z��@T�@T�5U�V�Vr$c��URUR5nURUR5nUR5 UR(aURSURS35$URS5$)N�not(rA�0)r�rur�rIr-rC)r.�negationr��	sub_xpaths    r%�xpath_negation� GenericTranslator.xpath_negation6sq���
�
�8�,�,�-���J�J�x�3�3�4�	����!�����&�&��i�.A�.A�-B�!�'D�E�E��"�"�3�'�'r$c�Z�URUR5nURnURnURUR5n[[[[/[4[USUR[[UR5S355nU"X%5$)N�xpath_relation_r�)r�rur�r�r}rrr'r~r�r7�value)r.�relationr�r�r��rightr�s       r%�xpath_relation� GenericTranslator.xpath_relation>s����
�
�8�,�,�-���(�(�
��*�*���
�
�;�2�2�3����i��+�Y�6�7���!�$�"9�"9�$�s�J�DT�DT�:U�"V�!W�Wb�c�
�
���e�#�#r$c�*�URUR5nURVs/sHo0RU5PM nnUHBnUR5 UR(dM&URURS5 MD U$s snf�N�or�r�ru�
selector_listrIr-rC�r.�matchingr�ru�exprs�es      r%�xpath_matching� GenericTranslator.xpath_matchingL�w���
�
�8�,�,�-��6>�6L�6L�M�6L�(���H�%�6L��M��A�
�O�O���{�{�{��#�#�A�K�K��6�����N��Bc�*�URUR5nURVs/sHo0RU5PM nnUHBnUR5 UR(dM&URURS5 MD U$s snfr�r�r�s      r%�xpath_specificityadjustment�-GenericTranslator.xpath_specificityadjustmentUr�r�c�D�SRURRSS55n[[[
[[/[4[XS55nU(d[SURS35eU"URUR5U5$)z$Translate a functional pseudo-class.zxpath_{}_function�-�_N�The pseudo-class :z
() is unknown)r��name�replacerrrr'rr~rr�ru)r.�function�method_namer�s    r%�xpath_function� GenericTranslator.xpath_function^s���)�0�0����1F�1F�s�C�1P�Q����X�y�(�3�Y�>�?�@��D�t�,�
���!�$6�x�}�}�o�]�"S�T�T��d�j�j��!2�!2�3�X�>�>r$c�8�SRURRSS55n[[[
[/[4[XS55nU(d[SURS35eU"URUR55$)zTranslate a pseudo-class.zxpath_{}_pseudor�r�Nr�z is unknown)r��identr�rrrr'r~rr�ru)r.�pseudor�r�s    r%�xpath_pseudo�GenericTranslator.xpath_pseudois���'�.�.�v�|�|�/C�/C�C��/M�N����X�y�k�9�4�5�6���SW�8X�
���!�$6�v�|�|�n�K�"P�Q�Q��d�j�j����1�2�2r$c��URURn[[[[
[[
/[4[USU355nUR(aURR5nOURn[U5nUR(a/URSU3nU=(a [UR5nU(aSU-nOSURU5S3nURcSnOZUR(a3[[
URR5R5nOURRnU"UR!UR"5Xg5$)z Translate an attribute selector.�
xpath_attrib_�:�@zattribute::*[name() = r5N)�attribute_operator_mapping�operatorrrr'r7rr~�lower_case_attribute_names�attribr��is_safe_name�	namespacerHr��lower_case_attribute_valuesr�ru)r.rur�r�r��safer�r�s        r%�xpath_attrib�GenericTranslator.xpath_attribts8���2�2�8�3D�3D�E����i��h�s�m�4�i�?�@��D�M�(��4�5�
���*�*��?�?�(�(�*�D��?�?�D��D�!������(�(�)��4�&�1�D��<�L��);�);�<�D���4�Z�F�-�d�.@�.@��.F�-G�q�I�F��>�>�!��E�
�
-�
-���h�n�n�2�2�3�9�9�;�E��N�N�(�(�E��d�j�j��!2�!2�3�V�C�Cr$c�r�URUR5nURUSUR5$)zTranslate a class selector.z@class)r�ru�xpath_attrib_includes�
class_name)r.�class_selectorr�s   r%�xpath_class�GenericTranslator.xpath_class�s3���
�
�>�2�2�3���)�)�%��>�;T�;T�U�Ur$c�r�URUR5nURUSUR5$)zTranslate an ID selector.z@id)r�ru�xpath_attrib_equalsro)r.�id_selectorr�s   r%�
xpath_hash�GenericTranslator.xpath_hash�s/���
�
�;�/�/�0���'�'��u�k�n�n�E�Er$c�~�URnU(dSnSnO5[[U55nUR(aUR	5nUR
(a8UR
SU3nU=(a [[UR
55nUR
US9nU(dUR5 U$)z'Translate a type or universal selector.rFTr�)r,)r,rWr��lower_case_element_namesr�r�r�rI)r.rur,r�r�s     r%�
xpath_element�GenericTranslator.xpath_element�s����"�"����G��D���W�-�.�D��,�,�!�-�-�/�����"�+�+�,�A�g�Y�7�G��B�D��h�.@�.@�!A�B�D��"�"�7�"�3������!��r$c�&�URSU5$)z;right is a child, grand-child or further descendant of leftz/descendant-or-self::*/�rT�r.�leftr�s   r%�xpath_descendant_combinator�-GenericTranslator.xpath_descendant_combinator�s���y�y�2�E�:�:r$c�&�URSU5$)z#right is an immediate child of left�/r�r�s   r%�xpath_child_combinator�(GenericTranslator.xpath_child_combinator�s���y�y��e�$�$r$c�h�URSU5nUR5 URS5$)z)right is a sibling immediately after left�/following-sibling::zposition() = 1)rTrIrC)r.r�r�r�s    r%� xpath_direct_adjacent_combinator�2GenericTranslator.xpath_direct_adjacent_combinator�s3���	�	�0�%�8��
�����"�"�#3�4�4r$c�&�URSU5$)z1right is a sibling after left, immediately or notr�r�r�s   r%�"xpath_indirect_adjacent_combinator�4GenericTranslator.xpath_indirect_adjacent_combinator�s���y�y�/��7�7r$c�&�URSUSSS9$)zHright is a child, grand-child or further descendant of left; select leftz
[descendant::r5T)rRrSr�r�s   r%�$xpath_relation_descendant_combinator�6GenericTranslator.xpath_relation_descendant_combinator�s#���y�y��U�S�d��
�	
r$c�$�URSUSS9$)z0right is an immediate child of left; select leftz[./r5�rRr�r�s   r%�xpath_relation_child_combinator�1GenericTranslator.xpath_relation_child_combinator�s���y�y����y�<�<r$c�@�URSURS35$)z6right is a sibling immediately after left; select leftz following-sibling::*[(name() = 'z') and (position() = 1)])rCr,r�s   r%�)xpath_relation_direct_adjacent_combinator�;GenericTranslator.xpath_relation_direct_adjacent_combinator�s(���!�!�.�u�}�}�o�=U�V�
�	
r$c�$�URSUSS9$)z>right is a sibling after left, immediately or not; select leftz[following-sibling::r5rr�r�s   r%�+xpath_relation_indirect_adjacent_combinator�=GenericTranslator.xpath_relation_indirect_adjacent_combinator�s���y�y�/���y�M�Mr$c�^�[UR5upVUS-
nUS:XaUS::aU$US:aUS:aUR	S5$U(aSOUR
n	U(dSU	S3n
OS	U	S3n
US:XaUR	U
S
U35$/nUS:�aUS:�aUR
U
SU35 OUR
U
SU35 [U5S:wa7U
nU*[U5-n
U
S:wa	S
USU
S3nUR
USUS35 [U5S:�aSOSmUR	SRU4SjU555 U$![a n[SUR<S35UeSnAff=f)NzInvalid series: 'r��rr�rF�count(preceding-sibling::rA�count(following-sibling::� = z >= z <= r@z +z mod z = 0z(%s)z%sz and c3�.># �UH
nTU-v� M g7fr*r)rt�
expression�templates  �r%rw�=GenericTranslator.xpath_nth_child_function.<locals>.<genexpr>fs����M��:��J�.��s�)
r�	arguments�
ValueErrorrrCr,�append�abs�lenrT)r.r�r��lastrI�a�b�ex�b_min_1�nodetest�siblings_count�expressionsr��b_negrs              @r%�xpath_nth_child_function�*GenericTranslator.xpath_nth_child_function�s����	W��� 2� 2�3�D�A�Z�a�%��
��6�g��l��L�

�q�5�W�q�[��&�&�s�+�+�
(�3��
�
����8��
�!�D�N�8��
�!�D�N�
��6��&�&�.�)9��W�I�'F�G�G����q�5���{��"�"�n�%5�T�'��#C�D��

���.�!1��g�Y�?�@��q�6�Q�;�!�D�
�X��Q��'�E���z��4�&��5�'��+�����$��u�Q�C�t�4�5� ��-��1�6�t��
����L�L�M��M�M�	
����s�	W�!�$5�h�6H�6H�5K�1�"M�N�TV�V��	W�s�E�
E:�E5�5E:c�"�URXSS9$)NT)r)r"�r.r�r�s   r%�xpath_nth_last_child_function�/GenericTranslator.xpath_nth_last_child_functionjs���,�,�U�4�,�H�Hr$c�X�URS:Xa[S5eURXSS9$)NrF�"*:nth-of-type() is not implementedF)rI�r,rr"r%s   r%�xpath_nth_of_type_function�,GenericTranslator.xpath_nth_of_type_functionos2���=�=�C��!�"F�G�G��,�,�U�E�,�R�Rr$c�Z�URS:Xa[S5eURXSSS9$)NrFr)TF)rrIr*r%s   r%�xpath_nth_last_of_type_function�1GenericTranslator.xpath_nth_last_of_type_functionvs;���=�=�C��!�"F�G�G��,�,��$�e�-�
�	
r$c��UR5S/S/4;a[SUR<35e[[URSR
5nUR
SURU5S35$)N�STRING�IDENTz7Expected a single string or ident for :contains(), got rzcontains(., rA��argument_typesrrrr7r�rCrH�r.r�r�r�s    r%�xpath_contains_function�)GenericTranslator.xpath_contains_functions���
�"�"�$�h�Z�'��,C�C�!�I�(�J\�J\�I_�`��
��S�(�,�,�Q�/�5�5�6���"�"�\�$�2D�2D�U�2K�1L�A�#N�O�Or$c��UR5S/S/4;a[SUR<35e[[URSR
5nUR
SURU5S35$)Nr1r2�3Expected a single string or ident for :lang(), got rzlang(rAr3r5s    r%�xpath_lang_function�%GenericTranslator.xpath_lang_function�s���"�"�$�h�Z�'��,C�C�!�E�h�FX�FX�E[�\��
��S�(�,�,�Q�/�5�5�6���"�"�U�4�+=�+=�e�+D�*E�Q�#G�H�Hr$c�$�URS5$)Nznot(parent::*)�rC�r.r�s  r%�xpath_root_pseudo�#GenericTranslator.xpath_root_pseudo�s���"�"�#3�4�4r$c�$�URS5$)N�1r=r>s  r%�xpath_scope_pseudo�$GenericTranslator.xpath_scope_pseudo�s���"�"�3�'�'r$c�$�URS5$)Nzcount(preceding-sibling::*) = 0r=r>s  r%�xpath_first_child_pseudo�*GenericTranslator.xpath_first_child_pseudo�����"�"�#D�E�Er$c�$�URS5$)Nzcount(following-sibling::*) = 0r=r>s  r%�xpath_last_child_pseudo�)GenericTranslator.xpath_last_child_pseudo�rHr$c�v�URS:Xa[S5eURSURS35$)NrFz"*:first-of-type is not implementedr
�) = 0�r,rrCr>s  r%�xpath_first_of_type_pseudo�,GenericTranslator.xpath_first_of_type_pseudo�s9���=�=�C��!�"F�G�G��"�"�%>�u�}�}�o�U�#S�T�Tr$c�v�URS:Xa[S5eURSURS35$)NrFz!*:last-of-type is not implementedrrMrNr>s  r%�xpath_last_of_type_pseudo�+GenericTranslator.xpath_last_of_type_pseudo�s9���=�=�C��!�"E�F�F��"�"�%>�u�}�}�o�U�#S�T�Tr$c�$�URS5$)Nzcount(parent::*/child::*) = 1r=r>s  r%�xpath_only_child_pseudo�)GenericTranslator.xpath_only_child_pseudo�s���"�"�#B�C�Cr$c�v�URS:Xa[S5eURSURS35$)NrFz!*:only-of-type is not implementedzcount(parent::*/child::z) = 1rNr>s  r%�xpath_only_of_type_pseudo�+GenericTranslator.xpath_only_of_type_pseudo�s9���=�=�C��!�"E�F�F��"�"�%<�U�]�]�O�5�#Q�R�Rr$c�$�URS5$)Nznot(*) and not(string-length())r=r>s  r%�xpath_empty_pseudo�$GenericTranslator.xpath_empty_pseudo�rHr$c�$�URS5$)z:Common implementation for pseudo-classes that never match.r�r=r>s  r%�pseudo_never_matches�&GenericTranslator.pseudo_never_matches�s���"�"�3�'�'r$c�:�U(aeURU5 U$r*r=�r.r�r�r�s    r%�xpath_attrib_exists�%GenericTranslator.xpath_attrib_exists�s����y�
���D�!��r$c�Z�UceURUSURU535 U$)Nr�rCrHras    r%r��%GenericTranslator.xpath_attrib_equals�s:��� � � �
���t�f�C��(:�(:�5�(A�'B�C�D��r$c
��UceU(a+URSUSUSURU535 U$URUSURU535 U$)Nr�z) or z != reras    r%�xpath_attrib_different�(GenericTranslator.xpath_attrib_different�ss��� � � �����$�t�f�E�$��t�D�<N�<N�u�<U�;V� W�X���
���4�&��T�-?�-?��-F�,G� H�I��r$c��U(aC[U5(a3URSU-S-5nURUSUSUS35 U$URS5 U$)Nrbz* and contains(concat(' ', normalize-space(z	), ' '), rAr�)�is_non_whitespacerHrC)r.r�r�r��args     r%r��'GenericTranslator.xpath_attrib_includes�so���&�u�-�-��$�$�S�5�[�3�%6�7�C�����&�B�4�&�	�RU�QV�VW�X�
�
��
����$��r$c��UceURU5nURUS-5nURUSUSUSUSUS3
5 U$)Nr�z and (rz or starts-with(�, z)))rHrC)r.r�r�r�rl�arg_dashs      r%�xpath_attrib_dashmatch�(GenericTranslator.xpath_attrib_dashmatch�sl��� � � �� � ��'���%�%�e�c�k�2��
����f�F�4�&��C�5�(8���b��
�"�M�	
��r$c	��U(a+URUSUSURU5S35 U$URS5 U$)Nz and starts-with(rorAr�reras    r%�xpath_attrib_prefixmatch�*GenericTranslator.xpath_attrib_prefixmatch�sT�������&�)�$��r�$�2D�2D�U�2K�1L�A�N�
�
��
����$��r$c
��U(a<URUSUSUS[U5S-
SURU53	5 U$URS5 U$)Nz and substring(z, string-length(z)-rz) = r�)rCrrHras    r%�xpath_attrib_suffixmatch�*GenericTranslator.xpath_attrib_suffixmatchsk�������&���v�-=�d�V�2�c�%�j�ST�n�EU�UY�Z^�Zl�Zl�mr�Zs�Yt�u�
�
��
����$��r$c	��U(a+URUSUSURU5S35 U$URS5 U$)Nz and contains(rorAr�reras    r%�xpath_attrib_substringmatch�-GenericTranslator.xpath_attrib_substringmatchsS�������&��t�f�B�t�/A�/A�%�/H�.I��K�
�
��
����$��r$rN)�descendant-or-self::)ryr7rvr7rXr7)r|F)rurrvr7rrrWrXr7)r�r'r�rrXr')r�r7rXr7)r�rrXr')r�r
rXr')r�rrXr')r�rrXr')r�rrXr')r�rrXr')r�rrXr')r�rrXr')rurrXr')r�r	rXr')r�r
rXr')rurrXr')r�r'r�r'rXr')FT)
r�r'r�rrrWrIrWrXr'�r�r'r�rrXr'�r�r'rXr')r�r'r�r7r�r[rXr')Irrr r!r"r�r��id_attribute�lang_attributer�r�r�r'r�rzrsr��staticmethodrHr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr	r"r&r+r.r6r:r?rCrFrJrOrRrUrXr[r^�xpath_link_pseudo�xpath_visited_pseudo�xpath_hover_pseudo�xpath_active_pseudo�xpath_focus_pseudo�xpath_target_pseudo�xpath_enabled_pseudo�xpath_disabled_pseudo�xpath_checked_pseudorbr�rhr�rqrtrwrzr#rr$r%rGrG�sM���*�
�
�
 �	���
�������	"���L� �N�  %��!&��"'���M�
�6-�*/�	!+��!+��!+�$(�	!+�


�!+�F	D��	D�0=�	D�	�	D��
��
�	'�W�(�$���	?�	3�D�6V�F�
�,;��;�&/�;�	�;�%�5��5�&/�5�	�5�8��8�&/�8�	�8�
��
�&/�
�	�
�=��=�&/�=�	�=�
��
�&/�
�	�
�N��N�&/�N�	�N��"�B��B��B��	B�
�B�
�
B�HI��I�*2�I�	�I�
S��S�*2�S�	�S�
��
�*2�
�	�
�
P��
P�*2�
P�	�
P�I�5�(�F�F�U�
U�
D�S�
F�(�-��/��-��.��-��.��/��0��/�����&)��2<��	�����&)��2<��	��	��	�&)�	�2<�	�	�	�
��
�&)�
�2<�
�	�
�
��
�&)�
�2<�
�	�
�	��	�&)�	�2<�	�	�	�
��
�&)�
�2<�
�	�
�
��
�&)�
�2<�
�	�
r$rGc�\�\rSrSrSrSrSS
SjjrSSjrSSjrSSjr	SSjr
SS	jrS
rg)�HTMLTranslatori a�
Translator for (X)HTML documents.

Has a more useful implementation of some pseudo-classes based on
HTML-specific element names and attribute names, as described in
the `HTML5 specification`_. It assumes no-quirks mode.
The API is the same as :class:`GenericTranslator`.

.. _HTML5 specification: http://www.w3.org/TR/html5/links.html#selectors

:param xhtml:
    If false (the default), element names and attribute names
    are case-insensitive.

�langc�<�XlU(dSUlSUlgg)NT)�xhtmlr�r�)r.r�s  r%r0�HTMLTranslator.__init__3s���
��,0�D�)�.2�D�+�r$c�$�URS5$)Nz�(@selected and name(.) = 'option') or (@checked and (name(.) = 'input' or name(.) = 'command')and (@type = 'checkbox' or @type = 'radio'))r=r>s  r%r��#HTMLTranslator.xpath_checked_pseudo:s���"�"�
;�
�	
r$c�0�UR5S/S/4;a[SUR<35eURSRnU(deUR	UR5S-5nUR
SURSUS35$)	Nr1r2r9rr�z<ancestor-or-self::*[@lang][1][starts-with(concat(translate(@zE, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '-'), z)])r4rrr�rHr�rCr�)r.r�r�r�rls     r%r:�"HTMLTranslator.xpath_lang_functionCs����"�"�$�h�Z�'��,C�C�!�E�h�FX�FX�E[�\��
��"�"�1�%�+�+����u�� � ������!4�5���"�"�
��-�-�.�/��E��	
�
�	
r$c�$�URS5$)NzA@href and (name(.) = 'a' or name(.) = 'link' or name(.) = 'area')r=r>s  r%r�� HTMLTranslator.xpath_link_pseudoSs���"�"�O�
�	
r$c�$�URS5$)Na�
        (
            @disabled and
            (
                (name(.) = 'input' and @type != 'hidden') or
                name(.) = 'button' or
                name(.) = 'select' or
                name(.) = 'textarea' or
                name(.) = 'command' or
                name(.) = 'fieldset' or
                name(.) = 'optgroup' or
                name(.) = 'option'
            )
        ) or (
            (
                (name(.) = 'input' and @type != 'hidden') or
                name(.) = 'button' or
                name(.) = 'select' or
                name(.) = 'textarea'
            )
            and ancestor::fieldset[@disabled]
        )
        r=r>s  r%r��$HTMLTranslator.xpath_disabled_pseudo[s���"�"�
�
�	
r$c�$�URS5$)Na'
        (
            @href and (
                name(.) = 'a' or
                name(.) = 'link' or
                name(.) = 'area'
            )
        ) or (
            (
                name(.) = 'command' or
                name(.) = 'fieldset' or
                name(.) = 'optgroup'
            )
            and not(@disabled)
        ) or (
            (
                (name(.) = 'input' and @type != 'hidden') or
                name(.) = 'button' or
                name(.) = 'select' or
                name(.) = 'textarea' or
                name(.) = 'keygen'
            )
            and not (@disabled or ancestor::fieldset[@disabled])
        ) or (
            name(.) = 'option' and not(
                @disabled or ancestor::optgroup[@disabled]
            )
        )
        r=r>s  r%r��#HTMLTranslator.xpath_enabled_pseudoys���"�"�
�
�	
r$)r�r�r�N)F)r�rWrXrYr~r})
rrr r!r"r�r0r�r:r�r�r�r#rr$r%r�r� s,��� �N�3�
�
� 
�
�< 
r$r�))r"�
__future__r�re�collections.abcr�typingrrr�cssselect.parserrr	r
rrr
rrrrrrrrrrr�typing_extensionsr�RuntimeErrorrr'�compile�splitr��matchr�rkrGr�rr$r%�<module>r�s����#�	�$�0�0������(�&�>�m�\�>�A�A�H���F�+�1�1��
�z�z�6�7�=�=���J�J�1�2�8�8��W
�W
�ty
�&�y
r$

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 869 B 0644
parser.cpython-313.pyc File 47.69 KB 0644
xpath.cpython-313.pyc File 36.05 KB 0644
Filemanager