+
    ^eòjº!  ã                   ó�  € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	 ^ RI
HtHtHt  ]t ^ RIHt  ^ RIHt  ! R R	]4      t ^ R
IHt  ! R R]4      t]! 4       tR tRR ltRR ltRR ltRR lt RR lt!R t"]! 4       t#R#   ] d    ]]3t Lgi ; i  ] d
    ^ RIHt  Lsi ; i  ] d
    ^ RIHt  Li ; i  ] d     Lhi ; i)z?
An interface to html5lib that mimics the lxml.html interface.
N)Ú
HTMLParser)ÚTreeBuilder)Úetree)ÚElementÚXHTML_NAMESPACEÚ_contains_block_level_tag)Úurlopen)Úurlparsec                   ó.   a € ] tR t^t o RtRR ltRtV tR# )r   z*An html5lib HTML parser with lxml as tree.c                óD   € \         P                  ! V 3R VR\        /VB  R# ©ÚstrictÚtreeN)Ú_HTMLParserÚ__init__r   ©Úselfr   Úkwargss   &&,ÚŒ/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/lxml/html/html5parser.pyr   ÚHTMLParser.__init__   s   € Ü×Ò˜TÑM¨&ÐM´{ÐMÀfÔMó    © N©F©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s   ø‡ € Ù4÷Nò Nr   r   )ÚXHTMLParserc                   ó.   a € ] tR t^'t o RtRR ltRtV tR# )r#   z+An html5lib XHTML Parser with lxml as tree.c                óD   € \         P                  ! V 3R VR\        /VB  R# r   )Ú_XHTMLParserr   r   r   s   &&,r   r   ÚXHTMLParser.__init__*   s   € Ü×!Ò! $ÑR¨vÐR¼KÐRÈ6ÔRr   r   Nr   r   r!   s   @r   r#   r#   '   s   ø‡ € Ù9÷	Sò 	Sr   r#   c                 ój   € V P                  V4      pVe   V# V P                  R\        : RV: 24      # )NÚ{Ú})Úfindr   )r   ÚtagÚelems   && r   Ú	_find_tagr.   0   s.   € Ø�9‰9�S‹>€DØÒØˆØ�9Š9§²#Ð6Ó7Ð7r   c                óæ   € \        V \        4      '       g   \        R4      hVf   \        p/ pVf   \        V \        4      '       d   RpVe   WR&   VP
                  ! V 3/ VB P                  4       # )z¹
Parse a whole document into a string.

If `guess_charset` is true, or if the input is not Unicode but a
byte string, the `chardet` library will perform charset guessing
on the string.
ústring requiredTÚ
useChardet)Ú
isinstanceÚ_stringsÚ	TypeErrorÚhtml_parserÚbytesÚparseÚgetroot)ÚhtmlÚguess_charsetÚparserÚoptionss   &&& r   Údocument_fromstringr=   7   sp   € ô �dœH×%Ò%ÜÐ)Ó*Ð*à‚~Üˆà€GØÒ¤¨D´%×!8Ò!8ð ˆØÒ Ø -�ÑØ�<Š<˜Ñ( Ñ(×0Ñ0Ó2Ð2r   c                ó²  € \        V \        4      '       g   \        R4      hVf   \        p/ pVf   \        V \        4      '       d   RpVe   W$R&   VP
                  ! V R3/ VB pV'       dj   \        V^ ,          \        4      '       dM   V'       dE   V^ ,          P                  4       '       d%   \        P                  ! RV^ ,          ,          4      hV^  V# )aH  Parses several HTML elements, returning a list of elements.

The first item in the list may be a string.  If no_leading_text is true,
then it will be an error if there is leading text, and it will always be
a list of only elements.

If `guess_charset` is true, the `chardet` library will perform charset
guessing on the string.
r0   Fr1   ÚdivzThere is leading text: %r)	r2   r3   r4   r5   r6   ÚparseFragmentÚstripr   ÚParserError)r9   Úno_leading_textr:   r;   r<   Úchildrens   &&&&  r   Úfragments_fromstringrE   O   sÁ   € ô �dœH×%Ò%ÜÐ)Ó*Ð*à‚~Üˆà€GØÒ¤¨D´%×!8Ò!8ð ˆØÒ Ø -�ÑØ×#Ò# D¨%Ñ;°7Ñ;€Hß”J˜x¨�{¬H×5Ò5ßØ˜�{× Ñ ×"Ò"Ü×'Ò'Ð(CØ(0°­õ)4ó 5ð 5à˜�Ø€Or   c                óÆ  € \        V \        4      '       g   \        R4      h\        V4      p\	        WVV'       * R7      pV'       dm   \        V\        4      '       g   Rp\        V4      pV'       d@   \        V^ ,          \        4      '       d   V^ ,          Vn        V^  VP                  V4       V# V'       g   \        P                  ! R4      h\        V4      ^8”  d   \        P                  ! R4      hV^ ,          pVP                  '       dH   VP                  P                  4       '       d(   \        P                  ! RVP                  ,          4      hRVn        V# )a¢  Parses a single HTML element; it is an error if there is more than
one element, or if anything but whitespace precedes or follows the
element.

If 'create_parent' is true (or is a tag name) then a parent node
will be created to encapsulate the HTML in a single element.  In
this case, leading or trailing text is allowed.

If `guess_charset` is true, the `chardet` library will perform charset
guessing on the string.
r0   )r:   r;   rC   r?   zNo elements foundzMultiple elements foundzElement followed by text: %rN)r2   r3   r4   ÚboolrE   r   ÚtextÚextendr   rB   ÚlenÚtailrA   )r9   Úcreate_parentr:   r;   Úaccept_leading_textÚelementsÚnew_rootÚresults   &&&&    r   Úfragment_fromstringrQ   q   s  € ô �dœH×%Ò%ÜÐ)Ó*Ð*ä˜}Ó-Ðä#Ø°&Ø/Ô/ô1€H÷ Ü˜-¬×2Ò2Ø!ˆMÜ˜=Ó)ˆßÜ˜( 1�+¤x×0Ò0Ø (¨¥�”Ø˜Q�KØ�O‰O˜HÔ%ØˆçÜ×ÒÐ 3Ó4Ð4Ü
ˆ8ƒ}�qÔÜ×ÒÐ 9Ó:Ð:Ø�a�[€FØ‡{‡{€{�v—{‘{×(Ñ(×*Ò*Ü×ÒÐ >ÀÇÁÕ LÓMÐMØ€F„KØ€Mr   c                ó  € \        V \        4      '       g   \        R4      h\        WVR7      pV R,          p\        V\        4      '       d   VP                  RR4      pVP                  4       P                  4       pVP                  R4      '       g   VP                  R4      '       d   V# \        VR4      p\        V4      '       d   V# \        VR	4      p\        V4      ^8X  d|   VP                  '       d!   VP                  P                  4       '       gJ   VR,          P                  '       d(   VR,          P                  P                  4       '       g
   V^ ,          # \        V4      '       d
   R
Vn        V# RVn        V# )a€  Parse the html, returning a single element/document.

This tries to minimally parse the chunk of text, without knowing if it
is a fragment or a document.

'base_url' will set the document's base_url attribute (and the tree's
docinfo.URL)

If `guess_charset` is true, or if the input is not Unicode but a
byte string, the `chardet` library will perform charset guessing
on the string.
r0   )r;   r:   :Né2   NÚasciiÚreplacez<htmlz	<!doctypeÚheadÚbodyr?   Úspanéÿÿÿÿ)r2   r3   r4   r=   r6   ÚdecodeÚlstripÚlowerÚ
startswithr.   rJ   rH   rA   rK   r   r,   )r9   r:   r;   ÚdocÚstartrV   rW   s   &&&    r   Ú
fromstringr`   �   s2  € ô �dœH×%Ò%ÜÐ)Ó*Ð*Ü
˜dØ,9ô;€Cð ��I€EÜ�%œ×Òð —‘˜W iÓ0ˆà�L‰L‹N× Ñ Ó"€EØ×Ñ˜× Ò  E×$4Ñ$4°[×$AÒ$AØˆ
ä�S˜&Ó!€Dô ˆ4‡y‚yØˆ
ä�S˜&Ó!€Dô 	ˆD‹	�QŒ §	§	 	°·±·±×1BÒ1BØ�b•——� d¨2¥h§m¡m×&9Ñ&9×&;Ò&;Ø�A�wˆô
 ! ×&Ò&ØˆŒð €Kð ˆŒØ€Kr   c                ó   € Vf   \         p\        V \        4      '       g
   T pVf   RpM5\        V 4      '       d   \	        V 4      pVf   RpM\        V R4      pVf   Rp/ pV'       d   WR&   VP                  ! V3/ VB # )a
  Parse a filename, URL, or file-like object into an HTML document
tree.  Note: this returns a tree, not an element.  Use
``parse(...).getroot()`` to get the document root.

If ``guess_charset`` is true, the ``useChardet`` option is passed into
html5lib to enable character detection.  This option is on by default
when parsing from URLs, off by default when parsing from file(-like)
objects (which tend to return Unicode more often than not), and on by
default when parsing from a file path (which is read in binary mode).
FTÚrbr1   )r5   r2   r3   Ú_looks_like_urlr   Úopenr7   )Úfilename_url_or_filer:   r;   Úfpr<   s   &&&  r   r7   r7   Ó   sŽ   € ð ‚~ÜˆÜÐ*¬H×5Ò5Ø!ˆØÒ à!ˆMøÜ	Ð-×	.Ò	.ÜÐ)Ó*ˆØÒ à ˆMøäÐ&¨Ó-ˆØÒ Ø ˆMà€G÷ Ø -�ÑØ�<Š<˜Ñ&˜gÑ&Ð&r   c                 ó¶   € \        V 4      ^ ,          pV'       g   R# \        P                  R8X  d(   V\        P                  9   d   \        V4      ^8X  d   R# R# )é    FÚwin32T)r	   ÚsysÚplatformÚstringÚascii_lettersrJ   )ÚstrÚschemes   & r   rc   rc   ÷   sB   € Ü�c‹]˜1Õ€FßÙÜ
�,‰,˜'Ô
!Ø”f×*Ñ*Ô*Ü�F“˜qÔ áár   )NN)FNN)$r   rj   rl   Úhtml5libr   r   Ú html5lib.treebuilders.etree_lxmlr   Úlxmlr   Ú	lxml.htmlr   r   r   Ú
basestringr3   Ú	NameErrorr6   rn   Úurllib2r   ÚImportErrorÚurllib.requestr	   Úurllib.parser#   r&   Úxhtml_parserr.   r=   rE   rQ   r`   r7   rc   r5   r   r   r   Ú<module>r{      sì   ðñó Û å .Ý 8Ý ß IÑ IðØ€Hð'Ýð&Ý!ô
N�ô Nð!Ý4ôS�lô Sñ “=€Lò8ô3ô0ôD)ôX3ôl!'òH
ñ ‹l‚øðk ô Ø�sˆ|‚Hðûð ô 'ß&ð'ûð ô &ß%ð&ûð ô 	Ùð	úsE   ¨B «B ²B( ÁB; ÂBÂBÂB%Â$B%Â(B8Â7B8Â;CÃC