
    hi	                        d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z
mZmZ erddlmZ ddlmZ  G d d	e
          Z G d
 de
          ZdS )zOCustom element classes that correspond to the document part, e.g. <w:document>.    )annotations)TYPE_CHECKINGCallableList)	CT_SectPr)BaseOxmlElement
ZeroOrMore	ZeroOrOne)CT_Tbl)CT_Pc                  L    e Zd ZU dZ ed          Zded<   ed	d            ZdS )
CT_DocumentzB``<w:document>`` element, the root element of a document.xml file.zw:bodyCT_BodybodyreturnList[CT_SectPr]c                0    d}|                      |          S )a  All `w:sectPr` elements directly accessible from document element.

        Note this does not include a `sectPr` child in a paragraphs wrapped in
        revision marks or other intervening layer, perhaps `w:sdt` or customXml
        elements.

        `w:sectPr` elements appear in document order. The last one is always
        `w:body/w:sectPr`, all preceding are `w:p/w:pPr/w:sectPr`.
        z/./w:body/w:p/w:pPr/w:sectPr | ./w:body/w:sectPrxpath)selfr   s     j/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/docx/oxml/document.py
sectPr_lstzCT_Document.sectPr_lst   s     Bzz%       N)r   r   )	__name__
__module____qualname____doc__r
   r   __annotations__propertyr    r   r   r   r      sU         LLIh''D''''! ! ! X! ! !r   r   c                      e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<    edd          Z edd          Z edd          Z	ded<   ddZ
d Zedd            ZdS )r   zN`w:body`, the container element for the main document story in `document.xml`.zCallable[[], CT_P]add_pzCallable[[], CT_SectPr]get_or_add_sectPrz
List[CT_P]p_lstzList[CT_Tbl]tbl_lstzCallable[[CT_Tbl], CT_Tbl]_insert_tblzw:p)w:sectPr)
successorszw:tblr'   r    zCT_SectPr | NonesectPrr   r   c                    |                                  }|                                                     |                                           |                    d          D ]}|                    |           |S )ap  Return `w:sectPr` element for new section added at end of document.

        The last `w:sectPr` becomes the second-to-last, with the new `w:sectPr` being an
        exact clone of the previous one, except that all header and footer references
        are removed (and are therefore now "inherited" from the prior section).

        A copy of the previously-last `w:sectPr` will now appear in a new `w:p` at the
        end of the document. The returned `w:sectPr` is the sentinel `w:sectPr` for the
        document (and as implemented, `is` the prior sentinel `w:sectPr` with headers
        and footers removed).
        z#w:headerReference|w:footerReference)r#   r"   
set_sectPrcloner   remove)r   sentinel_sectPr
hdrftr_refs      r   add_section_breakzCT_Body.add_section_break3   sx     0022

 5 5 7 7888)//0UVV 	/ 	/J"":....r   c                `    |                      d          D ]}|                     |           dS )z~Remove all content child elements from this <w:body> element.

        Leave the <w:sectPr> element if it is present.
        z./*[not(self::w:sectPr)]N)r   r-   )r   content_elms     r   clear_contentzCT_Body.clear_contentI   s?    
  ::&@AA 	% 	%KKK$$$$	% 	%r   List[CT_P | CT_Tbl]c                ,    |                      d          S )zGenerate all `w:p` and `w:tbl` elements in this document-body.

        Elements appear in document order. Elements shaded by nesting in a `w:ins` or
        other "wrapper" element will not be included.
        z./w:p | ./w:tblr   )r   s    r   inner_content_elementszCT_Body.inner_content_elementsQ   s     zz+,,,r   N)r   r   )r   r4   )r   r   r   r   r   r	   ptblr
   r)   r0   r3   r   r6   r    r   r   r   r   #   s         XX....++++
5]333A
*W
7
7
7C(yr     F       ,% % % - - - X- - -r   r   N)r   
__future__r   typingr   r   r   docx.oxml.sectionr   docx.oxml.xmlchemyr   r	   r
   docx.oxml.tabler   docx.oxml.text.paragraphr   r   r   r    r   r   <module>r?      s    U U " " " " " " 0 0 0 0 0 0 0 0 0 0 ' ' ' ' ' ' E E E E E E E E E E .&&&&&&------! ! ! ! !/ ! ! !(5- 5- 5- 5- 5-o 5- 5- 5- 5- 5-r   