+
    iH0                        ^ 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 ^RIHtHt ^RIHtHtHt  ! R R	4      t ! R
 R4      t]]]3,          t]],          t ! R R4      tR# )    )annotations)aliases)dumps)sub)AnyIteratorListTuple)RE_POSSIBLE_ENCODING_INDICATIONTOO_BIG_SEQUENCE)	iana_nameis_multi_byte_encodingunicode_rangec                     ] tR t^tR3R R lltR R ltR R lt]R R	 l4       tR
 R lt	R R lt
R R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R  R! l4       t]R" R# l4       t]R$ R% l4       t]R& R' l4       t]R( R) l4       t]R* R+ l4       t]R, R- l4       tR4R. R/ llt]R0 R1 l4       tR2tR# )5CharsetMatchNc               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )   payloadbytes | bytearrayguessed_encodingstrmean_mess_ratiofloathas_sig_or_bombool	languagesCoherenceMatchesdecoded_payload
str | Nonepreemptive_declaration )formats   "l/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/charset_normalizer/models.py__annotate__CharsetMatch.__annotate__   sY     J J"J J 	J
 J $J $J !+J    c                	    Wn         W n        W0n        WPn        W@n        R V n        . V n        RV n        R V n        R V n	        W`n
        Wpn        R # )N        )_payload	_encoding_mean_mess_ratio
_languages_has_sig_or_bom_unicode_ranges_leaves_mean_coherence_ratio_output_payload_output_encoding_string_preemptive_declaration)selfr   r   r   r   r   r   r    s   &&&&&&&&r#   __init__CharsetMatch.__init__   sQ     ,3.'6,5%315+-,/"-1,0#23I$r&   c                    V ^8  d   QhRRRR/# r   otherobjectreturnr   r!   )r"   s   "r#   r$   r%   )   s     Y YF Yt Yr&   c                	   \        V\        4      '       g1   \        V\        4      '       d   \        V4      V P                  8H  # R # V P                  VP                  8H  ;'       d    V P
                  VP
                  8H  # )F)
isinstancer   r   r   encodingfingerprintr5   r:   s   &&r#   __eq__CharsetMatch.__eq__)   s_    %..%%% '4==88}}.XX43C3CuGXGX3XXr&   c                    V ^8  d   QhRRRR/# r9   r!   )r"   s   "r#   r$   r%   0   s     ( (F (t (r&   c                   \        V\        4      '       g   \        h\        V P                  VP                  ,
          4      p\        V P
                  VP
                  ,
          4      pVR8  d!   VR8  d   V P
                  VP
                  8  # VR8  dX   VR8:  dQ   \        V P                  4      \        8  d   V P                  VP                  8  # V P                  VP                  8  # V P                  VP                  8  # )zA
Implemented to make sorted available upon CharsetMatches items.
g{Gzt?g{Gz?)
r>   r   
ValueErrorabschaos	coherencelenr)   r   multi_byte_usage)r5   r:   chaos_differencecoherence_differences   &&  r#   __lt__CharsetMatch.__lt__0   s     %.."%djj5;;&>"?&)$..5??*J&K e#(<t(C>>EOO33%*>$*F 4==!%55zzEKK//((5+A+AAAzzEKK''r&   c                   V ^8  d   QhRR/# r   r<   r   r!   )r"   s   "r#   r$   r%   G   s     6 6% 6r&   c                	l    R \        \        V 4      4      \        V P                  4      ,          ,
          # )g      ?)rJ   r   rawr5   s   &r#   rK   CharsetMatch.multi_byte_usageF   s"    c#d)ns488}455r&   c                   V ^8  d   QhRR/# r   r<   r   r!   )r"   s   "r#   r$   r%   J   s       r&   c                	    V P                   f'   \        V P                  V P                  R4      V n         V P                   # )Nstrict)r3   r   r)   r*   rT   s   &r#   __str__CharsetMatch.__str__J   s.    <<t}}dnnhGDL||r&   c                   V ^8  d   QhRR/# rW   r!   )r"   s   "r#   r$   r%   P   s     J J# Jr&   c                	<    R V P                    RV P                   R2# )z<CharsetMatch 'z' fp(z)>)r?   r@   rT   s   &r#   __repr__CharsetMatch.__repr__P   s"     uT5E5E4FbIIr&   c                    V ^8  d   QhRRRR/# )r   r:   r   r<   Noner!   )r"   s   "r#   r$   r%   S   s     	# 	#, 	#4 	#r&   c                	    \        V\        4      '       d   W8X  d%   \        R P                  VP                  4      4      hRVn        V P                  P                  V4       R# )z;Unable to add instance <{}> as a submatch of a CharsetMatchN)r>   r   rF   r"   	__class__r3   r/   appendrA   s   &&r#   add_submatchCharsetMatch.add_submatchS   sP    %..%-MTTOO  E"r&   c                   V ^8  d   QhRR/# rW   r!   )r"   s   "r#   r$   r%   _   s      # r&   c                	    V P                   # N)r*   rT   s   &r#   r?   CharsetMatch.encoding^   s    ~~r&   c                   V ^8  d   QhRR/# r   r<   	list[str]r!   )r"   s   "r#   r$   r%   c   s     
 
) 
r&   c                    . p\         P                  ! 4        FM  w  r#V P                  V8X  d   VP                  V4       K)  V P                  V8X  g   K<  VP                  V4       KO  	  V# )zr
Encoding name are known by many name, using this could help when searching for IBM855 when it's listed as CP855.
)r   itemsr?   rd   )r5   also_known_asups   &   r#   encoding_aliasesCharsetMatch.encoding_aliasesb   sW    
 $&MMODA}}!$$Q'!#$$Q'	 $
 r&   c                   V ^8  d   QhRR/# r   r<   r   r!   )r"   s   "r#   r$   r%   p   s     $ $T $r&   c                	    V P                   # ri   r-   rT   s   &r#   bomCharsetMatch.bomo       ###r&   c                   V ^8  d   QhRR/# rv   r!   )r"   s   "r#   r$   r%   t   s     $ $ $r&   c                	    V P                   # ri   rx   rT   s   &r#   byte_order_markCharsetMatch.byte_order_marks   r{   r&   c                   V ^8  d   QhRR/# rl   r!   )r"   s   "r#   r$   r%   x   s     / /9 /r&   c                P    V P                    Uu. uF  q^ ,          NK  	  up# u upi )z
Return the complete list of possible languages found in decoded sequence.
Usually not really useful. Returned list may be empty even if 'language' property return something != 'Unknown'.
r,   )r5   es   & r#   r   CharsetMatch.languagesw   s$     #oo.o!o...s   #c                   V ^8  d   QhRR/# rW   r!   )r"   s   "r#   r$   r%      s     % %# %r&   c                R   V P                   '       g}   RV P                  9   d   R# ^ RIHpHp \        V P                  4      '       d   V! V P                  4      MV! V P                  4      p\        V4      ^ 8X  g   RV9   d   R# V^ ,          # V P                   ^ ,          ^ ,          # )zz
Most probable language found in decoded sequence. If none were detected or inferred, the property will return
"Unknown".
asciiEnglish)encoding_languagesmb_encoding_languageszLatin BasedUnknown)r,   could_be_from_charsetcharset_normalizer.cdr   r   r   r?   rJ   )r5   r   r   r   s   &   r#   languageCharsetMatch.language   s      $444  X *$--88 &dmm4'6  9~"my&@ Q<q!!$$r&   c                   V ^8  d   QhRR/# rQ   r!   )r"   s   "r#   r$   r%      s     % %u %r&   c                	    V P                   # ri   )r+   rT   s   &r#   rH   CharsetMatch.chaos   s    $$$r&   c                   V ^8  d   QhRR/# rQ   r!   )r"   s   "r#   r$   r%      s     % %5 %r&   c                	^    V P                   '       g   R # V P                   ^ ,          ^,          # )r(   r   rT   s   &r#   rI   CharsetMatch.coherence   s"    q!!$$r&   c                   V ^8  d   QhRR/# rQ   r!   )r"   s   "r#   r$   r%      s     2 2u 2r&   c                	>    \        V P                  ^d,          ^R7      # d   )ndigits)roundrH   rT   s   &r#   percent_chaosCharsetMatch.percent_chaos   s    TZZ#%q11r&   c                   V ^8  d   QhRR/# rQ   r!   )r"   s   "r#   r$   r%      s     6 65 6r&   c                	>    \        V P                  ^d,          ^R7      # r   )r   rI   rT   s   &r#   percent_coherenceCharsetMatch.percent_coherence   s    T^^c)155r&   c                   V ^8  d   QhRR/# )r   r<   r   r!   )r"   s   "r#   r$   r%      s      & r&   c                    V P                   # )z
Original untouched bytes.
)r)   rT   s   &r#   rS   CharsetMatch.raw   s    
 }}r&   c                   V ^8  d   QhRR/# )r   r<   zlist[CharsetMatch]r!   )r"   s   "r#   r$   r%      s      , r&   c                	    V P                   # ri   )r/   rT   s   &r#   submatchCharsetMatch.submatch   s    ||r&   c                   V ^8  d   QhRR/# rv   r!   )r"   s   "r#   r$   r%      s     % %d %r&   c                	2    \        V P                  4      ^ 8  # r   )rJ   r/   rT   s   &r#   has_submatchCharsetMatch.has_submatch   s    4<< 1$$r&   c                   V ^8  d   QhRR/# rl   r!   )r"   s   "r#   r$   r%      s     $ $9 $r&   c                	   V P                   e   V P                   # \        V 4       Uu. uF  p\        V4      NK  	  pp\        \	        V Uu0 uF  q3'       g   K  VkK  	  up4      4      V n         V P                   # u upi u upi ri   )r.   r   r   sortedlist)r5   chardetected_rangesrs   &   r#   	alphabetsCharsetMatch.alphabets   sr    +'''MPQUY,WYT]4-@Y,W%d+L!!AA+L&MN### -X+Ls   A<	BBc                   V ^8  d   QhRR/# rl   r!   )r"   s   "r#   r$   r%      s     E Ey Er&   c                z    V P                   .V P                   Uu. uF  qP                  NK  	  up,           # u upi )z
The complete list of encoding that output the exact SAME str result and therefore could be the originating
encoding.
This list does include the encoding available in property 'encoding'.
)r*   r/   r?   )r5   ms   & r#   r   "CharsetMatch.could_be_from_charset   s.     t||"D|!::|"DDD"Ds   8c                    V ^8  d   QhRRRR/# )r   r?   r   r<   bytesr!   )r"   s   "r#   r$   r%      s     $ $s $ $r&   c                `  a  S P                   e   S P                   V8w  d   VS n         \        S 4      pS P                  eM   S P                  P                  4       R9  d.   \	        \
        V 3R lVR,          ^R7      pW2R,          ,           pVP                  VR4      S n        S P                  # )z
Method to get re-encoded bytes payload using given target encoding. Default to UTF-8.
Any errors will be simply ignored by the encoder NOT replaced.
c                  < V P                   V P                  4       ^ ,          V P                  4       ^,           P                  V P                  4       ^ ,          \	        SP
                  4      P                  RR4      4      # )r   _-)stringspanreplacegroupsr   r2   )r   r5   s   &r#   <lambda>%CharsetMatch.output.<locals>.<lambda>   sW    ahhqvvx{QVVXa[AII
1!$"7"78@@cJr&   :Ni    N)count:i    NNr   )zutf-8utf8utf_8)r2   r   r4   lowerr   r   encoder1   )r5   r?   decoded_stringpatched_headers   f&  r#   outputCharsetMatch.output   s    
   (D,A,AX,M$,D! YN,,80066812 "%3 #5)" "02G!G#1#8#89#MD ###r&   c                   V ^8  d   QhRR/# r   r<   intr!   )r"   s   "r#   r$   r%      s      S r&   c                *    \        \        V 4      4      # )zM
Retrieve a hash fingerprint of the decoded payload, used for deduplication.
)hashr   rT   s   &r#   r@   CharsetMatch.fingerprint   s    
 CIr&   )r*   r-   r,   r/   r0   r+   r2   r1   r)   r4   r3   r.   )NN)r   )__name__
__module____qualname____firstlineno__r6   rB   rN   propertyrK   rZ   r^   re   r?   rs   ry   r~   r   r   rH   rI   r   r   rS   r   r   r   r   r   r@   __static_attributes__r!   r&   r#   r   r      s~   J8Y(, 6 6J	#   
 
 $ $ $ $ / / % %6 % % % %
 2 2 6 6     % % $ $ E E$:  r&   r   c                  ~    ] tR t^tRtRR R lltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltRtR# )CharsetMatchesz
Container with every CharsetMatch items ordered by default from most probable to the less one.
Act like a list(iterable) but does not implements all related methods.
Nc                   V ^8  d   QhRR/# )r   resultszlist[CharsetMatch] | Noner!   )r"   s   "r#   r$   CharsetMatches.__annotate__   s     O O 9 Or&   c                	H    V'       d   \        V4      V n        R # . V n        R # ri   )r   _results)r5   r   s   &&r#   r6   CharsetMatches.__init__   s    ?FF7OBr&   c                   V ^8  d   QhRR/# )r   r<   zIterator[CharsetMatch]r!   )r"   s   "r#   r$   r      s     ! !0 !r&   c              #  	:   "   V P                    R j  xL
  R #  L5iri   r   rT   s   &r#   __iter__CharsetMatches.__iter__   s     ==  s   c                    V ^8  d   QhRRRR/# )r   itemz	int | strr<   r   r!   )r"   s   "r#   r$   r      s      	 l r&   c                    \        V\        4      '       d   V P                  V,          # \        V\        4      '       d4   \	        VR4      pV P                   F  pWP
                  9   g   K  Vu # 	  \        h)z
Retrieve a single item either by its position or encoding name (alias may be used here).
Raise KeyError upon invalid index or encoding not present in results.
F)r>   r   r   r   r   r   KeyError)r5   r   results   && r#   __getitem__CharsetMatches.__getitem__   s_    
 dC  ==&&dC  T5)D--777!M ( r&   c                   V ^8  d   QhRR/# r   r!   )r"   s   "r#   r$   r     s     " " "r&   c                	,    \        V P                  4      # ri   rJ   r   rT   s   &r#   __len__CharsetMatches.__len__  s    4==!!r&   c                   V ^8  d   QhRR/# rv   r!   )r"   s   "r#   r$   r     s     & &$ &r&   c                	2    \        V P                  4      ^ 8  # r   r   rT   s   &r#   __bool__CharsetMatches.__bool__  s    4==!A%%r&   c                    V ^8  d   QhRRRR/# )r   r   r   r<   ra   r!   )r"   s   "r#   r$   r     s     . .< .D .r&   c                   \        V\        4      '       g.   \        RP                  \	        VP
                  4      4      4      h\        VP                  4      \        8  d`   V P                   FO  pVP                  VP                  8X  g   K   VP                  VP                  8X  g   K=  VP                  V4        R# 	  V P                  P                  V4       \        V P                  4      V n	        R# )zf
Insert a single match. Will be inserted accordingly to preserve sort.
Can be inserted as a submatch.
z-Cannot append instance '{}' to CharsetMatchesN)r>   r   rF   r"   r   rc   rJ   rS   r   r   r@   rH   re   rd   r   )r5   r   matchs   && r#   rd   CharsetMatches.append  s    
 $--?FF'  txx=++$$(8(88U[[DJJ=V&&t, ' 	T"t}}-r&   c                   V ^8  d   QhRR/# r   r<   zCharsetMatch | Noner!   )r"   s   "r#   r$   r   (  s        )  r&   c                P    V P                   '       g   R# V P                   ^ ,          # )zA
Simply return the first match. Strict equivalent to matches[0].
Nr   rT   s   &r#   bestCharsetMatches.best(  s     }}}}}Qr&   c                   V ^8  d   QhRR/# r   r!   )r"   s   "r#   r$   r   0  s      * r&   c                "    V P                  4       # )z@
Redundant method, call the method best(). Kept for BC reasons.
)r   rT   s   &r#   firstCharsetMatches.first0  s     yy{r&   r   ri   )r   r   r   r   __doc__r6   r   r   r   r   rd   r   r  r   r!   r&   r#   r   r      s5    
O!"&.(  r&   r   c                  D    ] tR tRtR R lt]R R l4       tR R ltRtR	# )
CliDetectionResulti;  c               D    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R/# )r   pathr   r?   r   rs   rm   alternative_encodingsr   r   r   r   rH   r   rI   unicode_pathis_preferredr!   )r"   s   "r#   r$   CliDetectionResult.__annotate__<  sx     / // / $	/
  )/ / / / / / !/ /r&   c                	    Wn         Wn        W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn	        Wn
        R # ri   )r
  r  r?   rs   r  r   r   r   rH   rI   r  )r5   r
  r?   rs   r  r   r   r   rH   rI   r  r  s   &&&&&&&&&&&&r#   r6   CliDetectionResult.__init__<  s@     	(4$,+;0E"%$-$2!
 )".r&   c                   V ^8  d   QhRR/# )r   r<   zdict[str, Any]r!   )r"   s   "r#   r$   r  W  s     
 
. 
r&   c                	   R V P                   RV P                  RV P                  RV P                  RV P                  RV P
                  RV P                  RV P                  RV P                  R	V P                  R
V P                  /# r
  r?   rs   r  r   r   r   rH   rI   r  r  r  rT   s   &r#   __dict__CliDetectionResult.__dict__V  s{     DII 5 5#T%?%?d11TZZD--D--
 	
r&   c                   V ^8  d   QhRR/# rW   r!   )r"   s   "r#   r$   r  f  s     A A Ar&   c                	2    \        V P                  R ^R7      # )T)ensure_asciiindent)r   r  rT   s   &r#   to_jsonCliDetectionResult.to_jsonf  s    T]]a@@r&   )r   r  rH   rI   r?   rs   r   r  r   r
  r  N)	r   r   r   r   r6   r   r  r  r   r!   r&   r#   r  r  ;  s'    /4 
 
A Ar&   r  N)
__future__r   encodings.aliasesr   jsonr   rer   typingr   r   r	   r
   constantr   r   utilsr   r   r   r   r   r   r   CoherenceMatchr   r  r!   r&   r#   <module>r$     sa    " %   - - G C Ce eP@ @F sEz"' ,A ,Ar&   