
    jF                    v    d Z ddlmZ ddlZddlmZmZmZ ddlm	Z
 ddlmZ erddlmZ ddlmZ dddZd ZdS )zDirectly exposed API functions and classes, :func:`Document` for now.

Provides a syntactically more convenient API for interacting with the OpcPackage graph.
    )annotationsN)IOTYPE_CHECKINGcast)CONTENT_TYPE)Package)Document)DocumentPartdocxstr | IO[bytes] | NonereturnDocumentObjectc                    | t                      n| } t          dt          j        |           j                  }|j        t          j        k    rd}t          || |j        fz            |j	        S )zReturn a |Document| object loaded from `docx`, where `docx` can be either a path
    to a ``.docx`` file (a string) or a file-like object.

    If `docx` is missing or ``None``, the built-in default document "template" is
    loaded.
    Nr
   z2file '%s' is not a Word file, content type is '%s')
_default_docx_pathr   r   openmain_document_partcontent_typeCTWML_DOCUMENT_MAIN
ValueErrordocument)r   document_parttmpls      |/home/chunsun/.hermes/profiles/hermes-scratch/workspace/agent-governance/.docx-venv/lib/python3.11/site-packages/docx/api.pyr	   r	      so     $(<TDd););)NOOM!R%999C}'A BBCCC!!    c                     t           j                            t                    d         } t           j                            | dd          S )z6Return the path to the built-in default .docx package.r   	templateszdefault.docx)ospathsplit__file__join)_thisdirs    r   r   r   "   s2    w}}X&&q)H7<<+~>>>r   )N)r   r   r   r   )__doc__
__future__r   r   typingr   r   r   docx.opc.constantsr   r   docx.packager   docx.documentr	   r   docx.parts.documentr
   r    r   r   <module>r,      s    
 # " " " " " 				 * * * * * * * * * * 1 1 1 1 1 1             1888888000000" " " " "? ? ? ? ?r   