
    f jg                     8    d Z ddlmZ dZdZdZdededz  fd	ZdS )
zStage 1d: UTF-8 structural validation.

Note: ``from __future__ import annotations`` is intentionally omitted because
this module is compiled with mypyc, which does not support PEP 563 string
annotations.
    )DetectionResultg?gGz?   datareturnNc           	         | sdS d}t          |           }d}d}||k     r| |         }|dk     r|dz  }d|cxk    rdk    rn nd}n(d|cxk    rd	k    rn nd
}nd|cxk    rdk    rn nd}ndS ||z   |k    rnt          d|          D ]}d| ||z            cxk    rdk    sn  dS |d
k    r/|dk    r| |dz            dk     rdS |dk    r| |dz            dk    rdS n4|dk    r.|dk    r| |dz            dk     rdS |dk    r| |dz            dk    rdS |dz  }||z  }||z  }||k     |dk    rdS ||z  }t          t          z
  }	t	          t          t          |	t	          |t
          z  d          z  z             }
t          d|
d          S )a  Validate UTF-8 byte structure.

    Returns a result only if multi-byte sequences are found (pure ASCII
    is handled by the ASCII stage).

    :param data: The raw byte data to examine.
    :returns: A :class:`DetectionResult` for UTF-8, or ``None``.
    Nr                                                      g      ?zutf-8)encoding
confidencelanguage)lenrange_MAX_CONFIDENCE_BASE_CONFIDENCEmin_MB_RATIO_SCALEr   )r   ilengthmultibyte_sequencesmultibyte_bytesbyteseq_lenjmb_ratioconfidence_ranger   s              iC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\chardet/pipeline/utf8.pydetect_utf8r,      s     t	AYYFO
f* /Aw$; 	FA 4 	 	 	 	4 	 	 	 	 	GGT 	 	 	 	T 	 	 	 	 	GGT 	 	 	 	T 	 	 	 	 	GG 4 w; 	 q'"" 	 	ADQK    4    tt a< 	t| QUd 2 tt| QUd 2 t\ 	t| QUd 2 tt| QUd 2 tq 7"	W_ f* /d a t 'H&)99+c(_2Lc.R.RRR J G
TRRRR    )__doc__chardet.pipeliner   r   r   r!   bytesr,    r-   r+   <module>r2      sx     - , , , , ,   NSe NS$ 6 NS NS NS NS NS NSr-   