Ë
    ò¦1hà(  ã                  ó¬  — U d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
 d dlmZ d dlmZ e	rd dlmZ  G d„ de«      Z G d„ d	e«      Z G d
„ de«      Z eej(                  ¬«      ej*                  d<    eej,                  dd¬«      ej*                  d<    eej(                  dd¬«      ej*                  d<    eej.                  ¬«      ej*                  d<    ed¬«      ej*                  d<    eej(                  ¬«      ej*                  d<    eej.                  ¬«      ej*                  d<    ed¬«      ej*                  d<   eegef   Zded<   e
eef   Zy)é    )Úannotations)ÚCallableÚDictÚIterableÚOptionalÚSetÚTupleÚTYPE_CHECKINGÚUnion)Ú	TypeAlias)ÚEntitySubstitution)Ú_AttributeValuec                  óú   — e Zd ZU dZdZded<   dZded<    e eddg«      ¬	«      Z	d
ed<   ded<   ded<   ded<   ded<   ded<   ded<   	 	 	 	 	 	 	 	 dd„Z
	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„Zdd„Zd d„Z	 	 	 	 d!d„Zy)"Ú	Formattera  Describes a strategy to use when outputting a parse tree to a string.

    Some parts of this strategy come from the distinction between
    HTML4, HTML5, and XML. Others are configurable by the user.

    Formatters are passed in as the `formatter` argument to methods
    like `bs4.element.Tag.encode`. Most people won't need to
    think about formatters, and most people who need to think about
    them can pass in one of these predefined strings as `formatter`
    rather than making a new Formatter object:

    For HTML documents:
     * 'html' - HTML entity substitution for generic HTML documents. (default)
     * 'html5' - HTML entity substitution for HTML5 documents, as
                 well as some optimizations in the way tags are rendered.
     * 'html5-4.12.0' - The version of the 'html5' formatter used prior to
                        Beautiful Soup 4.13.0.
     * 'minimal' - Only make the substitutions necessary to guarantee
                   valid HTML.
     * None - Do not perform any substitution. This will be faster
              but may result in invalid markup.

    For XML documents:
     * 'html' - Entity substitution for XHTML documents.
     * 'minimal' - Only make the substitutions necessary to guarantee
                   valid XML. (default)
     * None - Do not perform any substitution. This will be faster
              but may result in invalid markup.

    ÚhtmlÚstrÚHTMLÚxmlÚXMLÚscriptÚstyle)Úcdata_containing_tagszDict[str, Set[str]]ÚHTML_DEFAULTSúOptional[str]Úlanguageú%Optional[_EntitySubstitutionFunction]Úentity_substitutionÚvoid_element_close_prefixúSet[str]r   ÚindentÚboolÚempty_attributes_are_booleansc                óZ   — |�|S || j                   k(  r
t        «       S | j                  |   S )N)r   Úsetr   )Úselfr   ÚvalueÚkwargs       úK/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/bs4/formatter.pyÚ_defaultzFormatter._defaultB   s7   € ð ÐØˆLØ�t—x‘xÒô “5ˆLð ×!Ñ! %Ñ(Ð(ó    Nc                ó2  — |xs | j                   | _        || _        || _        | j	                  | j                  |d«      | _        || _        |€d}t        |t        «      r|dk  rd}d|z  }|| _
        yt        |t        «      r
|}|| _
        yd}|| _
        y)a»  Constructor.

        :param language: This should be `Formatter.XML` if you are formatting
           XML markup and `Formatter.HTML` if you are formatting HTML markup.

        :param entity_substitution: A function to call to replace special
           characters with XML/HTML entities. For examples, see
           bs4.dammit.EntitySubstitution.substitute_html and substitute_xml.
        :param void_element_close_prefix: By default, void elements
           are represented as <tag/> (XML rules) rather than <tag>
           (HTML rules). To get <tag>, pass in the empty string.
        :param cdata_containing_tags: The set of tags that are defined
           as containing CDATA in this dialect. For example, in HTML,
           <script> and <style> tags are defined as containing CDATA,
           and their contents should not be formatted.
        :param empty_attributes_are_booleans: If this is set to true,
          then attributes whose values are sent to the empty string
          will be treated as `HTML boolean
          attributes<https://dev.w3.org/html5/spec-LC/common-microsyntaxes.html#boolean-attributes>`_. (Attributes
          whose value is None are always rendered this way.)
        :param indent: If indent is a non-negative integer or string,
            then the contents of elements will be indented
            appropriately when pretty-printing. An indent level of 0,
            negative, or "" will only insert newlines. Using a
            positive integer indent indents that many spaces per
            level. If indent is a string (such as "\t"), that string
            is used to indent each level. The default behavior is to
            indent one space per level.

        r   Nr   ú )r   r   r   r   r)   r   r"   Ú
isinstanceÚintr   r    )r%   r   r   r   r   r"   r    Ú
indent_strs           r(   Ú__init__zFormatter.__init__O   s¨   € ðN !Ò- D§I¡IˆŒØ#6ˆÔ Ø)BˆÔ&Ø%)§]¡]Ø�M‰MÐ0Ð2Ió&
ˆÔ"ð .KˆÔ*Øˆ>ØˆFä�fœcÔ"Ø˜ŠzØ�Ø˜v™ˆJð
 !ˆ�ô	 ˜¤Ô$ØˆJð !ˆ�ð ˆJØ ˆ�r*   c                óÄ   — | j                   s|S ddlm} t        ||«      r0|j                  �$|j                  j
                  | j                  v r|S | j                  |«      S )a$  Process a string that needs to undergo entity substitution.
        This may be a string encountered in an attribute value or as
        text.

        :param ns: A string.
        :return: The same string but with certain characters replaced by named
           or numeric entities.
        é   )ÚNavigableString)r   Úelementr3   r-   ÚparentÚnamer   )r%   Únsr3   s      r(   Ú
substitutezFormatter.substituteŠ   sY   € ð ×'Ò'ØˆIÝ,ô �r˜?Ô+Ø—	‘	Ð%Ø—	‘	—‘ $×"<Ñ"<Ñ<ð ˆIà×'Ñ'¨Ó+Ð+r*   c                ó$   — | j                  |«      S )z­Process the value of an attribute.

        :param ns: A string.
        :return: A string with certain characters replaced by named
           or numeric entities.
        )r8   )r%   r&   s     r(   Úattribute_valuezFormatter.attribute_value¡   s   € ð �‰˜uÓ%Ð%r*   c                óŽ   ‡ — |j                   €g S t        |j                   j                  «       «      }t        ˆ fd„|D «       «      S )a°  Reorder a tag's attributes however you want.

        By default, attributes are sorted alphabetically. This makes
        behavior consistent between Python 2 and Python 3, and preserves
        backwards compatibility with older versions of Beautiful Soup.

        If `empty_attributes_are_booleans` is True, then
        attributes whose values are set to the empty string will be
        treated as boolean attributes.
        c              3  óR   •K  — | ]  \  }}|‰j                   r|d k(  rdn|f–— Œ  y­w)Ú N)r"   )Ú.0ÚkÚvr%   s      €r(   ú	<genexpr>z'Formatter.attributes.<locals>.<genexpr>»   s2   øè ø€ ò 
á��1ð ˜×;Ò;ÀÀRÂ‘ÈQÔPñ
ùs   ƒ$')ÚattrsÚlistÚitemsÚsorted)r%   ÚtagrD   s   `  r(   Ú
attributeszFormatter.attributesª   sC   ø€ ð �9‰9ÐØˆIä7;¸C¿I¹I¿O¹OÓ<MÓ7NˆÜó 
àô
ó 
ð 	
r*   )r   r   r&   úOptional[Set[str]]r'   r   Úreturnr   )NNú/NFr2   )r   r   r   r   r   r   r   rH   r"   r!   r    úUnion[int, str])r7   r   rI   r   )r&   r   rI   r   )rF   zbs4.element.TagrI   z/Iterable[Tuple[str, Optional[_AttributeValue]]])Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   Údictr$   r   r)   r0   r8   r:   rG   © r*   r(   r   r   
   s  … ñð@ €Dˆ#Óð €CˆÓñ *.Ù! 8¨WÐ"5Ó6ô*€MÐ&ó ð ÓØ>Ó>Ø"Ó"Ø#Ó#ØƒKð $(Ó'ð)Øð)Ø$6ð)Ø?Bð)à	ó)ð #'ØEIØ),Ø48Ø.3Ø!"ð9!àð9!ð Cð9!ð $'ð	9!ð
  2ð9!ð (,ð9!ð ó9!óv,ó.&ð
Ø"ð
à	8ô
r*   r   c                  óR   ‡ — e Zd ZU dZi Zded<   	 	 	 	 	 d	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚHTMLFormatterzA generic Formatter for HTML.z"Dict[Optional[str], HTMLFormatter]ÚREGISTRYc                óL   •— t         t        | �  | j                  |||||¬«       y ©N)r    )ÚsuperrT   r0   r   ©r%   r   r   r   r"   r    Ú	__class__s         €r(   r0   zHTMLFormatter.__init__Æ   s/   ø€ ô 	Œm˜TÑ+Ø�I‰IØØ%Ø!Ø)Øð 	,õ 	
r*   ©NrJ   NFr2   ©
r   r   r   r   r   rH   r"   r!   r    rK   ©rL   rM   rN   rO   rU   rP   r0   Ú__classcell__©rZ   s   @r(   rT   rT   Á   s^   ø… Ù'à35€HÐ0Ó5ð FJØ),Ø48Ø.3Ø!"ð
àBð
ð $'ð
ð  2ð	
ð
 (,ð
ð ÷
ñ 
r*   rT   c                  óR   ‡ — e Zd ZU dZi Zded<   	 	 	 	 	 d	 	 	 	 	 	 	 	 	 dˆ fd„Zˆ xZS )ÚXMLFormatterzA generic Formatter for XML.z!Dict[Optional[str], XMLFormatter]rU   c                óL   •— t         t        | �  | j                  |||||¬«       y rW   )rX   ra   r0   r   rY   s         €r(   r0   zXMLFormatter.__init__Ý   s/   ø€ ô 	Œl˜DÑ*Ø�H‰HØØ%Ø!Ø)Øð 	+õ 	
r*   r[   r\   r]   r_   s   @r(   ra   ra   Ø   s^   ø… Ù&à24€HÐ/Ó4ð FJØ),Ø48Ø.3Ø!"ð
àBð
ð $'ð
ð  2ð	
ð
 (,ð
ð ÷
ñ 
r*   ra   )r   r   r=   T)r   r   r"   Úhtml5z
html5-4.12ÚminimalNr   Ú_EntitySubstitutionFunction)Ú
__future__r   Útypingr   r   r   r   r   r	   r
   r   Útyping_extensionsr   Ú
bs4.dammitr   Úbs4._typingr   r   rT   ra   Úsubstitute_htmlrU   Úsubstitute_html5Úsubstitute_xmlr   re   rP   Ú_FormatterOrNamerR   r*   r(   ú<module>ro      sf  ðÞ "ß W× WÓ WÝ 'Ý )áÝ+ôt
Ð"ô t
ôn
�Iô 
ô.
�9ô 
ñ0 "/Ø*×:Ñ:ô"€× Ñ �vÑ ñ #0Ø*×;Ñ;Ø Ø"&ô#€× Ñ �wÑ ñ
 (5Ø*×:Ñ:Ø Ø"&ô(€× Ñ �|Ñ $ñ
 %2Ø*×9Ñ9ô%€× Ñ �yÑ !ñ  -ÀÔF€× Ñ �tÑ Ù ,Ø*×:Ñ:ô!€× Ñ �fÑ ñ $0Ø*×9Ñ9ô$€× Ñ �iÑ  ñ +¸tÔD€× Ñ �dÑ ð *2°3°%¸°*Ñ)=Ð ˜YÓ =ð ˜ C˜Ñ(Ñ r*   