+
     h/  c                  s   ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^R	IHtHtHtHtHtHtHt ]
! ]R
7      R R l4       t]
! ]R
7      R R l4       t]
! ]R
7      R R l4       t]
! ]R
7      R R l4       t]
! ]R
7      R R l4       t]
! ]R
7      R R l4       t]
! ]R
7      R R l4       t]
! ]R
7      R R l4       t ]
! ]R
7      R R l4       t!]
! ]R
7      R R l4       t"]
! ]R
7      R R  l4       t#]
! ]R
7      R! R" l4       t$]
! ]R
7      R# R$ l4       t%]
! ]R
7      R% R& l4       t&]
! ]R
7      R' R( l4       t']
! ]R
7      R) R* l4       t(]
! ]R
7      R+ R, l4       t)]
! ]*! ]4      R
7      R- R. l4       t+]
! ]R
7      R/ R0 l4       t,RER1 R2 llt-]
! ^R
7      R3 R4 l4       t.R5 R6 lt/R7 R8 lt0RFR9 R: llt1R; R< lt2R= R> lt3R?]Ph                  R@3RA RB llt5RGRC RD llt6R# )Hi    )annotationsN)IncrementalDecoder)aliases)	lru_cache)findall)	Generator)MultibyteIncrementalDecoder)ENCODING_MARKSIANA_SUPPORTED_SIMILARRE_POSSIBLE_ENCODING_INDICATIONUNICODE_RANGES_COMBINEDUNICODE_SECONDARY_RANGE_KEYWORDUTF8_MAXIMAL_ALLOCATIONCOMMON_CJK_CHARACTERS)Zmaxsizec                    V ^8  d   QhRRRR/#    	characterstrreturnbool Zformat   "=/usr/lib/python3.14/site-packages/charset_normalizer/utils.py__annotate__r      s      c d     c                s    \         P                  ! V 4      pRT9   ;'       gT    RT9   ;'       gG    RT9   ;'       g:    RT9   ;'       g-    RT9   ;'       g     RT9   ;'       g    RT9   ;'       g    RT9   #   \         d     R # i ; i)	Fz
WITH GRAVEz
WITH ACUTEzWITH CEDILLAzWITH DIAERESISzWITH CIRCUMFLEXz
WITH TILDEzWITH MACRONzWITH RING ABOVEunicodedataname
ValueErrorr   Zdescription   & r   is_accentuatedr!      s    &++I6 	# 	, 	,;&	, 	,[(	, 	, {*	, 	, +		, 	,
 ;&	, 	, K'	, 	, +	  s   A8 8BBc               s     V ^8  d   QhRRRR/# )r   r   r   r   r   r   r   r   r   r   .   s     " "S "S "r   c                s    \         P                  ! V 4      pV'       g   V # VP                  R 4      p\        \	        V^ ,          ^4      4      # )Z )r   ZdecompositionZsplitZchrint)r   Z
decomposedZcodes   &  r   remove_accentr$   -   sA    !//	:J!'',Es58R !!r   c               r   )r   r   r   r   
str | Noner   r   r   r   r   r   9   s     
 
S 
Z 
r   c                sl    \        V 4      p\        P                  ! 4        F  w  r#W9   g   K  Vu # 	  R# )zC
Retrieve the Unicode range official name from a single character.
N)Zordr
   items)r   Zcharacter_ord
range_nameZ	ord_range   &   r   unicode_ranger)   8   s5    
 YM!8!>!>!@
% "A r   c               r   r   r   r   r   r   r   r   G   s     " " " "r   c                ^     \         P                  ! V 4      pRV9   #   \         d     R # i ; i)FZLATINr   r   r    r   is_latinr+   F   s8    &++I6 k!!      ,,c               r   r   r   r   r   r   r   r   P   s     , ,c ,d ,r   c                sl    \         P                  ! V 4      pR V9   d   R# \        V 4      pVf   R# RV9   # )ZPTFZPunctuationr   categoryr)   r   character_categorycharacter_ranger#   r   is_punctuationr2   O   s=    )229=
  "/	":OO++r   c               r   r   r   r   r   r   r   r   _   s     E E E Er   c                s    \         P                  ! V 4      pR V9   g   RV9   d   R# \        V 4      pVf   R# RV9   ;'       d    VR8g  # )ZSZNTFZFormsZLor-   r/   r#   r   	is_symbolr3   ^   sS    )229=
  C+=$="/	":Oo%DD*<*DDr   c               r   r   r   r   r   r   r   r   n   s     N N3 N4 Nr   c                sH    \        V 4      pVf   R# RV9   ;'       g    RV9   # )NFZ	EmoticonsZPictographs)r)   )r   r1   r    r   is_emoticonr4   m   s-    "/	":O/)MM]o-MMr   c               r   r   r   r   r   r   r   r   x   s     Q QC QD Qr   c                s    V P                  4       '       g   V R9   d   R# \        P                  ! V 4      pRV9   ;'       g    VR9   # )   ｜TZZ>   Z+Z<Z>r5   >   ZPcZPdZPo)isspacer   r.   )r   r0   r    r   is_separatorr7   w   sH    i+AA)229=$$PP(:>P(PPr   c               r   r   r   r   r   r   r   r      s     6 6 6 6r   c                sD    V P                  4       V P                  4       8g  # N)ZislowerZisupperr      &r   is_case_variabler;      s    )"3"3"555r   c               r   r   r   r   r   r   r   r      s     # #c #d #r   c                r*   )FZCJKr   r   Zcharacter_namer    r   is_cjkr=      s8    $)))4 N""  r,   c               r   r   r   r   r   r   r   r           ( (3 (4 (r   c                r*   )FZHIRAGANAr   r<   r    r   is_hiraganar?      8    $)))4 ''  r,   c               r   r   r   r   r   r   r   r      r>   r   c                r*   )FZKATAKANAr   r<   r    r   is_katakanarA      r@   r,   c               r   r   r   r   r   r   r   r           & & & &r   c                r*   )FZHANGULr   r<   r    r   	is_hangulrC      8    $)))4 ~%%  r,   c               r   r   r   r   r   r   r   r      s     $ $s $t $r   c                r*   )FZTHAIr   r<   r    r   is_thairE      s8    $)))4 ^##  r,   c               r   r   r   r   r   r   r   r      rB   r   c                r*   )FARABICr   r<   r    r   	is_arabicrG      rD   r,   c               r   r   r   r   r   r   r   r      s     L Ls Lt Lr   c                sx     \         P                  ! V 4      pRT9   ;'       d    RT9   #   \         d     R # i ; i)FrF   zISOLATED FORMr   r<   r    r   is_arabic_isolated_formrH      sE    $)))4 ~%KK/^*KK  s   * 99c               r   r   r   r   r   r   r   r      s     2 2s 2t 2r   c                s    V \         9  # r8   )r   r9   r:   r   is_cjk_uncommonrI      s    111r   c               r   )r   r'   r   r   r   r   r   r   r   r   r      s     U U3 U4 Ur   c                s   a  \         ;QJ d#    V 3R  l\         4       F  '       g   K   R# 	  R# ! V 3R  l\         4       4      # )c              3  s,   <"   T F	  qS9   x  K  	  R # 5ir8   r   )Z.0Zkeywordr'   s   & r   Z	<genexpr>Z-is_unicode_range_secondary.<locals>.<genexpr>   s     T4S*$4Ss   TF)Zanyr   )r'   s   fr   is_unicode_range_secondaryrJ      s.    3T4ST33T3T3T4STTTr   c               r   r   r   r   r   r   r   r      s      c d r   c                s    V P                  4       R J ;'       d-    V P                  4       R J ;'       d    V R8g  ;'       d    V R8g  # )FZu   ﻿)r6   Zisprintabler9   r:   r   is_unprintablerK      s[     	u$ 	" 	"!!#u,	" 	"	" 	" !	r   c               s$    V ^8  d   QhRRRRRR/# )r   sequencebytessearch_zoner"   r   r%   r   r   r   r   r   r      s!      U  
 r   c           	     s   \        V \        4      '       g   \        h\        V 4      p\	        \
        V R\        W!4       P                  RRR7      4      p\        V4      ^ 8X  d   R# V FY  pVP                  4       P                  RR4      p\        P                  ! 4        F  w  rVWT8X  d   Vu u # Wd8X  g   K  Vu u # 	  K[  	  R# )zO
Extract using ASCII-only decoder any specified encoding in the first n-bytes.
NZasciiignoreZerrors-_)
isinstancerM   Z	TypeErrorlenr   r	   mindecodelowerreplacer   r&   )rL   rN   Zseq_lenZresultsZspecified_encodingencoding_aliasencoding_ianas   &&     r   any_specified_encodingr[      s     h&&x=G ',3w,-44WX4NG
 7|q%/557??SI
 .5]]_)N3$$2$$	 .= & r   c               r   )r   r   r   r   r   r   r   r   r   r   r     s        r   c                s~    V R9   ;'       g2    \        \        P                  ! RV  24      P                  \        4      # )zI
Verify is a specific encoding is a multi byte one based on it IANA name

encodings.>	   Zutf_7Zutf_8utf_16utf_32Z	utf_16_beZ	utf_16_leZ	utf_32_beZ	utf_32_leZ	utf_8_sig)Z
issubclass	importlibimport_moduler   r   )r   r:   r   is_multi_byte_encodingra     sH    
  
 
   
*TF 34GG#
r   c               r   )r   rL   rM   r   ztuple[str | None, bytes]r   r   r   r   r   r     s      % ,D r   c                s    \          FP  p\         V,          p\        V\        4      '       d   V.pV F!  pV P                  V4      '       g   K  W3u u # 	  KR  	  R# )z1
Identify and extract SIG/BOM in given sequence.
)Nr   )r   rS   rM   Z
startswith)rL   iana_encodingZmarksZmarkr(   r   identify_sig_or_bomrc     sX    
 (%3M%BeU##GED""4(($**  ( r   c               r   )r   rb   r   r   r   r   r   r   r   r   r   (  s     5 53 54 5r   c                s    V R9  # )r]   >   r]   r^   r   )rb   r:   r   should_strip_sig_or_bomrd   (  s     444r   c               s$    V ^8  d   QhRRRRRR/# )r   cp_namer   strictr   r   r   r   r   r   r   r   ,  s!      s D C r   c                s    V P                  4       P                  RR4      p \        P                  ! 4        F  w  r#WV39   g   K  Vu # 	  V'       d   \	        RV  R24      hV # )zIReturns the Python normalized encoding name (Not the IANA official name).rQ   rR   zUnable to retrieve IANA for 'Z')rW   rX   r   r&   r   )re   rf   rY   rZ   s   &&  r   	iana_namerg   ,  s_    mmo%%c3/G
 *1%}55   *9 8	CDDNr   c               $    V ^8  d   QhRRRRRR/# )r   iana_name_ar   iana_name_br   Zfloatr   r   r   r   r   r   =  s!     ' 's ' ' 'r   c                s   \        V 4      '       g   \        V4      '       d   R # \        P                  ! RV  24      P                  p\        P                  ! RV 24      P                  pV! RR7      pV! RR7      p^ p\	        ^4       F?  p\        V.4      pVP                  V4      VP                  V4      8X  g   K6  V^,          pKA  	  V^,          # )g        r\   rO   rP   )ra   r_   r`   r   rangerM   rV   )	ri   rj   Z	decoder_aZ	decoder_bZid_aZid_bZcharacter_match_countiZto_be_decodeds	   &&       r   cp_similarityrm   =  s    k**.D[.Q.Q''*[M(BCVVI''*[M(BCVVI(9D(9D!"3Z$aSz;;}%])CC!Q&! 
 !3&&r   c               rh   )r   ri   r   rj   r   r   r   r   r   r   r   r   Q  s!      s   r   c                sD    V \         9   ;'       d    V\         V ,          9   # )z
Determine if two code page are at least 80% similar. IANA_SUPPORTED_SIMILAR dict was generated using
the function cp_similarity.
)r   )ri   rj   s   &&r   is_cp_similarrn   Q  s*     	-- 	? 	?1+>>r   Zcharset_normalizerz)%(asctime)s | %(levelname)s | %(message)sc               s(    V ^8  d   QhRRRRRRRR/# )r   r   r   levelr"   format_stringr   ZNoner   r   r   r   r   r   \  s0     
 



 
 
	
r   c                s    \         P                  ! V 4      pVP                  V4       \         P                  ! 4       pVP	                  \         P
                  ! V4      4       VP                  V4       R # r8   )loggingZ	getLoggerZsetLevelZStreamHandlerZsetFormatterZ	FormatterZ
addHandler)r   ro   rp   ZloggerZhandlers   &&&  r   set_logging_handlerrr   \  sU    
 t$F
OOE##%G**=9:
gr   c               s@    V ^8  d   QhRRRRRRRRR	R
RR
RRRR
RRRR/
# )r   	sequencesrM   rZ   r   offsetsrk   
chunk_sizer"   bom_or_sig_availabler   strip_sig_or_bomsig_payloadis_multi_byte_decoderdecoded_payloadr%   r   zGenerator[str, None, None]r   r   r   r   r   r   i  sl     5 555 5 	5
 5 5 5  5  5  5r   c	              #  sH  "   V'       d+   VR J d%   V F  p	WW,            p
V
'       g    R# V
x  K  	  R# V F  p	W,           pV\        V 4      ^,           8  d   K$  W	W,            pV'       d   VR J d	   Wl,           pTP                  TV'       d   RMRR7      p
V'       dy   V	^ 8  dr   \        V^4      pV'       d^   V
RV V9  dT   \        W^,
          R4       F<  pWV pV'       d   VR J d	   Wl,           pVP                  VRR7      p
V
RV V9   g   K<   M	  V
x  K  	  R# 5i)FrO   rf   rP   Ni)rT   rV   rU   rk   )rs   rZ   rt   ru   rv   rw   rx   ry   rz   rl   ZchunkZ	chunk_endZcut_sequenceZchunk_partial_size_chkZjs   &&&&&&&&&      r   cut_sequence_chunksr{   i  s)     0E9A#7EK	  AI3y>A--$8L#(8E(A*9 ''#8xh ( E %Q.1*b.A& $556oM"1!eR0'09'=/4D4M+6+EL , 3 3M( 3 S !8"89_L! 1 KG s   BD"D" A/D"D")i    )Tr8   )7Z
__future__r    r_   rq   r   Zcodecsr   Zencodings.aliasesr   Z	functoolsr   Zrer   Ztypingr   Z_multibytecodecr   Zconstantr   r   r	   r
   r   r   r   r!   r$   r)   r+   r2   r3   r4   r7   r;   r=   r?   rA   rC   rE   rG   rH   rI   rT   rJ   rK   r[   ra   rc   rd   rg   rm   rn   ZINFOrr   r{   r   r   r   <module>r|      s   "    % %      *+ ," *+" ," *+
 ,
 *+" ," *+, ,, *+E ,E *+N ,N *+Q ,Q *+6 ,6 *+# ,# *+( ,( *+( ,( *+& ,& *+$ ,$ *+& ,& *+L ,L *+2 ,2 3./0U 1U *+ ,@ 3 ($5"'( %D
5 5r   