+
    ^eòjt%  ã                   ó®   € R t ^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHt  ! R R4      t ! R R	4      t ! R
 R4      t ! R R4      t ! R R4      tR# )zQLow-level, read-only API to a serialized Open Packaging Convention (OPC) package.)ÚRELATIONSHIP_TARGET_MODE)Ú	parse_xml)ÚPACKAGE_URIÚPackURI)ÚPhysPkgReader)ÚCaseInsensitiveDictc                   ó†   a a€ ] tR t^
t oRtV 3R lt]R 4       tR tR t	]R 4       t
]R 4       t]R
R l4       tR	tVtV ;t# )ÚPackageReaderz~Provides access to the contents of a zip-format OPC package via its
:attr:`serialized_parts` and :attr:`pkg_srels` attributes.c                óD   <€ \         \        V `  4        W n        W0n        R # ©N)Úsuperr	   Ú__init__Ú
_pkg_srelsÚ_sparts)ÚselfÚcontent_typesÚ	pkg_srelsÚspartsÚ	__class__s   &&&&€Ú‰/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/docx/opc/pkgreader.pyr   ÚPackageReader.__init__   s   ø€ ÜŒm˜TÑ+Ô-Ø#ŒØŽó    c                óî   € \        V 4      p\        P                  VP                  4      p\        P                  V\        4      p\        P                  WV4      pVP                  4        \	        W#V4      # )zEReturn a |PackageReader| instance loaded with contents of `pkg_file`.)	r   Ú_ContentTypeMapÚfrom_xmlÚcontent_types_xmlr	   Ú
_srels_forr   Ú_load_serialized_partsÚclose)Úpkg_fileÚphys_readerr   r   r   s   &    r   Ú	from_fileÚPackageReader.from_file   sa   € ô $ HÓ-ˆÜ'×0Ñ0°×1NÑ1NÓOˆÜ!×,Ñ,¨[¼+ÓFˆ	Ü×5Ñ5°kÈmÓ\ˆØ×ÑÔÜ˜]°vÓ>Ð>r   c              #  ó”   "  € V P                    F3  pVP                  VP                  VP                  VP                  3x € K5  	  R# 5i)zmGenerate a 4-tuple `(partname, content_type, reltype, blob)` for each of the
serialized parts in the package.N)r   ÚpartnameÚcontent_typeÚreltypeÚblob)r   Úss   & r   Úiter_spartsÚPackageReader.iter_sparts   s4   é € ð —”ˆAØ—:‘:˜qŸ~™~¨q¯y©y¸!¿&¹&ÐAÔAó ùs   ‚AAc              #  ó´   "  € V P                    F  p\        V3x € K  	  V P                   F&  pVP                   F  pVP                  V3x € K  	  K(  	  R# 5i)zUGenerate a 2-tuple `(source_uri, srel)` for each of the relationships in the
package.N)r   r   r   Úsrelsr$   )r   ÚsrelÚsparts   &  r   Ú
iter_srelsÚPackageReader.iter_srels#   sK   é € ð —O”OˆDÜ Ð%Ô%ñ $à—\”\ˆEØŸœ�Ø—~‘~ tÐ,Ô,ó $ó "ùs   ‚AAc                óª   € . p\         P                  W4      pV F,  w  rVrxW%,          p	\        WYWvV4      p
VP                  V
4       K.  	  \	        V4      # )z Return a list of |_SerializedPart| instances corresponding to the parts in
`phys_reader` accessible by walking the relationship graph starting with
`pkg_srels`.)r	   Ú_walk_phys_partsÚ_SerializedPartÚappendÚtuple)r    r   r   r   Úpart_walkerr$   r'   r&   r,   r%   r.   s   &&&        r   r   Ú$PackageReader._load_serialized_parts,   sV   € ð
 ˆÜ#×4Ñ4°[ÓLˆÛ.9Ñ*ˆH˜GØ(Õ2ˆLÜ# H¸GÈ5ÓQˆEØ�M‰M˜%Ö ñ /:ô �V‹}Ðr   c                ód   € V P                  V4      p\        P                  VP                  V4      # )znReturn |_SerializedRelationships| instance populated with relationships for
source identified by `source_uri`.)Úrels_xml_forÚ_SerializedRelationshipsÚload_from_xmlÚbaseURI)r    Ú
source_uriÚrels_xmls   && r   r   ÚPackageReader._srels_for9   s-   € ð ×+Ñ+¨JÓ7ˆÜ'×5Ñ5°j×6HÑ6HÈ(ÓSÐSr   c              #  ó^  "  € Vf   . pV Fœ  pVP                   '       d   K  VP                  pWB9   d   K+  VP                  V4       VP                  p\        P                  W4      pV P                  V4      pWGWV3x € \        P                  WV4      pV F  w  rGrQWGWQ3x € K  	  Kž  	  R# 5i)z�Generate a 4-tuple `(partname, blob, reltype, srels)` for each of the parts
in `phys_reader` by walking the relationship graph rooted at srels.N)Úis_externalÚtarget_partnamer4   r&   r	   r   Úblob_forr2   )	r    r,   Úvisited_partnamesr-   r$   r&   Ú
part_srelsr'   Únext_walkers	   &&&      r   r2   ÚPackageReader._walk_phys_parts@   s¯   é € ð Ò$Ø "ÐÛˆDØ××ÐÙØ×+Ñ+ˆHØÔ,ÙØ×$Ñ$ XÔ.Ø—l‘lˆGÜ&×1Ñ1°+ÓHˆJØ×'Ñ'¨Ó1ˆDØ 7Ð7Ò7Ü'×8Ñ8¸ÐRcÓdˆKÛ2=Ñ.� Ø wÐ6Ô6ó 3>ó ùs   ‚B+B-)r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ústaticmethodr!   r)   r/   r   r   r2   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r   Ú__classdict__s   @@r   r	   r	   
   sr   ù‡ € ñBõð
 ñ?ó ð?òBò-ð ñ
ó ð
ð ñTó ðTð ó7ó ÷7ð 7r   r	   c                   óX   a a€ ] tR t^Vt oRtV 3R ltR t]R 4       tR t	R t
RtVtV ;t# )r   z‰Value type providing dictionary semantics for looking up content type by part
name, e.g. ``content_type = cti['/ppt/presentation.xml']``.c                óh   <€ \         \        V `  4        \        4       V n        \        4       V n        R # r   )r   r   r   r   Ú
_overridesÚ	_defaults©r   r   s   &€r   r   Ú_ContentTypeMap.__init__Z   s$   ø€ ÜŒo˜tÑ-Ô/Ü-Ó/ˆŒÜ,Ó.ˆŽr   c                óD  € \        V\        4      '       g   Rp\        V\        V4      ,          4      hWP                  9   d   V P                  V,          # VP
                  V P                  9   d   V P                  VP
                  ,          # Rp\        W!,          4      h)z6Return content type for part identified by `partname`.z4_ContentTypeMap key must be <type 'PackURI'>, got %sz8no content type for partname '%s' in [Content_Types].xml)Ú
isinstancer   ÚKeyErrorÚtyperU   ÚextrV   )r   r$   Útmpls   && r   Ú__getitem__Ú_ContentTypeMap.__getitem___   sv   € ä˜(¤G×,Ò,ØIˆDÜ˜4¤$ x£.Õ0Ó1Ð1Ø—‘Ô&Ø—?‘? 8Õ,Ð,Ø�<‰<˜4Ÿ>™>Ô)Ø—>‘> (§,¡,Õ/Ð/ØIˆÜ�t•Ó'Ð'r   c                ó  € \        V 4      p\        4       pVP                   F)  pVP                  VP                  VP
                  4       K+  	  VP                   F)  pVP                  VP                  VP
                  4       K+  	  V# )z[Return a new |_ContentTypeMap| instance populated with the contents of
`content_types_xml`.)	r   r   Ú	overridesÚ_add_overrider$   r%   ÚdefaultsÚ_add_defaultÚ	extension)r   Ú	types_elmÚct_mapÚoÚds   &    r   r   Ú_ContentTypeMap.from_xmlk   sl   € ô Ð/Ó0ˆ	Ü Ó"ˆØ×$Ô$ˆAØ× Ñ  §¡¨Q¯^©^Ö<ñ %à×#Ô#ˆAØ×Ñ §¡¨Q¯^©^Ö<ñ $àˆr   c                ó"   € W P                   V&   R# )zVAdd the default mapping of `extension` to `content_type` to this content type
mapping.N)rV   )r   rf   r%   s   &&&r   re   Ú_ContentTypeMap._add_defaultw   s   € ð %1�‰�yÓ!r   c                ó"   € W P                   V&   R# )zUAdd the default mapping of `partname` to `content_type` to this content type
mapping.N)rU   )r   r$   r%   s   &&&r   rc   Ú_ContentTypeMap._add_override|   s   € ð %1�‰˜Ó!r   )rV   rU   )rH   rI   rJ   rK   rL   r   r_   rM   r   re   rc   rN   rO   rP   rQ   s   @@r   r   r   V   s8   ù‡ € ñCõ/ò

(ð ñ	ó ð	ò1÷
1ò 1r   r   c                   ó†   a a€ ] tR t^‚t oRtV 3R lt]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       tRtVtV ;t# )	r3   z‡Value object for an OPC package part.

Provides access to the partname, content type, blob, and serialized relationships
for the part.
c                óh   <€ \         \        V `  4        Wn        W n        W0n        W@n        WPn        R # r   )r   r3   r   Ú	_partnameÚ_content_typeÚ_reltypeÚ_blobÚ_srels)r   r$   r%   r&   r'   r,   r   s   &&&&&&€r   r   Ú_SerializedPart.__init__‰   s*   ø€ ÜŒo˜tÑ-Ô/Ø!ŒØ)ÔØŒØŒ
ØŽr   c                ó   € V P                   # r   )rr   ©r   s   &r   r$   Ú_SerializedPart.partname‘   s   € à�~‰~Ðr   c                ó   € V P                   # r   )rs   ry   s   &r   r%   Ú_SerializedPart.content_type•   s   € à×!Ñ!Ð!r   c                ó   € V P                   # r   )ru   ry   s   &r   r'   Ú_SerializedPart.blob™   s   € à�z‰zÐr   c                ó   € V P                   # )z-The referring relationship type of this part.©rt   ry   s   &r   r&   Ú_SerializedPart.reltype�   ó   € ð �}‰}Ðr   c                ó   € V P                   # r   ©rv   ry   s   &r   r,   Ú_SerializedPart.srels¢   s   € à�{‰{Ðr   )ru   rs   rr   rt   rv   )rH   rI   rJ   rK   rL   r   Úpropertyr$   r%   r'   r&   r,   rN   rO   rP   rQ   s   @@r   r3   r3   ‚   sx   ù‡ € ñõð ñó ðð ñ"ó ð"ð ñó ðð ñó ðð ñó ÷ð r   r3   c                   ó–   a a€ ] tR t^§t oRtV 3R lt]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       t]R 4       tR	tVtV ;t# )
Ú_SerializedRelationshipzÑValue object representing a serialized relationship in an OPC package.

Serialized, in this case, means any target part is referred to via its partname
rather than a direct link to an in-memory |Part| object.
c                óÀ   <€ \         \        V `  4        Wn        VP                  V n        VP                  V n        VP                  V n	        VP                  V n        R # r   )r   rˆ   r   Ú_baseURIÚrIdÚ_rIdr&   rt   Útarget_modeÚ_target_modeÚ
target_refÚ_target_ref)r   r<   Úrel_elmr   s   &&&€r   r   Ú _SerializedRelationship.__init__®   sH   ø€ ÜÔ% tÑ5Ô7ØŒØ—K‘KˆŒ	ØŸ™ˆŒØ#×/Ñ/ˆÔØ"×-Ñ-ˆÖr   c                ó<   € V P                   \        P                  8H  # )z'True if target_mode is ``RTM.EXTERNAL``)rŽ   ÚRTMÚEXTERNALry   s   &r   rA   Ú#_SerializedRelationship.is_external¶   s   € ð × Ñ ¤C§L¡LÑ0Ð0r   c                ó   € V P                   # )z.Relationship type, like ``RT.OFFICE_DOCUMENT``r€   ry   s   &r   r&   Ú_SerializedRelationship.reltype»   r‚   r   c                ó   € V P                   # )zeRelationship id, like 'rId9', corresponds to the ``Id`` attribute on the
``CT_Relationship`` element.)rŒ   ry   s   &r   r‹   Ú_SerializedRelationship.rIdÀ   s   € ð �y‰yÐr   c                ó   € V P                   # )zoString in ``TargetMode`` attribute of ``CT_Relationship`` element, one of
``RTM.INTERNAL`` or ``RTM.EXTERNAL``.)rŽ   ry   s   &r   r�   Ú#_SerializedRelationship.target_modeÆ   s   € ð × Ñ Ð r   c                ó   € V P                   # )z²String in ``Target`` attribute of ``CT_Relationship`` element, a relative
part reference for internal target mode or an arbitrary URI, e.g. an HTTP URL,
for external target mode.)r�   ry   s   &r   r�   Ú"_SerializedRelationship.target_refÌ   s   € ð
 ×ÑÐr   c                óÜ   € V P                   '       d   Rp\        V4      h\        V R4      '       g1   \        P                  ! V P
                  V P                  4      V n        V P                  # )zÁ|PackURI| instance containing partname targeted by this relationship.

Raises ``ValueError`` on reference if target_mode is ``'External'``. Use
:attr:`target_mode` to check before referencing.
zUtarget_partname attribute on Relationship is undefined where TargetMode == "External"Ú_target_partname)rA   Ú
ValueErrorÚhasattrr   Úfrom_rel_refrŠ   r�   r    )r   Úmsgs   & r   rB   Ú'_SerializedRelationship.target_partnameÓ   s]   € ð ××Ðð0ð ô ˜S“/Ð!ä�tÐ/×0Ò0Ü$+×$8Ò$8¸¿¹ÈÏÉÓ$XˆDÔ!Ø×$Ñ$Ð$r   )rŠ   rŒ   rt   rŽ   r    r�   )rH   rI   rJ   rK   rL   r   r†   rA   r&   r‹   r�   r�   rB   rN   rO   rP   rQ   s   @@r   rˆ   rˆ   §   sŒ   ù‡ € ñõ.ð ñ1ó ð1ð ñó ðð ñó ðð
 ñ!ó ð!ð
 ñ ó ð ð ñ%ó ÷%ð %r   rˆ   c                   óL   a a€ ] tR t^æt oRtV 3R ltR t]R 4       tRt	Vt
V ;t# )r:   z|Read-only sequence of |_SerializedRelationship| instances corresponding to the
relationships item XML passed to constructor.c                ó:   <€ \         \        V `  4        . V n        R # r   )r   r:   r   rv   rW   s   &€r   r   Ú!_SerializedRelationships.__init__ê   s   ø€ ÜÔ&¨Ñ6Ô8ØˆŽr   c                ó6   € V P                   P                  4       # )z*Support iteration, e.g. 'for x in srels:'.)rv   Ú__iter__ry   s   &r   rª   Ú!_SerializedRelationships.__iter__î   s   € à�{‰{×#Ñ#Ó%Ð%r   c                ó¦   € \        4       pVeC   \        V4      pVP                   F'  pVP                  P	                  \        W4      4       K)  	  V# )z¢Return |_SerializedRelationships| instance loaded with the relationships
contained in `rels_item_xml`.

Returns an empty collection if `rels_item_xml` is |None|.
)r:   r   ÚRelationship_lstrv   r4   rˆ   )r<   Úrels_item_xmlr,   Úrels_elmr‘   s   &&   r   r;   Ú&_SerializedRelationships.load_from_xmlò   sI   € ô )Ó*ˆØÒ$Ü  Ó/ˆHØ#×4Ô4�Ø—‘×#Ñ#Ô$;¸GÓ$MÖNñ 5àˆr   r„   )rH   rI   rJ   rK   rL   r   rª   rM   r;   rN   rO   rP   rQ   s   @@r   r:   r:   æ   s-   ù‡ € ñ5õò&ð ñó ÷ð r   r:   N)rL   Údocx.opc.constantsr   r”   Údocx.opc.oxmlr   Údocx.opc.packurir   r   Údocx.opc.phys_pkgr   Údocx.opc.sharedr   r	   r   r3   rˆ   r:   © r   r   Ú<module>r·      sO   ðÙ Wå >Ý #ß 1Ý +Ý /÷I7ñ I7÷X)1ñ )1÷X"ñ "÷J<%ñ <%÷~ó r   