
    kYZ                        d Z ddlZ	 ddlmZ eZnC# e$ r; ddl	Z	ddiZe	j
                                        D ]\  ZZ ee          eedz   <   Y nw xY wddgZdRd
Zi ddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+i d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMZh dNZdO Z ej        dP          ZdQ ZdS )Sz*
General functions for HTML manipulation.
    N)html5zapos;';escapeunescapeTc                     |                      dd          } |                      dd          } |                      dd          } |r,|                      dd          } |                      d	d
          } | S )z
    Replace special characters "&", "<" and ">" to HTML-safe sequences.
    If the optional flag quote is true (the default), the quotation mark
    characters, both double quote (") and single quote (') characters are also
    translated.
    &z&amp;<z&lt;>z&gt;"z&quot;r   z&#x27;)replace)squotes     \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/htmlmin/python3html/__init__.pyr   r      sp     	
		#wA			#vA			#vA &IIc8$$IIdH%%H       �      u   €         u   ‚   u   ƒ   u   „   u   …   u   †   u   ‡   u   ˆ   u   ‰   u   Š   u   ‹   u   Œ         u   Ž               u   ‘   u   ’   u   “   u   ”   u   •   u   –   u   —   u   ˜   u   ™   u   š   u   ›   u   œ         u   ž   u   Ÿ>~                                                                             	 
                 	 
                                                                                          r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r%   r&   r(   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r8   r9    c                 v   |                      d          } | d         dk    r| d         dv r,t          | dd                              d          d          }n*t          | dd                              d                    }|t          v rt          |         S d|cxk    rd	k    sn |d
k    rdS |t          v rdS t          |          S | t          v rt          |          S t          t          |           dz
  dd          D ]5}| d |         t          v r"t          | d |                  | |d          z   c S 6d| z   S )Nr{   r   #xXr|   r   r   i   i  r   r    r	   )	groupintrstrip_invalid_charrefs_invalid_codepointsunichr_html5rangelen)r   numxs      r   _replace_charrefr   b   sQ   	

Ats{{Q44<<aell3'',,CCaell3''((C###$S))S""""F""""cHnn8%%%2c{{ ;;!9s1vvaxB'' 	 	A!uae}qu,,,,  7Nr   z7&(#[0-9]+;?|#[xX][0-9a-fA-F]+;?|[^\t\n\f <&#;]{1,32};?)c                 N    d| vr| S t                               t          |           S )a^  
    Convert all named and numeric character references (e.g. &gt;, &#62;,
    &x3e;) in the string s to the corresponding unicode characters.
    This function uses the rules defined by the HTML 5 standard
    for both valid and invalid character references, and the list of
    HTML 5 named character references defined in html.entities.html5.
    r	   )_charrefsubr   )r   s    r   r   r      s'     !||<<(!,,,r   )T)__doc__re_rehtml.entitiesr   r   chrr   ImportErrorhtmlentitydefsname2codepoint	iteritemskv__all__r   r   r   r   compiler   r    r   r   <module>r      s       $------FF $ $ $d^F-7799 $ $1 &))q3w$ $$ Z
    $#(#$# 	(# 	&	#
 	(# 	(# 	(# 	(# 	(# 	(# 	(# 	(# 	(# 	(# 	(#  	&!#" 	(## #$ 	&%#& 	&'#( 	()#* 	(+#, 	(-#. 	(/#0 	(1#2 	(3#4 	(5#6 	(7#8 	(9#: 	(;#< 	(=#> 	(?#@ 	&A#B 	(C#D 	(E# # J   0  6 3; 3 4 4
- 
- 
- 
- 
-s    =AA