
    Mi                        % S SK Jr  S SKJrJrJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJr  S SKJr  S	rS
\S'    SSSSSSS.               SS jjjrg)    )annotations)IOAnyOptional)Element)&convert_file_to_html_text_using_pandoc)FileType)exactly_one)get_last_modified_date)partition_htmlepubstrDETECTION_ORIGINNF)filemetadata_filenamemetadata_last_modified	languagesdetect_language_per_elementc                   [        XS9  U (       a  [        U 5      OSn[        SU US9n[        SUU=(       d    U [        R
                  U=(       d    UUU[        S.UD6$ )a  Partitions an EPUB document. The document is first converted to HTML and then
partitioned using partition_html.

Parameters
----------
filename
    A string defining the target filename path.
file
    A file-like object using "rb" mode --> open(filename, "rb").
metadata_last_modified
    The last modified date for the document.
languages
    User defined value for `metadata.languages` if provided. Otherwise language is detected
    using naive Bayesian filter via `langdetect`. Multiple languages indicates text could be
    in either language.
    Additional Parameters:
        detect_language_per_element
            Detect language per element instead of at the document level.
)filenamer   Nr   )source_formatr   r   )textr   metadata_file_typer   r   r   detection_origin )r
   r   r   r   r	   EPUBr   )	r   r   r   r   r   r   kwargslast_modified	html_texts	            u/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/unstructured/partition/epub.pypartition_epubr!      so    : -8@*84dM6I  	+7x#==5F$?)	 	 	    )N)r   Optional[str]r   zOptional[IO[bytes]]r   r#   r   r#   r   zOptional[list[str]]r   boolr   r   returnzlist[Element])
__future__r   typingr   r   r   unstructured.documents.elementsr   'unstructured.file_utils.file_conversionr   unstructured.file_utils.modelr	   $unstructured.partition.common.commonr
   &unstructured.partition.common.metadatar   unstructured.partition.htmlr   r   __annotations__r!   r   r"   r    <module>r/      s    " $ $ 3 Z 2 < I 6 #  #0 !%'+,0%)(-00 0 %	0
 *0 #0 "&0 0 0r"   